summaryrefslogtreecommitdiff
path: root/src/graphics/Graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/Graphics.cpp')
-rw-r--r--src/graphics/Graphics.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp
index 3394ab2..35120c9 100644
--- a/src/graphics/Graphics.cpp
+++ b/src/graphics/Graphics.cpp
@@ -55,6 +55,16 @@ void VideoBuffer::Resize(int width, int height, bool resample)
int newWidth = width;
int newHeight = height;
pixel * newBuffer;
+ if(newHeight == -1 && newWidth == -1)
+ return;
+ if(newHeight == -1)
+ {
+ newHeight = ((float)Height)*((float)newWidth/(float)Width);
+ }
+ if(newWidth == -1)
+ {
+ newWidth = ((float)Width)*((float)newHeight/(float)Height);
+ }
if(resample)
newBuffer = Graphics::resample_img(Buffer, Width, Height, newWidth, newHeight);
else
@@ -1113,16 +1123,6 @@ pixel *Graphics::render_packed_rgb(void *image, int width, int height, int cmp_s
return res;
}
-void Graphics::draw_image(const VideoBuffer & vidBuf, int x, int y, int a)
-{
- draw_image(vidBuf.Buffer, x, y, vidBuf.Width, vidBuf.Height, a);
-}
-
-void Graphics::draw_image(VideoBuffer * vidBuf, int x, int y, int a)
-{
- draw_image(vidBuf->Buffer, x, y, vidBuf->Width, vidBuf->Height, a);
-}
-
VideoBuffer Graphics::DumpFrame()
{
#ifdef OGLI