* Lets use the built-in bool-type instead of a dirty macro!
* replace [Bb][Oo][Oo][Ll] with bool * replace TRUE with true * replace FALSE with false git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2609 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
8cd7f8fd5b
commit
579e952cb8
|
@ -77,27 +77,27 @@ void inputKeyEvent(SDL_KeyboardEvent key, Uint8 newState) {
|
|||
}
|
||||
}
|
||||
|
||||
Bool isKeyDown(SDLKey key) {
|
||||
bool isKeyDown(SDLKey key) {
|
||||
return (KeyStates[key].data & OH_KEY_RELEASE);
|
||||
}
|
||||
|
||||
Bool isKeyDoubleDown(SDLKey key) {
|
||||
bool isKeyDoubleDown(SDLKey key) {
|
||||
return (KeyStates[key].data & OH_KEY_DDOWN && KeyStates[key].data & OH_KEY_RELEASE );
|
||||
}
|
||||
|
||||
Bool isKeyHold(SDLKey key) {
|
||||
bool isKeyHold(SDLKey key) {
|
||||
return (KeyStates[key].duration);
|
||||
}
|
||||
|
||||
Bool isMouseButtonDown(Uint8 button) {
|
||||
bool isMouseButtonDown(Uint8 button) {
|
||||
return (MouseStates[button].data & OH_KEY_RELEASE);
|
||||
}
|
||||
|
||||
Bool isMouseButtonDoubleDown(Uint8 button) {
|
||||
bool isMouseButtonDoubleDown(Uint8 button) {
|
||||
return (MouseStates[button].data & OH_KEY_DDOWN && MouseStates[button].data & OH_KEY_RELEASE);
|
||||
}
|
||||
|
||||
Bool isMouseButtonHold(Uint8 button) {
|
||||
bool isMouseButtonHold(Uint8 button) {
|
||||
return (MouseStates[button].duration);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
|
||||
/* Simple implementation of singleclick doubleclick holdbutton via SDL */
|
||||
|
||||
#define Bool int
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
///use max possible sdl keys
|
||||
const Uint32 MAX_KEYS = SDLK_LAST;
|
||||
///use max possible sdl mouse buttons(UNUSED?,LEFT,RIGHT,MIDDLE)
|
||||
|
@ -76,12 +72,12 @@ extern void inputMotionMouseEvent(SDL_MouseMotionEvent motion);
|
|||
|
||||
extern void inputKeyEvent(SDL_KeyboardEvent key, Uint8 newState);
|
||||
|
||||
Bool isKeyDown(SDLKey key);
|
||||
Bool isKeyDoubleDown(SDLKey key);
|
||||
Bool isKeyHold(SDLKey key);
|
||||
Bool isMouseButtonDown(Uint8 button);
|
||||
Bool isMouseButtonDoubleDown(Uint8 button);
|
||||
Bool isMouseButtonHold(Uint8 button);
|
||||
bool isKeyDown(SDLKey key);
|
||||
bool isKeyDoubleDown(SDLKey key);
|
||||
bool isKeyHold(SDLKey key);
|
||||
bool isMouseButtonDown(Uint8 button);
|
||||
bool isMouseButtonDoubleDown(Uint8 button);
|
||||
bool isMouseButtonHold(Uint8 button);
|
||||
|
||||
extern void inputUpdate(void);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ void _imd_save_connectors(FILE *fp, iIMDShape *s)
|
|||
//* params filename = name of file to save to including .IMD extention
|
||||
//* s = pointer to IMD shape
|
||||
//*
|
||||
//* returns TRUE -> ok, FLASE -> error
|
||||
//* returns true -> ok, FLASE -> error
|
||||
//*
|
||||
//******
|
||||
bool iV_IMDSave(const char *filename, iIMDShape *s, bool PieIMD)
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
static char mychars[255]; //temp char
|
||||
static int mychars_index = 0; //temp char current index
|
||||
static TwBar *textBar; //text box bar
|
||||
static BOOL textboxUp = FALSE; //whether textbox is up or not
|
||||
static bool textboxUp = false; //whether textbox is up or not
|
||||
|
||||
static char *text_pointer = NULL;
|
||||
|
||||
|
@ -165,7 +165,7 @@ static void TW_CALL addTextBox(void *clientData)
|
|||
snprintf(&test[8 + size], 1, "\'");
|
||||
//strcat(&test[0], attr);
|
||||
|
||||
textboxUp = TRUE;
|
||||
textboxUp = true;
|
||||
|
||||
strncpy(&mychars[0], string, size);
|
||||
mychars_index = size;
|
||||
|
@ -185,7 +185,7 @@ static void deleteTextBox()
|
|||
}
|
||||
|
||||
TwDeleteBar(textBar);
|
||||
textboxUp = FALSE;
|
||||
textboxUp = false;
|
||||
}
|
||||
|
||||
static void updateTextBox(void)
|
||||
|
@ -411,7 +411,7 @@ int main(int argc, char *argv[])
|
|||
inputButtonMouseEvent(event.button, event.type);
|
||||
break;
|
||||
case SDL_QUIT: // Window is closed
|
||||
bQuit = TRUE;
|
||||
bQuit = true;
|
||||
break;
|
||||
case SDL_VIDEORESIZE: // Window size has changed
|
||||
// Resize SDL video mode
|
||||
|
|
|
@ -48,7 +48,7 @@ static bool check_extension(const char* extension_name)
|
|||
const char *tmp = extension_list;
|
||||
unsigned int first_extension_length;
|
||||
|
||||
if (!extension_name || !extension_list) return FALSE;
|
||||
if (!extension_name || !extension_list) return false;
|
||||
|
||||
while (tmp[0]) {
|
||||
first_extension_length = strcspn(tmp, " ");
|
||||
|
|
Loading…
Reference in New Issue