00001 #ifndef _CSRPG_H_
00002 #define _CSRPG_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #define RES_X 640
00017 #define RES_Y 480 // for "fight" backgrounds
00018 #define IS_FULLSCREEN 0
00019 #define CUTOFF_DISTANCE 8 // how far away from the player you draw tiles
00020 #define SLOW_PC 0 // turns off backgrounds and such for 386's
00021 #define INPUT_DELAY 0 // for performance testing, or if you have a 386, then set this to 0
00022
00023 #define CHEATER_MODE 1 // use the 'g' and 'k' keys to trade gold for keys and keys for gold
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #define FACING_UP 0
00040 #define FACING_LEFT 1
00041 #define FACING_DOWN 2
00042 #define FACING_RIGHT 3
00043
00044
00045 #include "SDL.h"
00046 #include "SDL_image.h"
00047 #include "SDL_mixer.h"
00048 #include "SDL_ttf.h"
00049
00050
00051 #include <math.h>
00052 #include <cstdlib>
00053 #include <list>
00054 #include <cstdio>
00055
00056
00057 #include "npc.h"
00058 #include "HUDController.h"
00059 #include "Player.h"
00060 #include "Map.h"
00061 #include "SpecialTiles.h"
00062 #include "Shops.h"
00063
00064
00065 #define MAX_TILES 8
00066 #define MAX_SPRITES 10
00067 #define MAX_ITEMS 9 // WHY DO YOU NOT WORK???#$?@
00068
00069
00070 #define MAX_FLOORS 5
00071
00072
00073 #define IS_TRIPPY 0 // randomly shifts some colours
00074
00075 using namespace std;
00076
00078
00086 class CGame {
00087 public:
00089 void titleScreen();
00091 void gameLoop();
00093 CGame();
00095 ~CGame();
00096 private:
00097
00098 SDL_Surface *screen;
00099 SDL_Event event;
00100 Map theMap;
00101
00102
00103
00104 bool bIsDone;
00105
00106
00107 bool bIsFighting;
00108 bool bPlayerTurn;
00110
00112
00114
00116
00118
00119
00121 void Roam_DrawEverything();
00123 void paintTiles();
00125 void drawSprite(int c, int r, SDL_Rect *temprect);
00127 void Roam_CheckNPCConvo(int x, int y);
00129 void Roam_GetInput();
00130
00132
00134
00136
00138
00139 void detectAndOpenDoors(int x, int y);
00141 void shopKeeping();
00142
00143
00145
00147
00149
00151
00153
00155
00156
00157
00159
00161
00163
00165
00166
00167
00168
00169 list <NPC*> characters;
00170 Player you;
00171 QuestMaster *qm;
00172 NPC* targetNPC;
00173 int fightBackground;
00174 Shop NormalShop;
00175 TTF_Font *font;
00176 int menuchoice;
00177
00178
00179
00180
00181 SDL_Surface *tiles[MAX_TILES];
00182 SDL_Surface *chargfx[MAX_SPRITES][4];
00183 SDL_Surface *icons[5];
00184 SDL_Surface *fightBackgrounds[2];
00185 SDL_Surface *clouds;
00186 SDL_Surface *portrait;
00187 vector <SDL_Surface*> items;
00188
00189
00191
00192
00194
00195
00196
00197
00199
00200 void loadSurfaces();
00202 void initFonts();
00203 };
00204
00205 #endif