aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-11-29 10:27:02 +0100
committerBertrand Augereau2011-11-29 11:03:29 +0100
commit55d727219705ba859657877a9a57a1a2e2665ada (patch)
tree5c57e5b14c9b5f6a8e1f5720990179cb13465a5f /engines
parent17d5b0d28d626dfcaf538feb7d400e30f7c93376 (diff)
downloadscummvm-rg350-55d727219705ba859657877a9a57a1a2e2665ada.tar.gz
scummvm-rg350-55d727219705ba859657877a9a57a1a2e2665ada.tar.bz2
scummvm-rg350-55d727219705ba859657877a9a57a1a2e2665ada.zip
DREAMWEB: 'nextfolder' ported to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp34
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp31
-rw-r--r--engines/dreamweb/stubs.h2
-rw-r--r--engines/dreamweb/use.cpp9
5 files changed, 35 insertions, 44 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 85324fb2a9..b19b86e3af 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -9740,40 +9740,6 @@ void DreamGenContext::loadmenu() {
loadintotemp2();
}
-void DreamGenContext::nextfolder() {
- STACK_CHECK;
- _cmp(data.byte(kFolderpage), 12);
- if (!flags.z())
- goto cannextf;
- blank();
- return;
-cannextf:
- _cmp(data.byte(kCommandtype), 201);
- if (flags.z())
- goto alreadynextf;
- data.byte(kCommandtype) = 201;
- al = 16;
- commandonly();
-alreadynextf:
- ax = data.word(kMousebutton);
- _cmp(ax, data.word(kOldbutton));
- if (flags.z())
- return /* (notnextf) */;
- _cmp(ax, 1);
- if (flags.z())
- goto donextf;
- return;
-donextf:
- _inc(data.byte(kFolderpage));
- folderhints();
- delpointer();
- showfolder();
- data.word(kMousebutton) = 0;
- bx = offset_folderlist;
- checkcoords();
- worktoscreenm();
-}
-
void DreamGenContext::folderhints() {
STACK_CHECK;
_cmp(data.byte(kFolderpage), 5);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index a63d27dc66..76734fd8de 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -180,7 +180,6 @@ public:
static const uint16 addr_loadfolder = 0xc7c4;
static const uint16 addr_lastfolder = 0xc7c0;
static const uint16 addr_folderhints = 0xc7bc;
- static const uint16 addr_nextfolder = 0xc7b8;
static const uint16 addr_loadmenu = 0xc7b0;
static const uint16 addr_showmenu = 0xc7ac;
static const uint16 addr_dumpmenu = 0xc79c;
@@ -1341,7 +1340,7 @@ public:
void calledenslift();
void useclearbox();
void entryanims();
- void nextfolder();
+ //void nextfolder();
void getfreead();
void showarrows();
void walkintoroom();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index f44d290378..0338a69327 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2423,5 +2423,36 @@ const uint8 *DreamGenContext::getTextInFile1(uint16 index) {
return string;
}
+void DreamGenContext::checkFolderCoords() {
+ RectWithCallback folderlist[] = {
+ { 280,320,160,200,&DreamGenContext::quitkey },
+ { 143,300,6,194,&DreamGenContext::nextfolder },
+ { 0,143,6,194,&DreamGenContext::lastfolder },
+ { 0,320,0,200,&DreamGenContext::blank },
+ { 0xFFFF,0,0,0,0 }
+ };
+ checkcoords(folderlist);
+}
+
+void DreamGenContext::nextfolder() {
+ if (data.byte(kFolderpage) == 12) {
+ blank();
+ return;
+ }
+ if (data.byte(kCommandtype) != 201) {
+ data.byte(kCommandtype) = 201;
+ commandonly(16);
+ }
+ if ((data.word(kMousebutton) == 1) && (data.word(kMousebutton) != data.word(kOldbutton))) {
+ ++data.byte(kFolderpage);
+ folderhints();
+ delpointer();
+ showfolder();
+ data.word(kMousebutton) = 0;
+ checkFolderCoords();
+ worktoscreenm();
+ }
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 76964b01cd..b4ad02ed13 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -355,9 +355,11 @@
void restoreall();
void restorereels();
void viewfolder();
+ void checkFolderCoords();
void showfolder();
void showleftpage();
void showrightpage();
+ void nextfolder();
uint8 getlocation(uint8 index);
void getlocation();
void setlocation(uint8 index);
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 2e32a21488..b64797e0cd 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -211,14 +211,7 @@ void DreamGenContext::viewfolder() {
vsync();
dumppointer();
dumptextline();
- RectWithCallback folderlist[] = {
- { 280,320,160,200,&DreamGenContext::quitkey },
- { 143,300,6,194,&DreamGenContext::nextfolder },
- { 0,143,6,194,&DreamGenContext::lastfolder },
- { 0,320,0,200,&DreamGenContext::blank },
- { 0xFFFF,0,0,0,0 }
- };
- checkcoords(folderlist);
+ checkFolderCoords();
} while (data.byte(kGetback) == 0);
data.byte(kManisoffscreen) = 0;
getridoftemp();