aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2005-09-09 21:13:43 +0000
committerGregory Montoir2005-09-09 21:13:43 +0000
commit732f33bd3adcc27ba6b4d3cc8266f3e612627462 (patch)
treec4bfd7db2d39acca6b8c9d55f07809d3d3c1de4d
parentd0467607ba072f355d730d75dc115c8d69d5bf9b (diff)
downloadscummvm-rg350-732f33bd3adcc27ba6b4d3cc8266f3e612627462.tar.gz
scummvm-rg350-732f33bd3adcc27ba6b4d3cc8266f3e612627462.tar.bz2
scummvm-rg350-732f33bd3adcc27ba6b4d3cc8266f3e612627462.zip
cleanup
svn-id: r18799
-rw-r--r--kyra/kyra.cpp39
-rw-r--r--kyra/kyra.h29
-rw-r--r--kyra/screen.cpp3
3 files changed, 41 insertions, 30 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp
index aba3362f68..72642cd07d 100644
--- a/kyra/kyra.cpp
+++ b/kyra/kyra.cpp
@@ -436,17 +436,17 @@ void KyraEngine::seq_intro() {
&KyraEngine::seq_introKallakMalcom
};
_skipIntroFlag = true; // only true if user already played the game once
- _seq_copyViewOffs = 1;
+ _seq_copyViewOffs = true;
_screen->setFont(Screen::FID_8_FNT);
// snd_kyraPlayTheme(0);
- setTalkCoords(0x90);
+ setTalkCoords(144);
_screen->setScreenPalette(_screen->_currentPalette);
for (int i = 0; i < ARRAYSIZE(introProcTable) && !seq_skipSequence(); ++i) {
(this->*introProcTable[i])();
}
- setTalkCoords(0x88);
+ setTalkCoords(136);
waitTicks(0x1E);
- _seq_copyViewOffs = 0;
+ _seq_copyViewOffs = false;
}
void KyraEngine::seq_introLogos() {
@@ -498,8 +498,8 @@ void KyraEngine::seq_introLogos() {
void KyraEngine::seq_introStory() {
debug(9, "KyraEngine::seq_introStory()");
-// loadBitmap("MAIN_ENG.CPS", 3, 3, 0);
- _screen->clearPage(0); // XXX
+ loadBitmap("MAIN_ENG.CPS", 3, 3, 0);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
}
void KyraEngine::seq_introMalcomTree() {
@@ -570,14 +570,10 @@ void KyraEngine::seq_freeHandShapes() {
void KyraEngine::seq_copyView() {
debug(9, "KyraEngine::seq_copyView()");
int y = 128;
- if (_seq_copyViewOffs == 0) {
+ if (!_seq_copyViewOffs) {
y -= 8;
}
- if (_seq_specialSequenceTempBuffer) {
- _screen->copyToPage0(16, y, 3, _seq_specialSequenceTempBuffer);
- } else {
- _screen->copyRegion(0, 16, 0, 16, 320, y, 2, 0);
- }
+ _screen->copyRegion(0, 16, 0, 16, 320, y, 2, 0);
}
bool KyraEngine::seq_skipSequence() const {
@@ -610,7 +606,6 @@ bool KyraEngine::seq_playSpecialSequence(const uint8 *seqData, bool skipSeq) {
seqLoopTable[i].count = 0xFFFF;
}
memset(wsaMovieTable, 0, sizeof(wsaMovieTable));
- _seq_specialSequenceTempBuffer = 0;
_screen->_curPage = 0;
while (!quitFlag) {
@@ -717,9 +712,6 @@ bool KyraEngine::seq_playSpecialSequence(const uint8 *seqData, bool skipSeq) {
case 8:
_screen->shuffleScreen(0, 16, 320, 128, 2, 0, 0, false);
_screen->_curPage = 2;
- if (_seq_specialSequenceTempBuffer) {
- _screen->copyCurPageBlock(0, 16, 40, 128, _seq_specialSequenceTempBuffer);
- }
break;
case 9:
seq_copyView();
@@ -789,7 +781,7 @@ bool KyraEngine::seq_playSpecialSequence(const uint8 *seqData, bool skipSeq) {
uint8 fillColor = *seqData++;
int b;
if (talkTextPrinted && !talkTextRestored) {
- if (!_seq_specialSequenceTempBuffer && wsaCurDecodePage != 0) {
+ if (wsaCurDecodePage != 0) {
b = 2;
} else {
b = 0;
@@ -798,7 +790,7 @@ bool KyraEngine::seq_playSpecialSequence(const uint8 *seqData, bool skipSeq) {
}
talkTextPrinted = true;
talkTextRestored = false;
- if (!_seq_specialSequenceTempBuffer && wsaCurDecodePage != 0) {
+ if (wsaCurDecodePage != 0) {
b = 2;
} else {
b = 0;
@@ -809,7 +801,7 @@ bool KyraEngine::seq_playSpecialSequence(const uint8 *seqData, bool skipSeq) {
case 17:
if (talkTextPrinted && !talkTextRestored) {
int b;
- if (!_seq_specialSequenceTempBuffer && wsaCurDecodePage != 0) {
+ if (wsaCurDecodePage != 0) {
b = 2;
} else {
b = 0;
@@ -891,12 +883,7 @@ bool KyraEngine::seq_playSpecialSequence(const uint8 *seqData, bool skipSeq) {
}
break;
case 26:
- if (!_seq_specialSequenceTempBuffer) {
- _seq_specialSequenceTempBuffer = (uint8 *)malloc(320 * 128);
- }
- if (_seq_specialSequenceTempBuffer) {
- memset(_seq_specialSequenceTempBuffer, 0, 320 * 128);
- }
+ // allocate offscreen buffer, not needed
break;
case 27:
displayTextFlag = true;
@@ -913,8 +900,6 @@ bool KyraEngine::seq_playSpecialSequence(const uint8 *seqData, bool skipSeq) {
}
_screen->updateScreen();
}
- free(_seq_specialSequenceTempBuffer);
- _seq_specialSequenceTempBuffer = 0;
return seqSkippedFlag;
}
diff --git a/kyra/kyra.h b/kyra/kyra.h
index b6d972e7b4..1986de1aef 100644
--- a/kyra/kyra.h
+++ b/kyra/kyra.h
@@ -44,6 +44,32 @@ enum {
KYRA3 = 4
};
+struct Character {
+ uint16 sceneId;
+ uint8 height;
+ uint8 facing;
+ uint16 currentAnimFrame;
+ uint32 unk6;
+ uint8 inventoryItems[10];
+ int16 x1, y1, x2, y2;
+};
+
+struct Shape {
+ uint8 unk0;
+ uint8 unk1;
+ uint8 imageNum;
+ uint8 x, y, w, h;
+};
+
+struct Room {
+ uint8 id;
+ uint16 room_north_exit;
+ uint16 room_east_exit;
+ uint16 room_south_exit;
+ uint16 room_west_exit;
+ uint8 items_table[12];
+};
+
struct TalkCoords {
uint16 y, x, w;
};
@@ -131,9 +157,8 @@ protected:
uint16 _talkMessageH;
bool _talkMessagePrinted;
- int _seq_copyViewOffs;
+ bool _seq_copyViewOffs;
uint8 *_seq_handShapes[3];
- uint8 *_seq_specialSequenceTempBuffer;
Resource *_res;
Screen *_screen;
diff --git a/kyra/screen.cpp b/kyra/screen.cpp
index 17f8f8cf13..a0f36c9306 100644
--- a/kyra/screen.cpp
+++ b/kyra/screen.cpp
@@ -299,6 +299,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag
setPagePixel(dstPage, i, j, color);
}
}
+ updateScreen();
_system->delayMillis(ticks * 1000 / 60);
}
}
@@ -351,7 +352,7 @@ void Screen::loadFont(FontId fontId, uint8 *fontData) {
}
Screen::FontId Screen::setFont(FontId fontId) {
- debug(9, "Screen::setFont(0%d)", fontId);
+ debug(9, "Screen::setFont(%d)", fontId);
FontId prev = _currentFont;
_currentFont = fontId;
return prev;