Skip to content

Commit 98d18b9

Browse files
committed
* NEW: Added new windows property
1 parent af523a9 commit 98d18b9

File tree

10 files changed

+182
-419
lines changed

10 files changed

+182
-419
lines changed

src/Layers/xrRender/HW.cpp

Lines changed: 2 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void CHW::Reset (HWND hwnd)
9999
R_CHK (pDevice->CreateStateBlock (D3DSBT_ALL,&dwDebugSB));
100100
#endif
101101
#ifndef _EDITOR
102-
updateWindowProps (hwnd);
102+
//updateWindowProps (hwnd);
103103
#endif
104104
}
105105

@@ -433,7 +433,7 @@ void CHW::CreateDevice (HWND m_hWnd, bool move_window)
433433
Msg ("* Texture memory: %d M", memory/(1024*1024));
434434
Msg ("* DDI-level: %2.1f", float(D3DXGetDriverLevel(pDevice))/100.f);
435435
#ifndef _EDITOR
436-
updateWindowProps (m_hWnd);
436+
//updateWindowProps (m_hWnd);
437437
fill_vid_mode_list (this);
438438
#endif
439439
}
@@ -547,74 +547,7 @@ BOOL CHW::support (D3DFORMAT fmt, DWORD type, DWORD usage)
547547
else return TRUE;
548548
}
549549

550-
void CHW::updateWindowProps (HWND m_hWnd)
551-
{
552-
// BOOL bWindowed = strstr(Core.Params,"-dedicated") ? TRUE : !psDeviceFlags.is (rsFullscreen);
553-
//#ifndef DEDICATED_SERVER
554-
// BOOL bWindowed = !psDeviceFlags.is (rsFullscreen);
555-
//#else
556-
// BOOL bWindowed = TRUE;
557-
//#endif
558550

559-
BOOL bWindowed = TRUE;
560-
#ifndef _EDITOR
561-
if (!g_dedicated_server)
562-
bWindowed = !psDeviceFlags.is(rsFullscreen);
563-
#endif
564-
565-
u32 dwWindowStyle = 0;
566-
// Set window properties depending on what mode were in.
567-
if (bWindowed) {
568-
if (m_move_window) {
569-
dwWindowStyle = WS_BORDER | WS_VISIBLE;
570-
if (!strstr(Core.Params, "-no_dialog_header"))
571-
dwWindowStyle |= WS_DLGFRAME | WS_SYSMENU | WS_MINIMIZEBOX;
572-
SetWindowLong(m_hWnd, GWL_STYLE, dwWindowStyle);
573-
// When moving from fullscreen to windowed mode, it is important to
574-
// adjust the window size after recreating the device rather than
575-
// beforehand to ensure that you get the window size you want. For
576-
// example, when switching from 640x480 fullscreen to windowed with
577-
// a 1000x600 window on a 1024x768 desktop, it is impossible to set
578-
// the window size to 1000x600 until after the display mode has
579-
// changed to 1024x768, because windows cannot be larger than the
580-
// desktop.
581-
582-
RECT m_rcWindowBounds;
583-
RECT DesktopRect;
584-
585-
GetClientRect (GetDesktopWindow(), &DesktopRect);
586-
587-
SetRect( &m_rcWindowBounds,
588-
(DesktopRect.right-DevPP.BackBufferWidth)/2,
589-
(DesktopRect.bottom-DevPP.BackBufferHeight)/2,
590-
(DesktopRect.right+DevPP.BackBufferWidth)/2,
591-
(DesktopRect.bottom+DevPP.BackBufferHeight)/2 );
592-
593-
AdjustWindowRect ( &m_rcWindowBounds, dwWindowStyle, FALSE );
594-
595-
SetWindowPos ( m_hWnd,
596-
HWND_NOTOPMOST,
597-
m_rcWindowBounds.left,
598-
m_rcWindowBounds.top,
599-
( m_rcWindowBounds.right - m_rcWindowBounds.left ),
600-
( m_rcWindowBounds.bottom - m_rcWindowBounds.top ),
601-
SWP_SHOWWINDOW|SWP_NOCOPYBITS|SWP_DRAWFRAME );
602-
}
603-
}
604-
else
605-
{
606-
SetWindowLong ( m_hWnd, GWL_STYLE, dwWindowStyle=(WS_POPUP|WS_VISIBLE) );
607-
SetWindowLong ( m_hWnd, GWL_EXSTYLE, WS_EX_TOPMOST);
608-
}
609-
610-
#ifndef _EDITOR
611-
if (!g_dedicated_server)
612-
{
613-
ShowCursor (FALSE);
614-
SetForegroundWindow( m_hWnd );
615-
}
616-
#endif
617-
}
618551

619552

620553
struct _uniq_mode
@@ -626,79 +559,6 @@ struct _uniq_mode
626559

627560
#ifndef _EDITOR
628561

629-
/*
630-
void free_render_mode_list()
631-
{
632-
for( int i=0; vid_quality_token[i].name; i++ )
633-
{
634-
xr_free (vid_quality_token[i].name);
635-
}
636-
xr_free (vid_quality_token);
637-
vid_quality_token = NULL;
638-
}
639-
*/
640-
/*
641-
void fill_render_mode_list()
642-
{
643-
if(vid_quality_token != NULL) return;
644-
645-
D3DCAPS9 caps;
646-
CHW _HW;
647-
_HW.CreateD3D ();
648-
_HW.pD3D->GetDeviceCaps (D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);
649-
_HW.DestroyD3D ();
650-
u16 ps_ver_major = u16 ( u32(u32(caps.PixelShaderVersion)&u32(0xf << 8ul))>>8 );
651-
652-
xr_vector<LPCSTR> _tmp;
653-
u32 i = 0;
654-
for(; i<5; ++i)
655-
{
656-
bool bBreakLoop = false;
657-
switch (i)
658-
{
659-
case 3: //"renderer_r2.5"
660-
if (ps_ver_major < 3)
661-
bBreakLoop = true;
662-
break;
663-
case 4: //"renderer_r_dx10"
664-
bBreakLoop = true;
665-
break;
666-
default: ;
667-
}
668-
669-
if (bBreakLoop) break;
670-
671-
_tmp.push_back (NULL);
672-
LPCSTR val = NULL;
673-
switch (i)
674-
{
675-
case 0: val ="renderer_r1"; break;
676-
case 1: val ="renderer_r2a"; break;
677-
case 2: val ="renderer_r2"; break;
678-
case 3: val ="renderer_r2.5"; break;
679-
case 4: val ="renderer_r_dx10"; break; // -)
680-
}
681-
_tmp.back() = xr_strdup(val);
682-
}
683-
u32 _cnt = _tmp.size()+1;
684-
vid_quality_token = xr_alloc<xr_token>(_cnt);
685-
686-
vid_quality_token[_cnt-1].id = -1;
687-
vid_quality_token[_cnt-1].name = NULL;
688-
689-
#ifdef DEBUG
690-
Msg("Available render modes[%d]:",_tmp.size());
691-
#endif // DEBUG
692-
for(u32 i=0; i<_tmp.size();++i)
693-
{
694-
vid_quality_token[i].id = i;
695-
vid_quality_token[i].name = _tmp[i];
696-
#ifdef DEBUG
697-
Msg ("[%s]",_tmp[i]);
698-
#endif // DEBUG
699-
}
700-
}
701-
*/
702562
void free_vid_mode_list()
703563
{
704564
for( int i=0; vid_mode_token[i].name; i++ )

src/Layers/xrRender/HW.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class CHW
3939
u32 selectPresentInterval ();
4040
u32 selectGPU ();
4141
u32 selectRefresh (u32 dwWidth, u32 dwHeight, D3DFORMAT fmt);
42-
void updateWindowProps (HWND hw);
4342
BOOL support (D3DFORMAT fmt, DWORD type, DWORD usage);
4443

4544
#ifdef DEBUG

src/Layers/xrRender/ResourceManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#pragma warning(disable:4995)
99
#include <d3dx9.h>
1010
#pragma warning(default:4995)
11-
11+
#include <thread>
1212
#include "ResourceManager.h"
1313
#include "tss.h"
1414
#include "blenders\blender.h"

0 commit comments

Comments
 (0)