about summary refs log tree commit diff
path: root/datasrc
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-04-13 20:37:12 +0200
committeroy <Tom_Adams@web.de>2011-04-13 20:37:12 +0200
commit06115dd49dca2f8eb5f14606437e8fd20037cc4d (patch)
tree5ec4bca6158319b3f5285d7689c5f94ae8da8c93 /datasrc
parent63e059b8fff6498e42b765a1dca000e53005ea77 (diff)
downloadzcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.tar.gz
zcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.zip
added "Whitespace and line Endings cleanup" by GreYFoX
Diffstat (limited to 'datasrc')
-rw-r--r--datasrc/compile.py52
-rw-r--r--datasrc/content.py40
-rw-r--r--datasrc/datatypes.py30
3 files changed, 61 insertions, 61 deletions
diff --git a/datasrc/compile.py b/datasrc/compile.py
index 0ae3bbc7..e8901c48 100644
--- a/datasrc/compile.py
+++ b/datasrc/compile.py
@@ -21,7 +21,7 @@ def create_flags_table(names):
 		i += 1
 	lines += ["};"]
 	return lines
-	
+
 def EmitEnum(names, num):
 	print("enum")
 	print("{")
@@ -92,11 +92,11 @@ if gen_client_content_source or gen_server_content_source:
 
 # NETWORK
 if gen_network_header:
-	
+
 	print("#ifndef GAME_GENERATED_PROTOCOL_H")
 	print("#define GAME_GENERATED_PROTOCOL_H")
 	print(network.RawHeader)
-	
+
 	for e in network.Enums:
 		for l in create_enum_table(["%s_%s"%(e.name, v) for v in e.values], 'NUM_%sS'%e.name): print(l)
 		print("")
@@ -104,17 +104,17 @@ if gen_network_header:
 	for e in network.Flags:
 		for l in create_flags_table(["%s_%s" % (e.name, v) for v in e.values]): print(l)
 		print("")
-		
+
 	for l in create_enum_table(["NETOBJ_INVALID"]+[o.enum_name for o in network.Objects], "NUM_NETOBJTYPES"): print(l)
 	print("")
 	for l in create_enum_table(["NETMSG_INVALID"]+[o.enum_name for o in network.Messages], "NUM_NETMSGTYPES"): print(l)
 	print("")
-		
+
 	for item in network.Objects + network.Messages:
 		for line in item.emit_declaration():
 			print(line)
 		print("")
-		
+
 	EmitEnum(["SOUND_%s"%i.name.value.upper() for i in content.container.sounds.items], "NUM_SOUNDS")
 	EmitEnum(["WEAPON_%s"%i.name.value.upper() for i in content.container.weapons.id.items], "NUM_WEAPONS")
 
@@ -127,11 +127,11 @@ class CNetObjHandler
 	char m_aMsgData[1024];
 	int m_NumObjCorrections;
 	int ClampInt(const char *pErrorMsg, int Value, int Min, int Max);
-	
+
 	static const char *ms_apObjNames[];
 	static int ms_aObjSizes[];
 	static const char *ms_apMsgNames[];
-	
+
 public:
 	CNetObjHandler();
 
@@ -140,7 +140,7 @@ public:
 	int GetObjSize(int Type);
 	int NumObjCorrections();
 	const char *CorrectedObjOn();
-	
+
 	const char *GetMsgName(int Type);
 	void *SecureUnpackMsg(int Type, CUnpacker *pUnpacker);
 	const char *FailedMsgOn();
@@ -149,16 +149,16 @@ public:
 """)
 
 	print("#endif // GAME_GENERATED_PROTOCOL_H")
-	
+
 
 if gen_network_source:
 	# create names
 	lines = []
-	
+
 	lines += ['#include <engine/shared/protocol.h>']
 	lines += ['#include <engine/message.h>']
 	lines += ['#include "protocol.h"']
-	
+
 	lines += ['CNetObjHandler::CNetObjHandler()']
 	lines += ['{']
 	lines += ['\tm_pMsgFailedOn = "";']
@@ -202,7 +202,7 @@ if gen_network_source:
 	lines += ['\t""']
 	lines += ['};']
 	lines += ['']
-	
+
 	lines += ['const char *CNetObjHandler::GetObjName(int Type)']
 	lines += ['{']
 	lines += ['\tif(Type < 0 || Type >= NUM_NETOBJTYPES) return "(out of range)";']
@@ -216,16 +216,16 @@ if gen_network_source:
 	lines += ['\treturn ms_aObjSizes[Type];']
 	lines += ['};']
 	lines += ['']
-	
-	
+
+
 	lines += ['const char *CNetObjHandler::GetMsgName(int Type)']
 	lines += ['{']
 	lines += ['\tif(Type < 0 || Type >= NUM_NETMSGTYPES) return "(out of range)";']
 	lines += ['\treturn ms_apMsgNames[Type];']
 	lines += ['};']
 	lines += ['']
-		
-	
+
+
 	for l in lines:
 		print(l)
 
@@ -255,7 +255,7 @@ if gen_network_source:
 	lines += ['{']
 	lines += ['\tswitch(Type)']
 	lines += ['\t{']
-	
+
 	for item in network.Objects:
 		for line in item.emit_validate():
 			lines += ["\t" + line]
@@ -264,9 +264,9 @@ if gen_network_source:
 	lines += ['\treturn -1;']
 	lines += ['};']
 	lines += ['']
-		
- #int Validate(int Type, void *pData, int Size);	
-	
+
+ #int Validate(int Type, void *pData, int Size);
+
 	if 0:
 		for item in network.Messages:
 			for line in item.emit_unpack():
@@ -281,20 +281,20 @@ if gen_network_source:
 			lines += ['\tsecure_unpack_%s,' % msg.name]
 		lines += ['\t0x0']
 		lines += ['};']
-	
+
 	#
 	lines += ['void *CNetObjHandler::SecureUnpackMsg(int Type, CUnpacker *pUnpacker)']
 	lines += ['{']
 	lines += ['\tm_pMsgFailedOn = 0;']
 	lines += ['\tswitch(Type)']
 	lines += ['\t{']
-	
-	
+
+
 	for item in network.Messages:
 		for line in item.emit_unpack():
 			lines += ["\t" + line]
 		lines += ['\t']
-		
+
 	lines += ['\tdefault:']
 	lines += ['\t\tm_pMsgFailedOn = "(type out of range)";']
 	lines += ['\t\tbreak;']
@@ -313,6 +313,6 @@ if gen_network_source:
 
 	for l in lines:
 		print(l)
-	
+
 if gen_client_content_header or gen_server_content_header:
 	print("#endif")
diff --git a/datasrc/content.py b/datasrc/content.py
index 1dfa7aea..e714e8b8 100644
--- a/datasrc/content.py
+++ b/datasrc/content.py
@@ -22,7 +22,7 @@ class Image(Struct):
 		self.name = String(name)
 		self.filename = String(filename)
 		self.id = Int(-1)
-	
+
 class SpriteSet(Struct):
 	def __init__(self, name="", image=None, gridx=0, gridy=0):
 		Struct.__init__(self, "SPRITESET")
@@ -78,7 +78,7 @@ class WeaponSpec(Struct):
 		self.sprite_proj = Pointer(Sprite, Sprite())
 		self.sprite_muzzles = Array(Pointer(Sprite, Sprite()))
 		self.visual_size = Int(96)
-		
+
 		self.firedelay = Int(500)
 		self.maxammo = Int(10)
 		self.ammoregentime = Int(0)
@@ -111,7 +111,7 @@ class Weapon_Gun(Struct):
 		self.curvature = Float(1.25)
 		self.speed = Float(2200)
 		self.lifetime = Float(2.0)
-		
+
 class Weapon_Shotgun(Struct):
 	def __init__(self):
 		Struct.__init__(self, "WEAPONSPEC_SHOTGUN")
@@ -119,7 +119,7 @@ class Weapon_Shotgun(Struct):
 		self.curvature = Float(1.25)
 		self.speed = Float(2200)
 		self.speeddiff = Float(0.8)
-		self.lifetime = Float(0.25)		
+		self.lifetime = Float(0.25)
 
 class Weapon_Grenade(Struct):
 	def __init__(self):
@@ -137,7 +137,7 @@ class Weapon_Rifle(Struct):
 		self.bounce_delay = Int(150)
 		self.bounce_num = Int(1)
 		self.bounce_cost = Float(0)
-		
+
 class Weapon_Ninja(Struct):
 	def __init__(self):
 		Struct.__init__(self, "WEAPONSPEC_NINJA")
@@ -190,7 +190,7 @@ container.sounds.Add(SoundSet("player_pain_long", FileList("audio/vo_teefault_pa
 
 container.sounds.Add(SoundSet("body_land", FileList("audio/foley_land-%02d.wv", 4)))
 container.sounds.Add(SoundSet("player_airjump", FileList("audio/foley_dbljump-%02d.wv", 3)))
-container.sounds.Add(SoundSet("player_jump", FileList("audio/foley_foot_left-%02d.wv", 4) +  FileList("audio/foley_foot_right-%02d.wv", 4)))
+container.sounds.Add(SoundSet("player_jump", FileList("audio/foley_foot_left-%02d.wv", 4) + FileList("audio/foley_foot_right-%02d.wv", 4)))
 container.sounds.Add(SoundSet("player_die", FileList("audio/foley_body_splat-%02d.wv", 3)))
 container.sounds.Add(SoundSet("player_spawn", FileList("audio/vo_teefault_spawn-%02d.wv", 7)))
 container.sounds.Add(SoundSet("player_skid", FileList("audio/sfx_skid-%02d.wv", 4)))
@@ -292,7 +292,7 @@ container.sprites.Add(Sprite("armor_empty", set_game, 23,2,2,2))
 container.sprites.Add(Sprite("star1", set_game, 15,0,2,2))
 container.sprites.Add(Sprite("star2", set_game, 17,0,2,2))
 container.sprites.Add(Sprite("star3", set_game, 19,0,2,2))
-	
+
 container.sprites.Add(Sprite("part1", set_game, 6,0,1,1))
 container.sprites.Add(Sprite("part2", set_game, 6,1,1,1))
 container.sprites.Add(Sprite("part3", set_game, 7,0,1,1))
@@ -425,35 +425,35 @@ anim.body.frames.Add(AnimKeyframe(0.6, 0, 0, 0))
 anim.body.frames.Add(AnimKeyframe(0.8, 0,-1, 0))
 anim.body.frames.Add(AnimKeyframe(1.0, 0, 0, 0))
 
-anim.back_foot.frames.Add(AnimKeyframe(0.0,  8, 0, 0))
+anim.back_foot.frames.Add(AnimKeyframe(0.0, 8, 0, 0))
 anim.back_foot.frames.Add(AnimKeyframe(0.2, -8, 0, 0))
 anim.back_foot.frames.Add(AnimKeyframe(0.4,-10,-4, 0.2))
 anim.back_foot.frames.Add(AnimKeyframe(0.6, -8,-8, 0.3))
-anim.back_foot.frames.Add(AnimKeyframe(0.8,  4,-4,-0.2))
-anim.back_foot.frames.Add(AnimKeyframe(1.0,  8, 0, 0))
+anim.back_foot.frames.Add(AnimKeyframe(0.8, 4,-4,-0.2))
+anim.back_foot.frames.Add(AnimKeyframe(1.0, 8, 0, 0))
 
 anim.front_foot.frames.Add(AnimKeyframe(0.0,-10,-4, 0.2))
 anim.front_foot.frames.Add(AnimKeyframe(0.2, -8,-8, 0.3))
-anim.front_foot.frames.Add(AnimKeyframe(0.4,  4,-4,-0.2))
-anim.front_foot.frames.Add(AnimKeyframe(0.6,  8, 0, 0))
-anim.front_foot.frames.Add(AnimKeyframe(0.8,  8, 0, 0))
+anim.front_foot.frames.Add(AnimKeyframe(0.4, 4,-4,-0.2))
+anim.front_foot.frames.Add(AnimKeyframe(0.6, 8, 0, 0))
+anim.front_foot.frames.Add(AnimKeyframe(0.8, 8, 0, 0))
 anim.front_foot.frames.Add(AnimKeyframe(1.0,-10,-4, 0.2))
 container.animations.Add(anim)
 
 anim = Animation("hammer_swing")
 anim.attach.frames.Add(AnimKeyframe(0.0, 0, 0, -0.10))
-anim.attach.frames.Add(AnimKeyframe(0.3, 0, 0,  0.25))
-anim.attach.frames.Add(AnimKeyframe(0.4, 0, 0,  0.30))
-anim.attach.frames.Add(AnimKeyframe(0.5, 0, 0,  0.25))
+anim.attach.frames.Add(AnimKeyframe(0.3, 0, 0, 0.25))
+anim.attach.frames.Add(AnimKeyframe(0.4, 0, 0, 0.30))
+anim.attach.frames.Add(AnimKeyframe(0.5, 0, 0, 0.25))
 anim.attach.frames.Add(AnimKeyframe(1.0, 0, 0, -0.10))
 container.animations.Add(anim)
-			
+
 anim = Animation("ninja_swing")
 anim.attach.frames.Add(AnimKeyframe(0.00, 0, 0, -0.25))
 anim.attach.frames.Add(AnimKeyframe(0.10, 0, 0, -0.05))
-anim.attach.frames.Add(AnimKeyframe(0.15, 0, 0,  0.35))
-anim.attach.frames.Add(AnimKeyframe(0.42, 0, 0,  0.40))
-anim.attach.frames.Add(AnimKeyframe(0.50, 0, 0,  0.35))
+anim.attach.frames.Add(AnimKeyframe(0.15, 0, 0, 0.35))
+anim.attach.frames.Add(AnimKeyframe(0.42, 0, 0, 0.40))
+anim.attach.frames.Add(AnimKeyframe(0.50, 0, 0, 0.35))
 anim.attach.frames.Add(AnimKeyframe(1.00, 0, 0, -0.25))
 container.animations.Add(anim)
 
diff --git a/datasrc/datatypes.py b/datasrc/datatypes.py
index ddb3c9e3..73719f59 100644
--- a/datasrc/datatypes.py
+++ b/datasrc/datatypes.py
@@ -21,7 +21,7 @@ def FixCasing(Str):
 			else:
 				NewStr += c.lower()
 	return NewStr
-	
+
 def FormatName(type, name):
 	if "*" in type:
 		return "m_p" + FixCasing(name)
@@ -34,12 +34,12 @@ class BaseType:
 		self._type_name = type_name
 		self._target_name = "INVALID"
 		self._id = GetID() # this is used to remember what order the members have in structures etc
-	
+
 	def Identifyer(self): return "x"+str(self._id)
 	def TargetName(self): return self._target_name
 	def TypeName(self): return self._type_name
 	def ID(self): return self._id;
-	
+
 	def EmitDeclaration(self, name):
 		return ["%s %s;"%(self.TypeName(), FormatName(self.TypeName(), name))]
 	def EmitPreDefinition(self, target_name):
@@ -52,7 +52,7 @@ class MemberType:
 	def __init__(self, name, var):
 		self.name = name
 		self.var = var
-		
+
 class Struct(BaseType):
 	def __init__(self, type_name):
 		BaseType.__init__(self, type_name)
@@ -71,7 +71,7 @@ class Struct(BaseType):
 				print(v.name, v.var)
 			sys.exit(-1)
 		return m
-		
+
 	def EmitTypeDeclaration(self, name):
 		lines = []
 		lines += ["struct " + self.TypeName()]
@@ -93,7 +93,7 @@ class Struct(BaseType):
 			lines += ["\t" + " ".join(member.var.EmitDefinition("")) + ","]
 		lines += ["}"]
 		return lines
-		
+
 class Array(BaseType):
 	def __init__(self, type):
 		BaseType.__init__(self, type.TypeName())
@@ -114,7 +114,7 @@ class Array(BaseType):
 		for item in self.items:
 			lines += item.EmitPreDefinition("%s[%d]"%(self.Identifyer(), i))
 			i += 1
-			
+
 		if len(self.items):
 			lines += ["static %s %s[] = {"%(self.TypeName(), self.Identifyer())]
 			for item in self.items:
@@ -123,7 +123,7 @@ class Array(BaseType):
 			lines += ["};"]
 		else:
 			lines += ["static %s *%s = 0;"%(self.TypeName(), self.Identifyer())]
-			
+
 		return lines
 	def EmitDefinition(self, name):
 		return [str(len(self.items))+","+self.Identifyer()]
@@ -139,7 +139,7 @@ class Int(BaseType):
 	def EmitDefinition(self, name):
 		return ["%d"%self.value]
 		#return ["%d /* %s */"%(self.value, self._target_name)]
-		
+
 class Float(BaseType):
 	def __init__(self, value):
 		BaseType.__init__(self, "float")
@@ -149,7 +149,7 @@ class Float(BaseType):
 	def EmitDefinition(self, name):
 		return ["%f"%self.value]
 		#return ["%d /* %s */"%(self.value, self._target_name)]
-		
+
 class String(BaseType):
 	def __init__(self, value):
 		BaseType.__init__(self, "const char*")
@@ -158,7 +158,7 @@ class String(BaseType):
 		self.value = value
 	def EmitDefinition(self, name):
 		return ['"'+self.value+'"']
-		
+
 class Pointer(BaseType):
 	def __init__(self, type, target):
 		BaseType.__init__(self, "%s*"%type().TypeName())
@@ -227,7 +227,7 @@ class NetObject:
 		lines += ["\treturn 0;"]
 		lines += ["}"]
 		return lines
-		
+
 
 class NetEvent(NetObject):
 	def __init__(self, name, variables):
@@ -265,12 +265,12 @@ class NetMessage(NetObject):
 			extra += ["\t\t"+line for line in v.emit_pack()]
 		extra += ["\t\treturn pPacker->Error() != 0;"]
 		extra += ["\t}"]
-		
-		
+
+
 		lines = NetObject.emit_declaration(self)
 		lines = lines[:-1] + extra + lines[-1:]
 		return lines
-		
+
 
 class NetVariable:
 	def __init__(self, name):