[Scummvm-git-logs] scummvm master -> 47f5d4754222eec1f953055b399faaf6d2c0a403
a-yyg
76591232+a-yyg at users.noreply.github.com
Fri Jul 16 17:56:18 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5554a04475 SAGA2: Remove arrowptr.cpp
a613db2c9b SAGA2: Move mainDisplayList to SAGA2Engine
14e96f0b3d SAGA2: Fix global constructors in dispnode.cpp
47f5d47542 SAGA2: Fix global constructor warning on gtextbox.cpp
Commit: 5554a0447545eb1d9fb79e58f7f338220565cd09
https://github.com/scummvm/scummvm/commit/5554a0447545eb1d9fb79e58f7f338220565cd09
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-17T02:55:26+09:00
Commit Message:
SAGA2: Remove arrowptr.cpp
Changed paths:
R engines/saga2/arrowptr.cpp
engines/saga2/module.mk
diff --git a/engines/saga2/arrowptr.cpp b/engines/saga2/arrowptr.cpp
deleted file mode 100644
index 87d5dddf2a..0000000000
--- a/engines/saga2/arrowptr.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * 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.
- *
- *
- * Based on the original sources
- * Faery Tale II -- The Halls of the Dead
- * (c) 1993-1996 The Wyrmkeep Entertainment Co.
- */
-
-/* ===================================================================== *
- pointer.cpp -- Created from pointer1.bbm
- Image Size: 11 Wide by 17 High.
- Converted by iff2c.
- * ===================================================================== */
-
-#include "saga2/saga2.h"
-#include "saga2/gdraw.h"
-
-namespace Saga2 {
-
-static char arrowPtrData[] = {
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Row 0
- 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Row 1
- 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Row 2
- 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Row 3
- 0x01, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Row 4
- 0x01, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // Row 5
- 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, // Row 6
- 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, // Row 7
- 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, // Row 8
- 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, // Row 9
- 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, // Row 10
- 0x01, 0x02, 0x02, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, // Row 11
- 0x01, 0x02, 0x01, 0x00, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, // Row 12
- 0x01, 0x01, 0x00, 0x00, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, // Row 13
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, // Row 14
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, // Row 15
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, // Row 16
-};
-
-gStaticImage arrowPtr(11, 17, (uint8 *)arrowPtrData);
-
-} // end of namespace Saga2
diff --git a/engines/saga2/module.mk b/engines/saga2/module.mk
index 748ad9bdad..1e381ee1d8 100644
--- a/engines/saga2/module.mk
+++ b/engines/saga2/module.mk
@@ -2,7 +2,6 @@ MODULE := engines/saga2
MODULE_OBJS := \
actor.o \
- arrowptr.o \
assign.o \
audio.o \
automap.o \
Commit: a613db2c9bce4e3368843c2f2c3ff52e0b6550a7
https://github.com/scummvm/scummvm/commit/a613db2c9bce4e3368843c2f2c3ff52e0b6550a7
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-17T02:55:26+09:00
Commit Message:
SAGA2: Move mainDisplayList to SAGA2Engine
Changed paths:
engines/saga2/dispnode.cpp
engines/saga2/objects.cpp
engines/saga2/saga2.cpp
engines/saga2/saga2.h
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index 9cebdb4996..5551859dce 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -41,7 +41,6 @@ const int16 baseBubbleSpriteIndex = 111,
uint8 bubbleColorTable[] = { 1, 0, 0, 0 };
DisplayNode *DisplayNodeList::head;
-DisplayNodeList mainDisplayList;
SpellDisplayList activeSpells(maxActiveSpells);
@@ -95,7 +94,7 @@ uint8 identityColors[256] = {
// build the list of stuff to draw (like guns)
void buildDisplayList(void) {
- mainDisplayList.buildObjects(true);
+ g_vm->_mainDisplayList->buildObjects(true);
activeSpells.buildList();
}
@@ -103,7 +102,7 @@ void buildDisplayList(void) {
// Update all objects which have no motion task
void updateObjectAppearances(int32 deltaTime) {
- mainDisplayList.updateOStates(deltaTime);
+ g_vm->_mainDisplayList->updateOStates(deltaTime);
#ifdef WEWANTSPELLSTOSTOPINCOMBAT
if (!InCombatPauseKludge())
#endif
@@ -114,7 +113,7 @@ void updateObjectAppearances(int32 deltaTime) {
// Draw all sprites on the display list
void drawDisplayList(void) {
- mainDisplayList.draw();
+ g_vm->_mainDisplayList->draw();
}
void DisplayNodeList::init(uint16 s) {
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index dfe26f68cf..16638a03a9 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -137,7 +137,6 @@ extern StaticPoint16 fineScroll; // current scroll pos
extern hResContext *imageRes; // image resource handle
extern PlayerActor playerList[]; // Master list of all PlayerActors
extern SpellStuff spellBook[];
-extern DisplayNodeList mainDisplayList;
extern ObjectID pickedObject;
const uint32 imageGroupID = MKTAG('I', 'M', 'A', 'G');
@@ -3006,7 +3005,7 @@ void loadObjects(Common::InSaveFile *in) {
void cleanupObjects(void) {
if (objectList != nullptr)
delete[] objectList;
- mainDisplayList.reset();
+ g_vm->_mainDisplayList->reset();
}
void setCurrentWorld(ObjectID worldID) {
diff --git a/engines/saga2/saga2.cpp b/engines/saga2/saga2.cpp
index 6f1a8fbcc0..17c38b0965 100644
--- a/engines/saga2/saga2.cpp
+++ b/engines/saga2/saga2.cpp
@@ -37,6 +37,7 @@
#include "saga2/band.h"
#include "saga2/contain.h"
+#include "saga2/dispnode.h"
#include "saga2/gdraw.h"
#include "saga2/imagcach.h"
#include "saga2/mouseimg.h"
@@ -77,6 +78,7 @@ Saga2Engine::Saga2Engine(OSystem *syst)
_imageCache = new CImageCache;
_mTaskList = new MotionTaskList;
_bandList = new BandList();
+ _mainDisplayList = new DisplayNodeList;
_edpList = nullptr;
_sdpList = nullptr;
@@ -93,6 +95,7 @@ Saga2Engine::~Saga2Engine() {
delete _imageCache;
delete _mTaskList;
delete _bandList;
+ delete _mainDisplayList;
}
Common::Error Saga2Engine::run() {
diff --git a/engines/saga2/saga2.h b/engines/saga2/saga2.h
index 1201191b91..faae9266d4 100644
--- a/engines/saga2/saga2.h
+++ b/engines/saga2/saga2.h
@@ -58,6 +58,7 @@ class SensorList;
class Sensor;
class EffectDisplayPrototypeList;
class SpellDisplayPrototypeList;
+class DisplayNodeList;
enum {
kDebugResources = 1 << 0,
@@ -130,6 +131,7 @@ public:
EffectDisplayPrototypeList *_edpList;
SpellDisplayPrototypeList *_sdpList;
ContainerList *_containerList;
+ DisplayNodeList *_mainDisplayList;
gDisplayPort _mainPort;
Commit: 14e96f0b3de1ce8e2328404c14fcca57472c1078
https://github.com/scummvm/scummvm/commit/14e96f0b3de1ce8e2328404c14fcca57472c1078
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-17T02:55:26+09:00
Commit Message:
SAGA2: Fix global constructors in dispnode.cpp
Changed paths:
engines/saga2/dispnode.cpp
engines/saga2/idtypes.h
engines/saga2/magic.cpp
engines/saga2/saga2.cpp
engines/saga2/saga2.h
engines/saga2/spelcast.cpp
engines/saga2/speldata.cpp
engines/saga2/spellio.cpp
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index 5551859dce..15a27e3e12 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -33,17 +33,10 @@
namespace Saga2 {
-const uint16 maxActiveSpells = 8;
-
-// Horribly kludged hard-coded sprite index numbers for bubble sprites
-const int16 baseBubbleSpriteIndex = 111,
- bubbleSpriteCount = 8;
-uint8 bubbleColorTable[] = { 1, 0, 0, 0 };
+uint8 bubbleColorTable[] = { 1, 0, 0, 0 };
DisplayNode *DisplayNodeList::head;
-SpellDisplayList activeSpells(maxActiveSpells);
-
bool centerActorIndicatorEnabled;
/* ===================================================================== *
@@ -95,7 +88,7 @@ uint8 identityColors[256] = {
void buildDisplayList(void) {
g_vm->_mainDisplayList->buildObjects(true);
- activeSpells.buildList();
+ g_vm->_activeSpells->buildList();
}
//-----------------------------------------------------------------------
@@ -106,7 +99,7 @@ void updateObjectAppearances(int32 deltaTime) {
#ifdef WEWANTSPELLSTOSTOPINCOMBAT
if (!InCombatPauseKludge())
#endif
- activeSpells.updateStates(deltaTime);
+ g_vm->_activeSpells->updateStates(deltaTime);
}
//-----------------------------------------------------------------------
@@ -505,12 +498,12 @@ void DisplayNode::drawObject(void) {
bubbleColorTable,
ARRAYSIZE(bubbleColorTable));
- if (a->kludgeCount < 0 || ++a->kludgeCount >= bubbleSpriteCount)
+ if (a->kludgeCount < 0 || ++a->kludgeCount >= kBubbleSpriteCount)
a->kludgeCount = 0;
sc = &scList[0];
sc->sp = spellSprites->sprite(
- baseBubbleSpriteIndex + a->kludgeCount);
+ kBaseBubbleSpriteIndex + a->kludgeCount);
sc->offset.x = scList->offset.y = 0;
sc->colorTable = mainColors;
sc->flipped = false;
diff --git a/engines/saga2/idtypes.h b/engines/saga2/idtypes.h
index 1baf637e33..9e2534e970 100644
--- a/engines/saga2/idtypes.h
+++ b/engines/saga2/idtypes.h
@@ -449,6 +449,12 @@ enum {
kTileRectHeight = 428 - 8
};
+// Horribly kludged hard-coded sprite index numbers for bubble sprites
+enum {
+ kMaxActiveSpells = 8,
+ kBaseBubbleSpriteIndex = 111,
+ kBubbleSpriteCount = 8
+};
} // end of namespace Saga2
diff --git a/engines/saga2/magic.cpp b/engines/saga2/magic.cpp
index 8c4bd42f99..6f42155626 100644
--- a/engines/saga2/magic.cpp
+++ b/engines/saga2/magic.cpp
@@ -57,7 +57,6 @@ const int32 spellFailSound = 42;
* ===================================================================== */
extern WorldMapData *mapList;
-extern SpellDisplayList activeSpells;
extern SpellStuff spellBook[];
extern Point32 lastMousePos; // Last mouse position over map
@@ -305,7 +304,7 @@ bool implementSpell(GameObject *enactor, Location &target, SkillProto *spell)
}
}
- activeSpells.add(new SpellInstance(GetOwner(enactor), target, sProto.getDisplayID()));
+ g_vm->_activeSpells->add(new SpellInstance(GetOwner(enactor), target, sProto.getDisplayID()));
sProto.playSound(enactor);
return true;
}
@@ -345,7 +344,7 @@ bool implementSpell(GameObject *enactor, ActiveItem *target, SkillProto *spell)
}
}
- activeSpells.add(new SpellInstance(GetOwner(enactor), l, sProto.getDisplayID()));
+ g_vm->_activeSpells->add(new SpellInstance(GetOwner(enactor), l, sProto.getDisplayID()));
sProto.playSound(enactor);
return true;
}
@@ -383,7 +382,7 @@ bool implementSpell(GameObject *enactor, GameObject *target, SkillProto *spell)
}
}
- activeSpells.add(new SpellInstance(GetOwner(enactor), target, sProto.getDisplayID()));
+ g_vm->_activeSpells->add(new SpellInstance(GetOwner(enactor), target, sProto.getDisplayID()));
sProto.playSound(enactor);
return true;
}
diff --git a/engines/saga2/saga2.cpp b/engines/saga2/saga2.cpp
index 17c38b0965..72cd7b5f07 100644
--- a/engines/saga2/saga2.cpp
+++ b/engines/saga2/saga2.cpp
@@ -42,6 +42,7 @@
#include "saga2/imagcach.h"
#include "saga2/mouseimg.h"
#include "saga2/motion.h"
+#include "saga2/spelshow.h"
namespace Saga2 {
@@ -79,6 +80,7 @@ Saga2Engine::Saga2Engine(OSystem *syst)
_mTaskList = new MotionTaskList;
_bandList = new BandList();
_mainDisplayList = new DisplayNodeList;
+ _activeSpells = new SpellDisplayList(kMaxActiveSpells);
_edpList = nullptr;
_sdpList = nullptr;
@@ -96,6 +98,7 @@ Saga2Engine::~Saga2Engine() {
delete _mTaskList;
delete _bandList;
delete _mainDisplayList;
+ delete _activeSpells;
}
Common::Error Saga2Engine::run() {
diff --git a/engines/saga2/saga2.h b/engines/saga2/saga2.h
index faae9266d4..4b4290c067 100644
--- a/engines/saga2/saga2.h
+++ b/engines/saga2/saga2.h
@@ -59,6 +59,7 @@ class Sensor;
class EffectDisplayPrototypeList;
class SpellDisplayPrototypeList;
class DisplayNodeList;
+class SpellDisplayList;
enum {
kDebugResources = 1 << 0,
@@ -132,6 +133,7 @@ public:
SpellDisplayPrototypeList *_sdpList;
ContainerList *_containerList;
DisplayNodeList *_mainDisplayList;
+ SpellDisplayList *_activeSpells;
gDisplayPort _mainPort;
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index bfceae93e9..aeb5039628 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -35,7 +35,6 @@
namespace Saga2 {
extern WorldMapData *mapList;
-extern SpellDisplayList activeSpells;
extern SpellStuff spellBook[];
extern bool gameRunning; // kludge
extern PlatformHandle platformList; // platform resource hunk
diff --git a/engines/saga2/speldata.cpp b/engines/saga2/speldata.cpp
index 5ed31d3493..a14bfde962 100644
--- a/engines/saga2/speldata.cpp
+++ b/engines/saga2/speldata.cpp
@@ -94,7 +94,6 @@ StaticTilePoint SquareSpellVectors[32] = {
extern hResContext *spriteRes; // sprite resource handle
extern hResContext *schemeRes; // sprite resource handle
extern ColorTable identityColors;
-extern SpellDisplayList activeSpells;
/* ===================================================================== *
Global data
@@ -147,7 +146,7 @@ void initMagic(void) {
void cleanupMagic(void) {
- activeSpells.cleanup();
+ g_vm->_activeSpells->cleanup();
for (int i = 0; i < maxSpells; i++) {
spellBook[i].killEffects();
}
diff --git a/engines/saga2/spellio.cpp b/engines/saga2/spellio.cpp
index 0935f0cc31..d74639d574 100644
--- a/engines/saga2/spellio.cpp
+++ b/engines/saga2/spellio.cpp
@@ -37,14 +37,6 @@
namespace Saga2 {
-const ChunkID spellInstCountID = MakeID('S', 'P', 'E', 'L');
-
-/* ===================================================================== *
- Imports
- * ===================================================================== */
-
-extern SpellDisplayList activeSpells;
-
/* ===================================================================== *
partial SpellDisplayPrototype implementation
* ===================================================================== */
@@ -216,20 +208,20 @@ void initSpellState(void) {
void saveSpellState(Common::OutSaveFile *outS) {
debugC(2, kDebugSaveload, "Saving SpellState");
- activeSpells.write(outS);
+ g_vm->_activeSpells->write(outS);
}
void loadSpellState(Common::InSaveFile *in) {
debugC(2, kDebugSaveload, "Loading SpellState");
- activeSpells.read(in);
+ g_vm->_activeSpells->read(in);
}
// ------------------------------------------------------------------
// cleanup active spells
void cleanupSpellState(void) {
- activeSpells.wipe();
+ g_vm->_activeSpells->wipe();
}
// ------------------------------------------------------------------
Commit: 47f5d4754222eec1f953055b399faaf6d2c0a403
https://github.com/scummvm/scummvm/commit/47f5d4754222eec1f953055b399faaf6d2c0a403
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-17T02:55:26+09:00
Commit Message:
SAGA2: Fix global constructor warning on gtextbox.cpp
Changed paths:
engines/saga2/gtextbox.cpp
engines/saga2/gtextbox.h
diff --git a/engines/saga2/gtextbox.cpp b/engines/saga2/gtextbox.cpp
index 503db7afbe..57d25fa6ba 100644
--- a/engines/saga2/gtextbox.cpp
+++ b/engines/saga2/gtextbox.cpp
@@ -33,10 +33,7 @@
namespace Saga2 {
// definitions
-Rect16 editBaseRect(7,
- 45,
- 314,
- 111);
+StaticRect editBaseRect = {7, 45, 314, 111};
/* ===================================================================== *
Imports
diff --git a/engines/saga2/gtextbox.h b/engines/saga2/gtextbox.h
index 9d4a3a0ba4..79aea93062 100644
--- a/engines/saga2/gtextbox.h
+++ b/engines/saga2/gtextbox.h
@@ -54,7 +54,7 @@ const int16 blinkColor0 = 137;
const int16 blinkColor1 = 232;
const int16 blinkWide = 1;
-extern Rect16 editBaseRect;
+extern StaticRect editBaseRect;
/* ===================================================================== *
More information about the Scummvm-git-logs
mailing list