summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index b5b30995..19f87e0c 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -33,20 +33,10 @@ void ImageRect::setAlpha(float alpha)
}
}
-void Graphics::videoResized(int w, int h)
+void Graphics::updateSize(int width, int height, float /*scale*/)
{
- mWidth = w;
- mHeight = h;
-}
-
-int Graphics::getWidth() const
-{
- return mWidth;
-}
-
-int Graphics::getHeight() const
-{
- return mHeight;
+ mWidth = width;
+ mHeight = height;
}
bool Graphics::drawImage(Image *image, int x, int y)
@@ -63,9 +53,6 @@ bool Graphics::drawImage(Image *image,
int width, int height,
bool useColor)
{
- if (!image)
- return false;
-
return drawRescaledImage(image,
srcX, srcY,
dstX, dstY,
@@ -133,3 +120,13 @@ void Graphics::drawImageRect(int x, int y, int w, int h,
imgRect.grid[1], imgRect.grid[5], imgRect.grid[7], imgRect.grid[3],
imgRect.grid[4]);
}
+
+void Graphics::_beginDraw()
+{
+ pushClipArea(gcn::Rectangle(0, 0, mWidth, mHeight));
+}
+
+void Graphics::_endDraw()
+{
+ popClipArea();
+}