Mercurial > mm7
comparison Outdoor.cpp @ 2006:30c2b575d25c
signed fixes
DamagePlayerFromMonster -1 indexing
author | zipi |
---|---|
date | Wed, 06 Nov 2013 13:06:02 +0000 |
parents | 72af4d93bdfb |
children | 7a9477135943 |
comparison
equal
deleted
inserted
replaced
2005:8fa26b63244a | 2006:30c2b575d25c |
---|---|
1168 v1->pFaceIDLIST = 0; | 1168 v1->pFaceIDLIST = 0; |
1169 v6 = malloc(2); | 1169 v6 = malloc(2); |
1170 v1->pFaceIDLIST = (unsigned __int16 *)v6; | 1170 v1->pFaceIDLIST = (unsigned __int16 *)v6; |
1171 *(short *)v6 = 0; | 1171 *(short *)v6 = 0; |
1172 strcpy(v1->pSkyTextureName, pDefaultSkyTexture.data()); | 1172 strcpy(v1->pSkyTextureName, pDefaultSkyTexture.data()); |
1173 v1->uSky_TextureID = pBitmaps_LOD->LoadTexture(v1->pSkyTextureName); | 1173 v1->sSky_TextureID = pBitmaps_LOD->LoadTexture(v1->pSkyTextureName); |
1174 strcpy(v1->pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data()); | 1174 strcpy(v1->pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data()); |
1175 v7 = pBitmaps_LOD->LoadTexture(v1->pGroundTileset); | 1175 v7 = pBitmaps_LOD->LoadTexture(v1->pGroundTileset); |
1176 v1->uMainTile_BitmapID = v7; | 1176 v1->sMainTile_BitmapID = v7; |
1177 | 1177 |
1178 if ( v1->uSky_TextureID == -1 ) | 1178 if ( v1->sSky_TextureID == -1 ) |
1179 Error("Invalid Sky Tex Handle"); | 1179 Error("Invalid Sky Tex Handle"); |
1180 | 1180 |
1181 if ( v1->uMainTile_BitmapID == -1 ) | 1181 if ( v1->sMainTile_BitmapID == -1 ) |
1182 Error("Invalid Ground Tex Handle"); | 1182 Error("Invalid Ground Tex Handle"); |
1183 } | 1183 } |
1184 | 1184 |
1185 | 1185 |
1186 | 1186 |
1665 else | 1665 else |
1666 { | 1666 { |
1667 v108 = 0; | 1667 v108 = 0; |
1668 v107 = (int)pDefaultSkyTexture; | 1668 v107 = (int)pDefaultSkyTexture; |
1669 } | 1669 } |
1670 uSky_TextureID = pBitmaps_LOD->LoadTexture((const char *)v107, (enum TEXTURE_TYPE)v108); | 1670 sSky_TextureID = pBitmaps_LOD->LoadTexture((const char *)v107, (enum TEXTURE_TYPE)v108); |
1671 strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture); | 1671 strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture); |
1672 v34 = pTileTable->GetTileById(pTileTypes[0].uTileID); | 1672 v34 = pTileTable->GetTileById(pTileTypes[0].uTileID); |
1673 v35 = pBitmaps_LOD->LoadTexture(v34->pTileName); | 1673 v35 = pBitmaps_LOD->LoadTexture(v34->pTileName); |
1674 v36 = uSky_TextureID; | 1674 v36 = sSky_TextureID; |
1675 uMainTile_BitmapID = v35; | 1675 sMainTile_BitmapID = v35; |
1676 if ( v36 != -1 ) | 1676 if ( v36 != -1 ) |
1677 pBitmaps_LOD->pTextures[v36].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v36].palette_id1); | 1677 pBitmaps_LOD->pTextures[v36].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v36].palette_id1); |
1678 | 1678 |
1679 v37 = uMainTile_BitmapID; | 1679 v37 = sMainTile_BitmapID; |
1680 if ( v37 != -1 ) | 1680 if ( v37 != -1 ) |
1681 pBitmaps_LOD->pTextures[v37].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v37].palette_id1); | 1681 pBitmaps_LOD->pTextures[v37].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v37].palette_id1); |
1682 | 1682 |
1683 _47F0E2(); | 1683 _47F0E2(); |
1684 pGameLoadingUI_ProgressBar->Progress(); | 1684 pGameLoadingUI_ProgressBar->Progress(); |
2321 strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data()); | 2321 strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data()); |
2322 //v97 = pTileTypes[0].uTileID; | 2322 //v97 = pTileTypes[0].uTileID; |
2323 //v108 = 0; | 2323 //v108 = 0; |
2324 TileDesc* v98 = pTileTable->GetTileById(pTileTypes[0].uTileID); | 2324 TileDesc* v98 = pTileTable->GetTileById(pTileTypes[0].uTileID); |
2325 //v99 = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT); | 2325 //v99 = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT); |
2326 uMainTile_BitmapID = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT); | 2326 sMainTile_BitmapID = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT); |
2327 if (uMainTile_BitmapID != -1) | 2327 if (sMainTile_BitmapID != -1) |
2328 pBitmaps_LOD->pTextures[uMainTile_BitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[uMainTile_BitmapID].palette_id1); | 2328 pBitmaps_LOD->pTextures[sMainTile_BitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[sMainTile_BitmapID].palette_id1); |
2329 | 2329 |
2330 _47F0E2(); | 2330 _47F0E2(); |
2331 | 2331 |
2332 LABEL_150: | 2332 LABEL_150: |
2333 //v100 = HIDWORD(uLastVisitDay); | 2333 //v100 = HIDWORD(uLastVisitDay); |
2347 else | 2347 else |
2348 { | 2348 { |
2349 strcpy(loc_time.sky_texture_name, "plansky3"); | 2349 strcpy(loc_time.sky_texture_name, "plansky3"); |
2350 } | 2350 } |
2351 //v101 = pBitmaps_LOD->LoadTexture(field_4F8); | 2351 //v101 = pBitmaps_LOD->LoadTexture(field_4F8); |
2352 uSky_TextureID = pBitmaps_LOD->LoadTexture(loc_time.sky_texture_name); | 2352 sSky_TextureID = pBitmaps_LOD->LoadTexture(loc_time.sky_texture_name); |
2353 if (uSky_TextureID != -1) | 2353 if (sSky_TextureID != -1) |
2354 pBitmaps_LOD->pTextures[uSky_TextureID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[uSky_TextureID].palette_id1); | 2354 pBitmaps_LOD->pTextures[sSky_TextureID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[sSky_TextureID].palette_id1); |
2355 | 2355 |
2356 pPaletteManager->RecalculateAll(); | 2356 pPaletteManager->RecalculateAll(); |
2357 pSoundList->LoadSound(53, 0); | 2357 pSoundList->LoadSound(53, 0); |
2358 pSoundList->LoadSound(92, 0); | 2358 pSoundList->LoadSound(92, 0); |
2359 pSoundList->LoadSound(57, 0); | 2359 pSoundList->LoadSound(57, 0); |
2425 } | 2425 } |
2426 return result; | 2426 return result; |
2427 } | 2427 } |
2428 | 2428 |
2429 //----- (0047ED08) -------------------------------------------------------- | 2429 //----- (0047ED08) -------------------------------------------------------- |
2430 unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uY) | 2430 unsigned int OutdoorLocation::DoGetTileTexture(signed int sX, signed int sY) |
2431 { | 2431 { |
2432 int v3; // esi@5 | 2432 int v3; // esi@5 |
2433 unsigned int result; // eax@9 | 2433 unsigned int result; // eax@9 |
2434 | 2434 |
2435 assert(uX < 128 && uY < 128); | 2435 assert(sX < 128 && sY < 128); |
2436 | 2436 |
2437 v3 = this->pTerrain.pTilemap[uY * 128 + uX]; | 2437 v3 = this->pTerrain.pTilemap[sY * 128 + sX]; |
2438 if (v3 < 198) // < Tileset_3 | 2438 if (v3 < 198) // < Tileset_3 |
2439 { | 2439 { |
2440 if (v3 >= 90) | 2440 if (v3 >= 90) |
2441 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90; | 2441 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90; |
2442 } | 2442 } |
2488 | 2488 |
2489 return *(&this->pTerrain.pTilemap[128 * a3] + a2); | 2489 return *(&this->pTerrain.pTilemap[128 * a3] + a2); |
2490 } | 2490 } |
2491 | 2491 |
2492 //----- (0047EDB3) -------------------------------------------------------- | 2492 //----- (0047EDB3) -------------------------------------------------------- |
2493 int OutdoorLocation::ActuallyGetSomeOtherTileInfo(unsigned int uX, unsigned int uY) | 2493 int OutdoorLocation::ActuallyGetSomeOtherTileInfo(signed int sX, signed int sY) |
2494 { | 2494 { |
2495 assert(uX < 128 && uY < 128); | 2495 assert(sX < 128 && sY < 128); |
2496 int v3; // esi@5 | 2496 int v3; // esi@5 |
2497 | 2497 |
2498 v3 = this->pTerrain.pTilemap[uY * 128 + uX]; | 2498 v3 = this->pTerrain.pTilemap[sY * 128 + sX]; |
2499 if ( v3 >= 90 ) | 2499 if ( v3 >= 90 ) |
2500 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90; | 2500 v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90; |
2501 return pTileTable->pTiles[v3].uAttributes; | 2501 return pTileTable->pTiles[v3].uAttributes; |
2502 } | 2502 } |
2503 | 2503 |
3099 v28->field_14_actor_id = i; | 3099 v28->field_14_actor_id = i; |
3100 v35 = pMonsterList->pMonsters; | 3100 v35 = pMonsterList->pMonsters; |
3101 v36 = actor->pMonsterInfo.uID; | 3101 v36 = actor->pMonsterInfo.uID; |
3102 v28->field_1E = v62 | 0x200; | 3102 v28->field_1E = v62 | 0x200; |
3103 v28->pSpriteFrame = v15; | 3103 v28->pSpriteFrame = v15; |
3104 v28->uTintColor = pMonsterList->pMonsters[actor->pMonsterInfo.uID-1].uTintColor;//*((int *)&v35[v36] - 36); | 3104 v28->sTintColor = pMonsterList->pMonsters[actor->pMonsterInfo.uID-1].sTintColor;//*((int *)&v35[v36] - 36); |
3105 if (actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) | 3105 if (actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) |
3106 v28->field_1E = v62 | 0x200; | 3106 v28->field_1E = v62 | 0x200; |
3107 } | 3107 } |
3108 //LABEL_58: | 3108 //LABEL_58: |
3109 //++v59; | 3109 //++v59; |