From b5845f297da2648c9a971acf9dbf03feba3a50c6 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Thu, 25 Jul 2013 09:55:42 +0200 Subject: Debut gestion evenements souris. Il faut ecrire la fonction de dispatch, initialiser correctement la renderlist et bouger le cursor --- src/gameui.c | 2 +- src/include/data_game.h | 3 +++ src/include/data_ress.h | 2 +- src/test/testplay.c | 2 ++ src/test/testrender.c | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gameui.c b/src/gameui.c index 4d8b417..1800af7 100644 --- a/src/gameui.c +++ b/src/gameui.c @@ -2,7 +2,7 @@ int setInitialState(gameIni_t *gIni, gameState_t *gState) { gState->cameraX = gIni->level.xPos; - //FIXME : al lemmings states, skill counters... + //FIXME : all lemmings states, skill counters... return 0; } diff --git a/src/include/data_game.h b/src/include/data_game.h index b89986d..c3d4266 100644 --- a/src/include/data_game.h +++ b/src/include/data_game.h @@ -11,6 +11,9 @@ typedef struct { int animate; /* Is currently animating ? */ int x,y; int absolute; /* 0 if level-based coords, 1 if camera-based */ + int onhovercursorid; + void (*onmousebuttonevent_proc)(Uint8 button, Uint8 state, void *userptr); + } renderItem_t; typedef struct { diff --git a/src/include/data_ress.h b/src/include/data_ress.h index 4f0ac6b..6a62003 100644 --- a/src/include/data_ress.h +++ b/src/include/data_ress.h @@ -8,7 +8,7 @@ typedef struct { SDL_Texture *t; SDL_Rect size; - int frames; /* Already in gIni->style->frames, but convenient here also */ + int frames; /* Already in gIni->style->frames or similar, but convenient here also */ } sprite_t; typedef struct { diff --git a/src/test/testplay.c b/src/test/testplay.c index 4ade8df..1d63335 100644 --- a/src/test/testplay.c +++ b/src/test/testplay.c @@ -114,6 +114,8 @@ int addRLitem(renderItem_t list[], sprite_t *it, int rlMaxLen) { list[cur].y = curr_y; list[cur].currframe = 0; list[cur].absolute = 1; + list[cur].onhovercursorid = 0; + list[cur].onmousebuttonevent_proc = NULL; if (it->frames > 1) { list[cur].animate = 1; /* By defaut, animate */ diff --git a/src/test/testrender.c b/src/test/testrender.c index ec82e41..b8dc500 100644 --- a/src/test/testrender.c +++ b/src/test/testrender.c @@ -118,6 +118,8 @@ int addRLitem(renderItem_t list[], sprite_t *it, int rlMaxLen) { list[cur].y = curr_y; list[cur].currframe = 0; list[cur].absolute = 1; + list[cur].onhovercursorid = 0; + list[cur].onmousebuttonevent_proc = NULL; if (it->frames > 1) { list[cur].animate = 1; /* By defaut, animate */ -- cgit v1.2.3