summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <lpouzenc@gmail.com>2013-07-25 09:55:42 +0200
committerLudovic Pouzenc <lpouzenc@gmail.com>2013-07-25 09:55:42 +0200
commitb5845f297da2648c9a971acf9dbf03feba3a50c6 (patch)
tree08e8fd533e3641126dbd43fcb9dd38e7bb5190c3
parent77d83619a2225efce294b9698defb745e1dcefbd (diff)
downloadmplemmings-b5845f297da2648c9a971acf9dbf03feba3a50c6.tar.gz
mplemmings-b5845f297da2648c9a971acf9dbf03feba3a50c6.tar.bz2
mplemmings-b5845f297da2648c9a971acf9dbf03feba3a50c6.zip
Debut gestion evenements souris. Il faut ecrire la fonction de dispatch, initialiser correctement la renderlist et bouger le cursor
-rw-r--r--src/gameui.c2
-rw-r--r--src/include/data_game.h3
-rw-r--r--src/include/data_ress.h2
-rw-r--r--src/test/testplay.c2
-rw-r--r--src/test/testrender.c2
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 */