cleanup+walgrid init
[carveJwlIkooP6JGAAIwe30JlM.git] / character.h
index 6a3a26b0764ef4e06babb3e6ca0ca84ca280858e..bc2ccb5a52c3f8c2d29d7f48de61f19ceb674f59 100644 (file)
@@ -1,16 +1,25 @@
 #ifndef CHARACTER_H
 #define CHARACTER_H
 
-/* TODO: -> Common.h */
-#define VG_3D
-#include "vg/vg.h"
-
+#include "common.h"
 #include "model.h"
 #include "scene.h"
 #include "ik.h"
 #include "rigidbody.h"
 #include "shaders/character.h"
 
+vg_tex2d tex_pallet = { .path = "textures/ch_gradient.qoi" };
+
+static void character_register(void)
+{
+   shader_character_register();
+}
+
+static void character_init(void)
+{
+   vg_tex2d_init( (vg_tex2d *[]){ &tex_pallet }, 1 );
+}
+
 #define FOREACH_PART(FN) \
    FN( foot_l ) \
    FN( foot_r ) \
@@ -39,6 +48,7 @@
 #define ADD_ONE(_) +1
 #define PART_COUNT FOREACH_PART(ADD_ONE)
 
+
 enum character_part
 {
    FOREACH_PART( MAKE_ENUM )
@@ -503,8 +513,9 @@ static void character_testpose( struct character *ch, float t )
 static void character_draw( struct character *ch, float temp )
 {
    shader_character_use();
-
    shader_character_uPv( vg_pv );
+
+   vg_tex2d_bind( &tex_pallet, 0 );
    shader_character_uTexMain( 0 );
    shader_character_uOpacity( temp );
    
@@ -536,12 +547,6 @@ static void character_draw( struct character *ch, float temp )
    }
 }
 
-static void character_register(void)
-{
-   shader_character_register();
-}
-
-
 /* 
  * Ragdoll Stuff
  */