From faff797cd6a0056da5f1a94b130001a7f24346a1 Mon Sep 17 00:00:00 2001 From: janwas Date: Thu, 27 Jan 2005 15:31:06 +0000 Subject: [PATCH] include SDL or lib/input.h where needed (since lib.h no longer pulls it in) input.h now includes SDL (no more macro hackery to avoid the dependency) This was SVN commit r1837. --- source/gui/CGUI.h | 2 +- source/gui/IGUIObject.h | 2 +- source/lib/input.cpp | 2 +- source/lib/input.h | 18 ++++++++---------- source/ps/Interact.h | 2 ++ source/ps/KeyName.cpp | 1 + 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/source/gui/CGUI.h b/source/gui/CGUI.h index 8feacbb74f..41861de61b 100755 --- a/source/gui/CGUI.h +++ b/source/gui/CGUI.h @@ -28,7 +28,7 @@ ERROR_TYPE(GUI, JSOpenFailed); #include "GUITooltip.h" #include "Singleton.h" -#include "input.h" // JW: grr, classes suck in this case :P +#include "lib/input.h" #include "Xeromyces.h" diff --git a/source/gui/IGUIObject.h b/source/gui/IGUIObject.h index 252ec58cd1..ac76632d2c 100755 --- a/source/gui/IGUIObject.h +++ b/source/gui/IGUIObject.h @@ -35,7 +35,7 @@ gee@pyro.nu #include "GUItext.h" #include #include -#include "input.h" // just for EV_PASS +#include "lib/input.h" // just for EV_PASS #include "gui/scripting/JSInterface_IGUIObject.h" diff --git a/source/lib/input.cpp b/source/lib/input.cpp index fe477fa694..51b3944626 100755 --- a/source/lib/input.cpp +++ b/source/lib/input.cpp @@ -34,7 +34,7 @@ static EventHandler handler_stack[MAX_HANDLERS]; static int handler_stack_top = 0; -int _in_add_handler(EventHandler handler) +int in_add_handler(EventHandler handler) { if(handler_stack_top >= MAX_HANDLERS || !handler) { diff --git a/source/lib/input.h b/source/lib/input.h index d05cb518e5..0f14d24366 100755 --- a/source/lib/input.h +++ b/source/lib/input.h @@ -18,9 +18,10 @@ * http://www.stud.uni-karlsruhe.de/~urkt/ */ -#ifndef __INPUT_H__ -#define __INPUT_H__ +#ifndef INPUT_H__ +#define INPUT_H__ +#include "sdl.h" #ifdef __cplusplus extern "C" { @@ -41,15 +42,12 @@ enum // declare functions to take SDL_Event*; in_add_handler converts to void* // (avoids header dependency on SDL) -typedef int (*EventHandler)(const void* sdl_event); +typedef int (*EventHandler)(const SDL_Event*); -/* - * register an input handler, which will receive all subsequent events first. - * events are passed to other handlers if handler returns false. - */ -extern int _in_add_handler(EventHandler handler); -#define in_add_handler(h) _in_add_handler((EventHandler)h) +// register an input handler, which will receive all subsequent events first. +// events are passed to other handlers if handler returns EV_PASS. +extern int in_add_handler(EventHandler handler); extern void in_get_events(void); @@ -62,4 +60,4 @@ extern void in_stop(void); } #endif -#endif /* #ifndef __INPUT_H__ */ +#endif // #ifndef INPUT_H__ diff --git a/source/ps/Interact.h b/source/ps/Interact.h index ad84e3d49c..62bc89ec87 100755 --- a/source/ps/Interact.h +++ b/source/ps/Interact.h @@ -7,12 +7,14 @@ // Mark Thompson (mot20@cam.ac.uk / mark@wildfiregames.com) #include + #include "Singleton.h" #include "Entity.h" #include "EntityManager.h" #include "EntityMessage.h" #include "Scheduler.h" #include "Camera.h" +#include "lib/input.h" #define MAX_BOOKMARKS 10 #define MAX_GROUPS 20 diff --git a/source/ps/KeyName.cpp b/source/ps/KeyName.cpp index 89e156a49a..b16af41891 100755 --- a/source/ps/KeyName.cpp +++ b/source/ps/KeyName.cpp @@ -3,6 +3,7 @@ #include "precompiled.h" #include #include "CStr.h" +#include "lib/sdl.h" static std::map keymap;