Fixed compilation when SAGA_DEBUG is defined

svn-id: r35262
This commit is contained in:
Filippos Karapetis 2008-12-06 14:38:04 +00:00
parent 668eaea68c
commit d148d481f9
4 changed files with 10 additions and 15 deletions

View file

@ -99,9 +99,7 @@ struct Color {
struct Surface : Graphics::Surface { struct Surface : Graphics::Surface {
void transitionDissolve(const byte *sourceBuffer, const Common::Rect &sourceRect, int flags, double percent); void transitionDissolve(const byte *sourceBuffer, const Common::Rect &sourceRect, int flags, double percent);
#ifdef SAGA_DEBUG
void drawPalette(); void drawPalette();
#endif
void drawPolyLine(const Point *points, int count, int color); void drawPolyLine(const Point *points, int count, int color);
void blit(const Common::Rect &destRect, const byte *sourceBuffer); void blit(const Common::Rect &destRect, const byte *sourceBuffer);

View file

@ -149,6 +149,8 @@ void HitZone::draw(SagaEngine *vm, int color) {
Point *points; Point *points;
Point specialPoint1; Point specialPoint1;
Point specialPoint2; Point specialPoint2;
Surface *backBuffer = vm->_gfx->getBackBuffer();
for (i = 0; i < _clickAreasCount; i++) { for (i = 0; i < _clickAreasCount; i++) {
clickArea = &_clickAreas[i]; clickArea = &_clickAreas[i];
pointsCount = clickArea->pointsCount; pointsCount = clickArea->pointsCount;
@ -166,11 +168,11 @@ void HitZone::draw(SagaEngine *vm, int color) {
if (pointsCount == 2) { if (pointsCount == 2) {
// 2 points represent a box // 2 points represent a box
ds->drawFrame(points[0], points[1], color); backBuffer->drawFrame(points[0], points[1], color);
} else { } else {
if (pointsCount > 2) { if (pointsCount > 2) {
// Otherwise draw a polyline // Otherwise draw a polyline
ds->drawPolyLine(points, pointsCount, color); backBuffer->drawPolyLine(points, pointsCount, color);
} }
} }
if (vm->_scene->getFlags() & kSceneFlagISO) { if (vm->_scene->getFlags() & kSceneFlagISO) {
@ -184,7 +186,7 @@ void HitZone::draw(SagaEngine *vm, int color) {
specialPoint1.y--; specialPoint1.y--;
specialPoint2.x++; specialPoint2.x++;
specialPoint2.y++; specialPoint2.y++;
ds->drawFrame(specialPoint1, specialPoint2, color); backBuffer->drawFrame(specialPoint1, specialPoint2, color);
} }
} }
#endif #endif

View file

@ -76,9 +76,7 @@ public:
return objectIndexToId(kGameObjectStepZone, _index); return objectIndexToId(kGameObjectStepZone, _index);
} }
bool getSpecialPoint(Point &specialPoint) const; bool getSpecialPoint(Point &specialPoint) const;
#ifdef SAGA_DEBUG void draw(SagaEngine *vm, int color); // for debugging
void draw(SagaEngine *vm, int color);
#endif
bool hitTest(const Point &testPoint); bool hitTest(const Point &testPoint);
private: private:
@ -105,10 +103,7 @@ public:
} }
void load(const byte *resourcePointer, size_t resourceLength); void load(const byte *resourcePointer, size_t resourceLength);
void freeMem(void); void freeMem(void);
void draw(const Point& testPoint, int color, int color2); // for debugging
#ifdef SAGA_DEBUG
void draw(Surface *drawSurface, const Point& testPoint, int color, int color2);
#endif
int hitTest(const Point& testPoint); int hitTest(const Point& testPoint);
HitZone *getHitZone(int16 index) { HitZone *getHitZone(int16 index) {
if ((index < 0) || (index >= _hitZoneListCount)) { if ((index < 0) || (index >= _hitZoneListCount)) {

View file

@ -115,9 +115,9 @@ void Render::drawScene() {
#ifdef SAGA_DEBUG #ifdef SAGA_DEBUG
if (getFlags() & RF_OBJECTMAP_TEST) { if (getFlags() & RF_OBJECTMAP_TEST) {
if (_vm->_scene->_objectMap) if (_vm->_scene->_objectMap)
_vm->_scene->_objectMap->draw(backBufferSurface, mousePoint, kITEColorBrightWhite, kITEColorBlack); _vm->_scene->_objectMap->draw(mousePoint, kITEColorBrightWhite, kITEColorBlack);
if (_vm->_scene->_actionMap) if (_vm->_scene->_actionMap)
_vm->_scene->_actionMap->draw(backBufferSurface, mousePoint, kITEColorRed, kITEColorBlack); _vm->_scene->_actionMap->draw(mousePoint, kITEColorRed, kITEColorBlack);
} }
#endif #endif
@ -168,7 +168,7 @@ void Render::drawScene() {
textPoint.x = backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontSmall, txtBuffer, 0, kFontOutline); textPoint.x = backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontSmall, txtBuffer, 0, kFontOutline);
textPoint.y = 2; textPoint.y = 2;
_vm->_font->textDraw(kKnownFontSmall, backBufferSurface, txtBuffer, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline); _vm->_font->textDraw(kKnownFontSmall, txtBuffer, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
} }
#endif #endif