summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Appert <dappert>2010-12-11 18:27:25 +0000
committerDamien Appert <dappert>2010-12-11 18:27:25 +0000
commiteeed6b3d8386dcf4be6ca08126d516def2da6663 (patch)
tree9134a002644a20068e5c06aa53048f687a8dd1d4
parent3a5541cf69ef8d3db83722454aeda6713f33e351 (diff)
download2010-netlemmings-eeed6b3d8386dcf4be6ca08126d516def2da6663.tar.gz
2010-netlemmings-eeed6b3d8386dcf4be6ca08126d516def2da6663.tar.bz2
2010-netlemmings-eeed6b3d8386dcf4be6ca08126d516def2da6663.zip
modif px*4
git-svn-id: file:///var/svn/2010-netlemmings/trunk@197 077b3477-7977-48bd-8428-443f22f7bfda
-rw-r--r--src/graphic.c24
-rw-r--r--src/include/graphic.h1
2 files changed, 4 insertions, 21 deletions
diff --git a/src/graphic.c b/src/graphic.c
index c6acf4f..18e62c2 100644
--- a/src/graphic.c
+++ b/src/graphic.c
@@ -70,20 +70,6 @@ SDL_Surface * loadGif(char *filePath) {
return IMG_Load(filePath);
}
-int pxAreaColor (SDL_Surface* s, Uint32 p , int x , int y , int mX , int mY ){
- int i,j;
-
- // FIXME : make some test to prevent out of bound pixel
-
- for (i=x;i<x+mX;++i){
- for (j=y;j<y+mY;++j){
- putPixel(s, i , j , p);
- }
- }
-
- return 0;
-}
-
int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameGraphics_t *gGraph) {
int res, i, modifier;
int x,y,xmin,xmax,ymin,ymax,y2,xdst,ydst;
@@ -150,8 +136,8 @@ int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameGraphics_t *gGraph) {
xmax=min(tile->clip_rect.w, gGraph->surfaces.terrain->clip_rect.w - gIni->level.terrains[i].xpos);
SDL_LockSurface(tile);
- for (y=ymin; y<ymax; y+=2) {
- for (x=xmin; x<xmax; x+=2) {
+ for (y=ymin; y<ymax; y++) {
+ for (x=xmin; x<xmax; x++) {
// If we have Upside Down modifier, count lines in reverse order
if (( modifier & 4) == 4 ) {
y2=tile->clip_rect.h-1-y;
@@ -175,10 +161,8 @@ int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameGraphics_t *gGraph) {
dstPixel=getPixel8BitPalette(tile, x, y2);
dstStencil=ccc_terrain;
}
-
- pxAreaColor (gGraph->surfaces.terrain,dstPixel,xdst,ydst,2,2);
- pxAreaColor (gGraph->surfaces.stencil,dstStencil,xdst,ydst,2,2);
-
+ putPixel(gGraph->surfaces.terrain,xdst,ydst,dstPixel);
+ putPixel(gGraph->surfaces.stencil,xdst,ydst,dstStencil);
}
}
}
diff --git a/src/include/graphic.h b/src/include/graphic.h
index 1623d79..c1a92c5 100644
--- a/src/include/graphic.h
+++ b/src/include/graphic.h
@@ -16,7 +16,6 @@ int isTransparent(SDL_Surface *s, int x, int y);
void putPixel(SDL_Surface *s, int x, int y, Uint32 p);
SDL_Surface * createSurface(int width, int height);
SDL_Surface * loadGif(char *filePath);
-int pxAreaColor (SDL_Surface* s, Uint32 p , int x , int y , int mX , int mY );
int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameGraphics_t *gGraph);
int repaint(gameGraphSurfaces_t *srcSurfs, SDL_Rect *srcRect, SDL_Surface *dstSurf, SDL_Rect dstRect);