Mercurial > mm7
comparison Render.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 | 6b911d7e09a5 |
children | f7ad7bd0a806 |
comparison
equal
deleted
inserted
replaced
1164:6b911d7e09a5 | 1165:29a8defbad9e |
---|---|
1 #ifdef _MSC_VER | |
2 #define _CRT_SECURE_NO_WARNINGS | |
3 #endif | |
4 | |
1 #include <assert.h> | 5 #include <assert.h> |
2 | 6 |
3 #include "VideoPlayer.h" | 7 #include "VideoPlayer.h" |
4 #include "Sprites.h" | 8 #include "Sprites.h" |
5 #include "Mouse.h" | 9 #include "Mouse.h" |
1829 } | 1833 } |
1830 | 1834 |
1831 assert(v6 < 1000); // many random crashes here | 1835 assert(v6 < 1000); // many random crashes here |
1832 | 1836 |
1833 // for all shore tiles - draw a tile water under them since they're half-empty | 1837 // for all shore tiles - draw a tile water under them since they're half-empty |
1834 if (!strnicmp(pBitmaps_LOD->pTextures[v8->uTileBitmapID].pName, "wtrdr", 5)) // all shore tile filenames are wtrdrXXX | 1838 if (!_strnicmp(pBitmaps_LOD->pTextures[v8->uTileBitmapID].pName, "wtrdr", 5)) // all shore tile filenames are wtrdrXXX |
1835 { | 1839 { |
1836 pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE); // no Z writing: the shore tile will be draw in the same place, so taking care about z-fighting | 1840 pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE); // no Z writing: the shore tile will be draw in the same place, so taking care about z-fighting |
1837 pRenderer->DrawTerrainPolygon(v8->uNumVertices, v8, pBitmaps_LOD->pHardwareTextures[pRenderer->pHDWaterBitmapIDs[pRenderer->hd_water_current_frame]], false, true); | 1841 pRenderer->DrawTerrainPolygon(v8->uNumVertices, v8, pBitmaps_LOD->pHardwareTextures[pRenderer->pHDWaterBitmapIDs[pRenderer->hd_water_current_frame]], false, true); |
1838 pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE); | 1842 pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE); |
1839 | 1843 |
6516 | 6520 |
6517 //----- (004A1032) -------------------------------------------------------- | 6521 //----- (004A1032) -------------------------------------------------------- |
6518 bool Render::LockSurface_DDraw2(IDirectDrawSurface2 *pSurface, DDSURFACEDESC *pDesc, unsigned int uLockFlags) | 6522 bool Render::LockSurface_DDraw2(IDirectDrawSurface2 *pSurface, DDSURFACEDESC *pDesc, unsigned int uLockFlags) |
6519 { | 6523 { |
6520 IDirectDrawSurface2 *v4; // esi@1 | 6524 IDirectDrawSurface2 *v4; // esi@1 |
6521 bool v5; // eax@1 | 6525 HRESULT v5; // eax@1 |
6522 HRESULT v6; // eax@2 | 6526 HRESULT v6; // eax@2 |
6523 int v7; // [sp-8h] [bp-10h]@8 | 6527 int v7; // [sp-8h] [bp-10h]@8 |
6524 unsigned int v8; // [sp-4h] [bp-Ch]@8 | 6528 unsigned int v8; // [sp-4h] [bp-Ch]@8 |
6525 | 6529 |
6526 v4 = pSurface; | 6530 v4 = pSurface; |
10733 idx2 = uNumItems; | 10737 idx2 = uNumItems; |
10734 while (true) | 10738 while (true) |
10735 { | 10739 { |
10736 auto i = idx1 + (idx2 - idx1) / 2; | 10740 auto i = idx1 + (idx2 - idx1) / 2; |
10737 | 10741 |
10738 auto res = strcmpi(pName, pSpriteNames[i]); | 10742 auto res = _stricmp(pName, pSpriteNames[i]); |
10739 if (!res) | 10743 if (!res) |
10740 { | 10744 { |
10741 fseek(pFile, pSpriteOffsets[i], SEEK_SET); | 10745 fseek(pFile, pSpriteOffsets[i], SEEK_SET); |
10742 break; | 10746 break; |
10743 } | 10747 } |