[Scummvm-cvs-logs] SF.net SVN: scummvm: [28813] scummvm/trunk/engines/agi
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Sep 2 04:25:13 CEST 2007
Revision: 28813
http://scummvm.svn.sourceforge.net/scummvm/?rev=28813&view=rev
Author: thebluegr
Date: 2007-09-01 19:25:13 -0700 (Sat, 01 Sep 2007)
Log Message:
-----------
Some more updates to preagi string drawing function
Modified Paths:
--------------
scummvm/trunk/engines/agi/agi.h
scummvm/trunk/engines/agi/preagi.cpp
scummvm/trunk/engines/agi/preagi_mickey.cpp
Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h 2007-09-02 01:45:59 UTC (rev 28812)
+++ scummvm/trunk/engines/agi/agi.h 2007-09-02 02:25:13 UTC (rev 28813)
@@ -1005,6 +1005,7 @@
// 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);
};
Modified: scummvm/trunk/engines/agi/preagi.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi.cpp 2007-09-02 01:45:59 UTC (rev 28812)
+++ scummvm/trunk/engines/agi/preagi.cpp 2007-09-02 02:25:13 UTC (rev 28813)
@@ -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 @@
}
// 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 @@
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;
Modified: scummvm/trunk/engines/agi/preagi_mickey.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.cpp 2007-09-02 01:45:59 UTC (rev 28812)
+++ scummvm/trunk/engines/agi/preagi_mickey.cpp 2007-09-02 02:25:13 UTC (rev 28813)
@@ -191,7 +191,7 @@
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 @@
// 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::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::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 @@
// 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 @@
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 @@
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();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list