projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added generic support for handling user events
[rocksndiamonds.git]
/
src
/
libgame
/
system.c
diff --git
a/src/libgame/system.c
b/src/libgame/system.c
index de973c7316d69a9516a58c8bd505d6e5e069fe07..15e86a4afbc7084012132acac0f133577914085f 100644
(file)
--- a/
src/libgame/system.c
+++ b/
src/libgame/system.c
@@
-30,6
+30,7
@@
struct ProgramInfo program;
struct NetworkInfo network;
struct ProgramInfo program;
struct NetworkInfo network;
+struct RuntimeInfo runtime;
struct OptionInfo options;
struct VideoSystemInfo video;
struct AudioSystemInfo audio;
struct OptionInfo options;
struct VideoSystemInfo video;
struct AudioSystemInfo audio;
@@
-114,6
+115,11
@@
void InitNetworkInfo(boolean enabled, boolean connected, boolean serveronly,
network.server_port = server_port;
}
network.server_port = server_port;
}
+void InitRuntimeInfo()
+{
+ runtime.uses_touch_device = FALSE;
+}
+
void InitScoresInfo(void)
{
char *global_scores_dir = getPath2(getCommonDataDir(), SCORES_DIRECTORY);
void InitScoresInfo(void)
{
char *global_scores_dir = getPath2(getCommonDataDir(), SCORES_DIRECTORY);
@@
-311,6
+317,8
@@
void InitGfxCustomArtworkInfo(void)
void InitGfxOtherSettings(void)
{
gfx.cursor_mode = CURSOR_DEFAULT;
void InitGfxOtherSettings(void)
{
gfx.cursor_mode = CURSOR_DEFAULT;
+ gfx.mouse_x = 0;
+ gfx.mouse_y = 0;
}
void InitTileCursorInfo(void)
}
void InitTileCursorInfo(void)
@@
-1725,12
+1733,18
@@
void StopTextInput(void)
#endif
}
#endif
}
-
boolean CheckCloseWindowEvent(ClientMessageEvent *event
)
+
void PushUserEvent(int code, int value1, int value2
)
{
{
- if (event->type != EVENT_CLIENTMESSAGE)
- return FALSE;
+ UserEvent event;
+
+ SDL_memset(&event, 0, sizeof(event));
+
+ event.type = EVENT_USER;
+ event.code = code;
+ event.value1 = value1;
+ event.value2 = value2;
- return TRUE; // the only possible message here is SDL_QUIT
+ SDL_PushEvent((SDL_Event *)&event);
}
}