2 Copyright (C) 2004-2011 Parallel Realities
3 Copyright (C) 2011-2015 Perpendicular Dimensions
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 See the GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 signed char frameLoop;
36 char lastKeyPressed[25];
37 char lastKeyEvents[25];
39 // Joystick config stuff
40 int lastButtonPressed;
48 char keyState[SDL_NUM_SCANCODES];
49 char mouseLeft, mouseRight;
52 int joyprevX, joyprevY;
55 int joystickState[32]; // hopefully no one has a joystick with this many buttons(!)
64 char userHomeDirectory[PATH_MAX];
76 unsigned char *binaryBuffer; // used for unzipping
77 unsigned char *dataBuffer; // used for unzipping
84 char saveSlot[10][80];
87 int playerPosX, playerPosY;
91 Widget *highlightedWidget;
98 int cheatHealth, cheatExtras, cheatFuel, cheatLevels, cheatBlood, cheatInvulnerable;
99 int cheatReload, cheatSpeed, cheatSkipLevel;
104 int getMouseX() const;
105 int getMouseY() const;
107 void moveMouse(int dx, int dy);
110 void clearCheatVars();
111 bool compareLastKeyInputs();
115 void setUserHome(const char *path);
117 bool unpack(const char *filename, int fileType);
118 bool loadData(const char *filename);
119 void reportFontFailure();
120 void setPlayerPosition(int x, int y, int limitLeft, int limitRight, int limitUp, int limitDown);
121 int getFrameLoop() const;
123 void doTimeDifference();
124 float getTimeDifference() const;
125 void resetTimeDifference();
126 void setInfoMessage(const char *message, int priority, int type);
127 void deleteWidgets();
128 void addWidget(Widget *widget);
129 bool loadWidgets(const char *filename);
130 Widget *getWidgetByName(const char *name);
131 void showWidgetGroup(const char *groupName, bool show);
132 void enableWidgetGroup(const char *groupName, bool show);
133 void showWidget(const char *name, bool show);
134 void enableWidget(const char *name, bool enable);
135 void setWidgetVariable(const char *name, int *variable);
136 bool widgetChanged(const char *name);
137 void highlightWidget(int dir);
138 void highlightWidget(const char *name);
139 int processWidgets();
141 int getValueOfDefine(const char *word);
142 char *getDefineOfValue(const char *prefix, int value);
143 int getValueOfFlagTokens(const char *line);
144 void delay(unsigned int frameLimit);