Skip to content

Commit

Permalink
TONY: Remove various bits of unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzie committed Aug 27, 2012
1 parent 037920b commit 7b4dd0a
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 175 deletions.
19 changes: 2 additions & 17 deletions engines/tony/font.cpp
Expand Up @@ -49,21 +49,6 @@ RMFont::~RMFont() {
unload();
}


/**
* Dumps a font to a buffer
* @param buf Buffer for font contents
* @param nChars Number of characters (max 256)
* @param dimx X dimension in pixels
* @param dimy Y dimension in pixels
*
\****************************************************************************/

void DumpFontBMP(const char *filename, const byte *buf, int nChars, int charX, int charY, byte *pal) {
error("DumpFontBMP not supported in ScummVM");
}


void RMFont::load(const byte *buf, int nChars, int dimx, int dimy, uint32 palResID) {
_letter = new RMGfxSourceBuffer8RLEByte[nChars];

Expand Down Expand Up @@ -150,7 +135,7 @@ int RMFont::stringLen(char bChar, char bNext) {
}

/****************************************************************************\
* Metodi di RMFontColor
* RMFontColor Methods
\****************************************************************************/

RMFontColor::RMFontColor() : RMFont() {
Expand Down Expand Up @@ -180,7 +165,7 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
_fontG = g1;
_fontB = b1;

// Constructs a new paletter for the font
// Constructs a new palette for the font
for (i = 1; i < 16; i++) {
pal[i * 3 + 0] = r >> 16;
pal[i * 3 + 1] = g >> 16;
Expand Down
6 changes: 0 additions & 6 deletions engines/tony/game.cpp
Expand Up @@ -1527,12 +1527,6 @@ void RMPointer::close() {
}
}


int RMPointer::priority() {
// Pointer has minimum priority so it will be drawn last
return 200;
}

void RMPointer::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
CORO_BEGIN_CONTEXT;
int n;
Expand Down
5 changes: 0 additions & 5 deletions engines/tony/game.h
Expand Up @@ -100,11 +100,6 @@ class RMPointer {
*/
void doFrame();

/**
* Overloading of priorities
*/
int priority();

/**
* draw method
*/
Expand Down
85 changes: 24 additions & 61 deletions engines/tony/gfxcore.cpp
Expand Up @@ -65,50 +65,32 @@ void RMGfxTaskSetPrior::setPriority(int nPrior) {

RMGfxBuffer::RMGfxBuffer() {
_dimx = _dimy = 0;
_bUseDDraw = false;
_origBuf = _buf = NULL;
}

RMGfxBuffer::~RMGfxBuffer() {
destroy();
}

void RMGfxBuffer::create(int dimx, int dimy, int nBpp, bool bUseDDraw) {
void RMGfxBuffer::create(int dimx, int dimy, int nBpp) {
// Destroy the buffer it is already exists
if (_buf != NULL)
destroy();

// Copy the parameters in the private members
_dimx = dimx;
_dimy = dimy;
_bUseDDraw = bUseDDraw;

if (!_bUseDDraw) {
// Allocate a buffer
_origBuf = _buf = new byte[_dimx * _dimy * nBpp / 8];
assert(_buf != NULL);
Common::fill(_origBuf, _origBuf + _dimx * _dimy * nBpp / 8, 0);
}
// Allocate a buffer
_origBuf = _buf = new byte[_dimx * _dimy * nBpp / 8];
assert(_buf != NULL);
Common::fill(_origBuf, _origBuf + _dimx * _dimy * nBpp / 8, 0);
}

void RMGfxBuffer::destroy() {
if (!_bUseDDraw) {
if (_origBuf != NULL && _origBuf == _buf) {
delete[] _origBuf;
_origBuf = _buf = NULL;
}
}
}

void RMGfxBuffer::lock() {
if (_bUseDDraw) {
// Manages acceleration
}
}

void RMGfxBuffer::unlock() {
if (_bUseDDraw) {
// Manages acceleration
if (_origBuf != NULL && _origBuf == _buf) {
delete[] _origBuf;
_origBuf = _buf = NULL;
}
}

Expand All @@ -125,8 +107,8 @@ RMGfxBuffer::operator void *() {
return (void *)_buf;
}

RMGfxBuffer::RMGfxBuffer(int dimx, int dimy, int nBpp, bool bUseDDraw) {
create(dimx, dimy, nBpp, bUseDDraw);
RMGfxBuffer::RMGfxBuffer(int dimx, int dimy, int nBpp) {
create(dimx, dimy, nBpp);
}

/****************************************************************************\
Expand Down Expand Up @@ -240,8 +222,8 @@ RMGfxWoodyBuffer::RMGfxWoodyBuffer() {

}

RMGfxWoodyBuffer::RMGfxWoodyBuffer(int dimx, int dimy, bool bUseDDraw)
: RMGfxBuffer(dimx, dimy, 16, bUseDDraw) {
RMGfxWoodyBuffer::RMGfxWoodyBuffer(int dimx, int dimy)
: RMGfxBuffer(dimx, dimy, 16) {
}

/****************************************************************************\
Expand All @@ -252,19 +234,15 @@ RMGfxTargetBuffer::RMGfxTargetBuffer() {
_otlist = NULL;
_otSize = 0;
_trackDirtyRects = false;
// csModifyingOT = g_system->createMutex();
}

RMGfxTargetBuffer::~RMGfxTargetBuffer() {
clearOT();
// g_system->deleteMutex(csModifyingOT);
}

void RMGfxTargetBuffer::clearOT() {
OTList *cur, *n;

// g_system->lockMutex(csModifyingOT);

cur = _otlist;

while (cur != NULL) {
Expand All @@ -276,8 +254,6 @@ void RMGfxTargetBuffer::clearOT() {
}

_otlist = NULL;

// g_system->unlockMutex(csModifyingOT);
}

void RMGfxTargetBuffer::drawOT(CORO_PARAM) {
Expand All @@ -294,10 +270,6 @@ void RMGfxTargetBuffer::drawOT(CORO_PARAM) {
_ctx->prev = NULL;
_ctx->cur = _otlist;

// Lock the buffer to access it
lock();
// g_system->lockMutex(csModifyingOT);

while (_ctx->cur != NULL) {
// Call the task Draw method, passing it a copy of the original
_ctx->myprim = _ctx->cur->_prim->duplicate();
Expand Down Expand Up @@ -330,20 +302,13 @@ void RMGfxTargetBuffer::drawOT(CORO_PARAM) {
}
}

// g_system->unlockMutex(csModifyingOT);

//Unlock after writing
unlock();

CORO_END_CODE;
}

void RMGfxTargetBuffer::addPrim(RMGfxPrimitive *prim) {
int nPrior;
OTList *cur, *n;

// g_system->lockMutex(csModifyingOT);

// Warn of the OT listing
prim->_task->Register();

Expand All @@ -368,8 +333,6 @@ void RMGfxTargetBuffer::addPrim(RMGfxPrimitive *prim) {
n->_next = cur->_next;
cur->_next = n;
}

// g_system->unlockMutex(csModifyingOT);
}

void RMGfxTargetBuffer::addDirtyRect(const Common::Rect &r) {
Expand Down Expand Up @@ -554,8 +517,8 @@ int RMGfxSourceBufferPal::loadPaletteWA(uint32 resID, bool bSwapped) {
void RMGfxSourceBuffer4::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
}

RMGfxSourceBuffer4::RMGfxSourceBuffer4(int dimx, int dimy, bool bUseDDraw)
: RMGfxBuffer(dimx, dimy, 4, bUseDDraw) {
RMGfxSourceBuffer4::RMGfxSourceBuffer4(int dimx, int dimy)
: RMGfxBuffer(dimx, dimy, 4) {
setPriority(0);
}

Expand All @@ -569,8 +532,8 @@ int RMGfxSourceBuffer4::getBpp() {
return 4;
}

void RMGfxSourceBuffer4::create(int dimx, int dimy, bool bUseDDraw) {
RMGfxBuffer::create(dimx, dimy, 4, bUseDDraw);
void RMGfxSourceBuffer4::create(int dimx, int dimy) {
RMGfxBuffer::create(dimx, dimy, 4);
}

/****************************************************************************\
Expand Down Expand Up @@ -641,8 +604,8 @@ void RMGfxSourceBuffer8::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit
bigBuf.addDirtyRect(Common::Rect(dst._x1, dst._y1, dst._x1 + width, dst._y1 + height));
}

RMGfxSourceBuffer8::RMGfxSourceBuffer8(int dimx, int dimy, bool bUseDDraw)
: RMGfxBuffer(dimx, dimy, 8, bUseDDraw) {
RMGfxSourceBuffer8::RMGfxSourceBuffer8(int dimx, int dimy)
: RMGfxBuffer(dimx, dimy, 8) {
setPriority(0);
_bTrasp0 = false;
}
Expand All @@ -661,8 +624,8 @@ int RMGfxSourceBuffer8::getBpp() {
return 8;
}

void RMGfxSourceBuffer8::create(int dimx, int dimy, bool bUseDDraw) {
RMGfxBuffer::create(dimx, dimy, 8, bUseDDraw);
void RMGfxSourceBuffer8::create(int dimx, int dimy) {
RMGfxBuffer::create(dimx, dimy, 8);
}

#define GETRED(x) (((x) >> 10) & 0x1F)
Expand Down Expand Up @@ -1989,8 +1952,8 @@ void RMGfxSourceBuffer16::prepareImage() {
WRITE_LE_UINT16(&buf[i], FROM_LE_16(buf[i]) & 0x7FFF);
}

RMGfxSourceBuffer16::RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw)
: RMGfxBuffer(dimx, dimy, 16, bUseDDraw) {
RMGfxSourceBuffer16::RMGfxSourceBuffer16(int dimx, int dimy)
: RMGfxBuffer(dimx, dimy, 16) {
setPriority(0);
_bTrasp0 = false;
}
Expand All @@ -2004,8 +1967,8 @@ int RMGfxSourceBuffer16::getBpp() {
return 16;
}

void RMGfxSourceBuffer16::create(int dimx, int dimy, bool bUseDDraw) {
RMGfxBuffer::create(dimx, dimy, 16, bUseDDraw);
void RMGfxSourceBuffer16::create(int dimx, int dimy) {
RMGfxBuffer::create(dimx, dimy, 16);
}

/****************************************************************************\
Expand Down
23 changes: 9 additions & 14 deletions engines/tony/gfxcore.h
Expand Up @@ -61,11 +61,10 @@ class RMGfxBuffer {
int _dimx, _dimy;
byte *_buf;
byte *_origBuf;
bool _bUseDDraw;

public:
RMGfxBuffer();
RMGfxBuffer(int dimx, int dimy, int nBpp, bool bUseDDraw = false);
RMGfxBuffer(int dimx, int dimy, int nBpp);
virtual ~RMGfxBuffer();

// Attributes
Expand All @@ -77,13 +76,9 @@ class RMGfxBuffer {
}

// Creation
virtual void create(int dimx, int dimy, int nBpp, bool bUseDDraw = false);
virtual void create(int dimx, int dimy, int nBpp);
virtual void destroy();

// Buffer access
void lock();
void unlock();

// These are valid only if the buffer is locked
operator byte *();
operator void *();
Expand Down Expand Up @@ -321,11 +316,11 @@ class RMGfxSourceBuffer16 : public RMGfxSourceBuffer {

public:
RMGfxSourceBuffer16(bool bUseTrasp = false);
RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw = false);
RMGfxSourceBuffer16(int dimx, int dimy);
virtual ~RMGfxSourceBuffer16();

// Initialization
void create(int dimx, int dimy, bool bUseDDraw = false);
void create(int dimx, int dimy);

int getBpp();
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
Expand Down Expand Up @@ -366,11 +361,11 @@ class RMGfxSourceBuffer8 : public RMGfxSourceBufferPal {

public:
RMGfxSourceBuffer8(bool bTrasp0 = true);
RMGfxSourceBuffer8(int dimx, int dimy, bool bUseDDraw = false);
RMGfxSourceBuffer8(int dimx, int dimy);
virtual ~RMGfxSourceBuffer8();

// Initialization
void create(int dimx, int dimy, bool bUseDDraw = false);
void create(int dimx, int dimy);

int getBpp();
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
Expand Down Expand Up @@ -533,10 +528,10 @@ class RMGfxSourceBuffer8RLEWordAA : public RMGfxSourceBuffer8RLEWord, public RMG
class RMGfxSourceBuffer4 : public RMGfxSourceBufferPal {
public:
RMGfxSourceBuffer4();
RMGfxSourceBuffer4(int dimx, int dimy, bool bUseDDraw = false);
RMGfxSourceBuffer4(int dimx, int dimy);

// Initialization
void create(int dimx, int dimy, bool bUseDDraw = false);
void create(int dimx, int dimy);

int getBpp();
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
Expand Down Expand Up @@ -618,7 +613,7 @@ class RMGfxTargetBuffer : public virtual RMGfxBuffer {
class RMGfxWoodyBuffer: public RMGfxSourceBuffer16, public RMGfxTargetBuffer {
public:
RMGfxWoodyBuffer();
RMGfxWoodyBuffer(int dimx, int dimy, bool bUseDDraw = false);
RMGfxWoodyBuffer(int dimx, int dimy);
virtual ~RMGfxWoodyBuffer();

virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
Expand Down
10 changes: 0 additions & 10 deletions engines/tony/gfxengine.cpp
Expand Up @@ -500,9 +500,6 @@ void RMGfxEngine::init() {
GLOBALS._gfxEngine = this;
mpalInstallItemIrq(itemIrq);

// Initialize the input
_input.init();

// Initialize the mouse pointer
_point.init();

Expand Down Expand Up @@ -530,13 +527,6 @@ void RMGfxEngine::close() {
_inv.close();
_tony.close();
_point.close();
_input.close();
}

void RMGfxEngine::switchFullscreen(bool bFull) {
}

void RMGfxEngine::GDIControl(bool bCon) {
}

void RMGfxEngine::enableInput() {
Expand Down
6 changes: 0 additions & 6 deletions engines/tony/gfxengine.h
Expand Up @@ -92,12 +92,6 @@ class RMGfxEngine {
// Closes the graphics engine
void close();

// Warns when changing
void switchFullscreen(bool bFull);

// Warn that we are guided by the GDI
void GDIControl(bool bCon);

// Warns when entering or exits the options menu
void openOptionScreen(CORO_PARAM, int type);

Expand Down

0 comments on commit 7b4dd0a

Please sign in to comment.