about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2011-06-01 20:19:12 +0200
committeroy <Tom_Adams@web.de>2011-06-02 17:42:30 +0200
commit603071ee92de0859da04a70c7bd5971fca163288 (patch)
tree964b093b5404bac324997dfd4278e64d14783097
parentdeff0ce7c4442950580533b47d7145f79bcca9bb (diff)
downloadzcatch-603071ee92de0859da04a70c7bd5971fca163288.tar.gz
zcatch-603071ee92de0859da04a70c7bd5971fca163288.zip
fixed data struct names
-rw-r--r--datasrc/compile.py4
-rw-r--r--datasrc/content.py36
-rw-r--r--src/game/client/animstate.cpp12
-rw-r--r--src/game/client/animstate.h20
-rw-r--r--src/game/client/components/sounds.cpp4
-rw-r--r--src/game/client/render.cpp4
-rw-r--r--src/game/client/render.h2
7 files changed, 41 insertions, 41 deletions
diff --git a/datasrc/compile.py b/datasrc/compile.py
index e8901c48..088e500a 100644
--- a/datasrc/compile.py
+++ b/datasrc/compile.py
@@ -75,7 +75,7 @@ if gen_client_content_header or gen_server_content_header:
 		EmitTypeDeclaration(content.__dict__[name])
 
 	# the container pointer
-	print('extern DATACONTAINER *g_pData;')
+	print('extern CDataContainer *g_pData;')
 
 	# enums
 	EmitEnum(["IMAGE_%s"%i.name.value.upper() for i in content.container.images.items], "NUM_IMAGES")
@@ -88,7 +88,7 @@ if gen_client_content_source or gen_server_content_source:
 	if gen_server_content_source:
 		print('#include "server_data.h"')
 	EmitDefinition(content.container, "datacontainer")
-	print('DATACONTAINER *g_pData = &datacontainer;')
+	print('CDataContainer *g_pData = &datacontainer;')
 
 # NETWORK
 if gen_network_header:
diff --git a/datasrc/content.py b/datasrc/content.py
index e714e8b8..aa6554f3 100644
--- a/datasrc/content.py
+++ b/datasrc/content.py
@@ -3,13 +3,13 @@ from datatypes import *
 
 class Sound(Struct):
 	def __init__(self, filename=""):
-		Struct.__init__(self, "SOUND")
+		Struct.__init__(self, "CDataSound")
 		self.id = Int(0)
 		self.filename = String(filename)
 
 class SoundSet(Struct):
 	def __init__(self, name="", files=[]):
-		Struct.__init__(self, "SOUNDSET")
+		Struct.__init__(self, "CDataSoundset")
 		self.name = String(name)
 		self.sounds = Array(Sound())
 		self.last = Int(-1)
@@ -18,21 +18,21 @@ class SoundSet(Struct):
 
 class Image(Struct):
 	def __init__(self, name="", filename=""):
-		Struct.__init__(self, "IMAGE")
+		Struct.__init__(self, "CDataImage")
 		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")
+		Struct.__init__(self, "CDataSpriteset")
 		self.image = Pointer(Image, image) # TODO
 		self.gridx = Int(gridx)
 		self.gridy = Int(gridy)
 
 class Sprite(Struct):
 	def __init__(self, name="", Set=None, x=0, y=0, w=0, h=0):
-		Struct.__init__(self, "SPRITE")
+		Struct.__init__(self, "CDataSprite")
 		self.name = String(name)
 		self.set = Pointer(SpriteSet, Set) # TODO
 		self.x = Int(x)
@@ -42,14 +42,14 @@ class Sprite(Struct):
 
 class Pickup(Struct):
 	def __init__(self, name="", respawntime=15, spawndelay=0):
-		Struct.__init__(self, "PICKUPSPEC")
+		Struct.__init__(self, "CDataPickupspec")
 		self.name = String(name)
 		self.respawntime = Int(respawntime)
 		self.spawndelay = Int(spawndelay)
 
 class AnimKeyframe(Struct):
 	def __init__(self, time=0, x=0, y=0, angle=0):
-		Struct.__init__(self, "ANIM_KEYFRAME")
+		Struct.__init__(self, "CAnimKeyframe")
 		self.time = Float(time)
 		self.x = Float(x)
 		self.y = Float(y)
@@ -57,12 +57,12 @@ class AnimKeyframe(Struct):
 
 class AnimSequence(Struct):
 	def __init__(self):
-		Struct.__init__(self, "ANIM_SEQUENCE")
+		Struct.__init__(self, "CAnimSequence")
 		self.frames = Array(AnimKeyframe())
 
 class Animation(Struct):
 	def __init__(self, name=""):
-		Struct.__init__(self, "ANIMATION")
+		Struct.__init__(self, "CAnimation")
 		self.name = String(name)
 		self.body = AnimSequence()
 		self.back_foot = AnimSequence()
@@ -71,7 +71,7 @@ class Animation(Struct):
 
 class WeaponSpec(Struct):
 	def __init__(self, container=None, name=""):
-		Struct.__init__(self, "WEAPONSPEC")
+		Struct.__init__(self, "CDataWeaponspec")
 		self.name = String(name)
 		self.sprite_body = Pointer(Sprite, Sprite())
 		self.sprite_cursor = Pointer(Sprite, Sprite())
@@ -101,12 +101,12 @@ class WeaponSpec(Struct):
 
 class Weapon_Hammer(Struct):
 	def __init__(self):
-		Struct.__init__(self, "WEAPONSPEC_HAMMER")
+		Struct.__init__(self, "CDataWeaponspecHammer")
 		self.base = Pointer(WeaponSpec, WeaponSpec())
 
 class Weapon_Gun(Struct):
 	def __init__(self):
-		Struct.__init__(self, "WEAPONSPEC_GUN")
+		Struct.__init__(self, "CDataWeaponspecGun")
 		self.base = Pointer(WeaponSpec, WeaponSpec())
 		self.curvature = Float(1.25)
 		self.speed = Float(2200)
@@ -114,7 +114,7 @@ class Weapon_Gun(Struct):
 
 class Weapon_Shotgun(Struct):
 	def __init__(self):
-		Struct.__init__(self, "WEAPONSPEC_SHOTGUN")
+		Struct.__init__(self, "CDataWeaponspecShotgun")
 		self.base = Pointer(WeaponSpec, WeaponSpec())
 		self.curvature = Float(1.25)
 		self.speed = Float(2200)
@@ -123,7 +123,7 @@ class Weapon_Shotgun(Struct):
 
 class Weapon_Grenade(Struct):
 	def __init__(self):
-		Struct.__init__(self, "WEAPONSPEC_GRENADE")
+		Struct.__init__(self, "CDataWeaponspecGrenade")
 		self.base = Pointer(WeaponSpec, WeaponSpec())
 		self.curvature = Float(7.0)
 		self.speed = Float(1000)
@@ -131,7 +131,7 @@ class Weapon_Grenade(Struct):
 
 class Weapon_Rifle(Struct):
 	def __init__(self):
-		Struct.__init__(self, "WEAPONSPEC_RIFLE")
+		Struct.__init__(self, "CDataWeaponspecRifle")
 		self.base = Pointer(WeaponSpec, WeaponSpec())
 		self.reach = Float(800.0)
 		self.bounce_delay = Int(150)
@@ -140,7 +140,7 @@ class Weapon_Rifle(Struct):
 
 class Weapon_Ninja(Struct):
 	def __init__(self):
-		Struct.__init__(self, "WEAPONSPEC_NINJA")
+		Struct.__init__(self, "CDataWeaponspecNinja")
 		self.base = Pointer(WeaponSpec, WeaponSpec())
 		self.duration = Int(15000)
 		self.movetime = Int(200)
@@ -148,7 +148,7 @@ class Weapon_Ninja(Struct):
 
 class Weapons(Struct):
 	def __init__(self):
-		Struct.__init__(self, "WEAPONSPECS")
+		Struct.__init__(self, "CDataWeaponspecs")
 		self.hammer = Weapon_Hammer()
 		self.gun = Weapon_Gun()
 		self.shotgun = Weapon_Shotgun()
@@ -159,7 +159,7 @@ class Weapons(Struct):
 
 class DataContainer(Struct):
 	def __init__(self):
-		Struct.__init__(self, "DATACONTAINER")
+		Struct.__init__(self, "CDataContainer")
 		self.sounds = Array(SoundSet())
 		self.images = Array(Image())
 		self.pickups = Array(Pickup())
diff --git a/src/game/client/animstate.cpp b/src/game/client/animstate.cpp
index 1289126b..ce595359 100644
--- a/src/game/client/animstate.cpp
+++ b/src/game/client/animstate.cpp
@@ -7,7 +7,7 @@
 
 #include "animstate.h"
 
-static void AnimSeqEval(ANIM_SEQUENCE *pSeq, float Time, ANIM_KEYFRAME *pFrame)
+static void AnimSeqEval(CAnimSequence *pSeq, float Time, CAnimKeyframe *pFrame)
 {
 	if(pSeq->m_NumFrames == 0)
 	{
@@ -23,8 +23,8 @@ static void AnimSeqEval(ANIM_SEQUENCE *pSeq, float Time, ANIM_KEYFRAME *pFrame)
 	else
 	{
 		//time = max(0.0f, min(1.0f, time / duration)); // TODO: use clamp
-		ANIM_KEYFRAME *pFrame1 = 0;
-		ANIM_KEYFRAME *pFrame2 = 0;
+		CAnimKeyframe *pFrame1 = 0;
+		CAnimKeyframe *pFrame2 = 0;
 		float Blend = 0.0f;
 
 		// TODO: make this smarter.. binary search
@@ -49,7 +49,7 @@ static void AnimSeqEval(ANIM_SEQUENCE *pSeq, float Time, ANIM_KEYFRAME *pFrame)
 	}
 }
 
-static void AnimAddKeyframe(ANIM_KEYFRAME *pSeq, ANIM_KEYFRAME *pAdded, float Amount)
+static void AnimAddKeyframe(CAnimKeyframe *pSeq, CAnimKeyframe *pAdded, float Amount)
 {
 	pSeq->m_X += pAdded->m_X*Amount;
 	pSeq->m_Y += pAdded->m_Y*Amount;
@@ -65,7 +65,7 @@ static void AnimAdd(CAnimState *pState, CAnimState *pAdded, float Amount)
 }
 
 
-void CAnimState::Set(ANIMATION *pAnim, float Time)
+void CAnimState::Set(CAnimation *pAnim, float Time)
 {
 	AnimSeqEval(&pAnim->m_Body, Time, &m_Body);
 	AnimSeqEval(&pAnim->m_BackFoot, Time, &m_BackFoot);
@@ -73,7 +73,7 @@ void CAnimState::Set(ANIMATION *pAnim, float Time)
 	AnimSeqEval(&pAnim->m_Attach, Time, &m_Attach);
 }
 
-void CAnimState::Add(ANIMATION *pAnim, float Time, float Amount)
+void CAnimState::Add(CAnimation *pAnim, float Time, float Amount)
 {
 	CAnimState Add;
 	Add.Set(pAnim, Time);
diff --git a/src/game/client/animstate.h b/src/game/client/animstate.h
index 63b6a80a..fbc0a2f8 100644
--- a/src/game/client/animstate.h
+++ b/src/game/client/animstate.h
@@ -5,18 +5,18 @@
 
 class CAnimState
 {
-	ANIM_KEYFRAME m_Body;
-	ANIM_KEYFRAME m_BackFoot;
-	ANIM_KEYFRAME m_FrontFoot;
-	ANIM_KEYFRAME m_Attach;
+	CAnimKeyframe m_Body;
+	CAnimKeyframe m_BackFoot;
+	CAnimKeyframe m_FrontFoot;
+	CAnimKeyframe m_Attach;
 
 public:
-	ANIM_KEYFRAME *GetBody() { return &m_Body; };
-	ANIM_KEYFRAME *GetBackFoot() { return &m_BackFoot; };
-	ANIM_KEYFRAME *GetFrontFoot() { return &m_FrontFoot; };
-	ANIM_KEYFRAME *GetAttach() { return &m_Attach; };
-	void Set(ANIMATION *pAnim, float Time);
-	void Add(ANIMATION *pAdded, float Time, float Amount);
+	CAnimKeyframe *GetBody() { return &m_Body; };
+	CAnimKeyframe *GetBackFoot() { return &m_BackFoot; };
+	CAnimKeyframe *GetFrontFoot() { return &m_FrontFoot; };
+	CAnimKeyframe *GetAttach() { return &m_Attach; };
+	void Set(CAnimation *pAnim, float Time);
+	void Add(CAnimation *pAdded, float Time, float Amount);
 
 	static CAnimState *GetIdle();
 };
diff --git a/src/game/client/components/sounds.cpp b/src/game/client/components/sounds.cpp
index ffafa128..e9902108 100644
--- a/src/game/client/components/sounds.cpp
+++ b/src/game/client/components/sounds.cpp
@@ -131,7 +131,7 @@ void CSounds::Play(int Chn, int SetId, float Vol, vec2 Pos)
 	if(!g_Config.m_SndEnable || (Chn == CHN_MUSIC && !g_Config.m_SndMusic) || m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds)
 		return;
 
-	SOUNDSET *pSet = &g_pData->m_aSounds[SetId];
+	CDataSoundset *pSet = &g_pData->m_aSounds[SetId];
 
 	if(!pSet->m_NumSounds)
 		return;
@@ -162,7 +162,7 @@ void CSounds::Stop(int SetId)
 	if(m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds)
 		return;
 	
-	SOUNDSET *pSet = &g_pData->m_aSounds[SetId];
+	CDataSoundset *pSet = &g_pData->m_aSounds[SetId];
 	
 	for(int i = 0; i < pSet->m_NumSounds; i++)
 		Sound()->Stop(pSet->m_aSounds[i].m_Id);
diff --git a/src/game/client/render.cpp b/src/game/client/render.cpp
index 5dbc3842..93909d0c 100644
--- a/src/game/client/render.cpp
+++ b/src/game/client/render.cpp
@@ -37,7 +37,7 @@ static void layershot_end()
 	config.cl_layershot++;
 }*/
 
-void CRenderTools::SelectSprite(SPRITE *pSpr, int Flags, int sx, int sy)
+void CRenderTools::SelectSprite(CDataSprite *pSpr, int Flags, int sx, int sy)
 {
 	int x = pSpr->m_X+sx;
 	int y = pSpr->m_Y+sy;
@@ -232,7 +232,7 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote
 			}
 
 			// draw feet
-			ANIM_KEYFRAME *pFoot = f ? pAnim->GetFrontFoot() : pAnim->GetBackFoot();
+			CAnimKeyframe *pFoot = f ? pAnim->GetFrontFoot() : pAnim->GetBackFoot();
 
 			float w = BaseSize;
 			float h = BaseSize/2;
diff --git a/src/game/client/render.h b/src/game/client/render.h
index 10705e56..dc7207be 100644
--- a/src/game/client/render.h
+++ b/src/game/client/render.h
@@ -51,7 +51,7 @@ public:
 
 	//typedef struct SPRITE;
 
-	void SelectSprite(struct SPRITE *pSprite, int Flags=0, int sx=0, int sy=0);
+	void SelectSprite(struct CDataSprite *pSprite, int Flags=0, int sx=0, int sy=0);
 	void SelectSprite(int id, int Flags=0, int sx=0, int sy=0);
 
 	void DrawSprite(float x, float y, float size);