about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-07-08 09:07:21 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-07-08 09:07:21 +0000
commita13b94f9e0bca8ea892311d9d9e0c0bc48616ea7 (patch)
treec74b01682d62d8a5e13948a828307f263de36ac6
parent9d632dd826c8a312095de0f56df66b2580d336cb (diff)
downloadzcatch-a13b94f9e0bca8ea892311d9d9e0c0bc48616ea7.tar.gz
zcatch-a13b94f9e0bca8ea892311d9d9e0c0bc48616ea7.zip
minor update
-rw-r--r--datasrc/compile.py16
-rw-r--r--datasrc/network.py12
-rw-r--r--docs/conf/Languages.txt2
-rw-r--r--docs/conf/Menu.txt83
-rw-r--r--docs/conf/Topics.txt5
-rw-r--r--license.txt2
-rwxr-xr-xscripts/make_docs.sh2
-rw-r--r--src/engine/e_system.c1
8 files changed, 84 insertions, 39 deletions
diff --git a/datasrc/compile.py b/datasrc/compile.py
index af0671de..30734a21 100644
--- a/datasrc/compile.py
+++ b/datasrc/compile.py
@@ -66,6 +66,8 @@ if gen_client_content_source or gen_server_content_source:
 # NETWORK
 if gen_network_header:
 	
+	print "#ifndef FILE_G_PROTOCOL_H"
+	print "#define FILE_G_PROTOCOL_H"
 	print network.RawHeader
 	
 	for e in network.Enums:
@@ -87,11 +89,13 @@ if gen_network_header:
 
 	print "int netobj_validate(int type, void *data, int size);"
 	print "const char *netobj_get_name(int type);"
+	print "int netobj_get_size(int type);"
 	print "void *netmsg_secure_unpack(int type);"
 	print "const char *netmsg_get_name(int type);"
 	print "const char *netmsg_failed_on();"
 	print "int netobj_num_corrections();"
 	print "const char *netobj_corrected_on();"
+	print "#endif // FILE_G_PROTOCOL_H"
 	
 
 if gen_network_source:
@@ -117,9 +121,14 @@ if gen_network_source:
 	lines += ['}']
 
 	lines += ["static const char *netobj_names[] = {"]
+	lines += ['\t"invalid",']
 	lines += ['\t"%s",' % o.name for o in network.Objects]
 	lines += ['\t""', "};", ""]
 
+	lines += ["static int netobj_sizes[] = {"]
+	lines += ['\t0,']
+	lines += ['\tsizeof(%s),' % o.struct_name for o in network.Objects]
+	lines += ['\t0', "};", ""]
 	for l in lines:
 		print l
 
@@ -150,6 +159,13 @@ if gen_network_source:
 	lines += ['};']
 	lines += ['']
 
+	lines += ['int netobj_get_size(int type)']
+	lines += ['{']
+	lines += ['\tif(type < 0 || type >= NUM_NETOBJTYPES) return 0;']
+	lines += ['\treturn netobj_sizes[type];']
+	lines += ['};']
+	lines += ['']
+	
 	for item in network.Messages:
 		for line in item.emit_unpack():
 			print line
diff --git a/datasrc/network.py b/datasrc/network.py
index 46add62b..4c49f149 100644
--- a/datasrc/network.py
+++ b/datasrc/network.py
@@ -99,7 +99,7 @@ Objects = [
 		NetIntAny("teamscore_blue"),
 	]),
 
-	NetObject("Player_Core", [
+	NetObject("Character_Core", [
 		NetIntAny("x"),
 		NetIntAny("y"),
 		NetIntAny("vx"),
@@ -118,7 +118,7 @@ Objects = [
 		NetIntAny("hook_dy"),
 	]),
 
-	NetObject("Player_Character:Player_Core", [
+	NetObject("Character:Character_Core", [
 		NetIntRange("player_state", 0, 'NUM_PLAYERSTATES-1'),
 		NetIntRange("wanted_direction", -1, 1),
 		NetIntRange("health", 0, 10),
@@ -238,7 +238,13 @@ Messages = [
 		NetIntAny("color_feet"),
 	]),	
 
-	NetMessage("cl_changeinfo:cl_startinfo", []),
+	NetMessage("cl_changeinfo", [
+		NetString("name"),
+		NetString("skin"),
+		NetBool("use_custom_color"),
+		NetIntAny("color_body"),
+		NetIntAny("color_feet"),
+	]),
 	
 	NetMessage("cl_kill", []),
 
diff --git a/docs/conf/Languages.txt b/docs/conf/Languages.txt
index aa9ce802..be96913f 100644
--- a/docs/conf/Languages.txt
+++ b/docs/conf/Languages.txt
@@ -1,4 +1,4 @@
-Format: 1.35
+Format: 1.4
 
 # This is the Natural Docs languages file for this project.  If you change
 # anything here, it will apply to THIS PROJECT ONLY.  If you'd like to change
diff --git a/docs/conf/Menu.txt b/docs/conf/Menu.txt
index e3d50ddb..cce70808 100644
--- a/docs/conf/Menu.txt
+++ b/docs/conf/Menu.txt
@@ -1,4 +1,4 @@
-Format: 1.35
+Format: 1.4
 
 
 # You can add a title and sub-title to your menu like this:
@@ -9,6 +9,22 @@ Format: 1.35
 # Footer: [text]
 # If you want to add a copyright notice, this would be the place to do it.
 
+# You can add a timestamp to your documentation like one of these:
+# Timestamp: Generated on month day, year
+# Timestamp: Updated mm/dd/yyyy
+# Timestamp: Last updated mon day
+#
+#   m     - One or two digit month.  January is "1"
+#   mm    - Always two digit month.  January is "01"
+#   mon   - Short month word.  January is "Jan"
+#   month - Long month word.  January is "January"
+#   d     - One or two digit day.  1 is "1"
+#   dd    - Always two digit day.  1 is "01"
+#   day   - Day with letter extension.  1 is "1st"
+#   yy    - Two digit year.  2006 is "06"
+#   yyyy  - Four digit year.  2006 is "2006"
+#   year  - Four digit year.  2006 is "2006"
+
 
 # --------------------------------------------------------------------------
 # 
@@ -27,53 +43,66 @@ Format: 1.35
 # time it is run.  When working with groups, just deal with the braces and
 # forget about the indentation and comments.
 # 
+# You can use this file on other computers even if they use different
+# directories.  As long as the command line points to the same source files,
+# Natural Docs will be able to correct the locations automatically.
+# 
 # --------------------------------------------------------------------------
 
 
-Group: Articles  {
+File: OS Abstraction  (/home/kma/code/teeworlds/trunk/src/engine/e_system.h)
+
+Group: Engine  {
+
+   Group: Overview  {
 
-   File: Prediction  (docs/prediction.txt)
-   File: Time on the client  (docs/client_time.txt)
-   }  # Group: Articles
+      File: Time on the client  (/home/kma/code/teeworlds/trunk/src/engine/docs/client_time.txt)
+      File: Prediction  (/home/kma/code/teeworlds/trunk/src/engine/docs/prediction.txt)
+      }  # Group: Overview
 
-Group: Reference  {
+   Group: Reference  {
 
-   File: Lowlevel Library  (no auto-title, e_system.h)
+      Group: Common  {
 
-   Group: Common Interface  {
+         File: Engine Interface  (/home/kma/code/teeworlds/trunk/src/engine/e_if_other.h)
+         File: Messaging  (/home/kma/code/teeworlds/trunk/src/engine/e_if_msg.h)
+         }  # Group: Common
 
-      File: Engine Interface  (e_if_other.h)
-      File: Message Packing  (no auto-title, e_if_msg.h)
-      }  # Group: Common Interface
+      Group: Client  {
 
-   Group: Client Interface  {
+         File: Client Hooks  (/home/kma/code/teeworlds/trunk/src/engine/e_if_modc.h)
+         File: Client Interface  (/home/kma/code/teeworlds/trunk/src/engine/e_if_client.h)
+         File: Graphics  (/home/kma/code/teeworlds/trunk/src/engine/e_if_gfx.h)
+         File: Input  (/home/kma/code/teeworlds/trunk/src/engine/e_if_inp.h)
+         File: Sound  (/home/kma/code/teeworlds/trunk/src/engine/e_if_snd.h)
+         }  # Group: Client
 
-      File: General  (no auto-title, e_if_client.h)
-      File: Sound  (no auto-title, e_if_snd.h)
-      File: Input  (no auto-title, e_if_inp.h)
-      File: Graphics  (no auto-title, e_if_gfx.h)
-      }  # Group: Client Interface
+      Group: Server  {
 
-   Group: Server Interface  {
+         File: Server Hooks  (/home/kma/code/teeworlds/trunk/src/engine/e_if_mods.h)
+         File: Server Interface  (/home/kma/code/teeworlds/trunk/src/engine/e_if_server.h)
+         }  # Group: Server
 
-      File: General  (no auto-title, e_if_server.h)
-      }  # Group: Server Interface
+      }  # Group: Reference
 
-   Group: Mod Hooks  {
+   }  # Group: Engine
 
-      File: Client Side  (no auto-title, e_if_modc.h)
-      File: Server Side  (no auto-title, e_if_mods.h)
-      }  # Group: Mod Hooks
+Group: Game Implementation  {
 
-   }  # Group: Reference
+   File: Entity  (/home/kma/code/teeworlds/trunk/src/game/server/gs_common.hpp)
+   }  # Group: Game Implementation
 
 Group: Index  {
 
    Index: Everything
+   Class Index: Classes
    Constant Index: Constants
-   File Index: Files
    Function Index: Functions
-   Class Index: Classes
    Variable Index: Variables
    }  # Group: Index
 
+
+
+##### Do not change or remove these lines. #####
+Data: 1(D3333RuEG3AEp39ufG3tGG7uHof63tHN\A36H93`pEG)
+Data: 1(h3333RuEG3AEp39ufG3tGG7uHof63tHN\A36H93G\`8\G)
diff --git a/docs/conf/Topics.txt b/docs/conf/Topics.txt
index ee15ec83..b1a9b939 100644
--- a/docs/conf/Topics.txt
+++ b/docs/conf/Topics.txt
@@ -1,4 +1,4 @@
-Format: 1.35
+Format: 1.4
 
 # This is the Natural Docs topics file for this project.  If you change anything
 # here, it will apply to THIS PROJECT ONLY.  If you'd like to change something
@@ -55,9 +55,6 @@ Format: 1.35
 # Class Hierarchy: [yes|no]
 #    Whether the topics are part of the class hierarchy.  Defaults to no.
 #
-# Variable Type: [yes|no]
-#    Whether the topics can be a variable type.  Defaults to no.
-#
 # Page Title If First: [yes|no]
 #    Whether the topic's title becomes the page title if it's the first one in
 #    a file.  Defaults to no.
diff --git a/license.txt b/license.txt
index 5d83d6a3..4305f69e 100644
--- a/license.txt
+++ b/license.txt
@@ -15,8 +15,6 @@ freely, subject to the following restrictions:
 2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.
 3. This notice may not be removed or altered from any source distribution.
-4. Neither this software nor any of its individual components, in original
-  or modified versions, may be sold by itself.
 
 ------------------------------------------------------------------------
 
diff --git a/scripts/make_docs.sh b/scripts/make_docs.sh
index a7682d30..3ad7ccfc 100755
--- a/scripts/make_docs.sh
+++ b/scripts/make_docs.sh
@@ -1 +1 @@
-perl tools/naturaldocs/NaturalDocs -i src/engine -xi src/engine/external -p docs/conf -o html docs/output
+perl docs/tool/NaturalDocs -i src/game -i src/engine -xi src/engine/external -p docs/conf -o html docs/output
diff --git a/src/engine/e_system.c b/src/engine/e_system.c
index f8fca864..eeadbb95 100644
--- a/src/engine/e_system.c
+++ b/src/engine/e_system.c
@@ -492,7 +492,6 @@ int net_addr_comp(const NETADDR *a, const NETADDR *b)
 	return mem_comp(a, b, sizeof(NETADDR));
 }
 
-
 int net_host_lookup(const char *hostname, NETADDR *addr, int types)
 {
 	/* TODO: IPv6 support */