OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

gfx.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           gfx.h  -  description
00003                              -------------------
00004     begin                : Tue Apr 10 2001
00005     copyright            : (C) 2001 by UPi
00006     email                : upi@apocalypse.rulez.org
00007  ***************************************************************************/
00008 
00009 
00010 #ifndef _GFX_H
00011 #define _GFX_H
00012 
00019 struct _sge_TTFont;
00020 
00021 #include "SDL.h"
00022 
00023 enum GFX_Constants {
00024     AlignHCenter    = 1,
00025     AlignVCenter    = 2,
00026     AlignCenter     = 3,
00027     UseTilde        = 4,
00028     UseShadow       = 8,
00029 };
00030 
00031 int             DrawTextMSZ( const char* text, _sge_TTFont* font, int x, int y,
00032                     int flags, int fg, SDL_Surface* target, bool a_bTranslate = true );
00033 
00034 void            DrawGradientText( const char* text, _sge_TTFont* font, int y,
00035                     SDL_Surface* target, bool a_bTranslate = true );
00036 
00037 SDL_Color       MakeColor( Uint8 r, Uint8 g, Uint8 b );
00038 
00039 SDLKey          GetKey( bool a_bTranslate );
00040 
00041 SDL_Surface*    LoadBackground( const char* a_pcFilename, int a_iNumColors, int a_iPaletteOffset=0, bool a_bTransparent = false );
00042 
00043 bool            SetVideoMode( bool a_bLarge, bool a_bFullscreen, int a_iAdditionalFlags=0 );
00044 
00045 extern SDL_Surface* gamescreen;
00046 
00050 class CSurfaceLocker
00051 {
00052 public:
00053     inline CSurfaceLocker()
00054     {
00055         if ( 0 == m_giLockCount )
00056         {
00057             if (SDL_MUSTLOCK(gamescreen)) { 
00058                 SDL_LockSurface( gamescreen );
00059             }
00060         }
00061         ++m_giLockCount;
00062     }
00063     inline ~CSurfaceLocker()
00064     {
00065         --m_giLockCount;
00066         if ( 0 == m_giLockCount )
00067         {
00068             if (SDL_MUSTLOCK(gamescreen)) {
00069                 SDL_UnlockSurface( gamescreen );
00070             }
00071         }
00072     }
00073 
00074 protected:
00075     static int m_giLockCount;
00076 };
00077 
00078 extern _sge_TTFont* titleFont;      // Largest font, for titles
00079 extern _sge_TTFont* inkFont;        // Medium-size front, headings
00080 extern _sge_TTFont* impactFont;     // Smallest font, for long descriptions
00081 extern _sge_TTFont* chatFont;       // small but legible.
00082 
00083 #ifdef sge_bm_text_H
00084 extern sge_bmpFont* fastFont;       // In-game text, e.g. combo text
00085 extern sge_bmpFont* creditsFont;
00086 extern sge_bmpFont* storyFont;
00087 #endif
00088 
00089 
00090 
00091 
00092 
00093 
00094 #endif