Mercurial > mm7
comparison mm7_2.cpp @ 1165:29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
removed double LOBYTE, LOWORD etd macro definitions
swprintf called with string size parameter
ErrD3D with too many params fix
1 or 2 other minor fixes
author | Grumpy7 |
---|---|
date | Tue, 04 Jun 2013 03:21:21 +0200 |
parents | 354ec6263123 |
children | 15ad868d972f |
comparison
equal
deleted
inserted
replaced
1164:6b911d7e09a5 | 1165:29a8defbad9e |
---|---|
1 #ifdef _MSC_VER | |
2 #define _CRT_SECURE_NO_WARNINGS | |
3 #endif | |
4 | |
1 #include <io.h> | 5 #include <io.h> |
2 #include <direct.h> | 6 #include <direct.h> |
3 #include <assert.h> | 7 #include <assert.h> |
4 #include <windows.h> | 8 #include <windows.h> |
5 | 9 |
4255 MAP_TYPE MapStats::GetMapInfo(const char *Str2) | 4259 MAP_TYPE MapStats::GetMapInfo(const char *Str2) |
4256 { | 4260 { |
4257 assert(uNumMaps >= 2); | 4261 assert(uNumMaps >= 2); |
4258 | 4262 |
4259 for (uint i = 1; i < uNumMaps; ++i) | 4263 for (uint i = 1; i < uNumMaps; ++i) |
4260 if (!strcmpi(pInfos[i].pFilename, Str2)) | 4264 if (!_stricmp(pInfos[i].pFilename, Str2)) |
4261 return (MAP_TYPE)i; | 4265 return (MAP_TYPE)i; |
4262 | 4266 |
4263 assert(false && "Map not found!"); | 4267 assert(false && "Map not found!"); |
4264 } | 4268 } |
4265 | 4269 |
5668 WPARAM v37; // [sp+10h] [bp-5Ch]@103 | 5672 WPARAM v37; // [sp+10h] [bp-5Ch]@103 |
5669 LPARAM v38; // [sp+14h] [bp-58h]@103 | 5673 LPARAM v38; // [sp+14h] [bp-58h]@103 |
5670 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13 | 5674 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13 |
5671 int pXY[2]; // [sp+64h] [bp-8h]@261 | 5675 int pXY[2]; // [sp+64h] [bp-8h]@261 |
5672 int a2; // [sp+7Ch] [bp+10h]@50 | 5676 int a2; // [sp+7Ch] [bp+10h]@50 |
5673 | 5677 |
5674 switch (Msg) | 5678 switch (Msg) |
5675 { | 5679 { |
5676 case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam); | 5680 case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam); |
5677 case WM_CHAR: | 5681 case WM_CHAR: |
5678 { | 5682 { |
7097 char strCommand[256]; // [sp+10Ch] [bp-118h]@1 | 7101 char strCommand[256]; // [sp+10Ch] [bp-118h]@1 |
7098 char Filename[20]; // [sp+20Ch] [bp-18h]@1 | 7102 char Filename[20]; // [sp+20Ch] [bp-18h]@1 |
7099 | 7103 |
7100 | 7104 |
7101 wchar_t pMagicPath[1024]; | 7105 wchar_t pMagicPath[1024]; |
7102 swprintf(pMagicPath, L"%C:\\anims\\magic7.vid", c); | 7106 swprintf(pMagicPath, wcslen(L"%C:\\anims\\magic7.vid"), L"%C:\\anims\\magic7.vid", c); |
7103 if (GetFileAttributesW(pMagicPath) == -1) | 7107 if (GetFileAttributesW(pMagicPath) == -1) |
7104 return false; | 7108 return false; |
7105 | 7109 |
7106 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c); | 7110 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c); |
7107 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0)) | 7111 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0)) |