version 1.1 | | version 1.2 |
---|
| | |
#include <windows.h> | | #include <windows.h> |
#include <ddraw.h> | | #include <ddraw.h> |
#include <mmsystem.h> | | #include <mmsystem.h> |
| | #include "args.h" |
| | |
| | #ifndef NDEBUG |
| | #ifdef _MSC_VER |
| | #include <crtdbg.h> |
| | #endif |
| | #endif |
| | |
extern HINSTANCE hInst; | | extern HINSTANCE hInst; |
extern HWND g_hWnd; | | extern HWND g_hWnd; |
| | |
void arch_init_start() | | void arch_init_start() |
{ | | { |
WNDCLASS wcDescentClass; | | WNDCLASS wcDescentClass; |
| | |
| | #ifndef NDEBUG |
| | #ifdef _MSC_VER |
| | if (FindArg("-memdbg")) |
| | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | /* _CRTDBG_CHECK_ALWAYS_DF | */ |
| | /*_CRTDBG_CHECK_CRT_DF |*/ |
| | _CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF); |
| | #endif |
| | #endif |
| | |
wcDescentClass.lpszClassName = "WinDescent"; | | wcDescentClass.lpszClassName = "WinDescent"; |
wcDescentClass.hInstance = hInst; | | wcDescentClass.hInstance = hInst; |
wcDescentClass.lpfnWndProc = DescentWndProc; | | wcDescentClass.lpfnWndProc = DescentWndProc; |
| | |
abort(); | | abort(); |
} | | } |
| | |
#ifndef NDEBUG | | if (FindArg("-semiwin")) |
ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd,DDSCL_NORMAL); | | ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd,DDSCL_NORMAL); |
| | else |
| | { |
| | #ifndef NDEBUG |
| | ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd, |
| | DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN|DDSCL_ALLOWREBOOT); |
#else | | #else |
ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd,DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN); | | ddrval=IDirectDraw_SetCooperativeLevel(lpDD,g_hWnd, |
| | DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN|DDSCL_ALLOWREBOOT); |
#endif | | #endif |
| | } |
| | |
if (ddrval!=DD_OK) | | if (ddrval!=DD_OK) |
{ | | { |
fprintf(stderr,"SetCooperativeLevel() failed\n"); | | fprintf(stderr,"SetCooperativeLevel() failed\n"); |