[Super-tux-commit] supertux/lib/video drawing_context.h,1.3,1.4 font.h,1.3,1.4 surface.cpp,1.3,1.4
Brought to you by:
wkendrick
From: Tobias G. <to...@us...> - 2004-07-25 19:03:47
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31225/lib/video Modified Files: drawing_context.h font.h surface.cpp Log Message: - Major changes in Setup-API. - Moved all sound handling into SoundManager, which became a singleton. Index: font.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- font.h 22 Jul 2004 19:07:51 -0000 1.3 +++ font.h 25 Jul 2004 19:03:35 -0000 1.4 @@ -33,11 +33,11 @@ and displays it in a StarTrek fashion */ void display_text_file(const std::string& file, float scroll_speed); - /* Text type */ + /// Font class Font { public: - /* Kinds of texts. */ + /// Kinds of texts. enum FontType { TEXT, // images for all characters NUM // only images for numbers @@ -46,7 +46,7 @@ Font(const std::string& file, FontType type, int w, int h, int shadowsize=2); ~Font(); - /** returns the height of the font */ + /// returns the height of the font. float get_height() const; /** returns the width of a given text. (Note that I won't add a normal * get_width function here, as we might switch to variable width fonts in the Index: drawing_context.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/drawing_context.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- drawing_context.h 22 Jul 2004 19:07:51 -0000 1.3 +++ drawing_context.h 25 Jul 2004 19:03:35 -0000 1.4 @@ -47,6 +47,7 @@ LAYER_GUI = 500 }; + /// Handles drawing of things. /** * This class provides functions for drawing things on screen. It also * maintains a stack of transforms that are applied to graphics. @@ -57,26 +58,26 @@ DrawingContext(); ~DrawingContext(); - /** Adds a drawing request for a surface into the request list */ + /// Adds a drawing request for a surface into the request list. void draw_surface(const Surface* surface, const Vector& position, int layer, Uint32 drawing_effect = NONE_EFFECT); - /** Adds a drawing request for part of a surface */ + /// Adds a drawing request for part of a surface. void draw_surface_part(const Surface* surface, const Vector& source, const Vector& size, const Vector& dest, int layer, Uint32 drawing_effect = NONE_EFFECT); - /** draws a text */ + /// Draws a text. void draw_text(Font* font, const std::string& text, const Vector& position, int layer, Uint32 drawing_effect = NONE_EFFECT); - /** draws aligned text */ + /// Draws aligned text. void draw_text_center(Font* font, const std::string& text, const Vector& position, int layer, Uint32 drawing_effect = NONE_EFFECT); - /** draws a color gradient onto the whole screen */ + /// Draws a color gradient onto the whole screen */ void draw_gradient(Color from, Color to, int layer); - /** fills a rectangle */ + /// Fills a rectangle. void draw_filled_rect(const Vector& topleft, const Vector& size, Color color, int layer); - /** Processes all pending drawing requests and flushes the list */ + /// Processes all pending drawing requests and flushes the list. void do_drawing(); const Vector& get_translation() const @@ -91,7 +92,7 @@ void push_transform(); void pop_transform(); - /** apply that effect in the next draws (effects are listed on surface.h) */ + /// Apply that effect in the next draws (effects are listed on surface.h). void set_drawing_effect(int effect); private: Index: surface.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- surface.cpp 22 Jul 2004 19:07:51 -0000 1.3 +++ surface.cpp 25 Jul 2004 19:03:35 -0000 1.4 @@ -46,7 +46,7 @@ temp->format->Bmask, temp->format->Amask); if(!surface) - st_abort("No memory left.", ""); + Termination::abort("No memory left.", ""); SDL_SetAlpha(temp,0,0); SDL_BlitSurface(temp, NULL, surface, NULL); } @@ -260,7 +260,7 @@ temp = IMG_Load(file.c_str()); if (temp == NULL) - st_abort("Can't load", file); + Termination::abort("Can't load", file); /* Set source rectangle for conv: */ @@ -291,7 +291,7 @@ sdl_surface = SDL_DisplayFormatAlpha(conv); if (sdl_surface == NULL) - st_abort("Can't covert to display format", file); + Termination::abort("Can't covert to display format", file); if (use_alpha == false && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); @@ -311,7 +311,7 @@ temp = IMG_Load(file.c_str()); if (temp == NULL) - st_abort("Can't load", file); + Termination::abort("Can't load", file); if(use_alpha == false && !use_gl) sdl_surface = SDL_DisplayFormat(temp); @@ -319,7 +319,7 @@ sdl_surface = SDL_DisplayFormatAlpha(temp); if (sdl_surface == NULL) - st_abort("Can't covert to display format", file); + Termination::abort("Can't covert to display format", file); if (use_alpha == false && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); @@ -358,7 +358,7 @@ } if (sdl_surface == NULL) - st_abort("Can't covert to display format", "SURFACE"); + Termination::abort("Can't covert to display format", "SURFACE"); if (use_alpha == false && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); @@ -376,7 +376,7 @@ screen->format->Gmask, screen->format->Bmask, screen->format->Amask); if(sdl_surface == NULL) - st_abort("Cannot create surface for the gradient", "SURFACE"); + Termination::abort("Cannot create surface for the gradient", "SURFACE"); if(top == bottom) { |