aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/POTFILES1
-rw-r--r--engines/teenagent/actor.cpp5
-rw-r--r--engines/teenagent/actor.h1
-rw-r--r--engines/teenagent/animation.cpp1
-rw-r--r--engines/teenagent/animation.h1
-rw-r--r--engines/teenagent/callbacks.cpp21
-rw-r--r--engines/teenagent/configure.engine3
-rw-r--r--engines/teenagent/console.cpp47
-rw-r--r--engines/teenagent/console.h1
-rw-r--r--engines/teenagent/detection.cpp5
-rw-r--r--engines/teenagent/dialog.cpp3
-rw-r--r--engines/teenagent/dialog.h1
-rw-r--r--engines/teenagent/font.cpp3
-rw-r--r--engines/teenagent/font.h1
-rw-r--r--engines/teenagent/inventory.cpp1
-rw-r--r--engines/teenagent/inventory.h1
-rw-r--r--engines/teenagent/music.cpp4
-rw-r--r--engines/teenagent/music.h4
-rw-r--r--engines/teenagent/objects.cpp1
-rw-r--r--engines/teenagent/objects.h1
-rw-r--r--engines/teenagent/pack.cpp1
-rw-r--r--engines/teenagent/pack.h1
-rw-r--r--engines/teenagent/resources.cpp6
-rw-r--r--engines/teenagent/resources.h3
-rw-r--r--engines/teenagent/scene.cpp13
-rw-r--r--engines/teenagent/scene.h1
-rw-r--r--engines/teenagent/segment.cpp1
-rw-r--r--engines/teenagent/segment.h1
-rw-r--r--engines/teenagent/surface.cpp1
-rw-r--r--engines/teenagent/surface.h1
-rw-r--r--engines/teenagent/surface_list.cpp1
-rw-r--r--engines/teenagent/surface_list.h1
-rw-r--r--engines/teenagent/teenagent.cpp3
-rw-r--r--engines/teenagent/teenagent.h7
34 files changed, 97 insertions, 50 deletions
diff --git a/engines/teenagent/POTFILES b/engines/teenagent/POTFILES
new file mode 100644
index 0000000000..b8b832872e
--- /dev/null
+++ b/engines/teenagent/POTFILES
@@ -0,0 +1 @@
+engines/teenagent/resources.cpp
diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp
index d65a367309..5c796c13ab 100644
--- a/engines/teenagent/actor.cpp
+++ b/engines/teenagent/actor.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/actor.h"
@@ -133,10 +134,6 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
default:
return Common::Rect();
}
- if (s == NULL) {
- warning("no surface, skipping");
- return Common::Rect();
- }
Common::Rect dirty;
Common::Rect clip(0, 0, s->w, s->h);
diff --git a/engines/teenagent/actor.h b/engines/teenagent/actor.h
index 942397c636..33ed9e90d0 100644
--- a/engines/teenagent/actor.h
+++ b/engines/teenagent/actor.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/animation.h"
diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp
index effafcaac6..5708c101ec 100644
--- a/engines/teenagent/animation.cpp
+++ b/engines/teenagent/animation.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/teenagent.h"
diff --git a/engines/teenagent/animation.h b/engines/teenagent/animation.h
index 9be21a4c3d..44b1312554 100644
--- a/engines/teenagent/animation.h
+++ b/engines/teenagent/animation.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_ANIMATION_H
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index 2de81abb37..74d3d7d56d 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/teenagent.h"
@@ -294,7 +295,7 @@ bool TeenAgentEngine::fnRobotSafeAlreadyUnlockedCheck() {
}
void TeenAgentEngine::fnRobotSafeUnlockCheck() {
- if (CHECK_FLAG(dsAddr_MansionRobotSafeVoiceTestPassedFlag, 1) &&
+ if (CHECK_FLAG(dsAddr_MansionRobotSafeVoiceTestPassedFlag, 1) &&
CHECK_FLAG(dsAddr_MansionRobotSafeScentTestPassedFlag, 1) &&
CHECK_FLAG(dsAddr_MansionRobotSafeViewTestPassedFlag, 1)) {
waitLanAnimationFrame(1, 1);
@@ -546,7 +547,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x4056:
- // FIXME - This is the bird use callback in the first act at
+ // FIXME - This is the bird use callback in the first act at
// the mudpool. Current Code based on behaviour. Need to analyse cseg data.
dialog->popMark(scene, dsAddr_dialogStackMudpoolBird);
break;
@@ -1603,7 +1604,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x5b44:
- // FIXME - This is the doorbell use callback on House #2
+ // FIXME - This is the doorbell use callback on House #2
// i.e. Granny and Anne's House. Need to analyse cseg data properly.
// Current code inferred from behaviour.
// FIXME - Add animation call for Ego pushing doorbell.
@@ -1808,6 +1809,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
displayMessage(dsAddr_uninterestingHaystackMsg); // "I don't see anything interesting about this haystack"
break;
+ case 0x6663:
+ displayMessage(dsAddr_uninterestingHaystackMsg); // "I don't see anything interesting about this haystack"
+ break;
+
case 0x666a:
displayMessage(dsAddr_moreComplicatedMsg); // "It's more complicated than that"
break;
@@ -2382,6 +2387,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
fnEgoDefaultPosition();
break;
+ case 0x5634:
+ displayMessage(dsAddr_pullObjMsg2); // "I can't reach it"
+ break;
+
case 0x563b:
playSound(5, 10);
setOns(1, 0);
@@ -3322,6 +3331,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
fnMansionIntrusionAttempt();
break;
+ case 0x830b:
+ displayMessage(dsAddr_noChainsawFuelMsg); // "There's no fuel in the chainsaw"
+ break;
+
case 0x8312: // hedgehog + plastic apple
dialog->showMark(76, scene);
setLan(1, 0);
@@ -4611,7 +4624,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
SET_FLAG(dsAddr_mansionVCRPlayedTapeBeforeFlag, 1);
}
} else
- displayMessage(dsAddr_tvOffMsg); // "I just realised that the TV is off"
+ displayMessage(dsAddr_tvOffMsg); // "I just realized that the TV is off"
} else {
SET_FLAG(dsAddr_mansionVCRPlayingTapeFlag, 0);
if (CHECK_FLAG(dsAddr_mansionTVOnFlag, 1)) {
diff --git a/engines/teenagent/configure.engine b/engines/teenagent/configure.engine
new file mode 100644
index 0000000000..223a0e884c
--- /dev/null
+++ b/engines/teenagent/configure.engine
@@ -0,0 +1,3 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine teenagent "Teen Agent" yes
diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp
index 9ab6001d54..2304829782 100644
--- a/engines/teenagent/console.cpp
+++ b/engines/teenagent/console.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/console.h"
@@ -25,24 +26,24 @@
namespace TeenAgent {
Console::Console(TeenAgentEngine *engine) : _engine(engine) {
- DCmd_Register("enable_object", WRAP_METHOD(Console, enableObject));
- DCmd_Register("disable_object", WRAP_METHOD(Console, enableObject));
- DCmd_Register("set_ons", WRAP_METHOD(Console, setOns));
- DCmd_Register("set_music", WRAP_METHOD(Console, setMusic));
- DCmd_Register("animation", WRAP_METHOD(Console, playAnimation));
- DCmd_Register("actor_animation", WRAP_METHOD(Console, playActorAnimation));
- DCmd_Register("call", WRAP_METHOD(Console, call));
+ registerCmd("enable_object", WRAP_METHOD(Console, enableObject));
+ registerCmd("disable_object", WRAP_METHOD(Console, enableObject));
+ registerCmd("set_ons", WRAP_METHOD(Console, setOns));
+ registerCmd("set_music", WRAP_METHOD(Console, setMusic));
+ registerCmd("animation", WRAP_METHOD(Console, playAnimation));
+ registerCmd("actor_animation", WRAP_METHOD(Console, playActorAnimation));
+ registerCmd("call", WRAP_METHOD(Console, call));
}
bool Console::enableObject(int argc, const char **argv) {
if (argc < 2) {
- DebugPrintf("usage: %s object_id [scene_id]\n", argv[0]);
+ debugPrintf("usage: %s object_id [scene_id]\n", argv[0]);
return true;
}
int id = atoi(argv[1]);
if (id < 0) {
- DebugPrintf("object id %d is invalid\n", id);
+ debugPrintf("object id %d is invalid\n", id);
return true;
}
@@ -50,7 +51,7 @@ bool Console::enableObject(int argc, const char **argv) {
if (argc > 2) {
scene_id = atoi(argv[2]);
if (scene_id < 0) {
- DebugPrintf("scene id %d is invalid\n", scene_id);
+ debugPrintf("scene id %d is invalid\n", scene_id);
return true;
}
}
@@ -65,20 +66,20 @@ bool Console::enableObject(int argc, const char **argv) {
bool Console::setOns(int argc, const char **argv) {
if (argc < 3) {
- DebugPrintf("usage: %s index(0-3) value [scene_id]\n", argv[0]);
+ debugPrintf("usage: %s index(0-3) value [scene_id]\n", argv[0]);
return true;
}
int index = atoi(argv[1]);
if (index < 0 || index > 3) {
- DebugPrintf("index %d is invalid\n", index);
+ debugPrintf("index %d is invalid\n", index);
return true;
}
int value = 0;
value = atoi(argv[2]);
if (value < 0) {
- DebugPrintf("invalid value\n");
+ debugPrintf("invalid value\n");
return true;
}
@@ -86,7 +87,7 @@ bool Console::setOns(int argc, const char **argv) {
if (argc > 3) {
scene_id = atoi(argv[3]);
if (scene_id < 0) {
- DebugPrintf("scene id %d is invalid\n", scene_id);
+ debugPrintf("scene id %d is invalid\n", scene_id);
return true;
}
}
@@ -97,13 +98,13 @@ bool Console::setOns(int argc, const char **argv) {
bool Console::setMusic(int argc, const char **argv) {
if (argc < 2) {
- DebugPrintf("usage: %s index(1-11)\n", argv[0]);
+ debugPrintf("usage: %s index(1-11)\n", argv[0]);
return true;
}
int index = atoi(argv[1]);
if (index <= 0 || index > 11) {
- DebugPrintf("invalid value\n");
+ debugPrintf("invalid value\n");
return true;
}
@@ -113,14 +114,14 @@ bool Console::setMusic(int argc, const char **argv) {
bool Console::playAnimation(int argc, const char **argv) {
if (argc < 3) {
- DebugPrintf("usage: %s id slot(0-3)\n", argv[0]);
+ debugPrintf("usage: %s id slot(0-3)\n", argv[0]);
return true;
}
int id = atoi(argv[1]);
int slot = atoi(argv[2]);
if (id < 0 || slot < 0 || slot > 3) {
- DebugPrintf("invalid slot or animation id\n");
+ debugPrintf("invalid slot or animation id\n");
return true;
}
@@ -130,13 +131,13 @@ bool Console::playAnimation(int argc, const char **argv) {
bool Console::playActorAnimation(int argc, const char **argv) {
if (argc < 2) {
- DebugPrintf("usage: %s id\n", argv[0]);
+ debugPrintf("usage: %s id\n", argv[0]);
return true;
}
int id = atoi(argv[1]);
if (id < 0) {
- DebugPrintf("invalid animation id\n");
+ debugPrintf("invalid animation id\n");
return true;
}
@@ -146,18 +147,18 @@ bool Console::playActorAnimation(int argc, const char **argv) {
bool Console::call(int argc, const char **argv) {
if (argc < 2) {
- DebugPrintf("usage: %s 0xHEXADDR\n", argv[0]);
+ debugPrintf("usage: %s 0xHEXADDR\n", argv[0]);
return true;
}
uint addr;
if (sscanf(argv[1], "0x%x", &addr) != 1) {
- DebugPrintf("invalid address\n");
+ debugPrintf("invalid address\n");
return true;
}
if (!_engine->processCallback(addr))
- DebugPrintf("calling callback %04x failed\n", addr);
+ debugPrintf("calling callback %04x failed\n", addr);
return true;
}
diff --git a/engines/teenagent/console.h b/engines/teenagent/console.h
index 4dbdd3fc07..b569f98d8f 100644
--- a/engines/teenagent/console.h
+++ b/engines/teenagent/console.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_CONSOLE_H
diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index f9f5d2f13a..7a53faf98a 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "common/system.h"
@@ -184,7 +185,7 @@ public:
};
#if PLUGIN_ENABLED_DYNAMIC(TEENAGENT)
-REGISTER_PLUGIN_DYNAMIC(TEENAGENT, PLUGIN_TYPE_ENGINE, TeenAgentMetaEngine);
+ REGISTER_PLUGIN_DYNAMIC(TEENAGENT, PLUGIN_TYPE_ENGINE, TeenAgentMetaEngine);
#else
-REGISTER_PLUGIN_STATIC(TEENAGENT, PLUGIN_TYPE_ENGINE, TeenAgentMetaEngine);
+ REGISTER_PLUGIN_STATIC(TEENAGENT, PLUGIN_TYPE_ENGINE, TeenAgentMetaEngine);
#endif
diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp
index 870aca6400..0993c26961 100644
--- a/engines/teenagent/dialog.cpp
+++ b/engines/teenagent/dialog.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/dialog.h"
@@ -28,7 +29,7 @@ namespace TeenAgent {
void Dialog::show(uint16 dialogNum, Scene *scene, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
uint16 addr = _vm->res->getDialogAddr(dialogNum);
- // WORKAROUND: For Dialog 163, The usage of this in the engine overlaps the previous dialog i.e. the
+ // WORKAROUND: For Dialog 163, The usage of this in the engine overlaps the previous dialog i.e. the
// starting offset used is two bytes early, thus implicitly changing the first command of this dialog
// from NEW_LINE to CHANGE_CHARACTER.
// FIXME: Unsure if this is correct behaviour or if this is a regression from the original. Check this.
diff --git a/engines/teenagent/dialog.h b/engines/teenagent/dialog.h
index 6672ce7206..de67b999a2 100644
--- a/engines/teenagent/dialog.h
+++ b/engines/teenagent/dialog.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_DIALOG_H
diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp
index 47f52ff90f..ab75a45ba7 100644
--- a/engines/teenagent/font.cpp
+++ b/engines/teenagent/font.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/font.h"
@@ -65,7 +66,7 @@ uint Font::render(Graphics::Surface *surface, int x, int y, char c, byte color)
byte *glyph = _data + READ_LE_UINT16(_data + idx * 2);
int h = glyph[0], w = glyph[1];
- if (surface == NULL || surface->pixels == NULL || y + h <= 0 || y >= kScreenHeight || x + w <= 0 || x >= kScreenWidth)
+ if (surface == NULL || surface->getPixels() == NULL || y + h <= 0 || y >= kScreenHeight || x + w <= 0 || x >= kScreenWidth)
return w - _widthPack;
int i0 = 0, j0 = 0;
diff --git a/engines/teenagent/font.h b/engines/teenagent/font.h
index a61f145fa6..65931f2084 100644
--- a/engines/teenagent/font.h
+++ b/engines/teenagent/font.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_FONT_H
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index 354371666c..e8544446dc 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "common/memstream.h"
diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h
index d487848c2c..4a250987ba 100644
--- a/engines/teenagent/inventory.h
+++ b/engines/teenagent/inventory.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_INVENTORY_H
diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp
index b06a5f1f5e..5d66c3c90c 100644
--- a/engines/teenagent/music.cpp
+++ b/engines/teenagent/music.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/teenagent/music.h b/engines/teenagent/music.h
index 408436cf3a..e1630cc845 100644
--- a/engines/teenagent/music.h
+++ b/engines/teenagent/music.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp
index 5dad9ab99d..3197a715aa 100644
--- a/engines/teenagent/objects.cpp
+++ b/engines/teenagent/objects.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "common/debug.h"
diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h
index 6e7955766f..f923ae52ab 100644
--- a/engines/teenagent/objects.h
+++ b/engines/teenagent/objects.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
diff --git a/engines/teenagent/pack.cpp b/engines/teenagent/pack.cpp
index 2e6c913a72..cbf2bfd89e 100644
--- a/engines/teenagent/pack.cpp
+++ b/engines/teenagent/pack.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/pack.h"
diff --git a/engines/teenagent/pack.h b/engines/teenagent/pack.h
index 1d6c471554..3607bae91d 100644
--- a/engines/teenagent/pack.h
+++ b/engines/teenagent/pack.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp
index 442d0abf16..8d8f705a24 100644
--- a/engines/teenagent/resources.cpp
+++ b/engines/teenagent/resources.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/resources.h"
@@ -160,7 +161,7 @@ void Resources::loadOff(Graphics::Surface &surface, byte *palette, int id) {
off.read(id, buf, bufferSize);
byte *src = buf;
- byte *dst = (byte *)surface.pixels;
+ byte *dst = (byte *)surface.getPixels();
memcpy(dst, src, 64000);
memcpy(palette, buf + 64000, 768);
@@ -206,16 +207,19 @@ Common::SeekableReadStream *Resources::loadLan000(uint32 id) const {
if (dseg.get_byte(dsAddr_birdOnBarRadioAntennaFlag) == 1) {
return lan500.getStream(380);
}
+ break;
case 30:
if (dseg.get_byte(dsAddr_birdOnBarRadioAntennaFlag) == 1) {
return lan500.getStream(381);
}
+ break;
case 42:
if (dseg.get_byte(dsAddr_johnNotyOutsideMansionDoorFlag) == 1) {
return lan500.getStream(400);
}
+ break;
}
return lan000.getStream(id);
}
diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h
index 7aae2f9ec8..2cdc070a87 100644
--- a/engines/teenagent/resources.h
+++ b/engines/teenagent/resources.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_RESOURCES_H
@@ -494,7 +495,7 @@ const uint16 dsAddr_noDepraveMsg = 0x4d02; // "Nah, I don't want to deprave the
// No Read Again Message : 0x4d2a to 0x4d5a
const uint16 dsAddr_noReadAgainMsg = 0x4d2a; // "I don't want to read it again. I might like it."
// TV Off Message : 0x4d5b to 0x4d7f
-const uint16 dsAddr_tvOffMsg = 0x4d5b; // "I just realised that the TV is off"
+const uint16 dsAddr_tvOffMsg = 0x4d5b; // "I just realized that the TV is off"
// Not Happen Message : 0x4d80 to 0x4d92
const uint16 dsAddr_NotHappenMsg = 0x4d80; // "Nothing happened"
// Tape Started Message : 0x4d93 to 0x4da5
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index bdeb11a841..6e1cef31bc 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "common/config-manager.h"
@@ -48,7 +49,6 @@ Scene::Scene(TeenAgentEngine *vm) : _vm(vm), intro(false), _id(0), ons(0),
onEnabled = true;
memset(palette, 0, sizeof(palette));
- background.pixels = 0;
FilePack varia;
varia.open("varia.res");
@@ -74,8 +74,7 @@ Scene::Scene(TeenAgentEngine *vm) : _vm(vm), intro(false), _id(0), ons(0),
}
Scene::~Scene() {
- if (background.pixels)
- background.free();
+ background.free();
delete[] ons;
ons = 0;
@@ -372,7 +371,7 @@ void Scene::init(int id, const Common::Point &pos) {
for (byte i = 0; i < 4; ++i)
customAnimation[i].free();
- if (background.pixels == NULL)
+ if (background.getPixels() == NULL)
background.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
warp(pos);
@@ -416,7 +415,7 @@ void Scene::init(int id, const Common::Point &pos) {
if (nowPlaying != _vm->res->dseg.get_byte(dsAddr_currentMusic))
_vm->music->load(_vm->res->dseg.get_byte(dsAddr_currentMusic));
- _vm->_system->copyRectToScreen(background.pixels, background.pitch, 0, 0, background.w, background.h);
+ _vm->_system->copyRectToScreen(background.getPixels(), background.pitch, 0, 0, background.w, background.h);
setPalette(0);
}
@@ -642,8 +641,8 @@ bool Scene::render(bool tickGame, bool tickMark, uint32 messageDelta) {
return true;
}
- if (background.pixels && debugFeatures.feature[DebugFeatures::kShowBack]) {
- _vm->_system->copyRectToScreen(background.pixels, background.pitch, 0, 0, background.w, background.h);
+ if (background.getPixels() && debugFeatures.feature[DebugFeatures::kShowBack]) {
+ _vm->_system->copyRectToScreen(background.getPixels(), background.pitch, 0, 0, background.w, background.h);
} else
_vm->_system->fillScreen(0);
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 14aefa0cca..07b304ed97 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_SCENE_H
diff --git a/engines/teenagent/segment.cpp b/engines/teenagent/segment.cpp
index cb17190da7..0e7659d680 100644
--- a/engines/teenagent/segment.cpp
+++ b/engines/teenagent/segment.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/segment.h"
diff --git a/engines/teenagent/segment.h b/engines/teenagent/segment.h
index 286337d120..14ccb24894 100644
--- a/engines/teenagent/segment.h
+++ b/engines/teenagent/segment.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_SEGMENT_H
diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp
index 4db25bc749..748874a4c5 100644
--- a/engines/teenagent/surface.cpp
+++ b/engines/teenagent/surface.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/surface.h"
diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h
index 3e591ed3e0..35850cf3aa 100644
--- a/engines/teenagent/surface.h
+++ b/engines/teenagent/surface.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_SURFACE_H
diff --git a/engines/teenagent/surface_list.cpp b/engines/teenagent/surface_list.cpp
index e293ce6470..444d927294 100644
--- a/engines/teenagent/surface_list.cpp
+++ b/engines/teenagent/surface_list.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "teenagent/surface_list.h"
diff --git a/engines/teenagent/surface_list.h b/engines/teenagent/surface_list.h
index 73a41fb5f8..2cca7849df 100644
--- a/engines/teenagent/surface_list.h
+++ b/engines/teenagent/surface_list.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_SURFACE_LIST_H__
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 0b48a18b26..d5a8b8e2dc 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#include "common/config-manager.h"
@@ -399,7 +400,7 @@ bool TeenAgentEngine::showLogo() {
return true;
}
- _system->copyRectToScreen(s.pixels, s.w, s.x, s.y, s.w, s.h);
+ _system->copyRectToScreen(s.getPixels(), s.w, s.x, s.y, s.w, s.h);
_system->updateScreen();
_system->delayMillis(100);
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index d6a2c0d3c6..a06f8dbf9b 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
*/
#ifndef TEENAGENT_ENGINE_H
@@ -31,6 +32,9 @@
#include "common/rect.h"
#include "common/array.h"
+#include "gui/debugger.h"
+
+#include "teenagent/console.h"
#include "teenagent/dialog.h"
struct ADGameDescription;
@@ -50,7 +54,6 @@ struct UseHotspot;
class Scene;
class MusicPlayer;
class Dialog;
-class Console;
class Resources;
class Inventory;
@@ -84,6 +87,8 @@ public:
virtual bool canSaveGameStateCurrently() { return !_sceneBusy; }
virtual bool hasFeature(EngineFeature f) const;
+ GUI::Debugger *getDebugger() { return console; }
+
void init();
enum Action { kActionNone, kActionExamine, kActionUse };