mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 03:31:40 +00:00
Removed CHECK_HEAP
svn-id: r23979
This commit is contained in:
parent
847c145810
commit
d02e4d7f7c
@ -97,11 +97,6 @@
|
||||
// explains the reasons briefly.
|
||||
#define SCUMMVM_USE_LONG_INT
|
||||
|
||||
#if defined(CHECK_HEAP)
|
||||
#undef CHECK_HEAP
|
||||
#define CHECK_HEAP checkHeap();
|
||||
#endif
|
||||
|
||||
#define FORCEINLINE __forceinline
|
||||
#define NORETURN _declspec(noreturn)
|
||||
#define PLUGIN_EXPORT __declspec(dllexport)
|
||||
@ -320,11 +315,6 @@
|
||||
|
||||
#define SCUMM_LITTLE_ENDIAN
|
||||
|
||||
#if defined(CHECK_HEAP)
|
||||
#undef CHECK_HEAP
|
||||
#define CHECK_HEAP checkHeap();
|
||||
#endif
|
||||
|
||||
#define FORCEINLINE __forceinline
|
||||
#define NORETURN _declspec(noreturn)
|
||||
#define PLUGIN_EXPORT __declspec(dllexport)
|
||||
@ -368,10 +358,6 @@
|
||||
#define FORCEINLINE inline
|
||||
#endif
|
||||
|
||||
#ifndef CHECK_HEAP
|
||||
#define CHECK_HEAP
|
||||
#endif
|
||||
|
||||
#ifndef CDECL
|
||||
#define CDECL
|
||||
#endif
|
||||
|
@ -534,11 +534,3 @@ void CDECL warning(const char *s, ...) {
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void checkHeap() {
|
||||
#if defined(WIN32) && !defined(__SYMBIAN32__)
|
||||
if (_heapchk() != _HEAPOK) {
|
||||
error("Heap is invalid!");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -274,8 +274,6 @@ void CDECL debug(const char *s, ...) GCC_PRINTF(1, 2);
|
||||
void CDECL debugN(int level, const char *s, ...) GCC_PRINTF(2, 3);
|
||||
void CDECL debugC(int level, uint32 engine_level, const char *s, ...) GCC_PRINTF(3, 4);
|
||||
|
||||
void checkHeap();
|
||||
|
||||
extern int gDebugLevel;
|
||||
|
||||
|
||||
|
@ -1082,9 +1082,7 @@ void ScummEngine::processUpperActors() {
|
||||
|
||||
for (i = 1; i < _numActors; i++) {
|
||||
if (_actors[i].isInCurrentRoom() && _actors[i]._costume && _actors[i]._layer < 0) {
|
||||
CHECK_HEAP
|
||||
_actors[i].drawActorCostume();
|
||||
CHECK_HEAP
|
||||
_actors[i].animateCostume();
|
||||
}
|
||||
}
|
||||
|
@ -92,8 +92,6 @@ byte ClassicCostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) {
|
||||
const int scaletableSize = 128;
|
||||
const bool newAmiCost = (_vm->_game.version == 5) && (_vm->_game.platform == Common::kPlatformAmiga);
|
||||
|
||||
CHECK_HEAP
|
||||
|
||||
v1.scaletable = smallCostumeScaleTable;
|
||||
|
||||
if (_loaded._numColors == 32) {
|
||||
@ -298,7 +296,6 @@ byte ClassicCostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) {
|
||||
_draw_bottom = rect.bottom;
|
||||
|
||||
if (_height + rect.top >= 256) {
|
||||
CHECK_HEAP
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -306,8 +303,6 @@ byte ClassicCostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) {
|
||||
|
||||
v1.mask_ptr = _vm->getMaskBuffer(0, v1.y, _zbuf);
|
||||
|
||||
CHECK_HEAP
|
||||
|
||||
if (_loaded._format == 0x57) {
|
||||
// The v1 costume renderer needs the actor number, which is
|
||||
// the same thing as the costume renderer's _actorID.
|
||||
@ -317,7 +312,6 @@ byte ClassicCostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) {
|
||||
else
|
||||
proc3(v1);
|
||||
|
||||
CHECK_HEAP
|
||||
return drawFlag;
|
||||
}
|
||||
|
||||
|
@ -1496,7 +1496,6 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
|
||||
// Check whether lights are turned on or not
|
||||
const bool lightsOn = _vm->isLightOn();
|
||||
|
||||
CHECK_HEAP;
|
||||
if (_vm->_game.features & GF_SMALL_HEADER) {
|
||||
smap_ptr = ptr;
|
||||
} else if (_vm->_game.version == 8) {
|
||||
@ -1542,8 +1541,6 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
|
||||
if (limit > _numStrips - sx)
|
||||
limit = _numStrips - sx;
|
||||
for (int k = 0; k < limit; ++k, ++stripnr, ++sx, ++x) {
|
||||
CHECK_HEAP;
|
||||
|
||||
if (y < vs->tdirty[sx])
|
||||
vs->tdirty[sx] = y;
|
||||
|
||||
@ -1563,7 +1560,6 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
|
||||
if (_vm->_game.version == 8 || _vm->_game.heversion >= 60)
|
||||
transpStrip = true;
|
||||
|
||||
CHECK_HEAP;
|
||||
if (vs->hasTwoBuffers) {
|
||||
byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + x * 8;
|
||||
if (lightsOn)
|
||||
@ -1571,7 +1567,6 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
|
||||
else
|
||||
clear8Col(frontBuf, vs->pitch, height);
|
||||
}
|
||||
CHECK_HEAP;
|
||||
|
||||
decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag, tmsk_ptr);
|
||||
|
||||
|
@ -566,7 +566,6 @@ void ScummEngine::resetRoomObjects() {
|
||||
const byte *room, *searchptr, *rootptr;
|
||||
const CodeHeader *cdhd;
|
||||
|
||||
CHECK_HEAP
|
||||
room = getResourceAddress(rtRoom, _roomResource);
|
||||
|
||||
if (_numObjectsInRoom == 0)
|
||||
@ -628,8 +627,6 @@ void ScummEngine::resetRoomObjects() {
|
||||
if (_objs[i].obj_nr && !_objs[i].fl_object_index)
|
||||
resetRoomObject(&_objs[i], room);
|
||||
}
|
||||
|
||||
CHECK_HEAP
|
||||
}
|
||||
|
||||
void ScummEngine_v3old::resetRoomObjects() {
|
||||
@ -637,7 +634,6 @@ void ScummEngine_v3old::resetRoomObjects() {
|
||||
ObjectData *od;
|
||||
const byte *room, *ptr;
|
||||
|
||||
CHECK_HEAP
|
||||
room = getResourceAddress(rtRoom, _roomResource);
|
||||
|
||||
if (_numObjectsInRoom == 0)
|
||||
@ -673,8 +669,6 @@ void ScummEngine_v3old::resetRoomObjects() {
|
||||
dumpResource(buf, od->obj_nr, room + od->OBCDoffset);
|
||||
}
|
||||
}
|
||||
|
||||
CHECK_HEAP
|
||||
}
|
||||
|
||||
void ScummEngine_v4::resetRoomObjects() {
|
||||
@ -684,7 +678,6 @@ void ScummEngine_v4::resetRoomObjects() {
|
||||
uint16 obim_id;
|
||||
const byte *room;
|
||||
|
||||
CHECK_HEAP
|
||||
room = getResourceAddress(rtRoom, _roomResource);
|
||||
|
||||
if (_numObjectsInRoom == 0)
|
||||
@ -729,8 +722,6 @@ void ScummEngine_v4::resetRoomObjects() {
|
||||
resetRoomObject(&_objs[i], room);
|
||||
}
|
||||
}
|
||||
|
||||
CHECK_HEAP
|
||||
}
|
||||
|
||||
void ScummEngine_c64::resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr) {
|
||||
@ -1234,7 +1225,6 @@ void ScummEngine::addObjectToInventory(uint obj, uint room) {
|
||||
|
||||
debug(1, "Adding object %d from room %d into inventory", obj, room);
|
||||
|
||||
CHECK_HEAP
|
||||
if (whereIsObject(obj) == WIO_FLOBJECT) {
|
||||
idx = getObjectIndex(obj);
|
||||
assert(idx >= 0);
|
||||
@ -1256,8 +1246,6 @@ void ScummEngine::addObjectToInventory(uint obj, uint room) {
|
||||
dst = _res->createResource(rtInventory, slot, size);
|
||||
assert(dst);
|
||||
memcpy(dst, ptr, size);
|
||||
|
||||
CHECK_HEAP
|
||||
}
|
||||
|
||||
void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint room) {
|
||||
|
@ -729,8 +729,6 @@ int ScummEngine::getResourceSize(int type, int idx) {
|
||||
byte *ScummEngine::getResourceAddress(int type, int idx) {
|
||||
byte *ptr;
|
||||
|
||||
CHECK_HEAP
|
||||
|
||||
if (_game.heversion >= 80 && type == rtString)
|
||||
idx &= ~0x33539000;
|
||||
|
||||
@ -804,7 +802,6 @@ void ResourceManager::setResourceCounter(int type, int idx, byte flag) {
|
||||
byte *ResourceManager::createResource(int type, int idx, uint32 size) {
|
||||
byte *ptr;
|
||||
|
||||
CHECK_HEAP
|
||||
debugC(DEBUG_RESOURCE, "_res->createResource(%s,%d,%d)", resTypeFromId(type), idx, size);
|
||||
|
||||
if (!validateResource("allocating", type, idx))
|
||||
@ -823,7 +820,6 @@ byte *ResourceManager::createResource(int type, int idx, uint32 size) {
|
||||
|
||||
expireResources(size);
|
||||
|
||||
CHECK_HEAP
|
||||
ptr = (byte *)calloc(size + sizeof(MemBlkHeader) + SAFETY_AREA, 1);
|
||||
if (ptr == NULL) {
|
||||
error("Out of memory while allocating %d", size);
|
||||
@ -865,7 +861,6 @@ bool ResourceManager::validateResource(const char *str, int type, int idx) const
|
||||
void ResourceManager::nukeResource(int type, int idx) {
|
||||
byte *ptr;
|
||||
|
||||
CHECK_HEAP
|
||||
if (!address[type])
|
||||
return;
|
||||
|
||||
|
@ -44,7 +44,6 @@ namespace Scumm {
|
||||
void ScummEngine::startScene(int room, Actor *a, int objectNr) {
|
||||
int i, where;
|
||||
|
||||
CHECK_HEAP;
|
||||
debugC(DEBUG_GENERAL, "Loading room %d", room);
|
||||
|
||||
stopTalk();
|
||||
@ -212,8 +211,6 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
|
||||
}
|
||||
|
||||
_doEffect = true;
|
||||
|
||||
CHECK_HEAP;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -233,8 +233,6 @@ bool ScummEngine::loadState(int slot, bool compat) {
|
||||
|
||||
_sound->pauseSounds(true);
|
||||
|
||||
CHECK_HEAP
|
||||
|
||||
closeRoom();
|
||||
|
||||
memset(_inventory, 0, sizeof(_inventory[0]) * _numInventory);
|
||||
@ -372,7 +370,6 @@ bool ScummEngine::loadState(int slot, bool compat) {
|
||||
if (VAR_VOICE_MODE != 0xFF)
|
||||
VAR(VAR_VOICE_MODE) = ConfMan.getBool("subtitles");
|
||||
|
||||
CHECK_HEAP
|
||||
debug(1, "State loaded from '%s'", filename);
|
||||
|
||||
_sound->pauseSounds(false);
|
||||
|
@ -470,7 +470,6 @@ void ScummEngine::executeScript() {
|
||||
executeOpcode(_opcode);
|
||||
|
||||
}
|
||||
CHECK_HEAP;
|
||||
}
|
||||
|
||||
byte ScummEngine::fetchScriptByte() {
|
||||
|
@ -1655,8 +1655,6 @@ static void convertADResource(ResourceManager *res, const GameSettings& game, in
|
||||
src_ptr += 0x11 + 8 * 16;
|
||||
size -= 0x11 + 8 * 16;
|
||||
|
||||
CHECK_HEAP
|
||||
|
||||
track = src_ptr;
|
||||
|
||||
// Convert the ticks into a MIDI tempo.
|
||||
|
Loading…
x
Reference in New Issue
Block a user