]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/csqcmodel_settings.qh
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / csqcmodel_settings.qh
index da2661b9c549e5d2b1f845c1cac73b2d901fdc62..96836a38e23c635d00c5c731a3478a6d46d3afb3 100644 (file)
@@ -1,5 +1,4 @@
-#ifndef CSQCMODEL_SETTINGS_H
-#define CSQCMODEL_SETTINGS_H
+#pragma once
 
 // define this if svqc code wants to use .frame2 and .lerpfrac
 //#define CSQCMODEL_HAVE_TWO_FRAMES
@@ -20,7 +19,8 @@
 # define TAG_VIEWLOC_TYPE int
 .float tag_networkviewloc;
 
-# define MOVETYPE_NAME move_movetype
+# define ALPHA m_alpha
+.float m_alpha;
 #else
 # define TAG_ENTITY_NAME tag_entity
 # define TAG_ENTITY_TYPE entity
 # define TAG_VIEWLOC_NAME viewloc
 # define TAG_VIEWLOC_TYPE entity
 
-# define MOVETYPE_NAME movetype
+# define ALPHA alpha
 #endif
 
-// new fields
-.vector v_angle;
-
 // add properties you want networked to CSQC here
 #define CSQCMODEL_EXTRAPROPERTIES \
        CSQCMODEL_PROPERTY(BIT(0), int, ReadShort, WriteShort, colormap) \
        CSQCMODEL_PROPERTY(BIT(1), int, ReadInt24_t, WriteInt24_t, effects) \
        CSQCMODEL_PROPERTY(BIT(2), int, ReadByte, WriteByte, modelflags) \
-       CSQCMODEL_PROPERTY_SCALED(BIT(3), float, ReadByte, WriteByte, alpha, 254, -1, 254) \
+       CSQCMODEL_PROPERTY_SCALED(BIT(3), float, ReadByte, WriteByte, ALPHA, 254, -1, 254) \
        CSQCMODEL_PROPERTY(BIT(4), int, ReadByte, WriteByte, skin) \
        CSQCMODEL_PROPERTY(BIT(5), float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
        CSQCMODEL_PROPERTY(BIT(6), float, ReadByte, WriteByte, solid) \
                CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_x, 254, -1, 254) \
                CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_y, 254, -1, 254) \
                CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_z, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_x, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_y, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_z, 254, -1, 254) \
        CSQCMODEL_ENDIF \
+       CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_x, 16, 0, 255) \
+       CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_y, 16, 0, 255) \
+       CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_z, 16, 0, 255) \
        CSQCMODEL_IF(isplayer) \
                CSQCMODEL_PROPERTY(BIT(7), int, ReadByte, WriteByte, anim_state) \
                CSQCMODEL_PROPERTY(BIT(7), float, ReadApproxPastTime, WriteApproxPastTime, anim_time) \
        CSQCMODEL_ENDIF \
        CSQCMODEL_PROPERTY(BIT(10), float, ReadAngle, WriteAngle, v_angle_x) \
        CSQCMODEL_PROPERTY(BIT(11), int, ReadByte, WriteByte, traileffect) \
-       CSQCMODEL_PROPERTY_SCALED(BIT(12), float, ReadByte, WriteByte, scale, 16, 0, 255) \
+       CSQCMODEL_PROPERTY(BIT(12), float, ReadCoord, WriteCoord, scale) \
        CSQCMODEL_PROPERTY(BIT(13), int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
        CSQCMODEL_PROPERTY(BIT(14), TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) \
-       CSQCMODEL_PROPERTY(BIT(15), int, ReadByte, WriteByte, multijump_count) \
-       CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, MOVETYPE_NAME)
-// TODO get rid of colormod/glowmod here, find good solution for vortex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
+       CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, multijump_count) \
+       CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, move_movetype)
+// TODO get rid of colormod/glowmod here; also get rid of some useless properties on non-players that only exist for CopyBody
 
 // add hook function calls here
 #define CSQCPLAYER_HOOK_POSTCAMERASETUP() \
-       CSQCPlayer_SetViewLocation()
+       viewloc_SetViewLocation()
 
 // force updates of player entities this frequently (per second) even if unchanged
 #ifndef CSQCPLAYER_FORCE_UPDATES
@@ -94,4 +91,3 @@
 #endif
 
 #define CSQCMODEL_EF_RESPAWNGHOST EF_SELECTABLE
-#endif