summaryrefslogtreecommitdiff
path: root/src/graphics/Graphics.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2013-03-15 12:59:55 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2013-03-15 12:59:55 (GMT)
commit73b6ff4efb4bbe31993a595987b9abc59a5a2e76 (patch)
tree7320e993bf6df6c59ef956087f3fa63f17b19b5d /src/graphics/Graphics.cpp
parent6b68c04cd613847e4f2bbe1f0cd8a2a13a9d4660 (diff)
downloadpowder-73b6ff4efb4bbe31993a595987b9abc59a5a2e76.zip
powder-73b6ff4efb4bbe31993a595987b9abc59a5a2e76.tar.gz
Use VideoBuffer in place of thumbnail
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