diff options
Diffstat (limited to 'src/graphic.c')
-rw-r--r-- | src/graphic.c | 24 |
1 files changed, 4 insertions, 20 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); } } } |