Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CGraphics.h

Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2004 Parallel Realities 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License 00006 as published by the Free Software Foundation; either version 2 00007 of the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 See the GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 00019 */ 00020 00021 class Graphics { 00022 00023 private: 00024 00025 Engine *engine; 00026 SDL_Rect gRect; 00027 TTF_Font *font[5]; 00028 SDL_Color fontForeground, fontBackground; 00029 00030 List spriteList; 00031 00032 int fontSize; 00033 00034 int waterAnim; 00035 int slimeAnim; 00036 int lavaAnim; 00037 00038 int currentLoading; 00039 00040 int screenShotNumber; 00041 char screenshot[100]; 00042 char chatString[1024]; 00043 00044 SDL_Surface *fadeBlack; 00045 SDL_Surface *infoMessage; 00046 00047 public: 00048 00049 bool takeRandomScreenShots; 00050 00051 SDL_Surface *screen, *background; 00052 SDL_Surface *tile[MAX_TILES]; 00053 00054 SDL_Surface *infoBar; 00055 00056 int red, yellow, green, darkGreen, skyBlue, blue, cyan, white, lightGrey, grey, darkGrey, black; 00057 00058 Graphics(); 00059 void free(); 00060 void destroy(); 00061 void registerEngine(Engine *engine); 00062 void mapColors(); 00063 Sprite *getSpriteHead(); 00064 void setTransparent(SDL_Surface *sprite); 00065 void updateScreen(); 00066 void delay(int time); 00067 void RGBtoHSV(float r, float g, float b, float *h, float *s, float *v); 00068 void HSVtoRGB(float *r, float *g, float *b, float h, float s, float v); 00069 SDL_Surface *loadImage(char *filename); 00070 SDL_Surface *loadImage(char *filename, int hue, int sat, int value); 00071 SDL_Surface *quickSprite(char *name, SDL_Surface *image); 00072 void fade(int amount); 00073 void fadeToBlack(); 00074 void loadMapTiles(char *baseDir); 00075 void loadFont(int i, char *filename, int pixelSize); 00076 Sprite *addSprite(char *name); 00077 Sprite *getSprite(char *name, bool required); 00078 void animateSprites(); 00079 int getWaterAnim(); 00080 int getSlimeAnim(); 00081 int getLavaAnim(); 00082 int getLavaAnim(int current); 00083 void loadBackground(char *filename); 00084 void putPixel(int x, int y, Uint32 pixel, SDL_Surface *dest); 00085 Uint32 getPixel(SDL_Surface *surface, int x, int y); 00086 void drawLine(float startX, float startY, float endX, float endY, int color, SDL_Surface *dest); 00087 void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest, bool centered); 00088 void drawBackground(); 00089 void drawBackground(SDL_Rect *r); 00090 void drawRect(int x, int y, int w, int h, int color, SDL_Surface *dest); 00091 void drawRect(int x, int y, int w, int h, int color, int borderColor, SDL_Surface *dest); 00092 void setFontColor(int red, int green, int blue, int red2, int green2, int blue2); 00093 void setFontSize(int size); 00094 SDL_Surface *getString(char *in, bool transparent); 00095 void drawString(char *in, int x, int y, int alignment, SDL_Surface *dest); 00096 void clearChatString(); 00097 void createChatString(char *in); 00098 void drawChatString(SDL_Surface *surface, int y); 00099 void drawWidgetRect(int x, int y, int w, int h); 00100 SDL_Surface *createSurface(int width, int height); 00101 SDL_Surface *alphaRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue); 00102 void colorize(SDL_Surface *image, int red, int green, int blue); 00103 void lock(SDL_Surface *surface); 00104 void unlock(SDL_Surface *surface); 00105 void resetLoading(); 00106 void showLoading(int amount, int max); 00107 void showErrorAndExit(char *error, char *param); 00108 void showLicenseErrorAndExit(); 00109 void showRootWarning(); 00110 00111 };

Generated on Thu Dec 2 20:26:02 2004 for Blob Wars : Metal Blob Solid by doxygen 1.3.7