SAGA2: More work on reducing header dependency

This commit is contained in:
Eugene Sandulenko 2021-06-01 23:47:48 +02:00
parent eca51bba37
commit 20e0ee7e70
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
36 changed files with 62 additions and 74 deletions

View File

@ -46,7 +46,7 @@
#include "saga2/messager.h"
#include "saga2/weapons.h"
#include "saga2/localize.h"
#include "saga2/intrface.h"
// Include files needed for SAGA script dispatch
#include "saga2/script.h"

View File

@ -27,12 +27,7 @@
#ifndef SAGA2_AUTOMAP_H
#define SAGA2_AUTOMAP_H
#include "saga2/idtypes.h"
#include "saga2/contain.h"
#include "saga2/cmisc.h"
#include "saga2/button.h"
#include "saga2/intrface.h"
#include "saga2/floating.h"
namespace Saga2 {

View File

@ -27,8 +27,6 @@
#ifndef SAGA2_BAND_H
#define SAGA2_BAND_H
#include "saga2/idtypes.h"
namespace Saga2 {
class Actor;

View File

@ -26,10 +26,12 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
#include "common/debug.h"
#include "saga2/std.h"
#include "saga2/saga2.h"
#include "saga2/blitters.h"
#include "common/debug.h"
#include "saga2/gdraw.h"
namespace Saga2 {

View File

@ -27,10 +27,10 @@
#ifndef SAGA2_BLITTERS_H
#define SAGA2_BLITTERS_H
#include "saga2/gdraw.h"
namespace Saga2 {
class gPixelMap;
// VWPAGE.CPP , GDRAW.CPP
// Assembly-language function to copy pixel to SVGA (opaque)

View File

@ -27,12 +27,7 @@
#ifndef SAGA2_CONTAIN_H
#define SAGA2_CONTAIN_H
#include "saga2/fta.h"
#include "saga2/panel.h"
#include "saga2/floating.h"
#include "saga2/images.h"
#include "saga2/button.h"
#include "saga2/intrface.h"
namespace Saga2 {
@ -54,6 +49,14 @@ class ContainerNode;
class ContainerList;
struct ContainerAppearanceDef;
class CMassWeightIndicator;
class ProtoObj;
class gCompButton;
class gCompImage;
class gMultCompButton;
class TilePoint;
/* ===================================================================== *
Class definitions
* ===================================================================== */

View File

@ -142,6 +142,13 @@ DisplayNode::DisplayNode() {
efx = NULL;
}
TilePoint DisplayNode::SpellPos(void) {
if (efx)
return efx->current;
return Nowhere;
}
inline void DisplayNode::updateEffect(const int32 deltaTime) {
if (efx) efx->updateEffect(deltaTime);
}

View File

@ -27,11 +27,16 @@
#ifndef SAGA2_DISPNODE_H
#define SAGA2_DISPNODE_H
#include "saga2/objects.h"
#include "saga2/speldefs.h"
#include "saga2/idtypes.h"
#include "saga2/rect.h"
namespace Saga2 {
class GameObject;
class TilePoint;
class Effectron;
enum nodeType {
nodeTypeObject = 0,
nodeTypeEffect,
@ -66,18 +71,7 @@ public:
void drawEffect(void);
void updateObject(const int32 deltaTime);
void updateEffect(const int32 deltaTime);
TilePoint SpellPos(void) {
if (efx) return efx->current;
return Nowhere;
}
void *operator new (size_t s) {
return RNewPtr(s, NULL, "Display Node");
}
void operator delete (void *m) {
RDisposePtr(m);
}
TilePoint SpellPos(void);
};
/* ============================================================================ *
@ -98,17 +92,17 @@ public:
static DisplayNode *head; // head of list
DisplayNodeList(uint16 newSize) {
displayList = (DisplayNode *)TALLOC(sizeof(DisplayNode) * newSize, memDispNode);
displayList = (DisplayNode *)malloc(sizeof(DisplayNode) * newSize);
init(newSize);
count = 0;
}
DisplayNodeList() {
displayList = (DisplayNode *)TALLOC(sizeof(DisplayNode) * maxDisplayed, memDispNode);
displayList = (DisplayNode *)malloc(sizeof(DisplayNode) * maxDisplayed);
init(maxDisplayed);
count = 0;
}
~DisplayNodeList() {
delete [] displayList;
free(displayList);
}
void reset(void) {
@ -126,12 +120,6 @@ public:
private:
int16 sortDepth; // for sorting by depth
void *operator new (size_t s) {
return RNewPtr(s, NULL, "Display List");
}
void operator delete (void *m) {
RDisposePtr(m);
}
};
/* ============================================================================ *

View File

@ -219,6 +219,10 @@ const BandID NoBand = -1;
typedef uint32 soundSegment;
typedef uint8 gPen; // a pen index number
typedef uint16 weaponID;
} // end of namespace Saga2
#endif

View File

@ -27,8 +27,6 @@
#ifndef SAGA2_IMAGCACH_H
#define SAGA2_IMAGCACH_H
#include "saga2/dlist.h"
namespace Saga2 {
/* ===================================================================== *

View File

@ -27,8 +27,6 @@
#ifndef SAGA2_IMAGES_H
#define SAGA2_IMAGES_H
#include "saga2/gdraw.h"
namespace Saga2 {
// unselected button image

View File

@ -31,9 +31,8 @@
namespace Saga2 {
errorCode InitMouse(int16 width, int16 height) {
void InitMouse(int16 width, int16 height) {
warning("STUB: InitMouse()");
return errUnknown;
}
void CleanupMouse(void) {

View File

@ -28,7 +28,6 @@
#define SAGA2_INPUT_H
#include "saga2/rect.h"
#include "saga2/errors.h"
namespace Saga2 {
@ -113,7 +112,7 @@ struct gMouseState {
typedef uint32 gTimeStamp;
errorCode InitMouse(int16 width, int16 height);
void InitMouse(int16 width, int16 height);
void CleanupMouse(void);
void ReadMouse(gMouseState &st);
uint16 ReadQualifiers(void);

View File

@ -31,6 +31,7 @@
#include "saga2/localize.h"
#include "saga2/msgbox.h"
#include "saga2/floating.h"
#include "saga2/gbevel.h"
namespace Saga2 {

View File

@ -27,9 +27,6 @@
#ifndef SAGA2_PALETTE_H
#define SAGA2_PALETTE_H
#include "saga2/vpal.h"
#include "saga2/savefile.h"
namespace Saga2 {
/* ===================================================================== *

View File

@ -34,6 +34,7 @@
#include "saga2/floating.h"
#include "saga2/fta.h"
#include "saga2/display.h"
#include "saga2/gbevel.h"
namespace Saga2 {

View File

@ -28,11 +28,8 @@
#define SAGA2_PANEL_H
#include "saga2/dlist.h"
#include "saga2/gdraw.h"
#include "saga2/errors.h"
#include "saga2/gbevel.h"
#include "saga2/input.h"
#include "saga2/vwpage.h"
#include "saga2/vdraw.h"
namespace Saga2 {
// Fix problem with DOS's encroachment on name space that should

View File

@ -27,6 +27,7 @@
#include "saga2/std.h"
#define NO_LOCAL_MEMORY_OVERRIDES 1
#include "saga2/rmem.h"
#include "saga2/rmembase.h"
#include "saga2/errors.h"

View File

@ -27,8 +27,6 @@
#ifndef SAGA2_RMEMBASE_H
#define SAGA2_RMEMBASE_H
#include "saga2/rmem.h"
namespace Saga2 {
/* ===================================================================== *

View File

@ -39,6 +39,7 @@
#include "saga2/std.h"
#include "saga2/blitters.h"
#include "saga2/loadmsg.h"
#include "saga2/gdraw.h"
namespace Saga2 {

View File

@ -27,7 +27,6 @@
#include "common/serializer.h"
#include "common/system.h"
#include "engines/engine.h"
#include "gui/debugger.h"
namespace Video {
class SmackerDecoder;

View File

@ -53,6 +53,7 @@
#include "saga2/videobox.h"
#include "saga2/display.h"
#include "saga2/transit.h"
#include "saga2/contain.h"
void drawMainDisplay(void);

View File

@ -29,6 +29,7 @@
#include "saga2/std.h"
#include "saga2/rmemfta.h"
#include "saga2/dispnode.h"
#include "saga2/objproto.h"
#include "saga2/spells.h"
#include "saga2/spellbuk.h"
#include "saga2/spelshow.h"

View File

@ -29,6 +29,7 @@
#include "saga2/std.h"
#include "saga2/rmemfta.h"
#include "saga2/dispnode.h"
#include "saga2/objproto.h"
#include "saga2/spellbuk.h"
#include "saga2/spelshow.h"

View File

@ -31,7 +31,7 @@
#include "saga2/spellbuk.h"
#include "saga2/spelshow.h"
#include "saga2/spelvals.h"
#include "saga2/tilevect.h"
namespace Saga2 {

View File

@ -29,9 +29,6 @@
#include "saga2/dispnode.h"
#include "saga2/speldefs.h"
#include "saga2/spells.h"
#include "saga2/dice.h"
#include "saga2/tilevect.h"
namespace Saga2 {

View File

@ -49,6 +49,7 @@
#include "saga2/loadsave.h"
#include "saga2/display.h"
#include "saga2/automap.h"
#include "saga2/images.h"
namespace Saga2 {

View File

@ -27,9 +27,6 @@
#ifndef SAGA2_TILEVECT_H
#define SAGA2_TILEVECT_H
#include "saga2/tcoords.h"
#include "saga2/dice.h"
namespace Saga2 {
// This routine returns a random vector between two bounding vectors

View File

@ -48,6 +48,7 @@
#include "saga2/loadsave.h"
#include "saga2/display.h"
#include "saga2/transit.h"
#include "saga2/tile.h"
namespace Saga2 {

View File

@ -27,9 +27,6 @@
#ifndef SAGA2_VPAGE_H
#define SAGA2_VPAGE_H
#include "saga2/rect.h"
#include "saga2/errors.h"
namespace Saga2 {
class vDisplayPage {

View File

@ -27,6 +27,8 @@
#ifndef SAGA2_VPAL_H
#define SAGA2_VPAL_H
#include "saga2/idtypes.h"
namespace Saga2 {
// Stores an RGB value

View File

@ -28,6 +28,7 @@
#include "saga2/std.h"
#include "saga2/vwpage.h"
#include "saga2/vdraw.h"
namespace Saga2 {

View File

@ -27,8 +27,11 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
#include "saga2/std.h"
#include "saga2/rect.h"
#include "saga2/vdraw.h"
#include "saga2/vwpage.h"
#include "saga2/display.h"
#include "saga2/vpage.h"
namespace Saga2 {

View File

@ -27,10 +27,10 @@
#ifndef SAGA2_VWPAGE_H
#define SAGA2_VWPAGE_H
#include "vdraw.h"
namespace Saga2 {
class gDisplayPort;
#define CDDWindow void
extern void initDDGraphics(gDisplayPort &mainPort, CDDWindow *displayWin);

View File

@ -27,8 +27,11 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
#include "saga2/std.h"
#include "saga2/idtypes.h"
#include "saga2/rmemfta.h"
#include "saga2/weapons.h"
#include "saga2/spellbuk.h"
#include "saga2/actor.h"
namespace Saga2 {

View File

@ -28,14 +28,11 @@
#define SAGA2_WEAPONS_H
#include "saga2/spelshow.h"
#include "saga2/spells.h"
#include "saga2/dice.h"
#include "saga2/effects.h"
#include "saga2/actor.h"
#include "saga2/spellbuk.h"
namespace Saga2 {
struct ResourceItemEffect;
ProtoEffect *createNewProtoEffect(ResourceItemEffect *rie);
//-----------------------------------------------------------------------