From 57ed3585ebf8393230bf633cf2f249fa9b91a1bf Mon Sep 17 00:00:00 2001 From: Damien Appert Date: Sat, 11 Dec 2010 14:30:17 +0000 Subject: bon j'ai regardé le code :p MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2010-netlemmings/trunk@190 077b3477-7977-48bd-8428-443f22f7bfda --- .../SDL_tuto/TestParserLemmingsLVL/SpecLemming.odt | Bin 20911 -> 25885 bytes src/graphic.c | 21 +++++++++++++++++++++ src/include/graphic.h | 1 + src/loader.c | 1 + 4 files changed, 23 insertions(+) diff --git a/sdl-test/SDL_tuto/TestParserLemmingsLVL/SpecLemming.odt b/sdl-test/SDL_tuto/TestParserLemmingsLVL/SpecLemming.odt index 675e2c9..878a5ee 100644 Binary files a/sdl-test/SDL_tuto/TestParserLemmingsLVL/SpecLemming.odt and b/sdl-test/SDL_tuto/TestParserLemmingsLVL/SpecLemming.odt differ diff --git a/src/graphic.c b/src/graphic.c index b596be8..05a12cd 100644 --- a/src/graphic.c +++ b/src/graphic.c @@ -70,8 +70,23 @@ 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;isurfaces.terrain,dstPixel,xdst,ydst,2,2); + pxAreaColor (gGraph->surfaces.stencil,dstStencil,xdst,ydst,2,2); + /* //FIXME : optimiser le nombre d'appels ici ! putPixel(gGraph->surfaces.terrain, xdst, ydst, dstPixel); putPixel(gGraph->surfaces.terrain, xdst+1, ydst, dstPixel); putPixel(gGraph->surfaces.terrain, xdst, ydst+1, dstPixel); putPixel(gGraph->surfaces.terrain, xdst+1, ydst+1, dstPixel); + putPixel(gGraph->surfaces.stencil, xdst, ydst, dstStencil); putPixel(gGraph->surfaces.stencil, xdst+1, ydst, dstStencil); putPixel(gGraph->surfaces.stencil, xdst, ydst+1, dstStencil); putPixel(gGraph->surfaces.stencil, xdst+1, ydst+1, dstStencil); + */ + } } } diff --git a/src/include/graphic.h b/src/include/graphic.h index 32046aa..a4756ea 100644 --- a/src/include/graphic.h +++ b/src/include/graphic.h @@ -16,6 +16,7 @@ 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); #endif /*GRAPHIC_H*/ diff --git a/src/loader.c b/src/loader.c index d3cce84..e818ff4 100644 --- a/src/loader.c +++ b/src/loader.c @@ -59,6 +59,7 @@ int loadRessources(gameIni_t *gIni, gameRess_t *gRess) { case 7: case 8: snprintf(filepath, filenamelen, "%s/%s/%som_%d.gif", PATH_STYLE, gIni->style.name, gIni->style.name, i); + // ... cheater !! gRess->style.objectMasks[i] = loadGif(filepath); if (gRess->style.objectMasks[i]==NULL) { logs2(LOG_WARN, "loadRessources(), loadGif() error for ", filepath); -- cgit v1.2.3