More cleanup

This commit is contained in:
yaz0r 2025-06-17 00:28:15 -07:00
parent 97ba0bf877
commit f2d6decdb0
14 changed files with 264 additions and 357 deletions

View File

@ -61,7 +61,7 @@ int InitAnim(int animNum,int animType, int animInfo)
currentProcessedActorPtr->objectType |= AF_ANIMATED; currentProcessedActorPtr->objectType |= AF_ANIMATED;
SetAnimObjet(currentProcessedActorPtr->frame, getAnimationFromPtr(HQR_Get(listAnim,animNum)), getBodyFromPtr(HQR_Get(HQ_Bodys, currentProcessedActorPtr->bodyNum))); SetAnimObjet(currentProcessedActorPtr->frame, getAnimationFromPtr(HQR_Get(HQ_Anims,animNum)), getBodyFromPtr(HQR_Get(HQ_Bodys, currentProcessedActorPtr->bodyNum)));
currentProcessedActorPtr->animType = animType; currentProcessedActorPtr->animType = animType;
currentProcessedActorPtr->animInfo = animInfo; currentProcessedActorPtr->animInfo = animInfo;
@ -96,7 +96,7 @@ int InitAnim(int animNum,int animType, int animInfo)
removeFromBGIncrust(currentProcessedActorIdx); removeFromBGIncrust(currentProcessedActorIdx);
} }
SetAnimObjet(0, getAnimationFromPtr(HQR_Get(listAnim,animNum)), getBodyFromPtr(HQR_Get(HQ_Bodys, currentProcessedActorPtr->bodyNum))); SetAnimObjet(0, getAnimationFromPtr(HQR_Get(HQ_Anims,animNum)), getBodyFromPtr(HQR_Get(HQ_Bodys, currentProcessedActorPtr->bodyNum)));
currentProcessedActorPtr->newAnim = animNum; currentProcessedActorPtr->newAnim = animNum;
currentProcessedActorPtr->newAnimType = animType; currentProcessedActorPtr->newAnimType = animType;
@ -270,7 +270,7 @@ void GereAnim(void)
currentProcessedActorPtr->flagEndAnim = 0; currentProcessedActorPtr->flagEndAnim = 0;
currentProcessedActorPtr->frame = 0; currentProcessedActorPtr->frame = 0;
currentProcessedActorPtr->numOfFrames = GetNbFramesAnim(getAnimationFromPtr(HQR_Get(listAnim, newAnim))); currentProcessedActorPtr->numOfFrames = GetNbFramesAnim(getAnimationFromPtr(HQR_Get(HQ_Anims, newAnim)));
} }
} }
@ -316,7 +316,7 @@ void GereAnim(void)
oldStepY = currentProcessedActorPtr->stepY; oldStepY = currentProcessedActorPtr->stepY;
oldStepZ = currentProcessedActorPtr->stepZ; oldStepZ = currentProcessedActorPtr->stepZ;
currentProcessedActorPtr->END_FRAME = SetInterAnimObjet(currentProcessedActorPtr->frame, getAnimationFromPtr(HQR_Get(listAnim, currentProcessedActorPtr->ANIM)), getBodyFromPtr(HQR_Get(HQ_Bodys, currentProcessedActorPtr->bodyNum))); currentProcessedActorPtr->END_FRAME = SetInterAnimObjet(currentProcessedActorPtr->frame, getAnimationFromPtr(HQR_Get(HQ_Anims, currentProcessedActorPtr->ANIM)), getBodyFromPtr(HQR_Get(HQ_Bodys, currentProcessedActorPtr->bodyNum)));
walkStep(animStepX,animStepZ,currentProcessedActorPtr->beta); walkStep(animStepX,animStepZ,currentProcessedActorPtr->beta);

View File

@ -4,7 +4,7 @@ int getPosRelTable[] = {4,1,8,2,4,1,8,0};
int getMatrix(int param1, int actorIdx, int param2) int getMatrix(int param1, int actorIdx, int param2)
{ {
unsigned char* matrixPtr = (unsigned char*)HQR_Get(listMatrix,param1); unsigned char* matrixPtr = (unsigned char*)HQR_Get(HQ_Matrices,param1);
int matrixWidth = *matrixPtr++; int matrixWidth = *matrixPtr++;
int matrixHeigh = *matrixPtr++; int matrixHeigh = *matrixPtr++;
@ -515,7 +515,7 @@ int evalVar(const char* name)
temp2 = *(s16*)currentLifePtr; temp2 = *(s16*)currentLifePtr;
currentLifePtr +=2; currentLifePtr +=2;
return(testZvEndAnim(actorPtr,HQR_Get(listAnim,temp1),temp2)); return(testZvEndAnim(actorPtr,HQR_Get(HQ_Anims,temp1),temp2));
break; break;
} }

View File

@ -19,7 +19,7 @@ void LoadEtage(int floorNumber)
//stopSounds(); //stopSounds();
HQR_Reset(HQ_Bodys); HQR_Reset(HQ_Bodys);
HQR_Reset(listAnim); HQR_Reset(HQ_Anims);
g_currentFloor = floorNumber; g_currentFloor = floorNumber;

View File

@ -198,7 +198,7 @@ int InitSpecialObjet(int mode, int X, int Y, int Z, int stage, int room, int alp
} }
} }
actorTurnedToObj = 1; FlagGenereAffList = 1;
return(i); return(i);
} }
@ -746,7 +746,7 @@ void processLife(int lifeNum, bool callFoundLife)
{ {
if ((currentProcessedActorPtr->ANIM != -1) && (currentProcessedActorPtr->bodyNum != -1)) if ((currentProcessedActorPtr->ANIM != -1) && (currentProcessedActorPtr->bodyNum != -1))
{ {
sAnimation* pAnim = getAnimationFromPtr(HQR_Get(listAnim, currentProcessedActorPtr->ANIM)); sAnimation* pAnim = getAnimationFromPtr(HQR_Get(HQ_Anims, currentProcessedActorPtr->ANIM));
if (g_gameId >= JACK) if (g_gameId >= JACK)
{ {
@ -787,7 +787,7 @@ void processLife(int lifeNum, bool callFoundLife)
if (currentProcessedActorPtr->objectType & AF_ANIMATED) if (currentProcessedActorPtr->objectType & AF_ANIMATED)
{ {
sAnimation* pAnim = getAnimationFromPtr(HQR_Get(listAnim, currentProcessedActorPtr->ANIM)); sAnimation* pAnim = getAnimationFromPtr(HQR_Get(HQ_Anims, currentProcessedActorPtr->ANIM));
if (g_gameId >= JACK) if (g_gameId >= JACK)
{ {
@ -1174,7 +1174,7 @@ void processLife(int lifeNum, bool callFoundLife)
lifeTempVar1 = readNextArgument("TrackMode"); lifeTempVar1 = readNextArgument("TrackMode");
lifeTempVar2 = readNextArgument("TrackNumber"); lifeTempVar2 = readNextArgument("TrackNumber");
setMoveMode(lifeTempVar1, lifeTempVar2); InitDeplacement(lifeTempVar1, lifeTempVar2);
break; break;
} }

View File

@ -1168,14 +1168,14 @@ void LoadWorld(void)
if(g_gameId == AITD1) if(g_gameId == AITD1)
{ {
HQ_Bodys = HQR_InitRessource(listBodySelect[CVars[getCVarsIdx(CHOOSE_PERSO)]],37000, 50); // was calculated from free mem size HQ_Bodys = HQR_InitRessource(listBodySelect[CVars[getCVarsIdx(CHOOSE_PERSO)]],37000, 50); // was calculated from free mem size
listAnim = HQR_InitRessource(listAnimSelect[CVars[getCVarsIdx(CHOOSE_PERSO)]],30000, 80); // was calculated from free mem size HQ_Anims = HQR_InitRessource(listAnimSelect[CVars[getCVarsIdx(CHOOSE_PERSO)]],30000, 80); // was calculated from free mem size
} }
else else
{ {
HQ_Bodys = HQR_InitRessource("LISTBODY",37000, 50); // was calculated from free mem size HQ_Bodys = HQR_InitRessource("LISTBODY",37000, 50); // was calculated from free mem size
listAnim = HQR_InitRessource("LISTANIM",30000, 80); // was calculated from free mem size HQ_Anims = HQR_InitRessource("LISTANIM",30000, 80); // was calculated from free mem size
listMatrix = HQR_InitRessource("LISTMAT",64000,5); HQ_Matrices = HQR_InitRessource("LISTMAT",64000,5);
} }
@ -1713,7 +1713,7 @@ void DeleteObjet(int index) // remove actor
objectPtr->stage = actorPtr->stage; objectPtr->stage = actorPtr->stage;
objectPtr->room = actorPtr->room; objectPtr->room = actorPtr->room;
actorTurnedToObj = 1; FlagGenereAffList = 1;
} }
} }
} }
@ -1785,7 +1785,7 @@ void RefreshAux2(void)
//TODO: implementer la suite //TODO: implementer la suite
} }
void setMoveMode(int trackMode, int trackNumber) void InitDeplacement(int trackMode, int trackNumber)
{ {
currentProcessedActorPtr->trackMode = trackMode; currentProcessedActorPtr->trackMode = trackMode;
@ -1807,7 +1807,7 @@ void setMoveMode(int trackMode, int trackNumber)
} }
} }
s16 cameraVisibilityVar = 0; s16 ObjSalleRel = 0;
int IsInCamera(int roomNumber) int IsInCamera(int roomNumber)
{ {
@ -1817,12 +1817,12 @@ int IsInCamera(int roomNumber)
{ {
if(cameraDataTable[NumCamera]->viewedRoomTable[i].viewedRoomIdx == roomNumber) if(cameraDataTable[NumCamera]->viewedRoomTable[i].viewedRoomIdx == roomNumber)
{ {
cameraVisibilityVar = i; ObjSalleRel = i;
return(1); return(1);
} }
} }
cameraVisibilityVar = -1; ObjSalleRel = -1;
return 0; return 0;
} }
@ -1835,376 +1835,283 @@ int IsInCamRectTestAITD2(int X, int Z) // TODO: not 100% exact
return 0; return 0;
} }
int updateActorAitd2Only(int actorIdx)
{
tObject *currentActor = &objectTable[actorIdx];
if(g_gameId == AITD1)
{
return 0;
}
if(currentActor->bodyNum != -1)
{
if(IsInCamera(currentActor->room))
{
if(IsInCamRectTestAITD2(currentActor->roomX + currentActor->stepX, currentActor->roomZ + currentActor->stepZ))
{
currentActor->lifeMode |= 4;
return 1;
}
}
}
return 0;
}
void updateAllActorAndObjectsAITD2() void updateAllActorAndObjectsAITD2()
{ {
for(int i=0;i<NUM_MAX_OBJECT;i++) for (int i = 0; i < NUM_MAX_OBJECT; i++)
{ {
tObject *pObject = &objectTable[i]; tObject* pObject = &objectTable[i];
if(pObject->indexInWorld == -1) if (pObject->indexInWorld == -1)
{ {
continue; continue;
} }
pObject->lifeMode &= ~4; pObject->lifeMode &= ~4;
if(pObject->stage == g_currentFloor) if (pObject->stage == g_currentFloor)
{ {
switch(pObject->lifeMode) switch (pObject->lifeMode)
{ {
case 0: // OFF case 0: // OFF
break; break;
case 1: // STAGE case 1: // STAGE
continue; continue;
case 2: // ROOM case 2: // ROOM
if(pObject->room == currentRoom) if (pObject->room == currentRoom)
{ {
continue; continue;
} }
break; break;
case 3: // CAMERA case 3: // CAMERA
if(isInViewList(pObject->room)) if (isInViewList(pObject->room))
{ {
continue; continue;
} }
break; break;
default: default:
//assert(0); break;
break; }
}
if(updateActorAitd2Only(i)) if (pObject->bodyNum != -1)
{ {
pObject->lifeMode |= 4; if (IsInCamera(pObject->room))
continue; {
} if (IsInCamRectTestAITD2(pObject->roomX + pObject->stepX, pObject->roomZ + pObject->stepZ))
} {
DeleteObjet(i); pObject->lifeMode |= 4;
} continue;
}
}
}
}
DeleteObjet(i);
}
for(int i=0;i<maxObjects;i++) for (int i = 0; i < maxObjects; i++)
{ {
tWorldObject* currentObject = &ListWorldObjets[i]; tWorldObject* currentObject = &ListWorldObjets[i];
if(currentObject->objIndex != -1) if (currentObject->objIndex != -1)
{ {
if(currentWorldTarget == i) if (currentWorldTarget == i)
{ {
currentCameraTargetActor = currentObject->objIndex; currentCameraTargetActor = currentObject->objIndex;
} }
} continue;
else }
{
if(currentObject->stage == g_currentFloor)
{
if(currentObject->life != -1)
{
if(currentObject->lifeMode != -1)
{
int actorIdx;
int di;
switch(currentObject->lifeMode&3) if (currentObject->stage != g_currentFloor)
{ continue;
case 0:
{
di = 0;
break;
}
case 1:
{
di = 1;
break;
}
case 2:
{
if(currentObject->room != currentRoom)
{
di = 0;
}
else
{
di = 1;
}
break;
}
case 3:
{
if(!isInViewList(currentObject->room))
{
di = 0;
}
else
{
di = 1;
}
break;
}
}
if(!di) bool isOk = false;
{ switch (currentObject->lifeMode & 3)
if(currentObject->body != -1) {
{ case 0: // OFF
if(IsInCamera(currentObject->room)) isOk = false;
{ break;
if(IsInCamRectTestAITD2(currentObject->x,currentObject->z)) case 1: // STAGE
{ isOk = true;
currentObject->lifeMode |= 4; break;
} case 3: // CAMERA
else if (!isInViewList(currentObject->room))
{ {
continue; isOk = false;
} }
} else
else {
{ isOk = true;
continue; }
} break;
} case 2: // ROOM
else if (currentObject->room != currentRoom)
{ {
continue; isOk = false;
} }
} else
{
isOk = true;
}
break;
}
//int var_C = currentObject->flags & 0xFFDF; if (!isOk) {
//int var_E = currentObject->field_2; if ((currentObject->body == -1) || (!IsInCamera(currentObject->room)) || (!IsInCamRectTestAITD2(currentObject->x, currentObject->z)))
//int var_A = currentObject->anim; {
addObject: continue;
actorIdx = copyObjectToActor( currentObject->body, currentObject->typeZV, currentObject->foundName, }
currentObject->flags & 0xFFDF, else {
currentObject->x, currentObject->y, currentObject->z, currentObject->lifeMode |= 4;
currentObject->stage, currentObject->room, }
currentObject->alpha, currentObject->beta, currentObject->gamma, }
currentObject->anim,
currentObject->frame, currentObject->animType, currentObject->animInfo);
currentObject->objIndex = actorIdx; currentObject->objIndex = InitObjet(currentObject->body, currentObject->typeZV, currentObject->foundName,
currentObject->flags & ~AF_SPECIAL,
currentObject->x, currentObject->y, currentObject->z,
currentObject->stage, currentObject->room,
currentObject->alpha, currentObject->beta, currentObject->gamma,
currentObject->anim,
currentObject->frame, currentObject->animType, currentObject->animInfo);
if(actorIdx != -1) if (currentObject->objIndex != -1)
{ {
currentProcessedActorPtr = &objectTable[actorIdx]; currentProcessedActorPtr = &objectTable[currentObject->objIndex];
currentProcessedActorIdx = actorIdx; currentProcessedActorIdx = currentObject->objIndex;
if(currentWorldTarget == i) if (currentWorldTarget == i)
{ {
currentCameraTargetActor = currentProcessedActorIdx; currentCameraTargetActor = currentProcessedActorIdx;
} }
currentProcessedActorPtr->dynFlags = (currentObject->flags & 0x20) / 0x20; // recheck currentProcessedActorPtr->dynFlags = (currentObject->flags & 0x20) / 0x20; // recheck
currentProcessedActorPtr->life = currentObject->life; currentProcessedActorPtr->life = currentObject->life;
currentProcessedActorPtr->lifeMode = currentObject->lifeMode; currentProcessedActorPtr->lifeMode = currentObject->lifeMode;
currentProcessedActorPtr->indexInWorld = i; currentProcessedActorPtr->indexInWorld = i;
setMoveMode(currentObject->trackMode, currentObject->trackNumber); InitDeplacement(currentObject->trackMode, currentObject->trackNumber);
currentProcessedActorPtr->positionInTrack = currentObject->positionInTrack; currentProcessedActorPtr->positionInTrack = currentObject->positionInTrack;
if(g_gameId != AITD1) if (g_gameId != AITD1)
{ {
currentProcessedActorPtr->MARK = currentObject->mark; currentProcessedActorPtr->MARK = currentObject->mark;
} }
actorTurnedToObj = 1; FlagGenereAffList = 1;
} }
} }
} //FlagGenereActiveList = true;
else
{
if(isInViewList(currentObject->room))
goto addObject;
}
}
}
}
// objModifFlag1 = 0;
//TODO: object update
} }
void GenereActiveList() void GenereActiveList()
{ {
int i;
tObject *currentActor = objectTable.data();
tWorldObject* currentObject;
if(g_gameId > JACK) if(g_gameId > JACK)
{ {
updateAllActorAndObjectsAITD2(); updateAllActorAndObjectsAITD2();
return; return;
} }
for(i=0;i<NUM_MAX_OBJECT;i++) for(int i=0;i<NUM_MAX_OBJECT;i++)
{ {
if(currentActor->indexInWorld != -1) tObject* currentActor = &objectTable[i];
if (currentActor->indexInWorld == -1)
continue;
if(currentActor->stage == g_currentFloor)
{ {
if(currentActor->stage == g_currentFloor) if(currentActor->life != -1)
{ {
if(currentActor->life != -1) switch(currentActor->lifeMode)
{ {
switch(currentActor->lifeMode) case 0: // STAGE
continue;
case 1: // ROOM
if(currentActor->room != currentRoom)
{ {
case 0: continue;
{
break;
}
case 1:
{
if(currentActor->room != currentRoom)
{
DeleteObjet(i);
}
break;
}
case 2:
{
if(!isInViewList(currentActor->room))
{
DeleteObjet(i);
}
break;
}
default:
{
DeleteObjet(i);
break;
}
} }
} break;
else case 2: // CAMERA
{
if(!isInViewList(currentActor->room)) if(!isInViewList(currentActor->room))
{ {
DeleteObjet(i); DeleteObjet(i);
} }
break;
default:
{
break;
}
} }
} }
else else
{ {
DeleteObjet(i); if(!isInViewList(currentActor->room))
{
continue;
}
} }
} }
currentActor++; DeleteObjet(i);
} }
currentObject = &ListWorldObjets[0]; for(int i=0;i<maxObjects;i++)
for(i=0;i<maxObjects;i++)
{ {
if(currentObject->objIndex != -1) tWorldObject* currentObject = &ListWorldObjets[i];
{ if(currentObject->objIndex != -1) {
if(currentWorldTarget == i) if(currentWorldTarget == i)
{ {
currentCameraTargetActor = currentObject->objIndex; currentCameraTargetActor = currentObject->objIndex;
} }
continue;
} }
else
if (currentObject->stage != g_currentFloor) {
continue;
}
if (currentObject->life != -1)
{
switch (currentObject->lifeMode)
{
case -1:
continue;
case 0: // Stage
break;
case 1: // Room
if (currentObject->room != currentRoom)
{
continue;
}
break;
case 2: // Camera
if (!isInViewList(currentObject->room))
{
continue;
}
break;
}
}
else
{
if (!isInViewList(currentObject->room)) {
continue;
}
}
currentObject->objIndex = InitObjet( currentObject->body, currentObject->typeZV, currentObject->foundName,
currentObject->flags & ~AF_SPECIAL,
currentObject->x, currentObject->y, currentObject->z,
currentObject->stage, currentObject->room,
currentObject->alpha, currentObject->beta, currentObject->gamma,
currentObject->anim,
currentObject->frame, currentObject->animType, currentObject->animInfo);
if(currentObject->objIndex != -1)
{ {
if(currentObject->stage == g_currentFloor) currentProcessedActorPtr = &objectTable[currentObject->objIndex];
currentProcessedActorIdx = currentObject->objIndex;
if(currentWorldTarget == i)
{ {
if(currentObject->life != -1) currentCameraTargetActor = currentProcessedActorIdx;
{
if(currentObject->lifeMode != -1)
{
int actorIdx;
switch(currentObject->lifeMode)
{
case 1:
{
if(currentObject->room != currentRoom)
{
currentObject++;
continue;
}
break;
}
case 2:
{
if(!isInViewList(currentObject->room))
{
currentObject++;
continue;
}
break;
}
}
//int var_C = currentObject->flags & 0xFFDF;
//int var_E = currentObject->field_2;
//int var_A = currentObject->anim;
addObject: actorIdx = copyObjectToActor( currentObject->body, currentObject->typeZV, currentObject->foundName,
currentObject->flags & 0xFFDF,
currentObject->x, currentObject->y, currentObject->z,
currentObject->stage, currentObject->room,
currentObject->alpha, currentObject->beta, currentObject->gamma,
currentObject->anim,
currentObject->frame, currentObject->animType, currentObject->animInfo);
currentObject->objIndex = actorIdx;
if(actorIdx != -1)
{
currentProcessedActorPtr = &objectTable[actorIdx];
currentProcessedActorIdx = actorIdx;
if(currentWorldTarget == i)
{
currentCameraTargetActor = currentProcessedActorIdx;
}
currentProcessedActorPtr->dynFlags = (currentObject->flags & 0x20) / 0x20; // recheck
currentProcessedActorPtr->life = currentObject->life;
currentProcessedActorPtr->lifeMode = currentObject->lifeMode;
currentProcessedActorPtr->indexInWorld = i;
setMoveMode(currentObject->trackMode, currentObject->trackNumber);
currentProcessedActorPtr->positionInTrack = currentObject->positionInTrack;
actorTurnedToObj = 1;
}
}
}
else
{
if(isInViewList(currentObject->room))
goto addObject;
}
} }
}
currentObject++; currentProcessedActorPtr->dynFlags = (currentObject->flags & 0x20) / 0x20; // recheck
currentProcessedActorPtr->life = currentObject->life;
currentProcessedActorPtr->lifeMode = currentObject->lifeMode;
currentProcessedActorPtr->indexInWorld = i;
InitDeplacement(currentObject->trackMode, currentObject->trackNumber);
currentProcessedActorPtr->positionInTrack = currentObject->positionInTrack;
FlagGenereAffList = 1;
}
} }
// FlagGenereActiveList = 0; // FlagGenereActiveList = 0;
@ -3879,7 +3786,7 @@ void GereDec()
} }
else else
{ {
actorTurnedToObj = 1; FlagGenereAffList = 1;
} }
startChrono(&currentProcessedActorPtr->ROOM_CHRONO); startChrono(&currentProcessedActorPtr->ROOM_CHRONO);
@ -4481,7 +4388,7 @@ void cleanupAndExit(void)
HQR_Free(listLife); HQR_Free(listLife);
HQR_Free(listTrack); HQR_Free(listTrack);
HQR_Free(HQ_Bodys); HQR_Free(HQ_Bodys);
HQR_Free(listAnim); HQR_Free(HQ_Anims);
/* free(tabTextes); /* free(tabTextes);
free(aux); free(aux);

View File

@ -58,7 +58,7 @@ void SetProjection(int centerX, int centerY, int x, int y, int z);
void SetAngleCamera(int x, int y, int z); void SetAngleCamera(int x, int y, int z);
void SetPosCamera(int x, int y, int z); void SetPosCamera(int x, int y, int z);
s16 GiveDistance2D(int x1, int z1, int x2, int z2); s16 GiveDistance2D(int x1, int z1, int x2, int z2);
void setMoveMode(int trackMode, int trackNumber); void InitDeplacement(int trackMode, int trackNumber);
void InitRealValue(s16 beta, s16 newBeta, s16 param, RealValue* rotatePtr); void InitRealValue(s16 beta, s16 newBeta, s16 param, RealValue* rotatePtr);
s16 updateActorRotation(RealValue* rotatePtr); s16 updateActorRotation(RealValue* rotatePtr);
void deleteObject(int objIdx); void deleteObject(int objIdx);

View File

@ -219,7 +219,7 @@ void PlayWorld(int allowSystemMenu, int deltaTime)
if (!(currentProcessedActorPtr->lifeMode & 4)) if (!(currentProcessedActorPtr->lifeMode & 4))
{ {
processLife(currentProcessedActorPtr->life, false); processLife(currentProcessedActorPtr->life, false);
actorTurnedToObj = 1; FlagGenereAffList = 1;
} }
} }
} }

View File

@ -1,6 +1,6 @@
#include "common.h" #include "common.h"
int copyObjectToActor(int body, int typeZv, int hardZvIdx, s16 objectType, int x, int y, int z, int stage, int room, int alpha, int beta, int gamma, int anim, int frame, int animtype, int animInfo) int InitObjet(int body, int typeZv, int hardZvIdx, s16 objectType, int x, int y, int z, int stage, int room, int alpha, int beta, int gamma, int anim, int frame, int animtype, int animInfo)
{ {
int i; int i;
int j; int j;
@ -101,7 +101,7 @@ int copyObjectToActor(int body, int typeZv, int hardZvIdx, s16 objectType, int x
if(anim != -1) if(anim != -1)
{ {
sAnimation* animPtr = getAnimationFromPtr(HQR_Get(listAnim,anim)); sAnimation* animPtr = getAnimationFromPtr(HQR_Get(HQ_Anims,anim));
SetAnimObjet(frame,animPtr, bodyPtr); SetAnimObjet(frame,animPtr, bodyPtr);

View File

@ -1,4 +1,4 @@
#ifndef _OBJECT_H_ #ifndef _OBJECT_H_
#define _OBJECT_H_ #define _OBJECT_H_
int copyObjectToActor(int body, int typeZv, int hardZvIdx, s16 objectType, int x, int y, int z, int stage, int room, int alpha, int beta, int gamma, int anim, int frame, int animtype, int animInfo); int InitObjet(int body, int typeZv, int hardZvIdx, s16 objectType, int x, int y, int z, int stage, int room, int alpha, int beta, int gamma, int anim, int frame, int animtype, int animInfo);
#endif #endif

View File

@ -72,20 +72,20 @@ struct cameraViewedRoomStruct
struct cameraDataStruct struct cameraDataStruct
{ {
s16 alpha; s16 alpha; // 0
s16 beta; s16 beta; // 2
s16 gamma; s16 gamma; // 4
s16 x; s16 x; // 6
s16 y; s16 y; // 8
s16 z; s16 z; // 10
s16 focal1; s16 focal1; // 12
s16 focal2; s16 focal2; // 14
s16 focal3; s16 focal3; // 16
u16 numViewedRooms; u16 numViewedRooms; // 18
std::vector<cameraViewedRoomStruct> viewedRoomTable; std::vector<cameraViewedRoomStruct> viewedRoomTable; // 20
}; };
struct roomDataStruct struct roomDataStruct

View File

@ -261,7 +261,7 @@ int loadSave(int saveNumber)
if(g_gameId == AITD1) if(g_gameId == AITD1)
{ {
configureHqrHero(HQ_Bodys,listBodySelect[CVars[getCVarsIdx(CHOOSE_PERSO)]]); configureHqrHero(HQ_Bodys,listBodySelect[CVars[getCVarsIdx(CHOOSE_PERSO)]]);
configureHqrHero(listAnim,listAnimSelect[CVars[getCVarsIdx(CHOOSE_PERSO)]]); configureHqrHero(HQ_Anims,listAnimSelect[CVars[getCVarsIdx(CHOOSE_PERSO)]]);
} }
else else
{ {
@ -498,7 +498,7 @@ int loadSave(int saveNumber)
if(objectTable[i].ANIM != -1) if(objectTable[i].ANIM != -1)
{ {
sAnimation* animPtr = getAnimationFromPtr(HQR_Get(listAnim,objectTable[i].ANIM)); sAnimation* animPtr = getAnimationFromPtr(HQR_Get(HQ_Anims,objectTable[i].ANIM));
SetAnimObjet(objectTable[i].frame,animPtr,bodyPtr); SetAnimObjet(objectTable[i].frame,animPtr,bodyPtr);
} }
} }

View File

@ -488,7 +488,7 @@ void processTrack(void)
{ {
currentProcessedActorPtr->speed = 0; currentProcessedActorPtr->speed = 0;
currentProcessedActorPtr->trackNumber = -1; currentProcessedActorPtr->trackNumber = -1;
setMoveMode(0,0); InitDeplacement(0,0);
break; break;
} }
case TL_REPEAT: case TL_REPEAT:

View File

@ -80,11 +80,11 @@ s16 currentWorldTarget;
int fileSize; int fileSize;
hqrEntryStruct* HQ_Bodys = nullptr; hqrEntryStruct* HQ_Bodys = nullptr;
hqrEntryStruct* listAnim = nullptr; hqrEntryStruct* HQ_Anims = nullptr;
hqrEntryStruct* listLife = nullptr; hqrEntryStruct* listLife = nullptr;
hqrEntryStruct* listTrack = nullptr; hqrEntryStruct* listTrack = nullptr;
hqrEntryStruct* listHybrides = nullptr; hqrEntryStruct* listHybrides = nullptr;
hqrEntryStruct* listMatrix = nullptr; hqrEntryStruct* HQ_Matrices = nullptr;
s16 maxObjects; s16 maxObjects;
@ -162,7 +162,7 @@ int cameraFovY;
char currentCameraVisibilityList[30]; char currentCameraVisibilityList[30];
int actorTurnedToObj = 0; int FlagGenereAffList = 0;
int currentProcessedActorIdx; int currentProcessedActorIdx;
tObject* currentProcessedActorPtr; tObject* currentProcessedActorPtr;

View File

@ -336,11 +336,11 @@ extern s16 currentWorldTarget;
extern int fileSize; extern int fileSize;
extern hqrEntryStruct* HQ_Bodys; extern hqrEntryStruct* HQ_Bodys;
extern hqrEntryStruct* listAnim; extern hqrEntryStruct* HQ_Anims;
extern hqrEntryStruct* listLife; extern hqrEntryStruct* listLife;
extern hqrEntryStruct* listTrack; extern hqrEntryStruct* listTrack;
extern hqrEntryStruct* listHybrides; extern hqrEntryStruct* listHybrides;
extern hqrEntryStruct* listMatrix; extern hqrEntryStruct* HQ_Matrices;
extern s16 maxObjects; extern s16 maxObjects;
@ -417,7 +417,7 @@ extern int cameraFovY;
extern char currentCameraVisibilityList[30]; extern char currentCameraVisibilityList[30];
extern int actorTurnedToObj; extern int FlagGenereAffList;
extern int currentProcessedActorIdx; extern int currentProcessedActorIdx;
extern tObject* currentProcessedActorPtr; extern tObject* currentProcessedActorPtr;