CEngine.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 class Engine {
00022
00023
private:
00024
00025 SDL_Event
event;
00026 signed char frameLoop;
00027 int mouseX,
mouseY;
00028
00029
00030 unsigned int time1;
00031 unsigned int time2;
00032 float timeDifference;
00033
00034
00035 char lastKeyPressed[25];
00036 char lastKeyEvents[25];
00037
00038
00039 int lastButtonPressed;
00040
00041 Pak pak;
00042
00043
00044 int joyX,
joyY;
00045
00046
00047
00048
00049
00050
00051
00052 Uint32
joyNavAvail;
00053
00054
public:
00055
00056 int extremeAvailable;
00057
00058 char keyState[350];
00059 char mouseLeft,
mouseRight;
00060
00061 SDL_Joystick *
joystick[2];
00062 Joystick joypad;
00063
00064 Keyboard keyboard;
00065 bool waitForButton;
00066 bool waitForKey;
00067 bool allowJoypad;
00068
00069
bool isKey(
int key);
00070
void clearKey(
int key);
00071
00072 bool paused;
00073 bool saveConfig;
00074 bool allowQuit;
00075
00076 char userHomeDirectory[
PATH_MAX];
00077
00078 int useAudio;
00079 int fullScreen;
00080 int skill;
00081 bool practice;
00082
00083
00084 bool devNoMonsters;
00085
00086 SDL_RWops *
sdlrw;
00087
00088 unsigned char *
binaryBuffer;
00089 unsigned char *
dataBuffer;
00090
00091 int messageTime;
00092 int messagePriority;
00093 int messageType;
00094 char message[100];
00095
00096 char saveSlot[10][50];
00097 int continueSaveSlot;
00098
00099 int playerPosX,
playerPosY;
00100
00101 List widgetList;
00102
00103 Widget *
highlightedWidget;
00104
00105 Entity world;
00106
00107 List defineList;
00108
00109 bool cheats;
00110 int cheatHealth,
cheatExtras,
cheatFuel,
cheatLevels,
cheatBlood,
cheatInvulnerable;
00111 int cheatReload,
cheatSpeed,
cheatSkipLevel;
00112
00113
Engine();
00114
void destroy();
00115
void getInput();
00116
int getMouseX();
00117
int getMouseY();
00118
00119
bool getJoyLeft();
00120
bool getJoyRight();
00121
bool getJoyUp();
00122
bool getJoyDown();
00123
00124
00125
int getJoyX(
int max);
00126
int getJoyY(
int max);
00127
void lockJoy(Uint32 ticks);
00128
00129
void setMouse(
int x,
int y);
00130
bool userAccepts();
00131
00132
bool loadJoystickConfig();
00133
bool saveJoystickConfig();
00134
00135
bool loadKeyConfig();
00136
bool saveKeyConfig();
00137
void restoreKeyDefaults();
00138
00139
bool getKeyState(
int key);
00140
void setKeyState(
int key);
00141
00142
void doPause();
00143
void clearCheatVars();
00144
bool compareLastKeyInputs();
00145
void addKeyEvent();
00146
void flushInput();
00147
void clearInput();
00148
void setUserHome(
char *path);
00149
Pak *
getPak();
00150
bool unpack(
char *filename,
int fileType);
00151
bool loadData(
char *filename);
00152
void reportFontFailure();
00153
void setPlayerPosition(
int x,
int y,
int limitLeft,
int limitRight,
int limitUp,
int limitDown);
00154
int getFrameLoop();
00155
void doFrameLoop();
00156
void doTimeDifference();
00157
float getTimeDifference();
00158
void resetTimeDifference();
00159
void setInfoMessage(
char *message,
int priority,
int type);
00160
void deleteWidgets();
00161
void addWidget(
Widget *widget);
00162
bool loadWidgets(
char *filename);
00163
Widget *
getWidgetByName(
char *name);
00164
void showWidgetGroup(
char *groupName,
bool show);
00165
void enableWidgetGroup(
char *groupName,
bool show);
00166
void showWidget(
char *name,
bool show);
00167
void enableWidget(
char *name,
bool enable);
00168
void setWidgetVariable(
char *name,
int *variable);
00169
bool widgetChanged(
char *name);
00170
void highlightWidget(
int dir);
00171
void highlightWidget(
char *name);
00172
int processWidgets();
00173
bool loadDefines();
00174
int getValueOfDefine(
char *word);
00175
char *
getDefineOfValue(
char *prefix,
int value);
00176
int getValueOfFlagTokens(
char *line);
00177
00178 };
Generated on Thu Dec 2 20:26:02 2004 for Blob Wars : Metal Blob Solid by
1.3.7