aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorFilippos Karapetis2007-09-02 02:25:13 +0000
committerFilippos Karapetis2007-09-02 02:25:13 +0000
commitafac94340a4d71e352b5c17556557b290d8508e0 (patch)
treeee87156dfd5c25cc4993859851c9b94262d41d9b /engines/agi
parent2182d758d07432d990b0e18beb569d539b901e00 (diff)
downloadscummvm-rg350-afac94340a4d71e352b5c17556557b290d8508e0.tar.gz
scummvm-rg350-afac94340a4d71e352b5c17556557b290d8508e0.tar.bz2
scummvm-rg350-afac94340a4d71e352b5c17556557b290d8508e0.zip
Some more updates to preagi string drawing function
svn-id: r28813
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/agi.h1
-rw-r--r--engines/agi/preagi.cpp15
-rw-r--r--engines/agi/preagi_mickey.cpp16
3 files changed, 24 insertions, 8 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 8720153fa7..d5a296dd4c 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -1005,6 +1005,7 @@ public:
// Text
void drawStr(int row, int col, int attr, char *buffer);
void drawStrMiddle(int row, int attr, char *buffer);
+ void clearTextArea();
void drawChar(int x, int y, int attr, int code, char *fontdata);
};
diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp
index 25e143e42f..bfe79fad68 100644
--- a/engines/agi/preagi.cpp
+++ b/engines/agi/preagi.cpp
@@ -50,6 +50,12 @@
// preagi engines
#include "agi/preagi_mickey.h"
+// default attributes
+#define IDA_DEFAULT 0x0F
+#define IDA_DEFAULT_REV 0xF0
+
+#define IDI_MAX_ROW_PIC 20
+
namespace Agi {
PreAgiEngine::PreAgiEngine(OSystem *syst) : AgiBase(syst) {
@@ -274,6 +280,8 @@ int PreAgiEngine::preAgiUnloadResource(int r, int n) {
}
// String functions
+// TODO: These need to be moved elsewhere
+
void PreAgiEngine::drawStr(int row, int col, int attr, char *buffer)
{
int code;
@@ -311,6 +319,13 @@ void PreAgiEngine::drawStrMiddle(int row, int attr, char *buffer) {
drawStr(row, col, attr, buffer);
}
+void PreAgiEngine::clearTextArea() {
+ // FIXME: this causes crashes, I imagine it's because we're not currently locking the screen in drawStr
+ for (int row = IDI_MAX_ROW_PIC; row < 200 / 8; row++) {
+ //drawStr(row, 0, IDA_DEFAULT, " "); // 40 spaces
+ }
+}
+
void PreAgiEngine::drawChar(int x, int y, int attr, int code, char *fontdata)
{
int cx, cy;
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index 1f1715ac98..ef9d5d87f2 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -191,7 +191,7 @@ void Mickey::printStr(char *buffer) {
nRows = *buffer + IDI_MSA_ROW_MENU_0;
- //clearTextArea(); // TODO
+ _vm->clearTextArea();
for (iRow = IDI_MSA_ROW_MENU_0; iRow < nRows; iRow++) {
iCol = *(buffer + pc++);
@@ -244,7 +244,7 @@ void Mickey::drawMenu(MSA_MENU menu, int sel0, int sel1) {
// draw menu
- // clearTextArea(); // TODO
+ _vm->clearTextArea();
for (iRow = 0; iRow < 2; iRow++) {
for (iWord = 0; iWord < menu.row[iRow].count; iWord++) {
@@ -950,9 +950,9 @@ void Mickey::printStory() {
void Mickey::hidden() {
if (game.iRoom == IDI_MSA_PIC_MERCURY_CAVE_0) {
for (int i = 0; i < 5; i++) {
- //printExeMsg(IDO_MSA_HIDDEN_MSG[i]); // TODO
+ printExeMsg(IDO_MSA_HIDDEN_MSG[i]);
}
- // clearTextArea(); // TODO
+ _vm->clearTextArea();
_vm->_gfx->doUpdate();
_vm->_system->updateScreen(); // TODO: this should go in the game's main loop
_vm->waitAnyKey();
@@ -1020,7 +1020,7 @@ void Mickey::checkAirSupply(bool fSuit, int *iSupply) {
}
void Mickey::insertDisk(int iDisk) {
- //clearTextArea(); // TODO
+ _vm->clearTextArea();
_vm->drawStr(IDI_MSA_ROW_INSERT_DISK, IDI_MSA_COL_INSERT_DISK, IDA_DEFAULT, (char *)IDS_MSA_INSERT_DISK[iDisk]);
_vm->_gfx->doUpdate();
_vm->_system->updateScreen(); // TODO: this should go in the game's main loop
@@ -1055,7 +1055,7 @@ void Mickey::flipSwitch() {
// activate screen animation
game.fAnimXL30 = true;
- // clearTextArea(); // TODO
+ _vm->clearTextArea();
_vm->_gfx->doUpdate();
_vm->_system->updateScreen(); // TODO: this should go in the game's main loop
//playSound(IDI_MSA_SND_XL30); // TODO
@@ -1953,7 +1953,7 @@ void Mickey::debug_DrawObjs() {
drawPic(0);
drawObj((ENUM_MSA_OBJECT)iObj, 0, 0);
- ///clearTextArea(); // TODO
+ _vm->clearTextArea();
sprintf(szTitle, "Object %d", iObj);
_vm->drawStrMiddle(22, IDA_DEFAULT, szTitle);
_vm->drawStrMiddle(23, IDA_DEFAULT, (char *)IDS_MSA_NAME_OBJ[iObj]);
@@ -1969,7 +1969,7 @@ void Mickey::debug_DrawPics(){
for (int iPic = 1; iPic <= IDI_MSA_MAX_PIC; iPic++) {
drawPic(iPic);
- //clearTextArea(); // TODO
+ _vm->clearTextArea();
sprintf(szTitle, "Picture %d", iPic);
_vm->drawStrMiddle(22, IDA_DEFAULT, szTitle);
_vm->_gfx->doUpdate();