SAGA2: Reduced header dependency for fta.h

This commit is contained in:
Eugene Sandulenko 2021-06-02 00:40:57 +02:00
parent a6b19daa9a
commit c571279f1b
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
27 changed files with 35 additions and 14 deletions

View File

@ -27,6 +27,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
#include "saga2/std.h"
#include "saga2/hresmgr.h"
#include "saga2/automap.h"
#include "saga2/blitters.h"
#include "saga2/tile.h"
@ -35,7 +36,7 @@
#include "saga2/grequest.h"
#include "saga2/mapfeatr.h"
#include "saga2/grabinfo.h"
#include "saga2/hresmgr.h"
#include "saga2/rmemfta.h"
namespace Saga2 {

View File

@ -27,6 +27,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
#include "saga2/std.h"
#include "saga2/idtypes.h"
#include "saga2/fta.h"
#include "saga2/tile.h"
#include "saga2/annoy.h"

View File

@ -41,7 +41,7 @@ private:
public:
BitArray(uint16 newSize = 0) {
if (newSize) b = (uint32 *) TALLOC(sizeof(uint32) * (newSize / 32 + 1), memBitArray);
if (newSize) b = (uint32 *)malloc(sizeof(uint32) * (newSize / 32 + 1));
size = newSize;
clear(newSize);
}
@ -53,7 +53,7 @@ public:
void resize(uint16 newSize) {
uint32 *t = b;
if (newSize) {
b = (uint32 *) TALLOC(sizeof(uint32) * (newSize / 32 + 1), memBitArray);
b = (uint32 *)malloc(sizeof(uint32) * (newSize / 32 + 1));
clear(newSize);
if (size) for (int i = 0; i < MIN(size, newSize) / 32 + 1; i++) b[i] = t[i];
}

View File

@ -29,11 +29,12 @@
#include "saga2/std.h"
#include "saga2/rmemfta.h"
#include "saga2/cmisc.h"
#include "saga2/hresmgr.h"
#include "saga2/button.h"
#include "saga2/rmem.h"
#include "saga2/objects.h"
#include "saga2/grabinfo.h"
#include "saga2/hresmgr.h"
#include "saga2/fontlib.h"
namespace Saga2 {

View File

@ -28,6 +28,7 @@
#define SAGA2_BUTTON_H
#include "saga2/fta.h"
#include "saga2/hresmgr.h"
#include "saga2/panel.h"
#include "saga2/cmisc.h"
#include "saga2/sprite.h"

View File

@ -27,6 +27,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
#include "saga2/std.h"
#include "saga2/hresmgr.h"
#include "saga2/calender.h"
#include "saga2/intrface.h"
#include "saga2/config.h"

View File

@ -41,6 +41,8 @@
#include "saga2/spellbuk.h"
#include "saga2/imagcach.h"
#include "saga2/hresmgr.h"
#include "saga2/fontlib.h"
#include "saga2/rmemfta.h"
#include "saga2/pclass.r"

View File

@ -39,6 +39,7 @@
#include "saga2/program.h"
#include "saga2/version.h"
#include "saga2/hresmgr.h"
#include "saga2/fontlib.h"
namespace Saga2 {

View File

@ -28,6 +28,7 @@
#define SAGA2_FLOATING_H
#include "saga2/fta.h"
#include "saga2/hresmgr.h"
#include "saga2/panel.h"
namespace Saga2 {

View File

@ -27,11 +27,7 @@
#ifndef SAGA2_FTA_H
#define SAGA2_FTA_H
#include "saga2/rmemfta.h"
#include "saga2/vwpage.h"
#include "saga2/vpal.h"
#include "saga2/gpointer.h"
#include "saga2/fontlib.h"
#include "saga2/rmem.h"
namespace Saga2 {

View File

@ -35,6 +35,7 @@
#include "saga2/floating.h"
#include "saga2/images.h"
#include "saga2/setup.h"
#include "saga2/vpal.h"
#include "saga2/palette.h"
#include "saga2/transit.h"
#include "saga2/mouseimg.h"

View File

@ -183,7 +183,7 @@ gTextBox::gTextBox(
flags = flg;
currentLen[ index ] = buffer ? strlen(buffer) : 0;
cursorPos = anchorPos = scrollPixels = 0;
undoBuffer = (char *) TALLOC(sizeof(char) * (maxLen + 1), memInterface);
undoBuffer = (char *)malloc(sizeof(char) * (maxLen + 1));
textFont = font;
fontHeight = height;
fontOffset = fontHeight + 2;

View File

@ -45,6 +45,7 @@
#include "saga2/display.h"
#include "saga2/localize.h"
#include "saga2/imagcach.h"
#include "saga2/fontlib.h"
namespace Saga2 {
@ -1596,7 +1597,7 @@ void writePlaqTextPos(gPort &port,
void **loadButtonRes(hResContext *con, int16 resID, int16 numRes) {
int16 i, k;
void **images = (void **) TALLOC(sizeof(void *)*numRes, memInterface);
void **images = (void **)malloc(sizeof(void *)*numRes);
for (i = 0, k = resID; i < numRes; i++, k++) {
// get an image from the image cache
@ -1613,7 +1614,7 @@ void **loadButtonRes(hResContext *con, int16 resID, int16 numRes, char a, char b
int16 i, k;
void **images = (void **) TALLOC(sizeof(void *)*numRes, memInterface);
void **images = (void **)malloc(sizeof(void *)*numRes);
for (i = 0, k = resID; i < numRes; i++, k++) {
images[i] = ImageCache.requestImage(con, MKTAG(a, b, c, k));

View File

@ -46,6 +46,7 @@
#include "saga2/tilemode.h"
#include "saga2/magic.h"
#include "saga2/intrface.h"
#include "saga2/vpal.h"
#include "saga2/palette.h"
#include "saga2/contain.h"
#include "saga2/ioerrors.h"

View File

@ -29,6 +29,7 @@
#include "saga2/std.h"
#include "saga2/rmemfta.h"
#include "saga2/magic.h"
#include "saga2/idtypes.h"
#include "saga2/speldefs.h"
#include "saga2/spellbuk.h"
#include "saga2/spelshow.h"

View File

@ -32,6 +32,8 @@
#include "saga2/msgbox.h"
#include "saga2/floating.h"
#include "saga2/gbevel.h"
#include "saga2/fontlib.h"
#include "saga2/rmemfta.h"
namespace Saga2 {

View File

@ -85,7 +85,7 @@ public:
wanted.resize(newSize);
locked.resize(newSize);
recent.resize(newSize);
handle = (RESTYPE *) TALLOC(sizeof(RESTYPE) * newSize, memPrgResMan);
handle = (RESTYPE *)malloc(sizeof(RESTYPE) * newSize);
handles = newSize;
loader = loadfunction;
for (uint16 i = 0; i < newSize; i++)

View File

@ -48,6 +48,7 @@
#include "saga2/cmisc.h"
#include "saga2/button.h"
#include "saga2/hresmgr.h"
#include "saga2/fontlib.h"
namespace Saga2 {

View File

@ -26,7 +26,6 @@
#ifndef SAGA2_PROPERTY_H
#define SAGA2_PROPERTY_H
namespace Saga2 {
/* ===================================================================== *
@ -115,7 +114,7 @@ CompoundProperty< T >::CompoundProperty(
uint16 arrayBytes = sizeof(Property< T > *) * size;
// Allocate memory to copy the array.
propertyArray = (Property< T > **)TALLOC(arrayBytes, memPropList);
propertyArray = (Property< T > **)malloc(arrayBytes);
#if DEBUG
assert(propertyArray);
#endif

View File

@ -29,6 +29,7 @@
#include "saga2/std.h"
#include "saga2/rmemfta.h"
#include "saga2/magic.h"
#include "saga2/idtypes.h"
#include "saga2/speldefs.h"
#include "saga2/spellbuk.h"
#include "saga2/spelshow.h"

View File

@ -34,6 +34,7 @@
#include "saga2/band.h"
#include "saga2/sensor.h"
#include "saga2/tilemode.h"
#include "saga2/rmemfta.h"
namespace Saga2 {

View File

@ -28,6 +28,7 @@
#include "saga2/std.h"
#include "saga2/tcoords.h"
#include "saga2/idtypes.h"
#include "saga2/tile.h"
#include "saga2/terrain.h"
#include "saga2/objects.h"

View File

@ -32,6 +32,7 @@
#include "saga2/input.h"
#include "saga2/cmisc.h"
#include "saga2/tcoords.h"
#include "saga2/idtypes.h"
#include "saga2/tile.h"
#include "saga2/objects.h"
#include "saga2/tileload.h"

View File

@ -37,6 +37,7 @@
#include "saga2/audio.h"
#include "saga2/annoy.h"
#include "saga2/script.h"
#include "saga2/vpal.h"
#include "saga2/palette.h"
#include "saga2/intrface.h"
#include "saga2/mouseimg.h"

View File

@ -29,8 +29,10 @@
#include "saga2/std.h"
#include "saga2/fta.h"
#include "saga2/floating.h"
#include "saga2/idtypes.h"
#include "saga2/tile.h"
#include "saga2/transit.h"
#include "saga2/vpal.h"
#include "saga2/palette.h"
#include "saga2/calender.h"
#include "saga2/cmisc.h"

View File

@ -52,6 +52,7 @@
#include "saga2/tilemode.h"
#include "saga2/display.h"
#include "saga2/uitext.h"
#include "saga2/vpal.h"
#include "saga2/palette.h"
#include "saga2/display.h"
#include "saga2/program.h"
@ -59,6 +60,7 @@
#include "saga2/config.h"
#include "saga2/hresmgr.h"
#include "saga2/fontlib.h"
namespace Saga2 {

View File

@ -28,6 +28,7 @@
#include "saga2/std.h"
#include "saga2/fta.h"
#include "saga2/vpal.h"
#include "saga2/palette.h"
#include "saga2/transit.h"
#include "saga2/cmisc.h"