[Scummvm-cvs-logs] SF.net SVN: scummvm:[43270] scummvm/trunk

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue Aug 11 16:42:44 CEST 2009


Revision: 43270
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43270&view=rev
Author:   Kirben
Date:     2009-08-11 14:42:44 +0000 (Tue, 11 Aug 2009)

Log Message:
-----------
Add option to disable later games (Feeble Files, Puzzle Pack) in AGOS game engine, which require higher resolution.

Modified Paths:
--------------
    scummvm/trunk/configure
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/animation.cpp
    scummvm/trunk/engines/agos/animation.h
    scummvm/trunk/engines/agos/charset.cpp
    scummvm/trunk/engines/agos/cursor.cpp
    scummvm/trunk/engines/agos/debug.cpp
    scummvm/trunk/engines/agos/detection.cpp
    scummvm/trunk/engines/agos/detection_tables.h
    scummvm/trunk/engines/agos/draw.cpp
    scummvm/trunk/engines/agos/event.cpp
    scummvm/trunk/engines/agos/gfx.cpp
    scummvm/trunk/engines/agos/icons.cpp
    scummvm/trunk/engines/agos/module.mk
    scummvm/trunk/engines/agos/res.cpp
    scummvm/trunk/engines/agos/rooms.cpp
    scummvm/trunk/engines/agos/saveload.cpp
    scummvm/trunk/engines/agos/string.cpp
    scummvm/trunk/engines/agos/subroutine.cpp
    scummvm/trunk/engines/agos/verb.cpp
    scummvm/trunk/engines/agos/vga.cpp
    scummvm/trunk/engines/agos/vga_e2.cpp
    scummvm/trunk/engines/agos/vga_ff.cpp
    scummvm/trunk/engines/agos/vga_s1.cpp
    scummvm/trunk/engines/agos/window.cpp
    scummvm/trunk/engines/engines.mk

Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/configure	2009-08-11 14:42:44 UTC (rev 43270)
@@ -70,8 +70,9 @@
 add_engine scumm_7_8 "v7 & v8 games" yes
 add_engine he "HE71+ games" yes
 add_engine agi "AGI" yes
-add_engine agos "AGOS" yes "pn"
+add_engine agos "AGOS" yes "pn agos2"
 add_engine pn "Personal Nightmare" no
+add_engine agos2 "AGOS 2 games" yes
 add_engine cine "Cinematique evo 1" yes
 add_engine cruise "Cinematique evo 2" yes
 add_engine drascula "Drascula: The Vampire Strikes Back" yes

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/agos.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -59,6 +59,7 @@
 	"MUSIC",                               // speech_filename
 };
 
+#ifdef ENABLE_AGOS2
 AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
 	: AGOSEngine_Feeble(system) {
 
@@ -72,6 +73,7 @@
 	_startSecondCount = 0;
 	_tSecondCount = 0;
 }
+#endif
 
 AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system)
 	: AGOSEngine_Simon1(system) {
@@ -696,6 +698,7 @@
 	 3, 2, 14, 129,
 };
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_PuzzlePack::setupGame() {
 	gss = &puzzlepack_settings;
 	_numVideoOpcodes = 85;
@@ -712,6 +715,7 @@
 
 	AGOSEngine::setupGame();
 }
+#endif
 
 void AGOSEngine_Simon2::setupGame() {
 	gss = &simon2_settings;

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/agos.h	2009-08-11 14:42:44 UTC (rev 43270)
@@ -34,14 +34,13 @@
 #include "common/stack.h"
 #include "common/util.h"
 
+#ifdef ENABLE_AGOS2
 #include "agos/animation.h"
+#endif
 #include "agos/midi.h"
 #include "agos/sound.h"
 #include "agos/vga.h"
 
-// TODO: Replace with more portable code
-#include <setjmp.h>
-
 namespace AGOS {
 
 uint fileReadItemID(Common::SeekableReadStream *in);
@@ -892,6 +891,7 @@
 	void vc19_loop();
 	void vc20_setRepeat();
 	void vc21_endRepeat();
+	virtual void vc22_setPalette();
 	void vc23_setPriority();
 	void vc24_setSpriteXY();
 	void vc25_halt_sprite();
@@ -904,7 +904,7 @@
 	void vc33_setMouseOn();
 	void vc34_setMouseOff();
 	void vc35_clearWindow();
-	void vc36_setWindowImage();
+	virtual void vc36_setWindowImage();
 	void vc38_ifVarNotZero();
 	void vc39_setVar();
 	void vc40_scrollRight();
@@ -924,7 +924,6 @@
 
 	// Video Script Opcodes, Elvira 1
 	void vc17_waitEnd();
-	void vc22_setPaletteOld();
 	void vc32_saveScreen();
 	void vc37_pokePalette();
 
@@ -962,10 +961,9 @@
 	void vc45_setSpriteX();
 	void vc46_setSpriteY();
 	void vc47_addToVar();
-	void vc48_setPathFinder();
+	virtual void vc48_setPathFinder();
 	void vc59_ifSpeech();
 	void vc61_setMaskImage();
-	void vc22_setPaletteNew();
 
 	// Video Script Opcodes, Simon 2
 	void vc56_delayLong();
@@ -1771,6 +1769,8 @@
 
 	virtual void executeOpcode(int opcode);
 
+	virtual void vc22_setPalette();
+
 	// Opcodes, Simon 1
 	void os1_animate();
 	void os1_pauseGame();
@@ -1875,6 +1875,7 @@
 	virtual char *genSaveName(int slot);
 };
 
+#ifdef ENABLE_AGOS2
 class AGOSEngine_Feeble : public AGOSEngine_Simon2 {
 public:
 	AGOSEngine_Feeble(OSystem *system);
@@ -1886,6 +1887,9 @@
 
 	virtual void executeOpcode(int opcode);
 
+	virtual void vc36_setWindowImage();
+	virtual void vc48_setPathFinder();
+
 	void off_chance();
 	void off_jumpOut();
 	void off_addTextBox();
@@ -2092,6 +2096,7 @@
 
 	virtual char *genSaveName(int slot);
 };
+#endif
 
 } // End of namespace AGOS
 

Modified: scummvm/trunk/engines/agos/animation.cpp
===================================================================
--- scummvm/trunk/engines/agos/animation.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/animation.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -27,6 +27,7 @@
 
 #include "common/endian.h"
 #include "common/events.h"
+#include "common/file.h"
 #include "common/system.h"
 
 #include "graphics/cursorman.h"

Modified: scummvm/trunk/engines/agos/animation.h
===================================================================
--- scummvm/trunk/engines/agos/animation.h	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/animation.h	2009-08-11 14:42:44 UTC (rev 43270)
@@ -26,9 +26,6 @@
 #ifndef AGOS_ANIMATION_H
 #define AGOS_ANIMATION_H
 
-#include "common/file.h"
-#include "common/stream.h"
-
 #include "graphics/video/dxa_decoder.h"
 #include "graphics/video/smk_decoder.h"
 #include "sound/mixer.h"

Modified: scummvm/trunk/engines/agos/charset.cpp
===================================================================
--- scummvm/trunk/engines/agos/charset.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/charset.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -34,6 +34,7 @@
 
 namespace AGOS {
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::doOutput(const byte *src, uint len) {
 	if (_textWindow == NULL)
 		return;
@@ -64,6 +65,7 @@
 		}
 	}
 }
+#endif
 
 void AGOSEngine::doOutput(const byte *src, uint len) {
 	uint idx;
@@ -573,6 +575,7 @@
 	}
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::windowNewLine(WindowBlock *window) {
 	if (_noOracleScroll == 0) {
 		if (window->height < window->textRow + 30) {
@@ -603,6 +606,7 @@
 	window->textColumnOffset = 0;
 	window->textLength = 0;
 }
+#endif
 
 void AGOSEngine::windowNewLine(WindowBlock *window) {
 	window->textColumn = 0;

Modified: scummvm/trunk/engines/agos/cursor.cpp
===================================================================
--- scummvm/trunk/engines/agos/cursor.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/cursor.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -348,6 +348,7 @@
 	0,0,10,7,10,6,10,5,10,4,10,3,10,4,10,5,10,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 };
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_PuzzlePack::handleMouseMoved() {
 	uint x;
 
@@ -379,6 +380,7 @@
 
 	drawMousePointer();
 }
+#endif
 
 void AGOSEngine_Simon1::handleMouseMoved() {
 	uint x;
@@ -638,6 +640,7 @@
 	_videoLockOut &= ~1;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_PuzzlePack::initMouse() {
 	if (getGameId() == GID_DIMP) {
 		AGOSEngine_Simon1::initMouse();
@@ -652,48 +655,12 @@
 	// TODO: Add larger cursor
 	AGOSEngine_Simon1::initMouse();
 }
-
-static const byte mouseCursorPalette[] = {
-	0x00, 0x00, 0x00, 0x00, // Black
-	0xFF, 0xFF, 0xFF, 0x00, // White
-};
-
 void AGOSEngine_Feeble::initMouse() {
 	_maxCursorWidth = 40;
 	_maxCursorHeight = 40;
 	_mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1);
 }
 
-void AGOSEngine_Simon1::initMouse() {
-	AGOSEngine::initMouse();
-
-	const uint16 *src = _common_mouseInfo;
-	for (int i = 0; i < 16; i++) {
-		for (int j = 0; j < 16; j++) {
-			if (src[0] & (1 << (15 - (j % 16)))) {
-				if (src[1] & (1 << (15 - (j % 16)))) {
-					_mouseData[16 * i + j] = 1;
-				} else {
-					_mouseData[16 * i + j] = 0;
-				}
-			}
-		}
-		src += 2;
-	}
-
-	CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
-}
-
-void AGOSEngine::initMouse() {
-	_maxCursorWidth = 16;
-	_maxCursorHeight = 16;
-	_mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1);
-
-	memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight);
-
-	CursorMan.replaceCursorPalette(mouseCursorPalette, 0, ARRAYSIZE(mouseCursorPalette) / 4);
-}
-
 void AGOSEngine_PuzzlePack::loadMouseImage() {
 	loadZone(_variableArray[500]);
 	VgaPointersEntry *vpe = &_vgaBufferPointers[_variableArray[500]];
@@ -793,7 +760,43 @@
 		CursorMan.replaceCursor(_mouseData, _maxCursorWidth, _maxCursorHeight, hotspotX, hotspotY, 0);
 	}
 }
+#endif
 
+void AGOSEngine_Simon1::initMouse() {
+	AGOSEngine::initMouse();
+
+	const uint16 *src = _common_mouseInfo;
+	for (int i = 0; i < 16; i++) {
+		for (int j = 0; j < 16; j++) {
+			if (src[0] & (1 << (15 - (j % 16)))) {
+				if (src[1] & (1 << (15 - (j % 16)))) {
+					_mouseData[16 * i + j] = 1;
+				} else {
+					_mouseData[16 * i + j] = 0;
+				}
+			}
+		}
+		src += 2;
+	}
+
+	CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
+}
+
+static const byte mouseCursorPalette[] = {
+	0x00, 0x00, 0x00, 0x00, // Black
+	0xFF, 0xFF, 0xFF, 0x00, // White
+};
+
+void AGOSEngine::initMouse() {
+	_maxCursorWidth = 16;
+	_maxCursorHeight = 16;
+	_mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1);
+
+	memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight);
+
+	CursorMan.replaceCursorPalette(mouseCursorPalette, 0, ARRAYSIZE(mouseCursorPalette) / 4);
+}
+
 void AGOSEngine::drawMousePointer() {
 	if (getGameType() == GType_SIMON2) {
 		CursorMan.replaceCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);

Modified: scummvm/trunk/engines/agos/debug.cpp
===================================================================
--- scummvm/trunk/engines/agos/debug.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/debug.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -26,6 +26,8 @@
 // AGOS debug functions
 
 
+#include "common/file.h"
+
 #include "agos/debug.h"
 #include "agos/agos.h"
 #include "agos/intern.h"
@@ -323,6 +325,7 @@
 	}
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::dumpVgaFile(const byte *vga) {
 	const byte *pp;
 	const byte *p;
@@ -352,6 +355,7 @@
 		p += sizeof(ImageHeader_Feeble);
 	}
 }
+#endif
 
 void AGOSEngine_Simon1::dumpVgaFile(const byte *vga) {
 	const byte *pp;

Modified: scummvm/trunk/engines/agos/detection.cpp
===================================================================
--- scummvm/trunk/engines/agos/detection.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/detection.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -66,17 +66,21 @@
 };
 
 static const PlainGameDescriptor simonGames[] = {
+#ifdef ENABLE_PN
 	{"pn", "Personal Nightmare"},
+#endif
 	{"elvira1", "Elvira - Mistress of the Dark"},
 	{"elvira2", "Elvira II - The Jaws of Cerberus"},
 	{"waxworks", "Waxworks"},
 	{"simon1", "Simon the Sorcerer 1"},
 	{"simon2", "Simon the Sorcerer 2"},
+#ifdef ENABLE_AGOS2
 	{"feeble", "The Feeble Files"},
 	{"dimp", "Demon in my Pocket"},
 	{"jumble", "Jumble"},
 	{"puzzle", "NoPatience"},
 	{"swampy", "Swampy Adventures"},
+#endif
 	{0, 0}
 };
 
@@ -158,6 +162,7 @@
 	case AGOS::GType_SIMON2:
 		*engine = new AGOS::AGOSEngine_Simon2(syst);
 		break;
+#ifdef ENABLE_AGOS2
 	case AGOS::GType_FF:
 		if (gd->features & GF_DEMO)
 			*engine = new AGOS::AGOSEngine_FeebleDemo(syst);
@@ -167,6 +172,7 @@
 	case AGOS::GType_PP:
 		*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
 		break;
+#endif
 	default:
 		res = false;
 		error("AGOS engine: unknown gameType");

Modified: scummvm/trunk/engines/agos/detection_tables.h
===================================================================
--- scummvm/trunk/engines/agos/detection_tables.h	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/detection_tables.h	2009-08-11 14:42:44 UTC (rev 43270)
@@ -32,6 +32,7 @@
 using Common::GUIO_NOSUBTITLES;
 
 static const AGOSGameDescription gameDescriptions[] = {
+#ifdef ENABLE_PN
 	// Personal Nightmare 1.1 - English Amiga
 	{
 		{
@@ -123,6 +124,7 @@
 		GID_PN,
 		GF_OLD_BUNDLE | GF_CRUNCHED | GF_EGA | GF_PLANAR
 	},
+#endif
 
 	// Elvira 1 - English Amiga Floppy Demo
 	{
@@ -2335,6 +2337,7 @@
 		GF_TALKIE
 	},
 
+#ifdef ENABLE_AGOS2
 	// The Feeble Files - English DOS Demo
 	{
 		{
@@ -2807,6 +2810,7 @@
 		GID_SWAMPY,
 		GF_OLD_BUNDLE | GF_TALKIE
 	},
+#endif
 	{ AD_TABLE_END_MARKER, 0, 0, 0 }
 };
 

Modified: scummvm/trunk/engines/agos/draw.cpp
===================================================================
--- scummvm/trunk/engines/agos/draw.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/draw.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -46,6 +46,7 @@
 	return (byte *)_scaleBuf->pixels;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::animateSpritesByY() {
 	VgaSprite *vsp;
 	VgaPointersEntry *vpe;
@@ -147,6 +148,7 @@
 
 	_displayScreen = true;
 }
+#endif
 
 void AGOSEngine::animateSprites() {
 	VgaSprite *vsp;

Modified: scummvm/trunk/engines/agos/event.cpp
===================================================================
--- scummvm/trunk/engines/agos/event.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/event.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -552,6 +552,7 @@
 	} while (cur < start + amount && !shouldQuit());
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_PuzzlePack::timerProc() {
 	_lastTickCount = _system->getMillis();
 
@@ -609,6 +610,7 @@
 
 	_videoLockOut &= ~2;
 }
+#endif
 
 #ifdef ENABLE_PN
 void AGOSEngine_PN::timerProc() {
@@ -677,6 +679,7 @@
 	_videoLockOut &= ~2;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_PuzzlePack::dimpIdle() {
 	int z, n;
 
@@ -758,5 +761,6 @@
 		}
 	}
 }
+#endif
 
 } // End of namespace AGOS

Modified: scummvm/trunk/engines/agos/gfx.cpp
===================================================================
--- scummvm/trunk/engines/agos/gfx.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/gfx.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -226,6 +226,7 @@
 	return (state->draw_width != 0 && state->draw_height != 0);
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY) {
 	Common::Rect srcRect, dstRect;
 	float factor, xscale;
@@ -461,6 +462,7 @@
 		} while (--state->draw_height);
 	}
 }
+#endif
 
 void AGOSEngine_Simon1::drawMaskedImage(VC10_state *state) {
 	if (getGameType() == GType_SIMON1 && (_windowNum == 3 || _windowNum == 4 || _windowNum >= 10)) {

Modified: scummvm/trunk/engines/agos/icons.cpp
===================================================================
--- scummvm/trunk/engines/agos/icons.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/icons.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -374,6 +374,7 @@
 	_videoLockOut &= ~0x8000;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::drawIconArray(uint num, Item *itemRef, int line, int classMask) {
 	Item *item_ptr_org = itemRef;
 	WindowBlock *window;
@@ -477,6 +478,7 @@
 	window->iconPtr->upArrow = _scrollUpHitArea;
 	window->iconPtr->downArrow = _scrollDownHitArea;
 }
+#endif
 
 void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask) {
 	Item *item_ptr_org = itemRef;
@@ -581,6 +583,7 @@
 	}
 }
 
+#ifdef ENABLE_AGOS2
 uint AGOSEngine_Feeble::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *itemPtr) {
 	HitArea *ha = findEmptyHitArea();
 
@@ -596,6 +599,7 @@
 
 	return ha - _hitAreas;
 }
+#endif
 
 uint AGOSEngine_Simon2::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *itemPtr) {
 	HitArea *ha = findEmptyHitArea();
@@ -683,6 +687,7 @@
 	return ha - _hitAreas;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::addArrows(WindowBlock *window, uint8 num) {
 	HitArea *ha;
 
@@ -712,6 +717,7 @@
 	ha->window = window;
 	ha->verb = 1;
 }
+#endif
 
 void AGOSEngine_Simon2::addArrows(WindowBlock *window, uint8 num) {
 	HitArea *ha;

Modified: scummvm/trunk/engines/agos/module.mk
===================================================================
--- scummvm/trunk/engines/agos/module.mk	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/module.mk	2009-08-11 14:42:44 UTC (rev 43270)
@@ -2,7 +2,6 @@
 
 MODULE_OBJS := \
 	agos.o \
-	animation.o \
 	charset.o \
 	charset-fontdata.o \
 	contain.o \
@@ -12,7 +11,6 @@
 	detection.o \
 	draw.o \
 	event.o \
-	feeble.o \
 	gfx.o \
 	icons.o \
 	input.o \
@@ -20,8 +18,6 @@
 	menus.o \
 	midi.o \
 	midiparser_s1d.o \
-	oracle.o \
-	pn.o \
 	res.o \
 	res_ami.o \
 	res_snd.o \
@@ -30,26 +26,38 @@
 	script.o \
 	script_e1.o \
 	script_e2.o \
-	script_pn.o \
 	script_ww.o \
 	script_s1.o \
 	script_s2.o \
-	script_ff.o \
-	script_pp.o \
 	sound.o \
 	string.o \
 	subroutine.o \
 	verb.o \
 	vga.o \
 	vga_e2.o \
-	vga_pn.o \
 	vga_ww.o \
 	vga_s1.o \
 	vga_s2.o \
-	vga_ff.o \
 	window.o \
 	zones.o
 
+ifdef ENABLE_PN
+MODULE_OBJS += \
+	pn.o \
+	script_pn.o \
+	vga_pn.o
+endif
+
+ifdef ENABLE_AGOS2
+MODULE_OBJS += \
+	animation.o \
+	feeble.o \
+	oracle.o \
+	script_ff.o \
+	script_pp.o \
+	vga_ff.o
+endif
+
 # This module can be built as a plugin
 ifeq ($(ENABLE_AGOS), DYNAMIC_PLUGIN)
 PLUGIN := 1

Modified: scummvm/trunk/engines/agos/res.cpp
===================================================================
--- scummvm/trunk/engines/agos/res.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/res.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -39,26 +39,28 @@
 
 namespace AGOS {
 
+#ifdef ENABLE_AGOS2
 uint16 AGOSEngine_Feeble::to16Wrapper(uint value) {
 	return TO_LE_16(value);
 }
 
+uint16 AGOSEngine_Feeble::readUint16Wrapper(const void *src) {
+	return READ_LE_UINT16(src);
+}
+
+uint32 AGOSEngine_Feeble::readUint32Wrapper(const void *src) {
+	return READ_LE_UINT32(src);
+}
+#endif
+
 uint16 AGOSEngine::to16Wrapper(uint value) {
 	return TO_BE_16(value);
 }
 
-uint16 AGOSEngine_Feeble::readUint16Wrapper(const void *src) {
-	return READ_LE_UINT16(src);
-}
-
 uint16 AGOSEngine::readUint16Wrapper(const void *src) {
 	return READ_BE_UINT16(src);
 }
 
-uint32 AGOSEngine_Feeble::readUint32Wrapper(const void *src) {
-	return READ_LE_UINT32(src);
-}
-
 uint32 AGOSEngine::readUint32Wrapper(const void *src) {
 	return READ_BE_UINT32(src);
 }

Modified: scummvm/trunk/engines/agos/rooms.cpp
===================================================================
--- scummvm/trunk/engines/agos/rooms.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/rooms.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -25,6 +25,8 @@
 
 
 
+#include "common/file.h"
+
 #include "agos/agos.h"
 #include "agos/intern.h"
 

Modified: scummvm/trunk/engines/agos/saveload.cpp
===================================================================
--- scummvm/trunk/engines/agos/saveload.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/saveload.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -23,6 +23,7 @@
  *
  */
 
+#include "common/file.h"
 #include "common/savefile.h"
 #include "common/system.h"
 
@@ -72,6 +73,7 @@
 	return i;
 }
 
+#ifdef ENABLE_AGOS2
 char *AGOSEngine_PuzzlePack::genSaveName(int slot) {
 	static char buf[20];
 
@@ -88,6 +90,7 @@
 	sprintf(buf, "feeble.%.3d", slot);
 	return buf;
 }
+#endif
 
 char *AGOSEngine_Simon2::genSaveName(int slot) {
 	static char buf[20];

Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/string.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -25,6 +25,8 @@
 
 
 
+#include "common/file.h"
+
 #include "agos/agos.h"
 #include "agos/intern.h"
 
@@ -560,6 +562,7 @@
 	}
 }
 
+#ifdef ENABLE_AGOS2
 // The Feeble Files specific
 void AGOSEngine_Feeble::printScreenText(uint vgaSpriteId, uint color, const char *string, int16 x, int16 y, int16 width) {
 	char convertedString[320];
@@ -693,6 +696,7 @@
 
 	printInteractText(num, string);
 }
+#endif
 
 // Waxworks specific
 uint16 AGOSEngine_Waxworks::getBoxSize() {

Modified: scummvm/trunk/engines/agos/subroutine.cpp
===================================================================
--- scummvm/trunk/engines/agos/subroutine.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/subroutine.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -25,6 +25,8 @@
 
 
 
+#include "common/file.h"
+
 #include "agos/agos.h"
 #include "agos/intern.h"
 

Modified: scummvm/trunk/engines/agos/verb.cpp
===================================================================
--- scummvm/trunk/engines/agos/verb.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/verb.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -203,6 +203,7 @@
 	"", "", "", "komu ?"
 };
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::clearName() {
 	stopAnimateSimon2(2, 6);
 	_lastNameOn = NULL;
@@ -210,6 +211,7 @@
 	_mouseAnim = 1;
 	return;
 }
+#endif
 
 void AGOSEngine_Simon2::clearName() {
 	if (getBitFlag(79)) {
@@ -530,6 +532,7 @@
 	_needHitAreaRecalc++;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_PuzzlePack::resetVerbs() {
 	_verbHitArea = 300;
 }
@@ -559,6 +562,7 @@
 		setVerb(NULL);
 	}
 }
+#endif
 
 void AGOSEngine::resetVerbs() {
 	if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2)
@@ -590,6 +594,7 @@
 	}
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::setVerb(HitArea *ha) {
 	int cursor = _mouseCursor;
 	if (_noRightClick)
@@ -616,6 +621,7 @@
 	_needHitAreaRecalc++;
 	_verbHitArea = cursor + 300;
 }
+#endif
 
 void AGOSEngine::setVerb(HitArea *ha) {
 	HitArea *tmp = _currentVerbBox;
@@ -654,9 +660,11 @@
 	_currentVerbBox = ha;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::hitarea_leave(HitArea *ha, bool state) {
 	invertBox(ha, state);
 }
+#endif
 
 void AGOSEngine::hitarea_leave(HitArea *ha, bool state) {
 	if (getGameType() == GType_SIMON2) {
@@ -917,6 +925,7 @@
 		_lastNameOn = ha;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::invertBox(HitArea *ha, bool state) {
 	if (getBitFlag(205) || getBitFlag(206)) {
 		if (state != 0) {
@@ -959,6 +968,7 @@
 		}
 	}
 }
+#endif
 
 void AGOSEngine::invertBox(HitArea *ha, byte a, byte b, byte c, byte d) {
 	byte *src, color;

Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/vga.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -106,7 +106,7 @@
 	op[20] = &AGOSEngine::vc19_loop;
 	op[21] = &AGOSEngine::vc20_setRepeat;
 	op[22] = &AGOSEngine::vc21_endRepeat;
-	op[23] = &AGOSEngine::vc22_setPaletteOld;
+	op[23] = &AGOSEngine::vc22_setPalette;
 	op[24] = &AGOSEngine::vc23_setPriority;
 	op[25] = &AGOSEngine::vc24_setSpriteXY;
 	op[26] = &AGOSEngine::vc25_halt_sprite;
@@ -918,7 +918,7 @@
 	0x77, 0x55, 0x00,
 };
 
-void AGOSEngine::vc22_setPaletteOld() {
+void AGOSEngine::vc22_setPalette() {
 	byte *offs, *palptr, *src;
 	uint16 b, num;
 
@@ -1302,12 +1302,7 @@
 	_displayScreen = false;
 	uint16 vga_res = vcReadNextWord();
 	uint16 windowNum = vcReadNextWord();
-
-	if (getGameType() == GType_FF || getGameType() == GType_PP) {
-		fillBackGroundFromFront();
-	} else {
-		setWindowImage(windowNum, vga_res);
-	}
+	setWindowImage(windowNum, vga_res);
 }
 
 void AGOSEngine::vc37_pokePalette() {

Modified: scummvm/trunk/engines/agos/vga_e2.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga_e2.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/vga_e2.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -40,7 +40,7 @@
 
 	op[17] = &AGOSEngine::vc17_waitEnd;
 	op[19] = &AGOSEngine::vc19_loop;
-	op[22] = &AGOSEngine::vc22_setPaletteOld;
+	op[22] = &AGOSEngine::vc22_setPalette;
 	op[28] = &AGOSEngine::vc28_playSFX;
 	op[32] = &AGOSEngine::vc32_saveScreen;
 	op[37] = &AGOSEngine::vc37_pokePalette;

Modified: scummvm/trunk/engines/agos/vga_ff.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga_ff.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/vga_ff.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -68,6 +68,57 @@
 	}
 }
 
+void AGOSEngine_Feeble::vc36_setWindowImage() {
+	_displayScreen = false;
+	vcReadNextWord();
+	vcReadNextWord();
+	fillBackGroundFromFront();
+}
+
+void AGOSEngine_Feeble::vc48_setPathFinder() {
+	uint16 a = (uint16)_variableArrayPtr[12];
+	const uint16 *p = _pathFindArray[a - 1];
+
+	VgaSprite *vsp = findCurSprite();
+	int16 x, y, ydiff;
+	int16 x1, y1, x2, y2;
+	uint pos = 0;
+
+	x = vsp->x;
+	while (x >= (int16)readUint16Wrapper(p + 2)) {
+		p += 2;
+		pos++;
+	}
+
+	x1 = readUint16Wrapper(p);
+	y1 = readUint16Wrapper(p + 1);
+	x2 = readUint16Wrapper(p + 2);
+	y2 = readUint16Wrapper(p + 3);
+
+	if (x2 != 9999) {
+		ydiff = y2 - y1;
+		if (ydiff < 0) {
+			ydiff = -ydiff;
+			x = vsp->x & 7;
+			ydiff *= x;
+			ydiff /= 8;
+			ydiff = -ydiff;
+		} else {
+			x = vsp->x & 7;
+			ydiff *= x;
+			ydiff /= 8;
+		}
+		y1 += ydiff;
+	}
+
+	y = vsp->y;
+	vsp->y = y1;
+	checkScrollY(y1 - y, y1);
+
+	_variableArrayPtr[11] = x1;
+	_variableArrayPtr[13] = pos;
+}
+
 void AGOSEngine::vc75_setScale() {
 	_baseY = vcReadNextWord();
 	_scale = vcReadNextWord() / 1000000.0f;

Modified: scummvm/trunk/engines/agos/vga_s1.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga_s1.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/vga_s1.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -36,7 +36,7 @@
 
 	op[11] = &AGOSEngine::vc11_clearPathFinder;
 	op[17] = &AGOSEngine::vc17_setPathfinderItem;
-	op[22] = &AGOSEngine::vc22_setPaletteNew;
+	op[22] = &AGOSEngine::vc22_setPalette;
 	op[32] = &AGOSEngine::vc32_copyVar;
 	op[37] = &AGOSEngine::vc37_addToSpriteY;
 	op[48] = &AGOSEngine::vc48_setPathFinder;
@@ -96,7 +96,7 @@
 	0xFF, 0xFF, 0x77,
 };
 
-void AGOSEngine::vc22_setPaletteNew() {
+void AGOSEngine_Simon1::vc22_setPalette() {
 	byte *offs, *palptr = 0, *src;
 	uint16 a = 0, b, num, palSize = 0;
 
@@ -186,73 +186,32 @@
 	uint16 a = (uint16)_variableArrayPtr[12];
 	const uint16 *p = _pathFindArray[a - 1];
 
-	if (getGameType() == GType_FF || getGameType() == GType_PP) {
-		VgaSprite *vsp = findCurSprite();
-		int16 x, y, ydiff;
-		int16 x1, y1, x2, y2;
-		uint pos = 0;
+	uint b = (uint16)_variableArray[13];
+	p += b * 2 + 1;
+	int c = _variableArray[14];
 
-		x = vsp->x;
-		while (x >= (int16)readUint16Wrapper(p + 2)) {
-			p += 2;
-			pos++;
-		}
+	int step;
+	int y1, y2;
+	int16 *vp;
 
-		x1 = readUint16Wrapper(p);
-		y1 = readUint16Wrapper(p + 1);
-		x2 = readUint16Wrapper(p + 2);
-		y2 = readUint16Wrapper(p + 3);
+	step = 2;
+	if (c < 0) {
+		c = -c;
+		step = -2;
+	}
 
-		if (x2 != 9999) {
-			ydiff = y2 - y1;
-			if (ydiff < 0) {
-				ydiff = -ydiff;
-				x = vsp->x & 7;
-				ydiff *= x;
-				ydiff /= 8;
-				ydiff = -ydiff;
-			} else {
-				x = vsp->x & 7;
-				ydiff *= x;
-				ydiff /= 8;
-			}
-			y1 += ydiff;
-		}
+	vp = &_variableArray[20];
 
-		y = vsp->y;
-		vsp->y = y1;
-		checkScrollY(y1 - y, y1);
+	do {
+		y2 = readUint16Wrapper(p);
+		p += step;
+		y1 = readUint16Wrapper(p) - y2;
 
-		_variableArrayPtr[11] = x1;
-		_variableArrayPtr[13] = pos;
-	} else {
-		uint b = (uint16)_variableArray[13];
-		p += b * 2 + 1;
-		int c = _variableArray[14];
+		vp[0] = y1 / 2;
+		vp[1] = y1 - (y1 / 2);
 
-		int step;
-		int y1, y2;
-		int16 *vp;
-
-		step = 2;
-		if (c < 0) {
-			c = -c;
-			step = -2;
-		}
-
-		vp = &_variableArray[20];
-
-		do {
-			y2 = readUint16Wrapper(p);
-			p += step;
-			y1 = readUint16Wrapper(p) - y2;
-
-			vp[0] = y1 / 2;
-			vp[1] = y1 - (y1 / 2);
-
-			vp += 2;
-		} while (--c);
-	}
+		vp += 2;
+	} while (--c);
 }
 
 void AGOSEngine::vc59_ifSpeech() {

Modified: scummvm/trunk/engines/agos/window.cpp
===================================================================
--- scummvm/trunk/engines/agos/window.cpp	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/agos/window.cpp	2009-08-11 14:42:44 UTC (rev 43270)
@@ -122,6 +122,7 @@
 	window->scrollY = 0;
 }
 
+#ifdef ENABLE_AGOS2
 void AGOSEngine_Feeble::colorWindow(WindowBlock *window) {
 	byte *dst;
 	uint16 h, w;
@@ -140,6 +141,7 @@
 
 	_videoLockOut &= ~0x8000;
 }
+#endif
 
 void AGOSEngine::colorWindow(WindowBlock *window) {
 	uint16 y, h;

Modified: scummvm/trunk/engines/engines.mk
===================================================================
--- scummvm/trunk/engines/engines.mk	2009-08-11 14:34:33 UTC (rev 43269)
+++ scummvm/trunk/engines/engines.mk	2009-08-11 14:42:44 UTC (rev 43270)
@@ -24,7 +24,11 @@
 ifdef ENABLE_PN
 DEFINES += -DENABLE_PN
 endif
+
+ifdef ENABLE_AGOS2
+DEFINES += -DENABLE_AGOS2
 endif
+endif
 
 ifdef ENABLE_CINE
 DEFINES += -DENABLE_CINE=$(ENABLE_CINE)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list