Skip to content

Commit

Permalink
TONY: Silent some CppCheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jun 13, 2012
1 parent 746dcf3 commit 42a322d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
6 changes: 5 additions & 1 deletion engines/tony/font.cpp
Expand Up @@ -42,6 +42,7 @@ namespace Tony {

RMFont::RMFont() {
_letter = NULL;
_nLetters = _fontDimx = _fontDimy = _dimx = _dimy = 0;
}

RMFont::~RMFont() {
Expand Down Expand Up @@ -1993,7 +1994,7 @@ void RMText::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
\****************************************************************************/

RMTextDialog::RMTextDialog() : RMText() {
_startTime = 0;
_time = _startTime = 0;
_dst = RMPoint(0, 0);

_bSkipStatus = true;
Expand Down Expand Up @@ -2327,6 +2328,9 @@ RMDialogChoice::RMDialogChoice() {

_hUnreg = CoroScheduler.createEvent(false, false);
_bRemoveFromOT = false;

_curAdded = 0;
_bShow = false;
}

RMDialogChoice::~RMDialogChoice() {
Expand Down
4 changes: 2 additions & 2 deletions engines/tony/font.h
Expand Up @@ -57,8 +57,8 @@ class RMFont : public RMGfxTaskSetPrior {

class RMFontPrimitive : public RMGfxPrimitive {
public:
RMFontPrimitive() : RMGfxPrimitive() {}
RMFontPrimitive(RMGfxTask *task) : RMGfxPrimitive(task) {}
RMFontPrimitive() : RMGfxPrimitive() { _nChar = 0; }
RMFontPrimitive(RMGfxTask *task) : RMGfxPrimitive(task) { _nChar = 0; }
virtual ~RMFontPrimitive() { }
virtual RMGfxPrimitive *duplicate() {
return new RMFontPrimitive(*this);
Expand Down
3 changes: 3 additions & 0 deletions engines/tony/game.cpp
Expand Up @@ -1473,6 +1473,9 @@ bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, RMS
RMPointer::RMPointer() {
Common::fill(_pointer, _pointer + 16, (RMGfxSourceBuffer8 *)NULL);
Common::fill(_specialPointer, _specialPointer + 16, (RMItem *)NULL);

_nCurPointer = _nCurSpecialPointer = 0;
_nCurCustomPointer = NULL;
}

RMPointer::~RMPointer() {
Expand Down
16 changes: 7 additions & 9 deletions engines/tony/gfxcore.cpp
Expand Up @@ -390,16 +390,15 @@ RMGfxSourceBufferPal::~RMGfxSourceBufferPal() {
}

int RMGfxSourceBufferPal::loadPaletteWA(const byte *buf, bool bSwapped) {
int i;

if (bSwapped)
for (i = 0; i < (1 << getBpp()); i++) {
if (bSwapped) {
for (int i = 0; i < (1 << getBpp()); i++) {
_pal[i * 3 + 0] = buf[i * 3 + 2];
_pal[i * 3 + 1] = buf[i * 3 + 1];
_pal[i * 3 + 2] = buf[i * 3 + 0];
}
else
} else {
copyMemory(_pal, buf, (1 << getBpp()) * 3);
}

preparePalette();

Expand Down Expand Up @@ -1819,7 +1818,6 @@ RMGfxSourceBuffer16::~RMGfxSourceBuffer16() {
}

void RMGfxSourceBuffer16::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
int x, y;
uint16 *buf = bigBuf;
uint16 *raw = (uint16 *)_buf;
int dimx, dimy;
Expand Down Expand Up @@ -1852,8 +1850,8 @@ void RMGfxSourceBuffer16::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimi
buf += y1 * bigBuf.getDimx() + x1;

if (_bTrasp0) {
for (y = 0; y < dimy; y++) {
for (x = 0; x < dimx;) {
for (int y = 0; y < dimy; y++) {
for (int x = 0; x < dimx;) {
while (x < dimx && raw[x] == 0)
x++;

Expand All @@ -1867,7 +1865,7 @@ void RMGfxSourceBuffer16::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimi
buf += bigBuf.getDimx();
}
} else {
for (y = 0; y < dimy; y++) {
for (int y = 0; y < dimy; y++) {
Common::copy(raw, raw + dimx, buf);
buf += bigBuf.getDimx();
raw += _dimx;
Expand Down
5 changes: 5 additions & 0 deletions engines/tony/inventory.cpp
Expand Up @@ -755,6 +755,11 @@ int RMInventory::loadState(byte *state) {
* RMInterface methods
\****************************************************************************/

RMInterface::RMInterface() : RMGfxSourceBuffer8RLEByte() {
_bActive = _bPerorate = false;
_lastHotZone = -1;
}

RMInterface::~RMInterface() {

}
Expand Down
1 change: 1 addition & 0 deletions engines/tony/inventory.h
Expand Up @@ -169,6 +169,7 @@ class RMInterface : public RMGfxSourceBuffer8RLEByte {
int onWhichBox(RMPoint pt);

public:
RMInterface();
virtual ~RMInterface();

// The usual DoFrame (poll the graphics engine)
Expand Down

0 comments on commit 42a322d

Please sign in to comment.