Mercurial > mm7
diff TileTable.cpp @ 1588:e6ac4919b22c
Слияние
author | Ritor1 |
---|---|
date | Mon, 09 Sep 2013 09:13:40 +0600 |
parents | c4ab816fcc5e |
children | 75fafd8ced59 |
line wrap: on
line diff
--- a/TileTable.cpp Mon Sep 09 09:13:23 2013 +0600 +++ b/TileTable.cpp Mon Sep 09 09:13:40 2013 +0600 @@ -2,7 +2,6 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -30,15 +29,7 @@ //----- (00487E3B) -------------------------------------------------------- TileDesc *TileTable::GetTileById(unsigned int uTileID) { - /*TileDesc *result; // eax@3 - - if ( (uTileID & 0x80000000u) != 0 || (signed int)uTileID > (signed int)(this->uNumTiles - 1) ) - result = this->pTiles; - else - result = &this->pTiles[uTileID]; - return result;*/ - - assert(uTileID < sNumTiles); + Assert(uTileID < sNumTiles); return &pTiles[uTileID]; } @@ -112,7 +103,7 @@ v2 = fopen("data\\dtile.bin", "wb"); v3 = v2; if ( !v2 ) - Abortf("Unable to save dtile.bin!"); + Error("Unable to save dtile.bin!"); fwrite(v1, 4u, 1u, v2); fwrite(v1->pTiles, 0x1Au, v1->sNumTiles, v3); fclose(v3); @@ -125,8 +116,8 @@ num_mm7_tiles = data_mm7 ? *(int *)data_mm7 : 0, num_mm8_tiles = data_mm8 ? *(int *)data_mm8 : 0; sNumTiles = num_mm6_tiles + num_mm7_tiles + num_mm8_tiles; - assert(sNumTiles); - assert(!num_mm8_tiles); + Assert(sNumTiles); + Assert(!num_mm8_tiles); pTiles = (TileDesc *)pAllocator->AllocNamedChunk(pTiles, sNumTiles * sizeof(TileDesc), "Tile Descrip"); memcpy(pTiles, (char *)data_mm7 + 4, num_mm7_tiles * sizeof(TileDesc)); @@ -226,7 +217,7 @@ v3 = fopen(pFilename, "r"); File = v3; if ( !v3 ) - Abortf("TileTable::load - Unable to open file: %s."); + Error("TileTable::load - Unable to open file: %s."); v4 = 0; for ( i = v3; fgets(&Buf, 490, i); i = File ) { @@ -239,7 +230,7 @@ v5 = pAllocator->AllocNamedChunk(v2->pTiles, 26 * v4, "Tile Descrip"); v2->pTiles = (TileDesc *)v5; if ( !v5 ) - Abortf("TileTable::Load - Out of Memory!"); + Error("TileTable::Load - Out of Memory!"); memset(v5, 0, 26 * v2->sNumTiles); v2->sNumTiles = 0; fseek(File, 0, 0);