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.
This commit is contained in:
janwas 2005-01-27 15:31:06 +00:00
parent f6c95b259d
commit faff797cd6
6 changed files with 14 additions and 13 deletions

View File

@ -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"

View File

@ -35,7 +35,7 @@ gee@pyro.nu
#include "GUItext.h"
#include <string>
#include <vector>
#include "input.h" // just for EV_PASS
#include "lib/input.h" // just for EV_PASS
#include "gui/scripting/JSInterface_IGUIObject.h"

View File

@ -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)
{

View File

@ -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__

View File

@ -7,12 +7,14 @@
// Mark Thompson (mot20@cam.ac.uk / mark@wildfiregames.com)
#include <vector>
#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

View File

@ -3,6 +3,7 @@
#include "precompiled.h"
#include <map>
#include "CStr.h"
#include "lib/sdl.h"
static std::map<CStr,int> keymap;