From b322b763e4782f0519434fed6dbee60686eeb1a4 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sun, 11 Apr 2004 16:38:58 +0000 Subject: [PATCH] renamed timer_type to Timer SVN-Revision: 481 --- src/badguy.h | 2 +- src/button.cpp | 2 +- src/button.h | 2 +- src/gameloop.h | 6 +++--- src/gameobjs.h | 4 ++-- src/globals.cpp | 4 ++-- src/intro.cpp | 2 +- src/leveleditor.cpp | 2 +- src/menu.h | 2 +- src/mousecursor.h | 2 +- src/player.h | 8 ++++---- src/timer.cpp | 18 +++++++++--------- src/timer.h | 8 +------- src/title.cpp | 4 ++-- 14 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/badguy.h b/src/badguy.h index 84675d015..93c9356c3 100644 --- a/src/badguy.h +++ b/src/badguy.h @@ -96,7 +96,7 @@ public: private: bool seen; base_type old_base; - timer_type timer; + Timer timer; Physic physic; texture_type* texture_left; diff --git a/src/button.cpp b/src/button.cpp index c348a2368..82d048937 100644 --- a/src/button.cpp +++ b/src/button.cpp @@ -17,7 +17,7 @@ #include "globals.h" #include "button.h" -timer_type Button::popup_timer; +Timer Button::popup_timer; Button::Button(std::string icon_file, std::string ninfo, SDLKey nshortcut, int x, int y, int mw, int mh) { diff --git a/src/button.h b/src/button.h index 53dc8281c..a6850fe94 100644 --- a/src/button.h +++ b/src/button.h @@ -42,7 +42,7 @@ class Button } private: - static timer_type popup_timer; + static Timer popup_timer; texture_type icon; texture_type* bkgd; std::string info; diff --git a/src/gameloop.h b/src/gameloop.h index 7aeeec59b..27f6ce1bb 100644 --- a/src/gameloop.h +++ b/src/gameloop.h @@ -36,8 +36,8 @@ class GameSession { private: bool quit; - timer_type fps_timer; - timer_type frame_timer; + Timer fps_timer; + Timer frame_timer; World* world; int st_gl_mode; @@ -53,7 +53,7 @@ class GameSession int levelnb; public: - timer_type time_left; + Timer time_left; GameSession(); GameSession(const std::string& filename); diff --git a/src/gameobjs.h b/src/gameobjs.h index 72b9ee789..87ab2be91 100644 --- a/src/gameobjs.h +++ b/src/gameobjs.h @@ -50,7 +50,7 @@ class BrokenBrick { public: base_type base; - timer_type timer; + Timer timer; Tile* tile; void init(Tile* tile, float x, float y, float xm, float ym); @@ -75,7 +75,7 @@ class FloatingScore { public: int value; - timer_type timer; + Timer timer; base_type base; void init(float x, float y, int s); diff --git a/src/globals.cpp b/src/globals.cpp index e8419f5b9..335a0ee1e 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -39,8 +39,8 @@ SDL_Joystick * js; int wait_for_event(SDL_Event& event,unsigned int min_delay, unsigned int max_delay, bool empty_events) { int i; - timer_type maxdelay; - timer_type mindelay; + Timer maxdelay; + Timer mindelay; maxdelay.init(false); mindelay.init(false); diff --git a/src/intro.cpp b/src/intro.cpp index 1dfa485fb..369716b61 100644 --- a/src/intro.cpp +++ b/src/intro.cpp @@ -48,7 +48,7 @@ int intro(void) SDL_Rect src, dest; int done, i, quit, j, scene; int * height, * height_speed; - timer_type timer; + Timer timer; /* Load sprite images: */ texture_load(&bkgd, datadir + "/images/intro/intro.png", IGNORE_ALPHA); diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index 9fd68a0a9..d40fa6473 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -111,7 +111,7 @@ static Menu* subset_new_menu; static Menu* subset_settings_menu; static Menu* level_settings_menu; static Menu* select_tilegroup_menu; -static timer_type select_tilegroup_menu_effect; +static Timer select_tilegroup_menu_effect; static std::map tilegroups_map; static std::string cur_tilegroup; diff --git a/src/menu.h b/src/menu.h index b0058d4f8..4d9f00423 100644 --- a/src/menu.h +++ b/src/menu.h @@ -65,7 +65,7 @@ private: int height(); public: - timer_type effect; + Timer effect; int arrange_left; int active_item; menu_item_type *item; diff --git a/src/mousecursor.h b/src/mousecursor.h index 7ef6e0153..cc9c6a3fe 100644 --- a/src/mousecursor.h +++ b/src/mousecursor.h @@ -40,7 +40,7 @@ class MouseCursor int cur_state; int cur_frame, tot_frames; texture_type cursor; - timer_type timer; + Timer timer; }; #endif /*SUPERTUX_MOUSECURSOR_H*/ diff --git a/src/player.h b/src/player.h index 49115d835..0c80910cb 100644 --- a/src/player.h +++ b/src/player.h @@ -111,10 +111,10 @@ class Player base_type base; base_type old_base; base_type previous_base; - timer_type invincible_timer; - timer_type skidding_timer; - timer_type safe_timer; - timer_type frame_timer; + Timer invincible_timer; + Timer skidding_timer; + Timer safe_timer; + Timer frame_timer; Physic physic; public: diff --git a/src/timer.cpp b/src/timer.cpp index d504fa92e..4c3290db0 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -45,7 +45,7 @@ return; } void -timer_type::init(bool st_ticks) +Timer::init(bool st_ticks) { period = 0; time = 0; @@ -53,14 +53,14 @@ timer_type::init(bool st_ticks) } void -timer_type::start(unsigned int period_) +Timer::start(unsigned int period_) { time = get_ticks(); period = period_; } void -timer_type::stop() +Timer::stop() { if(get_ticks == st_get_ticks) init(true); @@ -69,7 +69,7 @@ timer_type::stop() } int -timer_type::check() +Timer::check() { if((time != 0) && (time + period > get_ticks())) return true; @@ -81,7 +81,7 @@ timer_type::check() } int -timer_type::started() +Timer::started() { if(time != 0) return true; @@ -90,19 +90,19 @@ timer_type::started() } int -timer_type::get_left() +Timer::get_left() { return (period - (get_ticks() - time)); } int -timer_type::get_gone() +Timer::get_gone() { return (get_ticks() - time); } void -timer_type::fwrite(FILE* fi) +Timer::fwrite(FILE* fi) { unsigned int diff_ticks; int tick_mode; @@ -121,7 +121,7 @@ timer_type::fwrite(FILE* fi) } void -timer_type::fread(FILE* fi) +Timer::fread(FILE* fi) { unsigned int diff_ticks; int tick_mode; diff --git a/src/timer.h b/src/timer.h index 0d03ccb19..b5cbf2c0a 100644 --- a/src/timer.h +++ b/src/timer.h @@ -20,7 +20,7 @@ void st_pause_ticks_init(void); void st_pause_ticks_start(void); void st_pause_ticks_stop(void); -class timer_type +class Timer { public: unsigned int period; @@ -33,9 +33,6 @@ class timer_type void stop(); /*====================================================================== - int timer_check(timer_type* ptimer); - - param : pointer to a timer which needs to be checked return: NO = the timer is not started or it is over YES = otherwise @@ -44,9 +41,6 @@ class timer_type int started(); /*====================================================================== - int timer_get_left(timer_type* ptimer); - - param : pointer to a timer that you want to get the time left return: the time left (in millisecond) note : the returned value can be negative ======================================================================*/ diff --git a/src/title.cpp b/src/title.cpp index 6b86242ea..deddd5a97 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -46,7 +46,7 @@ static texture_type logo; static texture_type img_choose_subset; static bool walking; -static timer_type random_timer; +static Timer random_timer; static SDL_Event event; static SDLKey key; @@ -389,7 +389,7 @@ void display_credits() { int done; int scroll, speed; - timer_type timer; + Timer timer; int n,d; int length; FILE* fi; -- 2.11.0