mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 22:58:09 +00:00
Fix a few script issues
svn-id: r29397
This commit is contained in:
parent
034eb920d2
commit
6e4037165d
@ -275,7 +275,7 @@ void freezeCell(cellStruct * pObject, int overlayIdx, int objIdx, int objType, i
|
||||
}
|
||||
|
||||
void sortCells(int16 param1, int16 param2, cellStruct *objPtr) {
|
||||
int16 var;
|
||||
/*int16 var;
|
||||
cellStruct *var8_;
|
||||
cellStruct *var40;
|
||||
cellStruct *var3E;
|
||||
@ -358,7 +358,7 @@ void sortCells(int16 param1, int16 param2, cellStruct *objPtr) {
|
||||
}
|
||||
|
||||
temp->prev = match;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
} // End of namespace Cruise
|
||||
|
@ -279,13 +279,22 @@ void loadCtpSub1(int boxIdx, int scale, uint16 *_walkboxTable,
|
||||
}
|
||||
}
|
||||
|
||||
int getNode(int nodeResult[2], int nodeId){
|
||||
if(nodeId < 0 || nodeId >= ctp_routeCoordCount)
|
||||
return -1;
|
||||
|
||||
nodeResult[0] = ctp_routeCoords[nodeId][0];
|
||||
nodeResult[1] = ctp_routeCoords[nodeId][1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int loadCtp(uint8 *ctpName) {
|
||||
int walkboxCounter; // si
|
||||
uint8 *ptr;
|
||||
uint8 *dataPointer; // ptr2
|
||||
char fileType[5]; // string2
|
||||
short int segementSizeTable[7]; // tempTable
|
||||
char string[32];
|
||||
|
||||
if (ctpVar1 == 0) {
|
||||
int i;
|
||||
@ -354,7 +363,7 @@ int loadCtp(uint8 *ctpName) {
|
||||
|
||||
free(ptr);
|
||||
|
||||
strcpyuint8(string, currentCtpName);
|
||||
strcpyuint8(currentCtpName, ctpName);
|
||||
|
||||
numberOfWalkboxes = segementSizeTable[6] / 2; // get the number of walkboxes
|
||||
|
||||
|
@ -54,6 +54,8 @@ extern ctpVar19Struct *ctpVar19;
|
||||
int loadCtp(uint8 * ctpName);
|
||||
int ctpProc2(int varX, int varY, int paramX, int paramY);
|
||||
|
||||
int getNode(int nodeResult[2], int nodeId);
|
||||
|
||||
} // End of namespace Cruise
|
||||
|
||||
#endif
|
||||
|
@ -1389,6 +1389,27 @@ int16 Op_2A(void) {
|
||||
return getProcParam(overlayIdx, 40, (uint8 *) var_26);
|
||||
}
|
||||
|
||||
int16 Op_SetObjectAtNode(void) {
|
||||
int16 node = popVar();
|
||||
int16 obj = popVar();
|
||||
int16 ovl = popVar();
|
||||
|
||||
if(!ovl)
|
||||
ovl = currentScriptPtr->overlayNumber;;
|
||||
|
||||
int nodeInfo[2];
|
||||
|
||||
if(!getNode(nodeInfo, node))
|
||||
{
|
||||
setObjectPosition(ovl, obj, 0, nodeInfo[0]);
|
||||
setObjectPosition(ovl, obj, 1, nodeInfo[1]);
|
||||
setObjectPosition(ovl, obj, 2, nodeInfo[1]);
|
||||
setObjectPosition(ovl, obj, 4, computeZoom(nodeInfo[1]));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void setupOpcodeTable(void) {
|
||||
int i;
|
||||
|
||||
@ -1422,6 +1443,7 @@ void setupOpcodeTable(void) {
|
||||
opcodeTablePtr[0x18] = Op_AddAnimation;
|
||||
opcodeTablePtr[0x19] = Op_RemoveAnimation;
|
||||
opcodeTablePtr[0x1A] = Op_SetZoom;
|
||||
opcodeTablePtr[0x1B] = Op_SetObjectAtNode;
|
||||
opcodeTablePtr[0x1E] = Op_1E;
|
||||
opcodeTablePtr[0x21] = Op_21;
|
||||
opcodeTablePtr[0x22] = Op_22;
|
||||
|
@ -169,7 +169,7 @@ int16 XMIN_XMAX[404];
|
||||
int16 polyBuffer4[512];
|
||||
|
||||
// this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2)
|
||||
void getPolySize(int positionX, int positionY, int scale, int sizeTable[4], char *dataPtr)
|
||||
void getPolySize(int positionX, int positionY, int scale, int sizeTable[4], unsigned char *dataPtr)
|
||||
{
|
||||
int upperBorder;
|
||||
int lowerBorder;
|
||||
@ -1036,7 +1036,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *pObject, int X, int scale, int
|
||||
flipPoly(fileIndex, (int16*)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale);
|
||||
|
||||
// this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2)
|
||||
getPolySize(newX, newY, newScale, sizeTable, (char*)newFrame);
|
||||
getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame);
|
||||
|
||||
spriteX2 = sizeTable[0] - 2; // left border
|
||||
spriteX1 = sizeTable[1] + 18; // right border
|
||||
|
@ -276,9 +276,9 @@ int32 opcodeType1(void) {
|
||||
di = currentScriptPtr->overlayNumber;
|
||||
}
|
||||
|
||||
if (var == 0x85) // Special case to handle...
|
||||
if ((var == 0x85) && !strcmp((char*)currentCtpName, "S26.CTP") && !di && mode == 1) // patch in bar
|
||||
{
|
||||
ASSERT(0);
|
||||
var= 0x87;
|
||||
}
|
||||
|
||||
setObjectPosition(di, var_4, mode, var);
|
||||
@ -732,8 +732,7 @@ int executeScripts(scriptInstanceStruct *ptr) {
|
||||
currentScriptOpcodeType = opcodeType & 7;
|
||||
|
||||
if (!opcodeTypeTable[(opcodeType & 0xFB) >> 3]) {
|
||||
printf("Unsupported opcode type %d\n",
|
||||
(opcodeType & 0xFB) >> 3);
|
||||
printf("Unsupported opcode type %d\n", (opcodeType & 0xFB) >> 3);
|
||||
exit(1);
|
||||
return (-21);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user