# HG changeset patch # User zipi # Date 1404482953 -3600 # Node ID eba7123e4a2d83f6266f577ff5f8c047b9db83d4 # Parent 2fe8feb3dcd1df93a7600a9ae14a228b7056c2a7 fixing some compiler variable optimalization diff -r 2fe8feb3dcd1 -r eba7123e4a2d Outdoor.cpp --- a/Outdoor.cpp Fri Jul 04 18:15:46 2014 +0600 +++ b/Outdoor.cpp Fri Jul 04 15:09:13 2014 +0100 @@ -271,7 +271,7 @@ } //----- (00488F5C) -------------------------------------------------------- -bool OutdoorLocation::Initialize(const char *pFilename, int File, size_t uRespawnInterval, int thisa) +bool OutdoorLocation::Initialize(const char *pFilename, int File, size_t uRespawnInterval, int *thisa) { OutdoorLocation *v5; // esi@1 bool result; // eax@2 @@ -1070,7 +1070,7 @@ } //----- (0047D0A6) -------------------------------------------------------- -bool OutdoorLocation::Load(const char *pFilename, ODMFace *File, size_t pNumItems, int thisa)//загрузка локации +bool OutdoorLocation::Load(const char *pFilename, ODMFace *File, size_t pNumItems, int *thisa)//загрузка локации { //OutdoorLocation *pOutdoorLocation; // esi@1 /*bool result; // eax@9 @@ -1945,7 +1945,7 @@ if (Str2 == 0) ++ddm.uNumRespawns; v108 = 0; - *(int *)thisa = 1; + *thisa = 1; v39 = pGames_LOD->FindContainer(Str, 0); fread(&header, 0x10, 1u, v39); //pFilename = (char *)header.uCompressedSize; @@ -1971,7 +1971,7 @@ goto LABEL_120; } - *(int *)thisa = 0; + *thisa = 0; LABEL_120: //v108 = (int)".odm"; //v83 = strlen(pContainer); @@ -1984,7 +1984,7 @@ pGameLoadingUI_ProgressBar->Progress(); - if ( *(int *)thisa ) + if ( *thisa ) { memcpy(uFullyRevealedCellOnMap, Dst, 0x3C8u); memcpy(uPartiallyRevealedCellOnMap, Src, 0x3C8u); diff -r 2fe8feb3dcd1 -r eba7123e4a2d Outdoor.h --- a/Outdoor.h Fri Jul 04 18:15:46 2014 +0600 +++ b/Outdoor.h Fri Jul 04 15:09:13 2014 +0100 @@ -138,7 +138,7 @@ void PrepareActorsDrawList(); void CreateDebugLocation(); void Release(); - bool Load(const char *pFilename, ODMFace *File, size_t a4, int thisa); + bool Load(const char *pFilename, ODMFace *File, size_t a4, int *thisa); int GetTileIdByTileMapId(signed int a2); unsigned int DoGetTileTexture(signed int uX, signed int uZ); int _47ED83(signed int a2, signed int a3); @@ -158,7 +158,7 @@ int GetSomeOtherTileInfo(int sX, int sY); unsigned int GetTileTexture(int sX, int sZ); int GetHeightOnTerrain(int sX, int sZ); - bool Initialize(const char *pFilename, int File, size_t uRespawnInterval, int thisa); + bool Initialize(const char *pFilename, int File, size_t uRespawnInterval, int *thisa); //bool Release2(); bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5); void MessWithLUN(); diff -r 2fe8feb3dcd1 -r eba7123e4a2d mm7_3.cpp --- a/mm7_3.cpp Fri Jul 04 18:15:46 2014 +0600 +++ b/mm7_3.cpp Fri Jul 04 15:09:13 2014 +0100 @@ -2650,13 +2650,14 @@ const char *pFilename; // [sp+84h] [bp-Ch]@1 //unsigned int v12; // [sp+88h] [bp-8h]@12 //int v13; // [sp+8Ch] [bp-4h]@11 + int v; pFilename = pLevelFilename; //thisa->AllocSoftwareDrawBuffers(); pODMRenderParams->Initialize(); pWeather->bRenderSnow = false; pRenderer->ClearZBuffer(0, 479); - thisa = (ODMRenderParams *)1; + //thisa = (ODMRenderParams *)1; GetAlertStatus(); if ( _A750D8_player_speech_timer ) _A750D8_player_speech_timer = 0; @@ -2668,14 +2669,14 @@ v3 = v4->uRespawnIntervalDays; } else - v4 = (MapInfo *)thisa; + v4 = (MapInfo *)1; day_attrib &= ~DAY_ATTRIB_FOG; dword_6BE13C_uCurrentlyLoadedLocationID = v2; pOutdoor->Initialize( pFilename, (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1, v3, - (int)&thisa); + &v); if ( !(dword_6BE364_game_settings_1 & GAME_SETTINGS_2000) ) { Actor::InitializeActors(); @@ -2684,8 +2685,8 @@ dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_2000; //v5 = 0; if ( !v2 ) - thisa = 0; - if ( thisa == (ODMRenderParams *)1 ) + v = 0; + if ( v == 1 ) { //v13 = 0; for (uint i = 0; i < pOutdoor->uNumSpawnPoints; ++i)