mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-11 05:36:12 +00:00
SAGA2: Fix RES_ID calls
This commit is contained in:
parent
3e0d5ec5cd
commit
392690a107
@ -62,11 +62,11 @@ APPFUNC(cmdControl);
|
||||
Resource ID constants
|
||||
* ===================================================================== */
|
||||
|
||||
const uint32 nameListID = RES_ID('N', 'A', 'M', 'E'),
|
||||
objListID = RES_ID('O', 'B', 'J', 'E'),
|
||||
worldListID = RES_ID('W', 'R', 'L', 'D'),
|
||||
objProtoID = RES_ID('P', 'R', 'O', 0),
|
||||
actorProtoID = RES_ID('P', 'R', 'O', 1);
|
||||
const uint32 nameListID = MKTAG('N', 'A', 'M', 'E'),
|
||||
objListID = MKTAG('O', 'B', 'J', 'E'),
|
||||
worldListID = MKTAG('W', 'R', 'L', 'D'),
|
||||
objProtoID = MKTAG('P', 'R', 'O', 0),
|
||||
actorProtoID = MKTAG('P', 'R', 'O', 1);
|
||||
|
||||
/* ===================================================================== *
|
||||
Locals
|
||||
@ -151,7 +151,7 @@ extern SpellStuff spellBook[];
|
||||
extern DisplayNodeList mainDisplayList;
|
||||
extern ObjectID pickedObject;
|
||||
|
||||
const uint32 imageGroupID = RES_ID('I', 'M', 'A', 'G');
|
||||
const uint32 imageGroupID = MKTAG('I', 'M', 'A', 'G');
|
||||
|
||||
extern TilePoint incDirTable[];
|
||||
|
||||
@ -2366,7 +2366,7 @@ uint16 GameObject::totalContainedBulk(void) {
|
||||
// Initial constructor
|
||||
|
||||
GameWorld::GameWorld(int16 map) {
|
||||
if (tileRes->seek(RES_ID('M', 'A', 'P', (char)map))) {
|
||||
if (tileRes->seek(MKTAG('M', 'A', 'P', (char)map))) {
|
||||
int16 mapSize; // Size of map in MetaTiles
|
||||
|
||||
tileRes->read(&mapSize, sizeof(mapSize));
|
||||
@ -2679,7 +2679,7 @@ void initObjectSoundFXTable(void) {
|
||||
hResContext *itemRes;
|
||||
|
||||
itemRes = auxResFile->newContext(
|
||||
RES_ID('I', 'T', 'E', 'M'),
|
||||
MKTAG('I', 'T', 'E', 'M'),
|
||||
"item resources");
|
||||
if (itemRes == NULL || !itemRes->_valid)
|
||||
error("Error accessing item resource group.\n");
|
||||
@ -2687,7 +2687,7 @@ void initObjectSoundFXTable(void) {
|
||||
objectSoundFXTable =
|
||||
(ObjectSoundFXs *)LoadResource(
|
||||
itemRes,
|
||||
RES_ID('S', 'N', 'D', 'T'),
|
||||
MKTAG('S', 'N', 'D', 'T'),
|
||||
"object sound effect table");
|
||||
|
||||
if (objectSoundFXTable == NULL)
|
||||
|
@ -138,8 +138,8 @@ template <class RESTYPE> RESTYPE LoadOnCall<RESTYPE>::rLoad(uint16 ind, bool asy
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//t = (RESTYPE) tileRes->load( tileID + RES_ID( 0,0,0,bankNum ) );
|
||||
t = (RESTYPE) loader(tileID + RES_ID(0, 0, 0, ind), asynch);
|
||||
//t = (RESTYPE) tileRes->load( tileID + MKTAG( 0,0,0,bankNum ) );
|
||||
t = (RESTYPE) loader(tileID + MKTAG(0, 0, 0, ind), asynch);
|
||||
|
||||
locked.Bit(ind, !asynch);
|
||||
wanted.Bit(ind, asynch);
|
||||
@ -168,7 +168,7 @@ template <class RESTYPE> void LoadOnCall<RESTYPE>::rFree(uint16 ind) {
|
||||
template <class RESTYPE> void LoadOnCall<RESTYPE>::rInit(uint16 ind) {
|
||||
RESTYPE t;
|
||||
if (!isValidPtr(handle[ ind ])) {
|
||||
t = (RESTYPE) loader(tileID + RES_ID(0, 0, 0, ind), FALSE);
|
||||
t = (RESTYPE) loader(tileID + MKTAG(0, 0, 0, ind), FALSE);
|
||||
handle[ ind ] = t;
|
||||
locked.Bit(ind, TRUE);
|
||||
RUnlockHandle((RHANDLE) handle[ ind ]);
|
||||
|
@ -271,7 +271,7 @@ void initPatrolRoutes(void) {
|
||||
|
||||
// Get patrol route resource context
|
||||
patrolRouteRes = auxResFile->newContext(
|
||||
RES_ID('P', 'T', 'R', 'L'),
|
||||
MKTAG('P', 'T', 'R', 'L'),
|
||||
"patrol route resource");
|
||||
if (patrolRouteRes == NULL || !patrolRouteRes->_valid)
|
||||
error("Error accessing patrol route resource group.");
|
||||
@ -303,11 +303,11 @@ void initPatrolRoutes(void) {
|
||||
|
||||
// Load this worlds's patrol routes
|
||||
if (patrolRouteRes->size(
|
||||
RES_ID('R', 'T', 'E', i)) > 0) {
|
||||
MKTAG('R', 'T', 'E', i)) > 0) {
|
||||
patrolRouteData[ i ] =
|
||||
(PatrolRouteData *)LoadResource(
|
||||
patrolRouteRes,
|
||||
RES_ID('R', 'T', 'E', i),
|
||||
MKTAG('R', 'T', 'E', i),
|
||||
"patrol route data");
|
||||
|
||||
if (patrolRouteData[ i ] == NULL)
|
||||
|
@ -149,7 +149,7 @@ static char convBuf[5];
|
||||
|
||||
inline uint32 extendID(int16 smallID) {
|
||||
sprintf(convBuf, "%4.4d", smallID);
|
||||
return smallID ? RES_ID(convBuf[0] + 'A' - '0', convBuf[1], convBuf[2], convBuf[3]) : 0 ;
|
||||
return smallID ? MKTAG(convBuf[0] + 'A' - '0', convBuf[1], convBuf[2], convBuf[3]) : 0 ;
|
||||
}
|
||||
|
||||
/* ===================================================================== *
|
||||
|
@ -133,7 +133,7 @@ void SpellStuff::addEffect(ProtoEffect *pe) {
|
||||
void SpellStuff::playSound(GameObject *go) {
|
||||
if (sound) {
|
||||
Location cal = go->notGetWorldLocation(); //Location(go->getLocation(),go->IDParent());
|
||||
Saga2::playSoundAt(RES_ID('S', 'P', 'L', sound), cal);
|
||||
Saga2::playSoundAt(MKTAG('S', 'P', 'L', sound), cal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace Saga2 {
|
||||
Constants
|
||||
* ===================================================================== */
|
||||
|
||||
const uint32 spellSpriteID = RES_ID('S', 'P', 'F', 'X');
|
||||
const uint32 spellSpriteID = MKTAG('S', 'P', 'F', 'X');
|
||||
|
||||
const int32 maxSpells = totalSpellBookPages;
|
||||
const int32 maxSpellPrototypes = totalSpellBookPages;
|
||||
@ -199,21 +199,21 @@ static void loadMagicData(void) {
|
||||
|
||||
// Get spell definitions
|
||||
spellRes = auxResFile->newContext(
|
||||
RES_ID('S', 'P', 'E', 'L'),
|
||||
MKTAG('S', 'P', 'E', 'L'),
|
||||
"spell resources");
|
||||
if (spellRes == NULL || !spellRes->_valid)
|
||||
error("Error accessing spell resource group.\n");
|
||||
i = 1;
|
||||
ADD_SHOW(eAreaInvisible, 0, 0, 0, 0, diFlagInc, ecFlagNone, 30, RES_ID('S', 'T', 'A', 0), 23, 24);
|
||||
ADD_SHOW(eAreaInvisible, 0, 0, 0, 0, diFlagInc, ecFlagNone, 30, MKTAG('S', 'T', 'A', 0), 23, 24);
|
||||
|
||||
spellBook[0].setManaType(sManaIDSkill);
|
||||
|
||||
while (spellRes->size(
|
||||
RES_ID('I', 'N', 'F', i)) > 0) {
|
||||
MKTAG('I', 'N', 'F', i)) > 0) {
|
||||
ResourceSpellItem *rsi =
|
||||
(ResourceSpellItem *)LoadResource(
|
||||
spellRes,
|
||||
RES_ID('I', 'N', 'F', i),
|
||||
MKTAG('I', 'N', 'F', i),
|
||||
"spell");
|
||||
|
||||
if (rsi == NULL)
|
||||
@ -230,11 +230,11 @@ static void loadMagicData(void) {
|
||||
// get spell effects
|
||||
i = 0;
|
||||
while (spellRes->size(
|
||||
RES_ID('E', 'F', 'F', i)) > 0) {
|
||||
MKTAG('E', 'F', 'F', i)) > 0) {
|
||||
ResourceSpellEffect *rse =
|
||||
(ResourceSpellEffect *)LoadResource(
|
||||
spellRes,
|
||||
RES_ID('E', 'F', 'F', i),
|
||||
MKTAG('E', 'F', 'F', i),
|
||||
"spell effect");
|
||||
|
||||
if (rse == NULL)
|
||||
|
@ -39,14 +39,14 @@ namespace Saga2 {
|
||||
|
||||
const int maxWeaponSpriteSets = 40;
|
||||
|
||||
const uint32 spriteGroupID = RES_ID('S', 'P', 'R', 'I'),
|
||||
frameGroupID = RES_ID('F', 'R', 'M', 'L'),
|
||||
poseGroupID = RES_ID('P', 'O', 'S', 'E'),
|
||||
schemeGroupID = RES_ID('S', 'C', 'H', 'M'),
|
||||
objectSpriteID = RES_ID('O', 'B', 'J', 'S'),
|
||||
mentalSpriteID = RES_ID('M', 'E', 'N', 'T'),
|
||||
weaponSpriteBaseID = RES_ID('W', 'P', 'N', 0),
|
||||
missileSpriteID = RES_ID('M', 'I', 'S', 'S');
|
||||
const uint32 spriteGroupID = MKTAG('S', 'P', 'R', 'I'),
|
||||
frameGroupID = MKTAG('F', 'R', 'M', 'L'),
|
||||
poseGroupID = MKTAG('P', 'O', 'S', 'E'),
|
||||
schemeGroupID = MKTAG('S', 'C', 'H', 'M'),
|
||||
objectSpriteID = MKTAG('O', 'B', 'J', 'S'),
|
||||
mentalSpriteID = MKTAG('M', 'E', 'N', 'T'),
|
||||
weaponSpriteBaseID = MKTAG('W', 'P', 'N', 0),
|
||||
missileSpriteID = MKTAG('M', 'I', 'S', 'S');
|
||||
|
||||
/* ===================================================================== *
|
||||
Prototypes
|
||||
@ -620,7 +620,7 @@ void ActorAppearance::loadSpriteBanks(int16 banksNeeded) {
|
||||
|
||||
// Load the sprite handle...
|
||||
if (spriteBanks[bank] == NULL && (banksNeeded & (1 << bank))) {
|
||||
spriteBanks[bank] = (SpriteSet **)spriteRes->load(id + RES_ID(0, 0, 0, bank), "sprite bank", FALSE);
|
||||
spriteBanks[bank] = (SpriteSet **)spriteRes->load(id + MKTAG(0, 0, 0, bank), "sprite bank", FALSE);
|
||||
|
||||
#if DEBUG
|
||||
if (spriteBanks[bank] == NULL)
|
||||
@ -751,7 +751,7 @@ void initSprites(void) {
|
||||
for (i = 0; i < maxWeaponSpriteSets; i++) {
|
||||
hResID weaponSpriteID;
|
||||
|
||||
weaponSpriteID = weaponSpriteBaseID + RES_ID(0, 0, 0, i);
|
||||
weaponSpriteID = weaponSpriteBaseID + MKTAG(0, 0, 0, i);
|
||||
|
||||
if (spriteRes->size(weaponSpriteID) == 0) {
|
||||
weaponSprites[i] = NULL;
|
||||
|
@ -135,7 +135,7 @@ void CVideoBox::init(void) {
|
||||
rInfo.running = TRUE;
|
||||
|
||||
// init the resource context handle
|
||||
decRes = resFile->newContext(RES_ID('V', 'I', 'D', 'O'),
|
||||
decRes = resFile->newContext(MKTAG('V', 'I', 'D', 'O'),
|
||||
"Video border resources");
|
||||
|
||||
|
||||
|
@ -322,7 +322,7 @@ static void loadWeaponData(void) {
|
||||
|
||||
// Get spell definitions
|
||||
spellRes = auxResFile->newContext(
|
||||
RES_ID('I', 'T', 'E', 'M'),
|
||||
MKTAG('I', 'T', 'E', 'M'),
|
||||
"weapon resources");
|
||||
if (spellRes == NULL || !spellRes->_valid)
|
||||
error("Error accessing weapon resource group.");
|
||||
@ -330,11 +330,11 @@ static void loadWeaponData(void) {
|
||||
// get spell effects
|
||||
i = 0;
|
||||
while (spellRes->size(
|
||||
RES_ID('E', 'F', 'F', i)) > 0) {
|
||||
MKTAG('E', 'F', 'F', i)) > 0) {
|
||||
ResourceItemEffect *rie =
|
||||
(ResourceItemEffect *)LoadResource(
|
||||
spellRes,
|
||||
RES_ID('E', 'F', 'F', i),
|
||||
MKTAG('E', 'F', 'F', i),
|
||||
"weapon effect");
|
||||
|
||||
if (rie == NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user