diff --git a/changelog.txt b/changelog.txt index a75e3bfca..2c808225f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,11 @@ Commander Genius Pre-Release v0.3 (CloneKeenPlus): -------------------------------------------------- +01-08-2009 +- Masked tile can now use semi-transparent pixels. Silcar 3 ghosts use that (Tulip) +- Implemented a new dialog system. Base for the future dialogs and menus +- Minor issues + 26-07-2009 - fixed some bugs which made the game crash - removed an old and obsolete class diff --git a/src/CGraphics.cpp b/src/CGraphics.cpp index 47bd4b8cc..b9d08da82 100644 --- a/src/CGraphics.cpp +++ b/src/CGraphics.cpp @@ -96,10 +96,18 @@ unsigned char xa,ya; void CGraphics::drawSprite_direct(int x, int y, unsigned int t) { unsigned char xa,ya; +unsigned char oldpixel; // used for the or operation when drawing maked sprites + for(ya=0;yasetpixel(x+xa, y+ya, sprites[t].imgdata[ya][xa]); + if ( sprites[t].maskdata[ya][xa] ) + { + oldpixel = g_pVideoDriver->getpixel(x+xa, y+ya); + g_pVideoDriver->setpixel(x+xa, y+ya, (oldpixel | sprites[t].imgdata[ya][xa]) ); + } + else + g_pVideoDriver->setpixel(x+xa, y+ya, (sprites[t].imgdata[ya][xa]==0) ? 16 : + sprites[t].imgdata[ya][xa]); } void CGraphics::drawTile(int x, int y, unsigned int t) @@ -250,11 +258,12 @@ unsigned int xstart,ystart; bufoffX = (x+xstart+scrollx_buf)&511; // offset within line for(xa=xstart;xa 255) - { t=0; // If there are some invalid values in the file - } - - c++; } - - // now do the enemies - gottenazero = 0; - - // get enemy/objectlayer data + // now do the sprites + // get sprite data curmapx = curmapy = mapdone = numruns = 0; resetcnt = resetpt = 0; while(!mapdone) - { - t = filebuf[c]; + { + t = filebuf[c]; - if (t==0 && !gottenazero) - { - curmapx = curmapy = 0; - gottenazero = 1; - } - if (map.isworldmap) addobjectlayertile(t, pCKP); else addenemytile(t, pCKP); - if (++resetcnt==resetpt) curmapx=curmapy=0; + if (map.isworldmap) addobjectlayertile(t, pCKP); else addenemytile(t, pCKP); + if (++resetcnt==resetpt) curmapx=curmapy=0; - c++; - } + c++; + } free(filebuf); diff --git a/src/fileio/CTileLoader.cpp b/src/fileio/CTileLoader.cpp index e5f8fd775..f47019e14 100644 --- a/src/fileio/CTileLoader.cpp +++ b/src/fileio/CTileLoader.cpp @@ -148,11 +148,6 @@ bool CTileLoader::load() } } - for(i=0 ; iControl.levelcontrol.episode==1) - { - -// MakeMask(443, 155, 7); - // tiles[443].masktile = 155; -// tiles[428].masktile = 155; - } } void procgoodie(int t, int mpx, int mpy, int theplayer, stCloneKeenPlus *pCKP) diff --git a/src/sdl/CVideoDriver.cpp b/src/sdl/CVideoDriver.cpp index cda814122..dc571caa6 100644 --- a/src/sdl/CVideoDriver.cpp +++ b/src/sdl/CVideoDriver.cpp @@ -724,7 +724,6 @@ void CVideoDriver::setpixel(unsigned int x, unsigned int y, unsigned char c) if( x >= GAME_STD_WIDTH || y >= GAME_STD_HEIGHT ) // out of Bonds!!! return; - if(BlitSurface->format->BitsPerPixel == 16) { Uint16 *ubuff16; @@ -749,7 +748,7 @@ void CVideoDriver::setpixel(unsigned int x, unsigned int y, unsigned char c) } unsigned char CVideoDriver::getpixel(int x, int y) { - return 0; + return 15; } // "Console" here refers to the capability to pop up in-game messages diff --git a/src/vorticon/CEGALatch.cpp b/src/vorticon/CEGALatch.cpp index e81d3c5c6..f55c7d6e8 100644 --- a/src/vorticon/CEGALatch.cpp +++ b/src/vorticon/CEGALatch.cpp @@ -102,7 +102,6 @@ bool CEGALatch::loadData(const std::string& filename, bool compresseddata) plane4 = (m_latchplanesize * 3); // ** read the 8x8 tiles ** - //g_pLogFile->ftextOut("latch_loadlatch(): Decoding 8x8 tiles...
", fname); // set up the getbit() function of CPlanes class CPlanes *Planes = new CPlanes(plane1 + m_fontlocation, @@ -112,7 +111,7 @@ bool CEGALatch::loadData(const std::string& filename, bool compresseddata) 0); // Load 8x8 Tiles - char c=0; + unsigned char c=0; for(int p=0;p<4;p++) { for(int t=0;t>= 8; Sprite[i].hitbox_u >>= 8; Sprite[i].hitbox_r >>= 8; @@ -143,7 +143,7 @@ bool CEGASprit::loadData(const std::string& filename, bool compresseddata) c = sprites[s].imgdata[y][x]; } c |= (Planes->getbit(RawData, p) << p); - if (p==3 && c==0) c = 16; + //if (p==3 && c==0) c = 16; sprites[s].imgdata[y][x] = c; } } @@ -159,7 +159,7 @@ bool CEGASprit::loadData(const std::string& filename, bool compresseddata) { for(int x=0 ; xgetbit(RawData, 4)); + sprites[s].maskdata[y][x] = Planes->getbit(RawData, 4); } } }