- Split the IHNM script functions into a different file

- Added two new defines, ENABLE_IHNM and ENABLE_SAGA2 (enabled by default), which can be used to remove the parts of the SAGA engine which are specific to IHNM and SAGA 2 games. Hopefully, this will reduce the size of the engine even more for platforms with little memory (e.g. the Nintendo DS)

svn-id: r35672
This commit is contained in:
Filippos Karapetis 2009-01-02 16:52:38 +00:00
parent a09a7678f4
commit d5b6996c45
29 changed files with 656 additions and 430 deletions

View file

@ -61,6 +61,7 @@ Sprite::Sprite(SagaEngine *vm) : _vm(vm) {
if (_vm->getGameId() == GID_ITE) {
loadList(_vm->getResourceDescription()->mainSpritesResourceId, _mainSprites);
_arrowSprites = _saveReminderSprites = _inventorySprites = _mainSprites;
#ifdef ENABLE_IHNM
} else if (_vm->getGameId() == GID_IHNM) {
if (_vm->getFeatures() & GF_IHNM_DEMO) {
loadList(RID_IHNMDEMO_ARROW_SPRITES, _arrowSprites);
@ -69,6 +70,7 @@ Sprite::Sprite(SagaEngine *vm) : _vm(vm) {
loadList(RID_IHNM_ARROW_SPRITES, _arrowSprites);
loadList(RID_IHNM_SAVEREMINDER_SPRITES, _saveReminderSprites);
}
#endif
} else {
error("Sprite: unknown game type");
}
@ -167,6 +169,7 @@ void Sprite::loadList(int resourceId, SpriteList &spriteList) {
memoryError("Sprite::loadList");
}
#ifdef ENABLE_IHNM
// IHNM sprites are upside-down, for reasons which i can only
// assume are perverse. To simplify things, flip them now. Not
// at drawing time.
@ -181,6 +184,7 @@ void Sprite::loadList(int resourceId, SpriteList &spriteList) {
dst += spriteInfo->width;
}
} else
#endif
memcpy(spriteInfo->decodedBuffer, _decodeBuf, outputLength);
}