[Scummvm-cvs-logs] SF.net SVN: scummvm: [29407] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Nov 4 11:45:11 CET 2007
Revision: 29407
http://scummvm.svn.sourceforge.net/scummvm/?rev=29407&view=rev
Author: peres001
Date: 2007-11-04 02:45:10 -0800 (Sun, 04 Nov 2007)
Log Message:
-----------
* Pushed specific code from base class down to Nippon Safes.
* Some refactoring of the main loop.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/parallaction.cpp
scummvm/trunk/engines/parallaction/parallaction.h
scummvm/trunk/engines/parallaction/parallaction_ns.cpp
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2007-11-04 09:10:53 UTC (rev 29406)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2007-11-04 10:45:10 UTC (rev 29407)
@@ -87,10 +87,7 @@
// private stuff
-static Job *_jDrawInventory = NULL;
-static Job *_jRunScripts = NULL;
-
Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) :
Engine(syst), _gameDescription(gameDesc), _char(this) {
@@ -275,28 +272,6 @@
void Parallaction::runGame() {
- addJob(kJobEraseAnimations, (void*)1, kPriority20);
- _jRunScripts = addJob(kJobRunScripts, 0, kPriority15);
- addJob(kJobDisplayAnimations, 0, kPriority3);
-
- _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
-
- if (_location._commands.size() > 0)
- runCommands(_location._commands);
-
- _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
-
- if (_location._comment)
- doLocationEnterTransition();
-
- if (_hasLocationSound)
- _soundMan->playSfx(_locationSound, 0, true);
-
- _vm->setArrowCursor();
-
- if (_location._aCommands.size() > 0)
- runCommands(_location._aCommands);
-
while ((_engineFlags & kEngineQuit) == 0) {
_keyDown = updateInput();
@@ -862,53 +837,10 @@
return;
}
-void Parallaction::switchBackground(const char* background, const char* mask) {
-// printf("switchBackground(%s)", name);
- Palette pal;
- uint16 v2 = 0;
- if (!scumm_stricmp(background, "final")) {
- _gfx->clearScreen(Gfx::kBitBack);
- for (uint16 _si = 0; _si < 32; _si++) {
- pal.setEntry(_si, v2, v2, v2);
- v2 += 4;
- }
- g_system->delayMillis(20);
- _gfx->setPalette(pal);
- _gfx->updateScreen();
- }
- setBackground(background, mask, mask);
-
- return;
-}
-
-
-void Parallaction::showSlide(const char *name) {
-
- BackgroundInfo info;
-
- _disk->loadSlide(info, name);
-
- // TODO: avoid using screen buffers for displaying slides. Using a generic buffer
- // allows for positioning of graphics as needed by Big Red Adventure.
- // The main problem lies with menu, which relies on multiple buffers, mainly because
- // it is crappy code.
- _gfx->setBackground(&info.bg);
- _gfx->setPalette(info.palette);
- _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
-
- info.bg.free();
- info.mask.free();
- info.path.free();
-
- return;
-}
-
-
-
// displays transition before a new location
//
// clears screen (in white??)
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2007-11-04 09:10:53 UTC (rev 29406)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2007-11-04 10:45:10 UTC (rev 29407)
@@ -427,7 +427,6 @@
void sortAnimations();
void freeAnimations();
- void showSlide(const char *name);
void setBackground(const char *background, const char *mask, const char *path);
void freeBackground();
@@ -528,6 +527,10 @@
Job *_jEraseLabel;
Zone *_hoverZone;
+ Job *_jDrawInventory;
+ Job *_jRunScripts;
+
+
protected: // members
bool detectGame(void);
@@ -544,7 +547,6 @@
virtual void changeCharacter(const char *name) = 0;
void allocateLocationSlot(const char *name);
void finalizeLocationParsing();
- void switchBackground(const char* background, const char* mask);
void freeLocation();
void showLocationComment(const char *text, bool end);
@@ -911,6 +913,9 @@
uint16 guiChooseLanguage();
uint16 guiSelectGame();
int guiGetSelectedBlock(const Common::Point &p);
+
+ void switchBackground(const char* background, const char* mask);
+ void showSlide(const char *name);
};
Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp 2007-11-04 09:10:53 UTC (rev 29406)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp 2007-11-04 10:45:10 UTC (rev 29407)
@@ -257,30 +257,62 @@
guiStart();
- _engineFlags &= ~kEngineChangeLocation;
+ changeLocation(_location._name);
- LocationName locname;
- locname.bind(_location._name);
+ addJob(kJobEraseAnimations, (void*)1, kPriority20);
+ _jRunScripts = addJob(kJobRunScripts, 0, kPriority15);
+ addJob(kJobDisplayAnimations, 0, kPriority3);
- changeCharacter(locname.character());
+ runGame();
- strcpy(_location._name, locname.location());
- strcpy(_saveData1, _location._name);
- parseLocation(_location._name);
+ return 0;
+}
- if (_location._startPosition.x != -1000) {
- _char._ani._left = _location._startPosition.x;
- _char._ani._top = _location._startPosition.y;
- _char._ani._frame = _location._startFrame;
- _location._startPosition.y = -1000;
- _location._startPosition.x = -1000;
- };
+void Parallaction_ns::switchBackground(const char* background, const char* mask) {
+// printf("switchBackground(%s)", name);
- runGame();
+ Palette pal;
- return 0;
+ uint16 v2 = 0;
+ if (!scumm_stricmp(background, "final")) {
+ _gfx->clearScreen(Gfx::kBitBack);
+ for (uint16 _si = 0; _si < 32; _si++) {
+ pal.setEntry(_si, v2, v2, v2);
+ v2 += 4;
+ }
+
+ g_system->delayMillis(20);
+ _gfx->setPalette(pal);
+ _gfx->updateScreen();
+ }
+
+ setBackground(background, mask, mask);
+
+ return;
}
+
+void Parallaction_ns::showSlide(const char *name) {
+
+ BackgroundInfo info;
+
+ _disk->loadSlide(info, name);
+
+ // TODO: avoid using screen buffers for displaying slides. Using a generic buffer
+ // allows for positioning of graphics as needed by Big Red Adventure.
+ // The main problem lies with menu, which relies on multiple buffers, mainly because
+ // it is crappy code.
+ _gfx->setBackground(&info.bg);
+ _gfx->setPalette(info.palette);
+ _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
+
+ info.bg.free();
+ info.mask.free();
+ info.path.free();
+
+ return;
+}
+
// changeLocation handles transitions between locations, and is able to display slides
// between one and the other.
//
@@ -441,6 +473,9 @@
};
_jobsFn = jobs;
+
+ _jDrawInventory = 0;
+ _jRunScripts = 0;
}
JobOpcode* Parallaction_ns::createJobOpcode(uint functionId, Job *job) {
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