summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2010-12-11 22:08:51 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2010-12-11 22:08:51 +0000
commitf40dd549d78388d28896c967e25fdf75505ececd (patch)
treea686f87ee8ca7010628f093f50d3fcd6cae6a2ef
parent89c1f8ce6192c7de3c3ed2971b366606b06b5098 (diff)
download2010-netlemmings-f40dd549d78388d28896c967e25fdf75505ececd.tar.gz
2010-netlemmings-f40dd549d78388d28896c967e25fdf75505ececd.tar.bz2
2010-netlemmings-f40dd549d78388d28896c967e25fdf75505ececd.zip
Commentaires ajotués dans les .h
git-svn-id: file:///var/svn/2010-netlemmings/trunk@201 077b3477-7977-48bd-8428-443f22f7bfda
-rw-r--r--src/include/data_localgame.h5
-rw-r--r--src/include/data_network.h4
-rw-r--r--src/include/data_ress.h1
-rw-r--r--src/include/data_types.h1
-rw-r--r--src/include/events.h2
-rw-r--r--src/include/netlem_state_machine.h1
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