|
From: <dv...@us...> - 2008-04-26 00:53:50
|
Revision: 161
http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=161&view=rev
Author: dvalin
Date: 2008-04-25 17:53:46 -0700 (Fri, 25 Apr 2008)
Log Message:
-----------
drop getDoublePicture, Image class already provides getResized.. (I suck)
Modified Paths:
--------------
branches/dunks/include/pakfile/Cpsfile.h
branches/dunks/src/pakfile/Cpsfile.cpp
Modified: branches/dunks/include/pakfile/Cpsfile.h
===================================================================
--- branches/dunks/include/pakfile/Cpsfile.h 2008-04-26 00:48:39 UTC (rev 160)
+++ branches/dunks/include/pakfile/Cpsfile.h 2008-04-26 00:53:46 UTC (rev 161)
@@ -18,10 +18,7 @@
Image * getPicture();
- Image * getDoublePicture();
- Image * getSubPicture(unsigned int left, unsigned int top, unsigned int width, unsigned int height);
-
private:
unsigned char* Filedata;
Uint32 CpsFilesize;
Modified: branches/dunks/src/pakfile/Cpsfile.cpp
===================================================================
--- branches/dunks/src/pakfile/Cpsfile.cpp 2008-04-26 00:48:39 UTC (rev 160)
+++ branches/dunks/src/pakfile/Cpsfile.cpp 2008-04-26 00:53:46 UTC (rev 161)
@@ -69,40 +69,6 @@
return img;
}
-Image * Cpsfile::getDoublePicture() {
- SDL_Surface *inputPic = getPicture()->getSurface();
- SDL_Surface *returnPic;
-
- // create new picture surface
- if((returnPic = SDL_CreateRGBSurface(SDL_HWSURFACE,inputPic->w * 2,inputPic->h * 2,8,0,0,0,0))== NULL) {
- fprintf(stderr,"DoublePicture: Cannot create new Picture!\n");
- exit(EXIT_FAILURE);
- }
-
- SDL_SetColors(returnPic, inputPic->format->palette->colors, 0, inputPic->format->palette->ncolors);
- SDL_LockSurface(returnPic);
- SDL_LockSurface(inputPic);
-
- //Now we can copy pixel by pixel
- for(int y = 0; y < inputPic->h;y++) {
- for(int x = 0; x < inputPic->w; x++) {
- char val = *( ((char*) (inputPic->pixels)) + y*inputPic->pitch + x);
- *( ((char*) (returnPic->pixels)) + 2*y*returnPic->pitch + 2*x) = val;
- *( ((char*) (returnPic->pixels)) + 2*y*returnPic->pitch + 2*x+1) = val;
- *( ((char*) (returnPic->pixels)) + (2*y+1)*returnPic->pitch + 2*x) = val;
- *( ((char*) (returnPic->pixels)) + (2*y+1)*returnPic->pitch + 2*x+1) = val;
- }
- }
-
- SDL_UnlockSurface(inputPic);
- SDL_UnlockSurface(returnPic);
-
- SDL_FreeSurface(inputPic);
- Image * img = new Image(returnPic);
-
- return img;
-}
-
Image * Cpsfile::getSubPicture(unsigned int left, unsigned int top, unsigned int width, unsigned int height)
{
SDL_Surface *Pic = getPicture()->getSurface();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|