diff options
author | Bertrand Augereau | 2011-08-25 10:39:51 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-25 11:12:27 +0200 |
commit | 19768db88210c8491a729fb20ac6af040296a0ec (patch) | |
tree | c650dbeb7a6d233c64a96ecbf17a4ad4c984f7df /engines | |
parent | 5cd7f3f82c8b6a4f43b7df3f2419077122e544c9 (diff) | |
download | scummvm-rg350-19768db88210c8491a729fb20ac6af040296a0ec.tar.gz scummvm-rg350-19768db88210c8491a729fb20ac6af040296a0ec.tar.bz2 scummvm-rg350-19768db88210c8491a729fb20ac6af040296a0ec.zip |
DREAMWEB: 'drawflags' ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/backdrop.cpp | 16 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 40 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 18 insertions, 42 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp index 6243cee32f..f667e7b73c 100644 --- a/engines/dreamweb/backdrop.cpp +++ b/engines/dreamweb/backdrop.cpp @@ -281,5 +281,21 @@ void DreamGenContext::showallfree() { } } +void DreamGenContext::drawflags() { + uint8 *mapFlags = segRef(data.word(kBuffers)).ptr(kMapflags, 0); + const uint8 *mapData = segRef(data.word(kMapdata)).ptr(kMap + data.byte(kMapy) * kMapwidth + data.byte(kMapx), 0); + const uint8 *backdropFlags = segRef(data.word(kBackdrop)).ptr(kFlags, 0); + + for (size_t i = 0; i < 10; ++i) { + for (size_t j = 0; j < 11; ++j) { + uint8 tile = mapData[i * kMapwidth + j]; + mapFlags[0] = backdropFlags[2 * tile + 0]; + mapFlags[1] = backdropFlags[2 * tile + 1]; + mapFlags[2] = tile; + mapFlags += 3; + } + } +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 721ac526e1..8d3518d5f6 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -6321,45 +6321,6 @@ void DreamGenContext::drawfloor() { es = pop(); } -void DreamGenContext::drawflags() { - STACK_CHECK; - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)); - al = data.byte(kMapy); - ah = 0; - cx = (66); - _mul(cx); - bl = data.byte(kMapx); - bh = 0; - _add(ax, bx); - si = (0); - _add(si, ax); - cx = 10; -_tmp28: - push(cx); - cx = 11; -_tmp28a: - ds = data.word(kMapdata); - _lodsb(); - ds = data.word(kBackdrop); - push(si); - push(ax); - ah = 0; - _add(ax, ax); - si = (0); - _add(si, ax); - _movsw(); - ax = pop(); - _stosb(); - si = pop(); - if (--cx) - goto _tmp28a; - _add(si, (66)-11); - cx = pop(); - if (--cx) - goto _tmp28; -} - void DreamGenContext::showallex() { STACK_CHECK; es = data.word(kBuffers); @@ -18156,7 +18117,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_deleteextext: deleteextext(); break; case addr_blockget: blockget(); break; case addr_drawfloor: drawfloor(); break; - case addr_drawflags: drawflags(); break; case addr_showallex: showallex(); break; case addr_autolook: autolook(); break; case addr_look: look(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 7fc3091819..fc4deeb488 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -449,7 +449,6 @@ public: static const uint16 addr_look = 0xc470; static const uint16 addr_autolook = 0xc46c; static const uint16 addr_showallex = 0xc450; - static const uint16 addr_drawflags = 0xc43c; static const uint16 addr_drawfloor = 0xc428; static const uint16 addr_blockget = 0xc424; static const uint16 addr_deleteextext = 0xc420; @@ -1973,7 +1972,7 @@ public: void getlocation(); void geteitherad(); //void placesetobject(); - void drawflags(); + //void drawflags(); void zoomonoff(); void updatesymboltop(); void showryanpage(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index c1a9140d20..7c8cee4690 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -190,4 +190,5 @@ void readmouse3(); void readmouse4(); uint16 waitframes(); + void drawflags(); |