mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Added window around windowed JA2
Replaced Windows console with freeware console implementation. Activate in windowed mode with \ Added error and quit if JA2 started in window mode in >16bpp color depth Fix to enemy sector investigation: Was deducting from redshirts when elites investigated Fix AWOL militia (need additional fix to prevent them from being redistributed during after reinforcements) Fix to tanks to add them in their original spot when a new one cannot be found. Should modify to remove old wreckage in this case. AI no longer tries to fire mortar when no room for it Tanks no longer try to throw knives git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1030 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_2005Express.vsprops"
|
||||
InheritedPropertySheets="..\ja2_2005Express.vsprops;..\ja2_2005ExpressDebug.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
|
||||
@@ -67,8 +67,8 @@ UINT32 guiRightButtonRepeatTimer;
|
||||
BOOLEAN gfTrackMousePos; // TRUE = queue mouse movement events, FALSE = don't
|
||||
BOOLEAN gfLeftButtonState; // TRUE = Pressed, FALSE = Not Pressed
|
||||
BOOLEAN gfRightButtonState; // TRUE = Pressed, FALSE = Not Pressed
|
||||
UINT16 gusMouseXPos; // X position of the mouse on screen
|
||||
UINT16 gusMouseYPos; // y position of the mouse on screen
|
||||
INT16 gusMouseXPos; // X position of the mouse on screen
|
||||
INT16 gusMouseYPos; // y position of the mouse on screen
|
||||
|
||||
// The queue structures are used to track input events using queued events
|
||||
|
||||
@@ -120,7 +120,7 @@ LRESULT CALLBACK KeyboardHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
else
|
||||
{ // Key was up
|
||||
KeyDown(wParam, lParam);
|
||||
gfSGPInputReceived = TRUE;
|
||||
gfSGPInputReceived = TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -131,6 +131,7 @@ LRESULT CALLBACK KeyboardHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UINT32 uiParam;
|
||||
POINT mpos;
|
||||
|
||||
#ifndef JA2
|
||||
if((Code < 0) || (!gfApplicationActive))
|
||||
@@ -145,8 +146,10 @@ LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
case WM_LBUTTONDOWN
|
||||
: // Update the current mouse position
|
||||
gusMouseXPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).x;
|
||||
gusMouseYPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).y;
|
||||
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
|
||||
ScreenToClient( ghWindow, &mpos);
|
||||
gusMouseXPos = (INT16)mpos.x;
|
||||
gusMouseYPos = (INT16)mpos.y;
|
||||
uiParam = gusMouseYPos;
|
||||
uiParam = uiParam << 16;
|
||||
uiParam = uiParam | gusMouseXPos;
|
||||
@@ -159,8 +162,10 @@ LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
case WM_LBUTTONUP
|
||||
: // Update the current mouse position
|
||||
gusMouseXPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).x;
|
||||
gusMouseYPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).y;
|
||||
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
|
||||
ScreenToClient( ghWindow, &mpos);
|
||||
gusMouseXPos = (INT16)mpos.x;
|
||||
gusMouseYPos = (INT16)mpos.y;
|
||||
uiParam = gusMouseYPos;
|
||||
uiParam = uiParam << 16;
|
||||
uiParam = uiParam | gusMouseXPos;
|
||||
@@ -173,8 +178,10 @@ LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
case WM_RBUTTONDOWN
|
||||
: // Update the current mouse position
|
||||
gusMouseXPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).x;
|
||||
gusMouseYPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).y;
|
||||
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
|
||||
ScreenToClient( ghWindow, &mpos);
|
||||
gusMouseXPos = (INT16)mpos.x;
|
||||
gusMouseYPos = (INT16)mpos.y;
|
||||
uiParam = gusMouseYPos;
|
||||
uiParam = uiParam << 16;
|
||||
uiParam = uiParam | gusMouseXPos;
|
||||
@@ -187,8 +194,10 @@ LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
case WM_RBUTTONUP
|
||||
: // Update the current mouse position
|
||||
gusMouseXPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).x;
|
||||
gusMouseYPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).y;
|
||||
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
|
||||
ScreenToClient( ghWindow, &mpos);
|
||||
gusMouseXPos = (INT16)mpos.x;
|
||||
gusMouseYPos = (INT16)mpos.y;
|
||||
uiParam = gusMouseYPos;
|
||||
uiParam = uiParam << 16;
|
||||
uiParam = uiParam | gusMouseXPos;
|
||||
@@ -201,8 +210,10 @@ LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
case WM_MOUSEMOVE
|
||||
: // Update the current mouse position
|
||||
gusMouseXPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).x;
|
||||
gusMouseYPos = (UINT16)(((MOUSEHOOKSTRUCT *)lParam)->pt).y;
|
||||
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
|
||||
ScreenToClient( ghWindow, &mpos);
|
||||
gusMouseXPos = (INT16)mpos.x;
|
||||
gusMouseYPos = (INT16)mpos.y;
|
||||
uiParam = gusMouseYPos;
|
||||
uiParam = uiParam << 16;
|
||||
uiParam = uiParam | gusMouseXPos;
|
||||
@@ -214,7 +225,16 @@ LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
|
||||
//Set that we have input
|
||||
gfSGPInputReceived = TRUE;
|
||||
break;
|
||||
default:
|
||||
return CallNextHookEx(ghMouseHook, Code, wParam, lParam);
|
||||
}
|
||||
|
||||
// if (gusMouseXPos < 0 || gusMouseXPos >= SCREEN_WIDTH ||
|
||||
// gusMouseYPos < 0 || gusMouseYPos >= SCREEN_HEIGHT)
|
||||
{
|
||||
return CallNextHookEx(ghMouseHook, Code, wParam, lParam);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -346,8 +366,8 @@ BOOLEAN InitializeInputManager(void)
|
||||
gfCurrentStringInputState = FALSE;
|
||||
gpCurrentStringDescriptor = NULL;
|
||||
// Activate the hook functions for both keyboard and Mouse
|
||||
ghKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) KeyboardHandler, (HINSTANCE) 0, GetCurrentThreadId());
|
||||
DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set keyboard hook returned %d", ghKeyboardHook));
|
||||
// ghKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) KeyboardHandler, (HINSTANCE) 0, GetCurrentThreadId());
|
||||
// DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set keyboard hook returned %d", ghKeyboardHook));
|
||||
|
||||
ghMouseHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC) MouseHandler, (HINSTANCE) 0, GetCurrentThreadId());
|
||||
DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set mouse hook returned %d", ghMouseHook));
|
||||
@@ -358,7 +378,7 @@ void ShutdownInputManager(void)
|
||||
{ // There's very little to do when shutting down the input manager. In the future, this is where the keyboard and
|
||||
// mouse hooks will be destroyed
|
||||
UnRegisterDebugTopic(TOPIC_INPUT, "Input Manager");
|
||||
UnhookWindowsHookEx(ghKeyboardHook);
|
||||
// UnhookWindowsHookEx(ghKeyboardHook);
|
||||
UnhookWindowsHookEx(ghMouseHook);
|
||||
}
|
||||
|
||||
@@ -913,6 +933,8 @@ void KeyChange(UINT32 usParam, UINT32 uiParam, UINT8 ufKeyState)
|
||||
}
|
||||
|
||||
GetCursorPos(&MousePos);
|
||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||
|
||||
uiTmpLParam = ((MousePos.y << 16) & 0xffff0000) | (MousePos.x & 0x0000ffff);
|
||||
|
||||
if (ufKeyState == TRUE)
|
||||
@@ -1064,6 +1086,7 @@ void GetMousePos(SGPPoint *Point)
|
||||
POINT MousePos;
|
||||
|
||||
GetCursorPos(&MousePos);
|
||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||
|
||||
Point->iX = (UINT32) MousePos.x;
|
||||
Point->iY = (UINT32) MousePos.y;
|
||||
@@ -1517,7 +1540,9 @@ void RestrictMouseCursor(SGPRect *pRectangle)
|
||||
{
|
||||
// Make a copy of our rect....
|
||||
memcpy( &gCursorClipRect, pRectangle, sizeof( gCursorClipRect ) );
|
||||
ClipCursor((RECT *)pRectangle);
|
||||
ClientToScreen( ghWindow, (LPPOINT)&gCursorClipRect);
|
||||
ClientToScreen( ghWindow, ((LPPOINT)&gCursorClipRect)+1);
|
||||
ClipCursor(&gCursorClipRect);
|
||||
fCursorWasClipped = TRUE;
|
||||
}
|
||||
|
||||
@@ -1538,6 +1563,8 @@ void RestoreCursorClipRect( void )
|
||||
void GetRestrictedClipCursor( SGPRect *pRectangle )
|
||||
{
|
||||
GetClipCursor((RECT *) pRectangle );
|
||||
ScreenToClient( ghWindow, (LPPOINT)pRectangle);
|
||||
ScreenToClient( ghWindow, ((LPPOINT)pRectangle)+1);
|
||||
}
|
||||
|
||||
BOOLEAN IsCursorRestricted( void )
|
||||
@@ -1613,6 +1640,7 @@ void HandleSingleClicksAndButtonRepeats( void )
|
||||
POINT MousePos;
|
||||
|
||||
GetCursorPos(&MousePos);
|
||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||
uiTmpLParam = ((MousePos.y << 16) & 0xffff0000) | (MousePos.x & 0x0000ffff);
|
||||
QueueEvent(LEFT_BUTTON_REPEAT, 0, uiTmpLParam);
|
||||
guiLeftButtonRepeatTimer = uiTimer + BUTTON_REPEAT_TIME;
|
||||
@@ -1633,6 +1661,7 @@ void HandleSingleClicksAndButtonRepeats( void )
|
||||
POINT MousePos;
|
||||
|
||||
GetCursorPos(&MousePos);
|
||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||
uiTmpLParam = ((MousePos.y << 16) & 0xffff0000) | (MousePos.x & 0x0000ffff);
|
||||
QueueEvent(RIGHT_BUTTON_REPEAT, 0, uiTmpLParam);
|
||||
guiRightButtonRepeatTimer = uiTimer + BUTTON_REPEAT_TIME;
|
||||
|
||||
@@ -107,8 +107,8 @@ extern void DequeueAllKeyBoardEvents();
|
||||
|
||||
extern BOOLEAN gfKeyState[256]; // TRUE = Pressed, FALSE = Not Pressed
|
||||
|
||||
extern UINT16 gusMouseXPos; // X position of the mouse on screen
|
||||
extern UINT16 gusMouseYPos; // y position of the mouse on screen
|
||||
extern INT16 gusMouseXPos; // X position of the mouse on screen
|
||||
extern INT16 gusMouseYPos; // y position of the mouse on screen
|
||||
extern BOOLEAN gfLeftButtonState; // TRUE = Pressed, FALSE = Not Pressed
|
||||
extern BOOLEAN gfRightButtonState; // TRUE = Pressed, FALSE = Not Pressed
|
||||
|
||||
|
||||
@@ -555,7 +555,7 @@ void MSYS_DeleteRegionFromList(MOUSE_REGION *region)
|
||||
//======================================================================================================
|
||||
// MSYS_UpdateMouseRegion
|
||||
//
|
||||
// Searches the list for the highest priority region and updates it's info. It also dispatches
|
||||
// Searches the list for the highest priority region and updates its info. It also dispatches
|
||||
// the callback functions
|
||||
//
|
||||
void MSYS_UpdateMouseRegion(void)
|
||||
|
||||
@@ -73,6 +73,7 @@ void GetRuntimeSettings( );
|
||||
|
||||
int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCommandLine, int sCommandShow);
|
||||
|
||||
Console g_Console("", "", "Lua Console", "no");
|
||||
|
||||
#if !defined(JA2) && !defined(UTILS)
|
||||
void ProcessCommandLine(CHAR8 *pCommandLine);
|
||||
@@ -95,6 +96,7 @@ HINSTANCE ghInstance;
|
||||
|
||||
// Global Variable Declarations
|
||||
RECT rcWindow;
|
||||
POINT ptWindowSize;
|
||||
|
||||
// moved from header file: 24mar98:HJH
|
||||
UINT32 giStartMem;
|
||||
@@ -141,6 +143,10 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
|
||||
switch(Message)
|
||||
{
|
||||
case WM_CLOSE:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case WM_MOUSEWHEEL:
|
||||
{
|
||||
QueueEvent(MOUSE_WHEEL, wParam, lParam);
|
||||
@@ -149,13 +155,22 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
|
||||
#ifdef JA2
|
||||
case WM_MOVE:
|
||||
if( 1==iScreenMode )
|
||||
{
|
||||
// if( 1==iScreenMode )
|
||||
// {
|
||||
GetClientRect(hWindow, &rcWindow);
|
||||
ClientToScreen(hWindow, (LPPOINT)&rcWindow);
|
||||
ClientToScreen(hWindow, (LPPOINT)&rcWindow+1);
|
||||
}
|
||||
// }
|
||||
break;
|
||||
case WM_GETMINMAXINFO:
|
||||
{
|
||||
MINMAXINFO *mmi = (MINMAXINFO*)lParam;
|
||||
|
||||
mmi->ptMaxSize = ptWindowSize;
|
||||
mmi->ptMaxTrackSize = mmi->ptMaxSize;
|
||||
mmi->ptMinTrackSize = mmi->ptMaxSize;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
case WM_MOUSEMOVE:
|
||||
break;
|
||||
@@ -303,6 +318,20 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case WM_SETCURSOR:
|
||||
SetCursor( NULL);
|
||||
return TRUE;
|
||||
|
||||
case WM_TIMER:
|
||||
#ifdef LUACONSOLE
|
||||
PollConsole( );
|
||||
#endif
|
||||
|
||||
if (gfApplicationActive)
|
||||
{
|
||||
GameLoop();
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_ACTIVATEAPP:
|
||||
switch(wParam)
|
||||
@@ -360,7 +389,7 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
|
||||
case WM_DESTROY:
|
||||
ShutdownStandardGamingPlatform();
|
||||
ShowCursor(TRUE);
|
||||
// ShowCursor(TRUE);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
@@ -410,6 +439,24 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
break;
|
||||
#endif
|
||||
|
||||
case WM_SYSKEYUP:
|
||||
case WM_KEYUP:
|
||||
KeyUp(wParam, lParam);
|
||||
break;
|
||||
|
||||
case WM_SYSKEYDOWN:
|
||||
case WM_KEYDOWN:
|
||||
KeyDown(wParam, lParam);
|
||||
gfSGPInputReceived = TRUE;
|
||||
break;
|
||||
|
||||
case WM_CHAR:
|
||||
if (wParam == '\\' &&
|
||||
lParam && KF_ALTDOWN)
|
||||
{
|
||||
g_Console.Create(NULL);
|
||||
}
|
||||
break;
|
||||
default
|
||||
: return DefWindowProc(hWindow, Message, wParam, lParam);
|
||||
}
|
||||
@@ -701,6 +748,7 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p
|
||||
#endif
|
||||
MSG Message;
|
||||
HWND hPrevInstanceWindow;
|
||||
UINT32 uiTimer = 0;
|
||||
|
||||
// Make sure that only one instance of this application is running at once
|
||||
// // Look for prev instance by searching for the window
|
||||
@@ -753,7 +801,7 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p
|
||||
|
||||
#endif
|
||||
|
||||
ShowCursor(FALSE);
|
||||
// ShowCursor(FALSE);
|
||||
|
||||
// Inititialize the SGP
|
||||
if (InitializeStandardGamingPlatform(hInstance, sCommandShow) == FALSE)
|
||||
@@ -762,7 +810,10 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p
|
||||
}
|
||||
|
||||
#ifdef LUACONSOLE
|
||||
CreateConsole();
|
||||
if (1==iScreenMode)
|
||||
{
|
||||
CreateConsole();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JA2
|
||||
@@ -776,12 +827,15 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p
|
||||
|
||||
FastDebugMsg("Running Game");
|
||||
|
||||
// 0verhaul: Roughly 60 frames per second. The original "low cpu" code did 30, but that is really slow
|
||||
SetTimer( ghWindow, uiTimer, 16, NULL);
|
||||
|
||||
// At this point the SGP is set up, which means all I/O, Memory, tools, etc... are available. All we need to do is
|
||||
// attend to the gaming mechanics themselves
|
||||
while (gfProgramIsRunning)
|
||||
{
|
||||
if (PeekMessage(&Message, NULL, 0, 0, PM_NOREMOVE))
|
||||
{ // We have a message on the WIN95 queue, let's get it
|
||||
// if (PeekMessage(&Message, NULL, 0, 0, PM_NOREMOVE))
|
||||
// { // We have a message on the WIN95 queue, let's get it
|
||||
if (!GetMessage(&Message, NULL, 0, 0))
|
||||
{ // It's quitting time
|
||||
return Message.wParam;
|
||||
@@ -790,6 +844,7 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p
|
||||
TranslateMessage(&Message);
|
||||
DispatchMessage(&Message);
|
||||
}
|
||||
#if 0
|
||||
else
|
||||
{ // Windows hasn't processed any messages, therefore we handle the rest
|
||||
#ifdef LUACONSOLE
|
||||
@@ -809,6 +864,9 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
KillTimer( ghWindow, uiTimer);
|
||||
|
||||
// This is the normal exit point
|
||||
FastDebugMsg("Exiting Game");
|
||||
@@ -854,7 +912,7 @@ void SGPExit(void)
|
||||
#endif
|
||||
|
||||
ShutdownStandardGamingPlatform();
|
||||
ShowCursor(TRUE);
|
||||
// ShowCursor(TRUE);
|
||||
if(strlen(gzErrorMsg))
|
||||
{
|
||||
MessageBox(NULL, gzErrorMsg, "Error", MB_OK | MB_ICONERROR );
|
||||
|
||||
+186
-108
@@ -58,8 +58,8 @@ extern int iScreenMode;
|
||||
typedef struct
|
||||
{
|
||||
BOOLEAN fRestore;
|
||||
UINT16 usMouseXPos, usMouseYPos;
|
||||
UINT16 usLeft, usTop, usRight, usBottom;
|
||||
INT16 usMouseXPos, usMouseYPos;
|
||||
INT16 usLeft, usTop, usRight, usBottom;
|
||||
RECT Region;
|
||||
LPDIRECTDRAWSURFACE _pSurface;
|
||||
LPDIRECTDRAWSURFACE2 pSurface;
|
||||
@@ -109,7 +109,7 @@ static LPDIRECTDRAWSURFACE _gpFrameBuffer = NULL;
|
||||
static LPDIRECTDRAWSURFACE2 gpFrameBuffer = NULL;
|
||||
static LPDIRECTDRAWSURFACE _gpBackBuffer = NULL;
|
||||
extern RECT rcWindow;
|
||||
|
||||
extern POINT ptWindowSize;
|
||||
|
||||
|
||||
//
|
||||
@@ -252,7 +252,29 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void *
|
||||
// Don't change this
|
||||
//
|
||||
if( 1==iScreenMode )
|
||||
hWindow = CreateWindowEx(0, (LPCSTR) ClassName, "Windowed JA2 !!", WS_POPUP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL);
|
||||
{
|
||||
RECT window;
|
||||
DWORD style;
|
||||
DWORD exstyle;
|
||||
|
||||
window.top = 0;
|
||||
window.left = 0;
|
||||
window.right = SCREEN_WIDTH;
|
||||
window.bottom = SCREEN_HEIGHT;
|
||||
|
||||
exstyle = WS_EX_APPWINDOW;
|
||||
style = WS_OVERLAPPEDWINDOW & (~(WS_MAXIMIZEBOX | WS_SYSMENU));
|
||||
|
||||
AdjustWindowRectEx( &window, style, FALSE, exstyle);
|
||||
OffsetRect( &window, -window.left, -window.top);
|
||||
|
||||
ptWindowSize.x = window.right;
|
||||
ptWindowSize.y = window.bottom;
|
||||
|
||||
hWindow = CreateWindowEx(exstyle, (LPCSTR) ClassName, "Windowed JA2 !!", style, window.left, window.top, window.right, window.bottom, NULL, NULL, hInstance, NULL);
|
||||
GetClientRect( hWindow, &window);
|
||||
window.top = window.top;
|
||||
}
|
||||
else
|
||||
hWindow = CreateWindowEx(WS_EX_TOPMOST, (LPCSTR) ClassName, (LPCSTR)ClassName, WS_POPUP | WS_VISIBLE, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, hInstance, NULL);
|
||||
|
||||
@@ -275,7 +297,7 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void *
|
||||
// Display our full screen window
|
||||
//
|
||||
|
||||
ShowCursor(FALSE);
|
||||
// ShowCursor(FALSE);
|
||||
ShowWindow(hWindow, usCommandShow);
|
||||
UpdateWindow(hWindow);
|
||||
SetFocus(hWindow);
|
||||
@@ -348,6 +370,8 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void *
|
||||
ZEROMEM(SurfaceDescription);
|
||||
if( 1==iScreenMode ) /* Windowed mode */
|
||||
{
|
||||
LPDIRECTDRAWCLIPPER clip;
|
||||
|
||||
// Create a primary surface and a backbuffer in system memory
|
||||
SurfaceDescription.dwSize = sizeof(DDSURFACEDESC);
|
||||
SurfaceDescription.dwFlags = DDSD_CAPS;
|
||||
@@ -360,6 +384,26 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void *
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ReturnCode = DirectDrawCreateClipper ( 0, &clip, NULL );
|
||||
if (ReturnCode != DD_OK)
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ReturnCode = IDirectDrawClipper_SetHWnd( clip, 0, ghWindow);
|
||||
if (ReturnCode != DD_OK)
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ReturnCode = IDirectDrawSurface_SetClipper( _gpPrimarySurface, clip);
|
||||
if (ReturnCode != DD_OK)
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ReturnCode = IDirectDrawSurface_QueryInterface(_gpPrimarySurface, /*&*/IID_IDirectDrawSurface2, (LPVOID *)&gpPrimarySurface); // (jonathanl)
|
||||
if (ReturnCode != DD_OK)
|
||||
@@ -647,7 +691,7 @@ void DoTester( )
|
||||
{
|
||||
IDirectDraw2_RestoreDisplayMode( gpDirectDrawObject );
|
||||
IDirectDraw2_SetCooperativeLevel(gpDirectDrawObject, ghWindow, DDSCL_NORMAL );
|
||||
ShowCursor(TRUE);
|
||||
// ShowCursor(TRUE);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -997,6 +1041,9 @@ void ScrollJA2Background(UINT32 uiDirection, INT16 sScrollXIncrement, INT16 sScr
|
||||
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
|
||||
usHeight=(gsVIEWPORT_WINDOW_END_Y - gsVIEWPORT_WINDOW_START_Y );
|
||||
|
||||
pSource = gpFrameBuffer;
|
||||
pDest = gpFrameBuffer;
|
||||
|
||||
///zmiany
|
||||
StripRegions[ 0 ].left = gsVIEWPORT_START_X ;
|
||||
StripRegions[ 0 ].right = gsVIEWPORT_END_X ;
|
||||
@@ -1060,6 +1107,11 @@ void ScrollJA2Background(UINT32 uiDirection, INT16 sScrollXIncrement, INT16 sScr
|
||||
Region.right = usWidth;
|
||||
Region.bottom = gsVIEWPORT_WINDOW_START_Y + usHeight;
|
||||
|
||||
if (Region.left >= Region.right)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(pDest, 0, gsVIEWPORT_WINDOW_START_Y, pSource, (LPRECT)&Region, DDBLTFAST_NOCOLORKEY);
|
||||
@@ -1384,6 +1436,7 @@ void ScrollJA2Background(UINT32 uiDirection, INT16 sScrollXIncrement, INT16 sScr
|
||||
// Optimize Redundent tiles too!
|
||||
//ExamineZBufferRect( (INT16)StripRegions[ cnt ].left, (INT16)StripRegions[ cnt ].top, (INT16)StripRegions[ cnt ].right, (INT16)StripRegions[ cnt ].bottom );
|
||||
|
||||
#if 0
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(pDest, StripRegions[ cnt ].left, StripRegions[ cnt ].top, gpFrameBuffer, (LPRECT)&( StripRegions[ cnt ] ), DDBLTFAST_NOCOLORKEY);
|
||||
@@ -1397,7 +1450,7 @@ void ScrollJA2Background(UINT32 uiDirection, INT16 sScrollXIncrement, INT16 sScr
|
||||
break;
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
sShiftX = 0;
|
||||
@@ -1515,6 +1568,7 @@ void RefreshScreen(void *DummyVariable)
|
||||
static BOOLEAN fShowMouse;
|
||||
HRESULT ReturnCode;
|
||||
static RECT Region;
|
||||
static INT16 sx, sy;
|
||||
static POINT MousePos;
|
||||
static BOOLEAN fFirstTime = TRUE;
|
||||
UINT32 uiTime;
|
||||
@@ -1585,6 +1639,7 @@ void RefreshScreen(void *DummyVariable)
|
||||
//
|
||||
|
||||
GetCursorPos(&MousePos);
|
||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -1653,6 +1708,13 @@ void RefreshScreen(void *DummyVariable)
|
||||
// Either Method (1) or (2)
|
||||
//
|
||||
{
|
||||
if ( gfRenderScroll )
|
||||
{
|
||||
// ScrollJA2Background( guiScrollDirection, gsScrollXIncrement, gsScrollYIncrement, gpPrimarySurface, gpBackBuffer, TRUE, PREVIOUS_MOUSE_DATA );
|
||||
ScrollJA2Background( guiScrollDirection, gsScrollXIncrement, gsScrollYIncrement, gpBackBuffer, gpBackBuffer, TRUE, PREVIOUS_MOUSE_DATA );
|
||||
gfForceFullScreenRefresh = TRUE;
|
||||
}
|
||||
|
||||
if (gfForceFullScreenRefresh == TRUE)
|
||||
{
|
||||
//
|
||||
@@ -1678,7 +1740,6 @@ void RefreshScreen(void *DummyVariable)
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1738,16 +1799,10 @@ void RefreshScreen(void *DummyVariable)
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if ( gfRenderScroll )
|
||||
{
|
||||
ScrollJA2Background( guiScrollDirection, gsScrollXIncrement, gsScrollYIncrement, gpPrimarySurface, gpBackBuffer, TRUE, PREVIOUS_MOUSE_DATA );
|
||||
}
|
||||
gfIgnoreScrollDueToCenterAdjust = FALSE;
|
||||
|
||||
|
||||
@@ -1826,7 +1881,7 @@ void RefreshScreen(void *DummyVariable)
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(pTmpBuffer, 0, 0, gpPrimarySurface, &Region, DDBLTFAST_NOCOLORKEY);
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(pTmpBuffer, 0, 0, gpPrimarySurface, &rcWindow, DDBLTFAST_NOCOLORKEY);
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
@@ -2003,7 +2058,7 @@ void RefreshScreen(void *DummyVariable)
|
||||
Region.right = Region.left + gusMouseCursorWidth;
|
||||
Region.bottom = Region.top + gusMouseCursorHeight;
|
||||
|
||||
if (Region.right > usScreenWidth)
|
||||
if (Region.right > usScreenWidth)
|
||||
{
|
||||
Region.right = usScreenWidth;
|
||||
}
|
||||
@@ -2015,17 +2070,17 @@ void RefreshScreen(void *DummyVariable)
|
||||
|
||||
if ((Region.right > Region.left)&&(Region.bottom > Region.top))
|
||||
{
|
||||
//
|
||||
//
|
||||
// Make sure the mouse background is marked for restore and coordinates are saved for the
|
||||
// future restore
|
||||
//
|
||||
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].fRestore = TRUE;
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].usRight = (UINT16) Region.right - (UINT16) Region.left;
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].usBottom = (UINT16) Region.bottom - (UINT16) Region.top;
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].usRight = (INT16)Region.right - (INT16) Region.left;
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].usBottom = (INT16)Region.bottom - (INT16) Region.top;
|
||||
if (Region.left < 0)
|
||||
{
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].usLeft = (UINT16) (0 - Region.left);
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].usLeft = (INT16) (0 - Region.left);
|
||||
gMouseCursorBackground[CURRENT_MOUSE_DATA].usMouseXPos = 0;
|
||||
Region.left = 0;
|
||||
}
|
||||
@@ -2149,10 +2204,14 @@ void RefreshScreen(void *DummyVariable)
|
||||
//
|
||||
// Step (1) - Flip pages
|
||||
//
|
||||
do
|
||||
Region.top = 0;
|
||||
Region.left = 0;
|
||||
Region.right = rcWindow.right - rcWindow.left;
|
||||
Region.bottom = rcWindow.bottom - rcWindow.top;
|
||||
if( 1==iScreenMode ) /* Windowed mode */
|
||||
{
|
||||
if( 1==iScreenMode ) /* Windowed mode */
|
||||
{
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface_Blt(
|
||||
gpPrimarySurface, // dest surface
|
||||
&rcWindow, // dest rect
|
||||
@@ -2160,32 +2219,48 @@ void RefreshScreen(void *DummyVariable)
|
||||
NULL, // src rect (all of it)
|
||||
DDBLT_WAIT,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface_Flip(
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
|
||||
gfRenderScroll = FALSE;
|
||||
gfScrollStart = FALSE;
|
||||
guiDirtyRegionCount = 0;
|
||||
guiDirtyRegionExCount = 0;
|
||||
gfForceFullScreenRefresh = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface_Flip(
|
||||
_gpPrimarySurface,
|
||||
NULL,
|
||||
gGameExternalOptions.gfVSync ? DDFLIP_WAIT : 0x00000008l
|
||||
);
|
||||
}
|
||||
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
}
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
|
||||
} while (ReturnCode != DD_OK);
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
|
||||
//
|
||||
// Step (2) - Copy Primary Surface to the Back Buffer
|
||||
//
|
||||
|
||||
//
|
||||
// Step (2) - Copy Primary Surface to the Back Buffer
|
||||
//
|
||||
if ( gfRenderScroll )
|
||||
{
|
||||
Region.left = 0;
|
||||
@@ -2193,7 +2268,6 @@ void RefreshScreen(void *DummyVariable)
|
||||
Region.right = gsVIEWPORT_END_X; //ods1 640;
|
||||
Region.bottom = gsVIEWPORT_END_Y;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, 0, 0, gpPrimarySurface, &Region, DDBLTFAST_NOCOLORKEY);
|
||||
@@ -2249,7 +2323,6 @@ void RefreshScreen(void *DummyVariable)
|
||||
{
|
||||
Region = gMouseCursorBackground[CURRENT_MOUSE_DATA].Region;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, gMouseCursorBackground[CURRENT_MOUSE_DATA].usMouseXPos, gMouseCursorBackground[CURRENT_MOUSE_DATA].usMouseYPos, gpPrimarySurface, (LPRECT)&Region, DDBLTFAST_NOCOLORKEY);
|
||||
@@ -2265,94 +2338,93 @@ void RefreshScreen(void *DummyVariable)
|
||||
} while (ReturnCode != DD_OK);
|
||||
}
|
||||
|
||||
if (gfForceFullScreenRefresh == TRUE )
|
||||
if (gfForceFullScreenRefresh == TRUE)
|
||||
{
|
||||
//
|
||||
// Method (1) - We will be refreshing the entire screen
|
||||
//
|
||||
Region.left = 0;
|
||||
Region.top = 0;
|
||||
Region.right = SCREEN_WIDTH;
|
||||
Region.bottom = SCREEN_HEIGHT;
|
||||
//
|
||||
// Method (1) - We will be refreshing the entire screen
|
||||
//
|
||||
Region.left = 0;
|
||||
Region.top = 0;
|
||||
Region.right = SCREEN_WIDTH;
|
||||
Region.bottom = SCREEN_HEIGHT;
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, 0, 0, gpPrimarySurface, &Region, DDBLTFAST_NOCOLORKEY);
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, 0, 0, gpPrimarySurface, &Region, DDBLTFAST_NOCOLORKEY);
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
|
||||
guiDirtyRegionCount = 0;
|
||||
guiDirtyRegionExCount = 0;
|
||||
gfForceFullScreenRefresh = FALSE;
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
|
||||
guiDirtyRegionCount = 0;
|
||||
guiDirtyRegionExCount = 0;
|
||||
gfForceFullScreenRefresh = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uiIndex = 0; uiIndex < guiDirtyRegionCount; uiIndex++)
|
||||
for (uiIndex = 0; uiIndex < guiDirtyRegionCount; uiIndex++)
|
||||
{
|
||||
Region.left = gListOfDirtyRegions[uiIndex].iLeft;
|
||||
Region.top = gListOfDirtyRegions[uiIndex].iTop;
|
||||
Region.right = gListOfDirtyRegions[uiIndex].iRight;
|
||||
Region.bottom = gListOfDirtyRegions[uiIndex].iBottom;
|
||||
|
||||
do
|
||||
{
|
||||
Region.left = gListOfDirtyRegions[uiIndex].iLeft;
|
||||
Region.top = gListOfDirtyRegions[uiIndex].iTop;
|
||||
Region.right = gListOfDirtyRegions[uiIndex].iRight;
|
||||
Region.bottom = gListOfDirtyRegions[uiIndex].iBottom;
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, gListOfDirtyRegions[uiIndex].iLeft, gListOfDirtyRegions[uiIndex].iTop, gpPrimarySurface, (LPRECT)&Region, DDBLTFAST_NOCOLORKEY);
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, Region.left, Region.top, gpPrimarySurface, (LPRECT)&Region, DDBLTFAST_NOCOLORKEY);
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
}
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
}
|
||||
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
}
|
||||
|
||||
guiDirtyRegionCount = 0;
|
||||
gfForceFullScreenRefresh = FALSE;
|
||||
guiDirtyRegionCount = 0;
|
||||
gfForceFullScreenRefresh = FALSE;
|
||||
|
||||
}
|
||||
|
||||
// Do extended dirty regions!
|
||||
for (uiIndex = 0; uiIndex < guiDirtyRegionExCount; uiIndex++)
|
||||
{
|
||||
Region.left = gDirtyRegionsEx[uiIndex].iLeft;
|
||||
Region.top = gDirtyRegionsEx[uiIndex].iTop;
|
||||
Region.right = gDirtyRegionsEx[uiIndex].iRight;
|
||||
Region.bottom = gDirtyRegionsEx[uiIndex].iBottom;
|
||||
Region.left = gDirtyRegionsEx[uiIndex].iLeft;
|
||||
Region.top = gDirtyRegionsEx[uiIndex].iTop;
|
||||
Region.right = gDirtyRegionsEx[uiIndex].iRight;
|
||||
Region.bottom = gDirtyRegionsEx[uiIndex].iBottom;
|
||||
|
||||
if ( ( Region.top < gsVIEWPORT_WINDOW_END_Y ) && gfRenderScroll )
|
||||
if ( ( Region.top < gsVIEWPORT_WINDOW_END_Y ) && gfRenderScroll )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, gDirtyRegionsEx[uiIndex].iLeft, gDirtyRegionsEx[uiIndex].iTop, gpPrimarySurface, (LPRECT)&Region, DDBLTFAST_NOCOLORKEY);
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
continue;
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
}
|
||||
|
||||
do
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
ReturnCode = IDirectDrawSurface2_SGPBltFast(gpBackBuffer, Region.left, Region.top, gpPrimarySurface, (LPRECT)&Region, DDBLTFAST_NOCOLORKEY);
|
||||
if ((ReturnCode != DD_OK)&&(ReturnCode != DDERR_WASSTILLDRAWING))
|
||||
{
|
||||
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
|
||||
}
|
||||
|
||||
if (ReturnCode == DDERR_SURFACELOST)
|
||||
{
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
goto ENDOFLOOP;
|
||||
}
|
||||
} while (ReturnCode != DD_OK);
|
||||
}
|
||||
|
||||
guiDirtyRegionExCount = 0;
|
||||
}
|
||||
guiDirtyRegionExCount = 0;
|
||||
|
||||
|
||||
ENDOFLOOP:
|
||||
@@ -2639,6 +2711,12 @@ HRESULT ReturnCode;
|
||||
gusGreenMask = (UINT16) SurfaceDescription.ddpfPixelFormat.dwGBitMask;
|
||||
gusBlueMask = (UINT16) SurfaceDescription.ddpfPixelFormat.dwBBitMask;
|
||||
|
||||
if (!gusRedMask)
|
||||
{
|
||||
MessageBox( NULL, "Jagged Alliance 2 windowed mode requires a color depth of 16bpp or less.", "Jagged Alliance 2", MB_ICONEXCLAMATION);
|
||||
PostQuitMessage(1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// RGB 5,5,5
|
||||
if((gusRedMask==0x7c00) && (gusGreenMask==0x03e0) && (gusBlueMask==0x1f))
|
||||
|
||||
Reference in New Issue
Block a user