aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/gfx.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2008-12-06 18:23:34 +0000
committerFilippos Karapetis2008-12-06 18:23:34 +0000
commit065694dbb166d2fb113ba36b9340d91f9c71fdbe (patch)
treec986e2dfb4c30027ce444397cb27f09f2c8b7f67 /engines/saga/gfx.cpp
parent5f2cd3c4a7e771a30e132fa90936b1da72fa21ab (diff)
downloadscummvm-rg350-065694dbb166d2fb113ba36b9340d91f9c71fdbe.tar.gz
scummvm-rg350-065694dbb166d2fb113ba36b9340d91f9c71fdbe.tar.bz2
scummvm-rg350-065694dbb166d2fb113ba36b9340d91f9c71fdbe.zip
- Prevented direct reference to the back buffer in many cases (apart from a few, where it's modified directly)
- Added skeleton code for dirty rectangle handling (still unfinished and non-working) - Added wrapper functions to access the back buffer, which add the appropriate dirty rectangles automatically svn-id: r35264
Diffstat (limited to 'engines/saga/gfx.cpp')
-rw-r--r--engines/saga/gfx.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index 285a33b656..eac1d871ae 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -30,6 +30,7 @@
#include "saga/interface.h"
#include "saga/rscfile.h"
#include "saga/scene.h"
+#include "saga/render.h"
#include "common/system.h"
#include "graphics/cursorman.h"
@@ -561,4 +562,28 @@ bool hitTestPoly(const Point *points, unsigned int npoints, const Point& test_po
return inside_flag;
}
+// This method adds a dirty rectangle automatically
+void Gfx::drawFrame(const Common::Point &p1, const Common::Point &p2, int color) {
+ _backBuffer.drawFrame(p1, p2, color);
+ _vm->_render->addDirtyRect(Common::Rect(p1.x, p1.y, p2.x, p2.y));
+}
+
+// This method adds a dirty rectangle automatically
+void Gfx::drawRect(const Common::Rect &destRect, int color) {
+ _backBuffer.drawRect(destRect, color);
+ _vm->_render->addDirtyRect(destRect);
+}
+
+// This method adds a dirty rectangle automatically
+void Gfx::fillRect(const Common::Rect &destRect, uint32 color) {
+ _backBuffer.fillRect(destRect, color);
+ _vm->_render->addDirtyRect(destRect);
+}
+
+// This method adds a dirty rectangle automatically
+void Gfx::drawRegion(const Common::Rect &destRect, const byte *sourceBuffer) {
+ _backBuffer.blit(destRect, sourceBuffer);
+ _vm->_render->addDirtyRect(destRect);
+}
+
} // End of namespace Saga