From f87231eab36e900a5f96e24e5c0c6fb90ab7bf62 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sat, 10 Apr 2004 20:37:36 +0000 Subject: [PATCH] - reduced menu fadness a bit (ie. balanced the edges) SVN-Revision: 457 --- src/gameloop.cpp | 16 ++++++++-------- src/gameloop.h | 7 +++++-- src/menu.cpp | 8 ++++---- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 3b8ceb2dd..e9b402fc2 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -296,7 +296,8 @@ void game_event(void) /* --- GAME ACTION! --- */ -int game_action(void) +int +GameSession::action() { unsigned int i; @@ -464,7 +465,8 @@ int game_action(void) /* --- GAME DRAW! --- */ -void game_draw(void) +void +GameSession::draw() { int y,x; @@ -655,7 +657,7 @@ GameSession::run() while (SDL_PollEvent(&event)) {} - game_draw(); + draw(); do { jump = false; @@ -721,7 +723,7 @@ GameSession::run() frame_ratio = 1; while(z >= 1) {*/ - if (game_action() == 0) + if (action() == 0) { /* == 0: no more lives */ /* == -1: continues */ @@ -747,7 +749,7 @@ GameSession::run() game_draw(); else jump = true;*/ /*FIXME: Implement this tweak right.*/ - game_draw(); + draw(); /* Time stops in pause mode */ if(game_pause || show_menu ) @@ -817,10 +819,8 @@ GameSession::run() return(quit); } - /* Load graphics/sounds shared between all levels: */ - -void loadshared(void) +void loadshared() { int i; diff --git a/src/gameloop.h b/src/gameloop.h index 542b7b174..b7e048b2d 100644 --- a/src/gameloop.h +++ b/src/gameloop.h @@ -32,10 +32,13 @@ extern int game_started; class GameSession { private: - timer_type fps_timer, frame_timer; + timer_type fps_timer, frame_timer; + public: GameSession(const char * subset, int levelnb, int mode); - int run(); + int run(); + void draw(); + int action(); }; void activate_bad_guys(Level* plevel); diff --git a/src/menu.cpp b/src/menu.cpp index 3ea29437f..99073f500 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -481,7 +481,7 @@ int Menu::width() } } - return (menu_width * 16 + 48); + return (menu_width * 16 + 24); } int Menu::height() @@ -498,9 +498,9 @@ Menu::draw() /* Draw a transparent background */ fillrect(pos_x - menu_width/2, - pos_y - 24*num_items/2, - menu_width,menu_height, - 150,180,200,100); + pos_y - 24*num_items/2 - 10, + menu_width,menu_height + 20, + 150,180,200,125); for(int i = 0; i < num_items; ++i) { -- 2.11.0