annotate OSAPI.cpp @ 2572:d87bfbd3bb3b

Step towards unification of Texture and RGBTexture (class Image)
author a.parshin
date Sat, 05 Mar 2016 01:51:54 +0200
parents 68cdef6879a0
children a76d408c5132
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
4
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2152
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
0
Ritor1
parents:
diff changeset
6 #include "OSAPI.h"
Ritor1
parents:
diff changeset
7 #include "OSInfo.h"
2499
68cdef6879a0 engine folder
Ritor1
parents: 2461
diff changeset
8 #include "Engine/Log.h"
0
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
11 bool OSInfo::initialized = false;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
12 OSVERSIONINFOA OSInfo::info;
0
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14
1926
3eb0c4f3d899 Woops, debug stuff.
Nomad
parents: 1924
diff changeset
15
1038
39f42990698f Cleanings
Nomad
parents: 28
diff changeset
16
0
Ritor1
parents:
diff changeset
17 //----- (00462C94) --------------------------------------------------------
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2415
diff changeset
18 int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hprevinstance, wchar_t *lpCmdLine, int nShowCmd)
0
Ritor1
parents:
diff changeset
19 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
20 #ifndef NDEBUG
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
21 {
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
22 //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF);
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
23 }
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
24 #endif
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
25
0
Ritor1
parents:
diff changeset
26 Log::Initialize();
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28 //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2415
diff changeset
29 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))//check whether the window is open
0
Ritor1
parents:
diff changeset
30 {
Ritor1
parents:
diff changeset
31 if (IsIconic(hMM7Window))
Ritor1
parents:
diff changeset
32 ShowWindow(hMM7Window, SW_RESTORE);
Ritor1
parents:
diff changeset
33 SetForegroundWindow(GetLastActivePopup(hMM7Window));
Ritor1
parents:
diff changeset
34 return 0;
Ritor1
parents:
diff changeset
35 }
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2415
diff changeset
36
0
Ritor1
parents:
diff changeset
37 HWND hPrevWindow = GetActiveWindow();
2412
e7a551f458e1 LoadSound - cause of the crash exe file
Ritor1
parents: 2253
diff changeset
38 if (!hPrevWindow)
0
Ritor1
parents:
diff changeset
39 {
Ritor1
parents:
diff changeset
40 Log::Warning(L"OS init: ok");
Ritor1
parents:
diff changeset
41 extern bool MM_Main(const wchar_t *pCmdLine);
Ritor1
parents:
diff changeset
42 MM_Main(lpCmdLine);
Ritor1
parents:
diff changeset
43 }
Ritor1
parents:
diff changeset
44 if (hPrevWindow)
Ritor1
parents:
diff changeset
45 SetActiveWindow(hPrevWindow);
Ritor1
parents:
diff changeset
46
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
47 return GetLastError();
0
Ritor1
parents:
diff changeset
48 }
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
49
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
50
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
51
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
52
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
53 void MsgBox(const wchar_t *msg, const wchar_t *title)
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
54 {
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
55 MessageBoxW(nullptr, msg, title, 0);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
56 }