refactor model things
[carveJwlIkooP6JGAAIwe30JlM.git] / model.h
diff --git a/model.h b/model.h
index 0547e8ecc17d919dc438dd456ef4acfaac48e15e..fb33e0bbad88bbaa45f7c1f61e708148c8a95d0b 100644 (file)
--- a/model.h
+++ b/model.h
@@ -30,23 +30,19 @@ enum classtype
 {
    k_classtype_none = 0,
    k_classtype_gate = 1,
-   k_classtype_block = 2,
    k_classtype_spawn = 3,
    k_classtype_water = 4,
-   k_classtype_car_path = 5,
-   k_classtype_instance = 6,
-   k_classtype_capsule = 7,
    k_classtype_route_node = 8,
    k_classtype_route = 9,
    k_classtype_bone = 10,
    k_classtype_skeleton = 11,
    k_classtype_skin = 12,
-   k_classtype_achievement_box = 13,
    k_classtype_audio = 14,
-   k_classtype_trigger = 15
+   k_classtype_trigger = 100,
+   k_classtype_logic_achievement = 101,
+   k_classtype_logic_relay = 102
 };
 
-
 #pragma pack(push,1)
 
 struct mdl_vert
@@ -111,26 +107,24 @@ struct mdl_file_header
 {
    u32 identifier, version, file_length, pad0;
 
-   u32 vertex_count, vertex_offset,
-       indice_count, indice_offset,
-       submesh_count, submesh_offset,
-       material_count, material_offset,
-       node_count, node_offset,
-       anim_count, anim_offset,
-       strings_length, strings_offset, 
-       entdata_length, entdata_offset, 
-       keyframe_count, keyframe_offset;
+   u32 
+       node_count,      node_offset,
+       submesh_count,   submesh_offset,
+       material_count,  material_offset,
+       anim_count,      anim_offset,
+       entdata_size,    entdata_offset, 
+       strings_size,    strings_offset, 
+
+       keyframe_count,  keyframe_offset,
+
+       vertex_count,    vertex_offset,
+       indice_count,    indice_offset;
 };
 
 /* 
  * Entity data structures
  */
 
-struct classtype_block
-{
-   boxf bbx;
-};
-
 struct classtype_gate
 {
    u32 target;
@@ -139,7 +133,7 @@ struct classtype_gate
 
 struct classtype_spawn
 {
-   u32 target;
+   u32 pstr_alias;
 };
 
 struct classtype_water
@@ -147,21 +141,6 @@ struct classtype_water
    u32 temp;
 };
 
-struct classtype_car_path
-{
-   u32 target, target1;
-};
-
-struct classtype_instance
-{
-   u32 pstr_file;
-};
-
-struct classtype_capsule
-{
-   float height, radius;
-};
-
 struct classtype_route_node
 {
    u32 target, target1;
@@ -170,6 +149,7 @@ struct classtype_route_node
 struct classtype_route
 {
    u32 id_start;
+   u32 pstr_name;
    v3f colour;
 };
 
@@ -199,10 +179,19 @@ struct classtype_skin
    u32 skeleton;
 };
 
-struct classtype_achievement_box
+struct classtype_trigger
 {
-   u32 pstr_name,
-       trigger;
+   u32 target;
+};
+
+struct classtype_logic_relay
+{
+   u32 targets[4];
+};
+
+struct classtype_logic_achievement
+{
+   u32 pstr_name;
 };
 
 struct classtype_audio
@@ -468,7 +457,8 @@ VG_STATIC mdl_context *mdl_load_full( void *lin_alloc, const char *path )
 
    /* create allocator */
    u32 tot_size = temp_ctx.info.file_length + sizeof( mdl_context );
-   void *data = vg_create_linear_allocator( lin_alloc, tot_size );
+   void *data = vg_create_linear_allocator( lin_alloc, tot_size, 
+                                            VG_MEMORY_SYSTEM );
 
    /* copy context and load all other data */
    mdl_context *ctx = vg_linear_alloc( data, sizeof(mdl_context) );