aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2004-11-23 21:51:30 +0000
committerGregory Montoir2004-11-23 21:51:30 +0000
commit9c317c95c3746ffcda8ae36b692a54ad49ad59dd (patch)
tree5789f2fcee1ff6ead8f9b81ee884635ffed595aa
parent7877ccf628d4033a4941762b867b819770a61fa6 (diff)
downloadscummvm-rg350-9c317c95c3746ffcda8ae36b692a54ad49ad59dd.tar.gz
scummvm-rg350-9c317c95c3746ffcda8ae36b692a54ad49ad59dd.tar.bz2
scummvm-rg350-9c317c95c3746ffcda8ae36b692a54ad49ad59dd.zip
sync queen engine with latest OSystem changes
svn-id: r15871
-rw-r--r--queen/logic.cpp19
-rw-r--r--queen/logic.h8
-rw-r--r--queen/queen.cpp1
3 files changed, 15 insertions, 13 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 044a1c8ed4..8cd7b2a3f8 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -58,14 +58,15 @@ static Common::String trim(const Common::String &s) {
}
Logic::Logic(QueenEngine *vm)
- : _credits(NULL), _vm(vm) {
+ : _credits(NULL), _objectData(NULL), _roomData(NULL), _sfxName(NULL),
+ _itemData(NULL), _graphicData(NULL), _walkOffData(NULL), _objectDescription(NULL),
+ _furnitureData(NULL), _actorData(NULL), _graphicAnim(NULL), _vm(vm) {
_joe.x = _joe.y = 0;
_joe.scale = 100;
_joe.walk = JWM_NORMAL;
memset(_gameState, 0, sizeof(_gameState));
memset(_talkSelected, 0, sizeof(_talkSelected));
_puzzleAttemptCount = 0;
- initialise();
_journal = new Journal(vm);
}
@@ -84,7 +85,7 @@ Logic::~Logic() {
delete[] _graphicAnim;
}
-void Logic::initialise() {
+void Logic::start() {
int16 i;
uint8 *jas = _vm->resource()->loadFile("QUEEN.JAS", 20);
@@ -929,24 +930,24 @@ void Logic::inventoryRefresh() {
}
}
-int16 Logic::previousInventoryItem(int16 start) const {
+int16 Logic::previousInventoryItem(int16 first) const {
int i;
- for (i = start - 1; i >= 1; i--)
+ for (i = first - 1; i >= 1; i--)
if (_itemData[i].name > 0)
return i;
- for (i = _numItems; i > start; i--)
+ for (i = _numItems; i > first; i--)
if (_itemData[i].name > 0)
return i;
return 0; //nothing found
}
-int16 Logic::nextInventoryItem(int16 start) const {
+int16 Logic::nextInventoryItem(int16 first) const {
int i;
- for (i = start + 1; i < _numItems; i++)
+ for (i = first + 1; i < _numItems; i++)
if (_itemData[i].name > 0)
return i;
- for (i = 1; i < start; i++)
+ for (i = 1; i < first; i++)
if (_itemData[i].name > 0)
return i;
diff --git a/queen/logic.h b/queen/logic.h
index ea764aa293..590d1031ac 100644
--- a/queen/logic.h
+++ b/queen/logic.h
@@ -155,8 +155,8 @@ public:
void inventorySetup();
uint16 findInventoryItem(int invSlot) const;
void inventoryRefresh();
- int16 previousInventoryItem(int16 start) const;
- int16 nextInventoryItem(int16 start) const;
+ int16 previousInventoryItem(int16 first) const;
+ int16 nextInventoryItem(int16 first) const;
void removeDuplicateItems();
uint16 numItemsInventory() const;
void inventoryInsertItem(uint16 itemNum, bool refresh = true);
@@ -196,6 +196,8 @@ public:
void startCredits(const char *filename);
void stopCredits();
+ void start();
+
enum {
JOE_RESPONSE_MAX = 40,
DEFAULT_TALK_SPEED = 7 * 3,
@@ -205,8 +207,6 @@ public:
protected:
- void initialise();
-
void asmMakeJoeUseDress();
void asmMakeJoeUseNormalClothes();
void asmMakeJoeUseUnderwear();
diff --git a/queen/queen.cpp b/queen/queen.cpp
index 998e0cb501..5057a4f19b 100644
--- a/queen/queen.cpp
+++ b/queen/queen.cpp
@@ -289,6 +289,7 @@ void QueenEngine::errorString(const char *buf1, char *buf2) {
}
int QueenEngine::go() {
+ _logic->start();
_logic->oldRoom(0);
_logic->newRoom(_logic->currentRoom());