diff options
author | Bertrand Augereau | 2011-11-17 11:34:06 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-11-17 12:38:17 +0100 |
commit | fc7a36d911341d960fcd9c2d890b1dc2362c5f35 (patch) | |
tree | ccd45d0955c291e1a58c6924629a310178ea76cf /engines/dreamweb | |
parent | db7184668dfec0d09460f6bc345faaa43d036bb6 (diff) | |
download | scummvm-rg350-fc7a36d911341d960fcd9c2d890b1dc2362c5f35.tar.gz scummvm-rg350-fc7a36d911341d960fcd9c2d890b1dc2362c5f35.tar.bz2 scummvm-rg350-fc7a36d911341d960fcd9c2d890b1dc2362c5f35.zip |
DREAMWEB: Cleaning in room loading
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/saveload.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/structs.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 24 |
3 files changed, 14 insertions, 16 deletions
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index f68ec86ddf..02a128837b 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -162,8 +162,8 @@ void DreamGenContext::doload() { dx = data; es = dx; - bx = kMadeuproomdat; - startloading(); + const Room *room = (Room *)cs.ptr(kMadeuproomdat, sizeof(Room)); + startloading(room); loadroomssample(); data.byte(kRoomloaded) = 1; data.byte(kNewlocation) = 255; diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index 2775cf49c9..c0adbe6823 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -182,7 +182,7 @@ struct People { }; struct Room { - uint8 name[10]; + char name[10]; uint8 b10; uint8 b11; uint8 b12; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index c94735f231..168d8251a4 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -786,8 +786,7 @@ void DreamGenContext::startloading(const Room *room) { al = room->b31; ah = data.byte(kReallocation); data.byte(kReallocation) = al; - dx = bx; - Common::String name = getFilename(*this); + Common::String name = room->name; engine->openFile(name); cs.word(kHandle) = 1; //only one handle flags._c = false; @@ -795,10 +794,10 @@ void DreamGenContext::startloading(const Room *room) { allocateload(); ds = ax; data.word(kBackdrop) = ax; - dx = (0); + dx = kFlags; loadseg(); ds = data.word(kWorkspace); - dx = (0); + dx = kMap; cx = 132*66; al = 0; fillspace(); @@ -807,11 +806,11 @@ void DreamGenContext::startloading(const Room *room) { allocateload(); data.word(kSetframes) = ax; ds = ax; - dx = (0); + dx = kFramedata; loadseg(); ds = data.word(kSetdat); dx = 0; - cx = (64*128); + cx = kSetdatlen; al = 255; fillspace(); loadseg(); @@ -862,22 +861,22 @@ void DreamGenContext::startloading(const Room *room) { loadseg(); ds = data.word(kFreedat); dx = 0; - cx = (16*80); + cx = kFreedatlen; al = 255; fillspace(); loadseg(); allocateload(); data.word(kFreedesc) = ax; ds = ax; - dx = (0); + dx = kFreetextdat; loadseg(); closefile(); findroominloc(); deletetaken(); setallchanges(); autoappear(); - al = data.byte(kNewlocation); - getroomdata(); + Room *newRoom = getroomdata(data.byte(kNewlocation)); + bx = (uint8 *)newRoom - cs.ptr(0, 0); data.byte(kLastweapon) = (uint8)-1; data.byte(kMandead) = 0; data.word(kLookcounter) = 160; @@ -2037,9 +2036,8 @@ void DreamGenContext::loadroom() { data.word(kTextaddressy) = 182; data.byte(kTextlen) = 240; data.byte(kLocation) = data.byte(kNewlocation); - al = data.byte(kNewlocation); - getroomdata(); - startloading(); + Room *room = getroomdata(data.byte(kNewlocation)); + startloading(room); loadroomssample(); switchryanon(); drawflags(); |