From: <ka...@us...> - 2014-04-09 06:18:27
|
Revision: 8222 http://sourceforge.net/p/paintown/code/8222 Author: kazzmir Date: 2014-04-09 06:18:21 +0000 (Wed, 09 Apr 2014) Log Message: ----------- remove temporary bitmap in the select screen Modified Paths: -------------- trunk/src/paintown-engine/game/character-select.cpp trunk/src/paintown-engine/game/game.cpp Modified: trunk/src/paintown-engine/game/character-select.cpp =================================================================== --- trunk/src/paintown-engine/game/character-select.cpp 2014-04-06 03:06:19 UTC (rev 8221) +++ trunk/src/paintown-engine/game/character-select.cpp 2014-04-09 06:18:21 UTC (rev 8222) @@ -530,14 +530,24 @@ // Player Util::ReferenceCount<Paintown::DisplayCharacter> displayed = player->guy; if (displayed->isLoaded()){ - Graphics::Bitmap temp(width, height); - temp.clearToMask(); Paintown::Character smaller(*displayed); - smaller.setX( width / 2 ); - smaller.setY( 0 ); - smaller.setZ( smaller.getHeight() ); - smaller.draw( &temp, 0, 0 ); - temp.drawStretched(x, y, width, height, bmp); + int displayWidth = smaller.getWidth(); + int displayHeight = smaller.getHeight(); + + Graphics::Bitmap area(Graphics::Bitmap(bmp, x, y, width, height).aspectRatio(displayWidth, displayHeight)); + +#ifdef USE_SDL + /* Shadows are messed up in sdl for some reason. They look like a purple blotch. Allegro5 looks ok though. */ + smaller.setDrawShadow(false); +#endif + + Graphics::StretchedBitmap temp(displayWidth, displayHeight, area, Graphics::StretchedBitmap::Mask); + temp.start(); + smaller.setX(displayWidth / 2); + smaller.setY(0); + smaller.setZ(displayHeight); + smaller.draw(&temp, 0, 0); + temp.finish(); } else { const int length = font.textLength(displayed->getName().c_str()); const int middle = font.getHeight()/4; Modified: trunk/src/paintown-engine/game/game.cpp =================================================================== --- trunk/src/paintown-engine/game/game.cpp 2014-04-06 03:06:19 UTC (rev 8221) +++ trunk/src/paintown-engine/game/game.cpp 2014-04-09 06:18:21 UTC (rev 8222) @@ -222,17 +222,6 @@ player->resetInput(); } - /* use the current screen as the background */ - /* in SDL/Allegro4 the screen buffer is always GFX_X, GFX_Y because it is - * an intermediate buffer before scaling to the screen. - * in Allegro5 the screen buffer is the actual screen so it may be larger - * than GFX_X, GFX_Y. - * Here we do a hack to rescale the screen buffer to the appropriate size. - * The width/height of screen_buffer in Allegro5 will be GFX_X, GFX_Y because - * thats what it was created with. - */ - /* FIXME: scale it to the size of the menu */ - // context.addBackground(Graphics::Bitmap(screen_buffer, true).scaleTo(640, 480)); try{ menu.run(context); /* im pretty sure there is no way to get the menu to return normally, @@ -381,7 +370,7 @@ } }; -bool playLevel( World & world, const vector< Paintown::Object * > & players){ +bool playLevel(World & world, const vector<Paintown::Object *> & players){ /* user presses ESC in the game and brings up the menu. ESC in the menu * should go back to the game. selecting the 'exit' option should quit the game * to the main menu. |