aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2011-09-03 14:50:58 +0300
committerFilippos Karapetis2011-09-03 14:51:51 +0300
commit41cc1932d2cc19e6179f54d1b149a245420dba7a (patch)
tree1c743a35692c61786a9bca4353be2f87b14a964b /engines/sci/engine
parentf85fd9b4f1168bcf0659ef6cf747c6616408921c (diff)
downloadscummvm-rg350-41cc1932d2cc19e6179f54d1b149a245420dba7a.tar.gz
scummvm-rg350-41cc1932d2cc19e6179f54d1b149a245420dba7a.tar.bz2
scummvm-rg350-41cc1932d2cc19e6179f54d1b149a245420dba7a.zip
SCI32: Added an initial skeleton structure for the SCI2 text drawing code
This includes kCreateTextBitmap, and moves all of the text drawing code into the new GfxText32 class
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 36de767464..556e5249b6 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -49,6 +49,7 @@
#include "sci/graphics/text16.h"
#include "sci/graphics/view.h"
#ifdef ENABLE_SCI32
+#include "sci/graphics/text32.h"
#include "sci/graphics/frameout.h"
#include "sci/video/robot_decoder.h"
#endif
@@ -1380,15 +1381,19 @@ reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv) {
}
reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {
- // TODO: argument 0 is usually 0, and arguments 1 and 2 are usually 1
switch (argv[0].toUint16()) {
case 0: {
if (argc != 4) {
warning("kCreateTextBitmap(0): expected 4 arguments, got %i", argc);
return NULL_REG;
}
- //reg_t object = argv[3];
- //Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text)));
+ reg_t object = argv[3];
+ Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text)));
+ debugC(kDebugLevelStrings, "kCreateTextBitmap case 0 (%04x:%04x, %04x:%04x, %04x:%04x)",
+ PRINT_REG(argv[1]), PRINT_REG(argv[2]), PRINT_REG(argv[3]));
+ debugC(kDebugLevelStrings, "%s", text.c_str());
+ // TODO: arguments 1 and 2
+ g_sci->_gfxText32->createTextBitmap(object);
break;
}
case 1: {
@@ -1396,8 +1401,11 @@ reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {
warning("kCreateTextBitmap(0): expected 2 arguments, got %i", argc);
return NULL_REG;
}
- //reg_t object = argv[1];
- //Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text)));
+ reg_t object = argv[1];
+ Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text)));
+ debugC(kDebugLevelStrings, "kCreateTextBitmap case 1 (%04x:%04x)", PRINT_REG(argv[1]));
+ debugC(kDebugLevelStrings, "%s", text.c_str());
+ g_sci->_gfxText32->createTextBitmap(object);
break;
}
default: