1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Zrobione przyciski menu głównego, ich podświetlanie i naciskanie.

Aby zamknąć menu naciśnij 'q'.
This commit is contained in:
Michał W. Urbańczyk
2007-06-11 01:38:07 +00:00
parent 6ed3c85f72
commit fd1e65d940
3 changed files with 291 additions and 18 deletions

View File

@@ -1,18 +1,18 @@
#include "SDL.h"
#include "CSemiDefHandler.h"
#include "CSemiLodHandler.h"
struct AnimatedPic
{
std::vector<SDL_Surface*> frames;
~AnimatedPic()
{
for (int i=0;i<frames.size();i++)
{
SDL_FreeSurface(frames[i]);
delete frames[i];
}
}
};
//struct AnimatedPic
//{
// std::vector<SDL_Surface*> frames;
// ~AnimatedPic()
// {
// for (int i=0;i<frames.size();i++)
// {
// SDL_FreeSurface(frames[i]);
// delete frames[i];
// }
// }
//};
class CPreGame
{
public:
@@ -23,11 +23,13 @@ public:
SDL_Surface * background;
CSemiDefHandler *newGame, *loadGame, *highScores,*credits, *quit;
SDL_Rect lNewGame, lLoadGame, lHighScores, lCredits, lQuit;
} * ourMainMenu;
int highlighted;//0=none; 1=new game; 2=load game; 3=high score; 4=credits; 5=quit
} * ourMainMenu, * newGameManu;
std::string map; //selected map
std::vector<CSemiLodHandler *> handledLods;
CPreGame(); //c-tor
void showMainMenu();
void runLoop(); // runs mainloop of PreGame
void initMainMenu(); //loads components for main menu
void highlightButton(int which, int on);
};