From f40dd549d78388d28896c967e25fdf75505ececd Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sat, 11 Dec 2010 22:08:51 +0000 Subject: Commentaires ajotués dans les .h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2010-netlemmings/trunk@201 077b3477-7977-48bd-8428-443f22f7bfda --- src/include/data_localgame.h | 5 +++-- src/include/data_network.h | 4 ++++ src/include/data_ress.h | 1 + src/include/data_types.h | 1 + src/include/events.h | 2 ++ src/include/netlem_state_machine.h | 1 + 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/include/data_localgame.h b/src/include/data_localgame.h index cd24d63..1466400 100644 --- a/src/include/data_localgame.h +++ b/src/include/data_localgame.h @@ -22,9 +22,10 @@ typedef struct { SDL_Rect *objectsBBox; } gameGraphObjState_t; -// Ensemble des éléménts graphiques du jeu (sauf l'écran) +// Ensemble des buffers graphiques du jeu (sauf l'écran) typedef struct { - SDL_Surface *screen, *terrain, *stencil, **objectsSurf; + SDL_Surface *screen, *terrain, *stencil, *tmpSurf; + // For loaded Gif tiles, see data_ress.h gameGraphObjState_t *objectsStat; } gameGraphSurfaces_t; diff --git a/src/include/data_network.h b/src/include/data_network.h index dfc93a0..9725cd5 100644 --- a/src/include/data_network.h +++ b/src/include/data_network.h @@ -7,8 +7,11 @@ #include "data_lemming.h" #include "events.h" +// All necessary stuff to ensure that client node on the network can synchronize each other + #define DEFAULT_LISTEN_PORT 9999 + enum gameState { gameNew, gameRunning, gameEnded }; typedef struct { @@ -34,6 +37,7 @@ typedef struct _client_t { typedef struct { id_t lemCount; + // Everything in this game for network syncing is based on events (a valid action of a local or remote player at one tick eventList_t elist; client_t local, net; //TODO : reprendre un peu, bcp de champs dupliqués pour rien } netGame_t; diff --git a/src/include/data_ress.h b/src/include/data_ress.h index 0018500..df09549 100644 --- a/src/include/data_ress.h +++ b/src/include/data_ress.h @@ -7,6 +7,7 @@ struct styleRess { SDL_Surface **tiles, **objects, **objectMasks; }; +// Image ressources loaded from files referenced in the style INI file typedef struct { struct styleRess style; } gameRess_t; diff --git a/src/include/data_types.h b/src/include/data_types.h index 20ac937..c2f6acc 100644 --- a/src/include/data_types.h +++ b/src/include/data_types.h @@ -1,6 +1,7 @@ #ifndef DATA_TYPES_H #define DATA_TYPES_H +// some basic types typedef int tick_t; typedef unsigned int id_t; typedef struct { diff --git a/src/include/events.h b/src/include/events.h index 46b8b30..50218bb 100644 --- a/src/include/events.h +++ b/src/include/events.h @@ -5,6 +5,8 @@ #include "data_types.h" #include "utils.h" +// Event and eventList management + enum eventType_t { eReady, eTimeSync, eLemAction }; typedef struct _event_t { diff --git a/src/include/netlem_state_machine.h b/src/include/netlem_state_machine.h index f0c41d4..7a3a5a6 100644 --- a/src/include/netlem_state_machine.h +++ b/src/include/netlem_state_machine.h @@ -3,6 +3,7 @@ #include "SDL/SDL_net.h" +// Big state machine for the diffrent states of the game (from splashscreen to game. typedef enum { eNull, // Pseudo_state for _getOrChangeState : do not change state, just return current state eLaunching, // Initial state, during system objects initialization -- cgit v1.2.3