svn-id: r29844
This commit is contained in:
Filippos Karapetis 2007-12-13 12:33:31 +00:00
parent 2f7539e865
commit 8b7f3fae35
5 changed files with 27 additions and 61 deletions

View File

@ -33,6 +33,8 @@
namespace Cine {
uint16 bgVar0;
byte *additionalBgTable[9];
byte currentAdditionalBgIdx = 0, currentAdditionalBgIdx2 = 0;
void loadCtHigh(byte * currentPtr) {
memcpy(page3Raw, currentPtr, 320 * 200);
@ -115,10 +117,6 @@ byte loadBg(const char *bgName) {
return 0;
}
byte *additionalBgTable[9];
byte currentAdditionalBgIdx = 0;
byte currentAdditionalBgIdx2 = 0;
void addBackground(const char *bgName, uint16 bgIdx) {
byte *ptr, *dataPtr;

View File

@ -39,19 +39,11 @@ uint32 var8;
BGIncrustList *bgIncrustList;
void addToBGList(int16 objIdx, bool addList) {
int16 x;
int16 y;
int16 width;
int16 height;
int16 part;
x = objectTable[objIdx].x;
y = objectTable[objIdx].y;
width = animDataTable[objectTable[objIdx].frame].var1;
height = animDataTable[objectTable[objIdx].frame].height;
part = objectTable[objIdx].part;
int16 x = objectTable[objIdx].x;
int16 y = objectTable[objIdx].y;
int16 width = animDataTable[objectTable[objIdx].frame].var1;
int16 height = animDataTable[objectTable[objIdx].frame].height;
int16 part = objectTable[objIdx].part;
if (g_cine->getGameType() == GType_OS) {
drawSpriteRaw2(animDataTable[objectTable[objIdx].frame].ptr1, objectTable[objIdx].part, width, height, page2Raw, x, y);
@ -64,16 +56,10 @@ void addToBGList(int16 objIdx, bool addList) {
}
void addSpriteFilledToBGList(int16 objIdx, bool addList) {
int16 x;
int16 y;
int16 width;
int16 height;
x = objectTable[objIdx].x;
y = objectTable[objIdx].y;
width = animDataTable[objectTable[objIdx].frame].width;
height = animDataTable[objectTable[objIdx].frame].height;
int16 x = objectTable[objIdx].x;
int16 y = objectTable[objIdx].y;
int16 width = animDataTable[objectTable[objIdx].frame].width;
int16 height = animDataTable[objectTable[objIdx].frame].height;
if (animDataTable[objectTable[objIdx].frame].ptr1) {
gfxFillSprite(animDataTable[objectTable[objIdx].frame].ptr1, width / 2, height, page2Raw, x, y);

View File

@ -160,26 +160,21 @@ void CineEngine::initialize() {
}
for (i = 0; i < NUM_MAX_ANIMDATA; i++) {
animDataTable[i].ptr1 = NULL;
animDataTable[i].ptr2 = NULL;
animDataTable[i].ptr1 = animDataTable[i].ptr2 = NULL;
}
overlayHead.next = NULL;
overlayHead.previous = NULL;
overlayHead.next = overlayHead.previous = NULL;
var8 = 0;
bgIncrustList = NULL;
objScriptList.next = NULL;
globalScriptsHead.next = NULL;
objScriptList.scriptPtr = NULL;
globalScriptsHead.next = NULL;
globalScriptsHead.scriptPtr = NULL;
var2 = 0;
var3 = 0;
var4 = 0;
var5 = 0;
var2 = var3 = var4 = var5 = 0;
freePrcLinkedList();

View File

@ -112,16 +112,11 @@ int8 removeOverlayElement(uint16 objIdx, uint16 param) {
currentHeadPtr = tempHead->next;
}
if (!currentHeadPtr) {
if (!currentHeadPtr || objIdx != currentHeadPtr->objIdx || param != currentHeadPtr->type) {
return -1;
}
if (objIdx != currentHeadPtr->objIdx || param != currentHeadPtr->type) {
return -1;
}
tempHead->next = currentHeadPtr->next;
tempPtr2 = currentHeadPtr->next;
tempHead->next = tempPtr2 = currentHeadPtr->next;
if (!tempPtr2) {
tempPtr2 = &overlayHead;
@ -143,11 +138,7 @@ int16 freeOverlay(uint16 objIdx, uint16 param) {
currentHeadPtr = previousPtr->next;
}
if (!currentHeadPtr) {
return -1;
}
if (!((currentHeadPtr->objIdx == objIdx) && (currentHeadPtr->type == param))) {
if (!currentHeadPtr || !((currentHeadPtr->objIdx == objIdx) && (currentHeadPtr->type == param))) {
return -1;
}

View File

@ -304,7 +304,9 @@ void AdlibSoundDriver::initCard() {
OPLWriteReg(_opl, 0xBD, _vibrato);
OPLWriteReg(_opl, 0x08, 0x40);
int i;
int i, j;
int oplRegs[] = { 0x60, 0x80, 0x20, 0xE0 };
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, 0x40 | _operatorsTable[i], 0);
}
@ -314,17 +316,11 @@ void AdlibSoundDriver::initCard() {
for (i = 0; i < 9; ++i) {
OPLWriteReg(_opl, 0xC0 | i, 0);
}
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, 0x60 | _operatorsTable[i], 0);
}
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, 0x80 | _operatorsTable[i], 0);
}
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, 0x20 | _operatorsTable[i], 0);
}
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, 0xE0 | _operatorsTable[i], 0);
for (j = 0; j < 4; j++) {
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, oplRegs[j] | _operatorsTable[i], 0);
}
}
OPLWriteReg(_opl, 1, 0x20);