Notices & clean
authorhgn <hgodden00@gmail.com>
Sat, 8 Oct 2022 00:19:42 +0000 (01:19 +0100)
committerhgn <hgodden00@gmail.com>
Sat, 8 Oct 2022 00:19:42 +0000 (01:19 +0100)
44 files changed:
anim_test.h [deleted file]
audio.h
blender_export.py
blender_graphics_cropper.py
build.sh
bvh.h
common.h
highscores.h
ik.h [deleted file]
ik_emulate.py [deleted file]
lighting.h [deleted file]
mesh.h [deleted file]
network.h
network_msg.h
physics_test.h
player.h
player_animation.h
player_audio.h
player_model.h
player_physics.h
player_walkgrid.h
ragdoll.h [deleted file]
render.h
rigidbody.h
road.h [deleted file]
scope.h [deleted file]
server.c
shaders.sh
skeleton.h
skeleton_animator.h [deleted file]
sprites_autocombine.h [deleted file]
steam.h
terrain.h [deleted file]
testaa.c [deleted file]
vg.conf
vg_config.h
world.h
world_gate.h
world_gen.h
world_info.h
world_render.h
world_routes.h
world_sfd.h
world_water.h

diff --git a/anim_test.h b/anim_test.h
deleted file mode 100644 (file)
index 054e955..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) Mount0 Software, Harry Godden - All Rights Reserved
- */
-
-#ifndef ANIM_TEST_H
-#define ANIM_TEST_H
-
-#include "player.h"
-#include "skeleton.h"
-#include "shaders/viewchar.h"
-
-static struct 
-{
-   struct skeleton skele;
-   struct skeleton_anim *anim_stand, *anim_highg;
-
-   glmesh mesh;
-}
-animtest;
-
-static void anim_test_start(void)
-{
-   mdl_header *johannes = mdl_load( "models/ch_new.mdl" );
-   skeleton_setup( &animtest.skele, johannes );
-   animtest.anim_stand = skeleton_get_anim( &animtest.skele, "pose_stand" );
-   animtest.anim_highg = skeleton_get_anim( &animtest.skele, "pose_highg" );
-   mdl_unpack_glmesh( johannes, &animtest.mesh );
-
-   free( johannes );
-}
-
-static void anim_test_update(void)
-{
-   player_freecam();
-   player_camera_update();
-   
-   m4x3f transform;
-   m4x3_identity( transform );
-   
-   v4f qt;
-   q_axis_angle( qt, (v3f){0.0f,1.0f,0.0f}, vg_time*1.2f );
-   q_m3x3( qt, transform );
-
-   mdl_keyframe apose[32],
-                bpose[32];
-
-   float a = sinf(vg_time)*0.5f+0.5f,
-         b = (sinf(vg_time*2.0f)*0.5f+0.5f)*(15.0f/30.0f);
-
-   skeleton_sample_anim( &animtest.skele, animtest.anim_stand, b, apose );
-   skeleton_sample_anim( &animtest.skele, animtest.anim_highg, b, bpose );
-
-   skeleton_lerp_pose( &animtest.skele, apose, bpose, a, apose );
-   skeleton_apply_standard( &animtest.skele, apose, transform );
-
-   skeleton_debug( &animtest.skele );
-}
-
-static void anim_test_render( vg_tex2d *tex )
-{
-   m4x4f world_4x4;
-   m4x3_expand( player.camera_inverse, world_4x4 );
-
-   gpipeline.fov = 60.0f;
-   m4x4_projection( vg_pv, gpipeline.fov, 
-         (float)vg_window_x / (float)vg_window_y, 
-         0.1f, 2100.0f );
-
-   m4x4_mul( vg_pv, world_4x4, vg_pv );
-   glEnable( GL_DEPTH_TEST );
-
-   shader_viewchar_use();
-   vg_tex2d_bind( tex, 0 );
-   shader_viewchar_uTexMain( 0 );
-   shader_viewchar_uPv( vg_pv );
-   
-   shader_link_standard_ub( _shader_viewchar.id, 2 );
-
-   glUniformMatrix4x3fv( _uniform_viewchar_uTransforms, 
-                         animtest.skele.bone_count,
-                         0,
-                         (float *)animtest.skele.final_mtx );
-   
-   mesh_bind( &animtest.mesh );
-   mesh_draw( &animtest.mesh );
-
-   glDisable( GL_DEPTH_TEST );
-   vg_lines_drawall( (float *)vg_pv );
-}
-
-#endif /* ANIM_TEST_H */
diff --git a/audio.h b/audio.h
index fc9330c1a629d7cc7fb4bb3f3c0e93c5e4e08e91..a984dd021c0cec676fb9a30f37a116888c54db27 100644 (file)
--- a/audio.h
+++ b/audio.h
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #include "common.h"
 
 #ifndef AUDIO_H
index c44694abc0ea5b6e41e36fec86cdfaa1ff5ce181..86b65410919ff61854517a805ca73b096bafa84a 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+#
+
 import bpy, math, gpu
 import cProfile
 from ctypes import *
index 37cd26c3b0ca2b831eacb8f5e6856658c649e123..0dbc463f26158a08ba813894589ab313b738f4f4 100644 (file)
@@ -1,3 +1,6 @@
+# Any copyright is dedicated to the Public Domain. (blender_graphics_cropper.py)
+# https://creativecommons.org/publicdomain/zero/1.0/
+
 import bpy, math, gpu, blf
 from mathutils import *
 from gpu_extras.batch import batch_for_shader
index 1bf5fdde0532db350608e3419d4640df80bcdab5..bb59b6faf6ff3f181f6d46a43ac738727559dc09 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
-# Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved
+# 
+# Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
 # 
 # Main cross-compiling build script for Skate Rift
 # Supports Linux and Windows building from a Linux Host
diff --git a/bvh.h b/bvh.h
index 637b55308cc4677140137664be3bf671e12421b3..c18bb3052d9ffa532231ae9bcfcba797dbad4814 100644 (file)
--- a/bvh.h
+++ b/bvh.h
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef BVH_H
 #define BVH_H
 #include "common.h"
index 3a3a23a000a4c07e5721b7c00581b74684f0f963..d0f4c078529f1b19baedaaaeb5580556ddedf97a 100644 (file)
--- a/common.h
+++ b/common.h
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef COMMON_H
 #define COMMON_H
 
index 0136886843899093ce074ca02a0e44a46f9be799..d99710e480cdf59f142ba126707f86995cdd740c 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef HIGHSCORES_H
 #define HIGHSCORES_H
 
diff --git a/ik.h b/ik.h
deleted file mode 100644 (file)
index e02fd30..0000000
--- a/ik.h
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef IK_H
-#define IK_H
-
-#include "vg/vg.h"
-
-/*
- *  Setup basic IK system (2d, 2 bones)
- *
- *  + base (m1)
- *   \
- *    \ l1
- *     \
- *      *(m2)   + pole
- *     /
- *    / l2
- *   + 
- *   end
- */
-struct ik_basic
-{
-   v3f base,
-       pole,
-       end;
-
-   float l1, l2;
-};
-
-typedef enum ik_dir ik_dir;
-enum ik_dir
-{
-   k_ikX,
-   k_iknX,
-   k_ikY,
-   k_iknY,
-   k_ikZ,
-   k_iknZ
-};
-
-static void ik_track_to( m4x3f m, v3f pos, v3f target, v3f axis, 
-      ik_dir fwd, ik_dir up )
-{
-   v3f dir, other;
-   v3_sub( target, pos, dir );
-   v3_normalize( dir );
-   v3_cross( dir, axis, other );
-
-   if( fwd == k_ikX && up == k_ikY )
-   {
-      v3_copy( axis,  m[0] );
-      v3_copy( dir,   m[1] );
-      v3_copy( other, m[2] );
-   }
-
-   if( fwd == k_ikY && up == k_ikX )
-   {
-      v3_negate( axis, m[2] );
-      v3_copy( dir,    m[1] );
-      v3_negate( other,m[0] );
-   }
-
-   if( fwd == k_ikY && up == k_iknX )
-   {
-      v3_negate( axis, m[2] );
-      v3_negate( dir,    m[1] );
-      v3_copy( other,m[0] );
-   }
-
-   if( fwd == k_ikZ && up == k_ikY )
-   {
-      v3_copy( axis,  m[1] );
-      v3_copy( dir,   m[2] );
-      v3_negate( other, m[0] );
-   }
-
-   if( fwd == k_iknZ && up == k_ikY )
-   {
-      v3_negate( axis,  m[1] );
-      v3_negate( dir,   m[2] );
-      v3_negate( other, m[0] );
-   }
-
-   v3_copy( pos, m[3] );
-}
-
-static void ik_basic( struct ik_basic *ik, m4x3f m1, m4x3f m2, 
-      enum ik_dir fwd, enum ik_dir up )
-{
-   /* Localize the system into 2d */
-   v3f local[3];
-   float *v0 = local[0],
-         *v1 = local[1],
-         *axis = local[2];
-
-   vg_line( ik->base, ik->pole, 0x6fffff00 );
-   vg_line( ik->end, ik->pole, 0x6fffff00 );
-
-   v3_sub( ik->base, ik->pole, v0 );
-   v3_sub( ik->end, ik->pole, v1 );
-
-   v3_cross( v0, v1, axis );
-   v3_normalize( v0 );
-   v3_normalize( axis );
-   v3_cross( axis, v0, v1 );
-
-   v3f p0, p1, p2;
-   v3_muladds( ik->base, axis, 0.05f, p0 );
-   v3_muladds( ik->base, v0, 0.05f, p1 );
-   v3_muladds( ik->base, v1, 0.05f, p2 );
-   vg_line( ik->base, p0, 0xffff0000 );
-   vg_line( ik->base, p1, 0xff00ff00 );
-   vg_line( ik->base, p2, 0xff0000ff );
-   
-   v2f base = { v3_dot( v0, ik->base ), v3_dot( v1, ik->base ) },
-       end  = { v3_dot( v0, ik->end  ), v3_dot( v1, ik->end  ) },
-       knee;
-
-   /* Compute angles */
-   v2f delta;
-   v2_sub( end, base, delta );
-
-   float 
-      d = vg_clampf( v2_length(delta), fabsf(ik->l1 - ik->l2), 
-            ik->l1+ik->l2-0.00001f ),
-      c = acosf( (ik->l1*ik->l1 + d*d - ik->l2*ik->l2) / (2.0f*ik->l1*d) ),
-      rot = atan2f( delta[1], delta[0] ) + c - VG_PIf/2.0f;
-   
-   knee[0] = sinf(-rot) * ik->l1;
-   knee[1] = cosf(-rot) * ik->l1;
-
-   /* Project back into world coords */
-   v3f world_knee;
-   v3_muladds( ik->base, v0, knee[0], world_knee );
-   v3_muladds( world_knee, v1, knee[1], world_knee );
-
-   /* Create matrices */
-   
-   ik_track_to( m1, ik->base, world_knee, axis, fwd, up );
-   ik_track_to( m2, world_knee, ik->end, axis, fwd, up );
-
-   vg_line( ik->base, world_knee, 0xa00000ff );
-   vg_line( world_knee, ik->end, 0xa000ff40 );
-}
-
-#endif
diff --git a/ik_emulate.py b/ik_emulate.py
deleted file mode 100644 (file)
index 0ee3cae..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-import bpy
-from math import *
-
-def v2_sub( a, b, d ):
-   d[0] = a[0]-b[0]
-   d[1] = a[1]-b[1]
-
-def v3_sub( a, b, d ):
-   d[0] = a[0]-b[0]
-   d[1] = a[1]-b[1]
-   d[2] = a[2]-b[2]
-
-def v3_cross( a, b, d ):
-   d[0] = a[1]*b[2] - a[2]*b[1]
-   d[1] = a[2]*b[0] - a[0]*b[2]
-   d[2] = a[0]*b[1] - a[1]*b[0]
-
-def v3_muladds( a, b, s, d ):
-   d[0] = a[0]+b[0]*s
-   d[1] = a[1]+b[1]*s
-   d[2] = a[2]+b[2]*s
-
-def v3_muls( a, s, d ):
-   d[0] = a[0]*s
-   d[1] = a[1]*s
-   d[2] = a[2]*s
-
-def v3_copy( a, b ):
-   b[0] = a[0]
-   b[1] = a[1]
-   b[2] = a[2]
-
-def v3_zero( a ):
-   a[0] = 0.0
-   a[1] = 0.0
-   a[2] = 0.0
-
-def v3_negate( a, b ):
-   b[0] = -a[0]
-   b[1] = -a[1]
-   b[2] = -a[2]
-
-def v3_dot( a, b ):
-   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]
-
-def v2_dot( a, b ):
-   return a[0]*b[0] + a[1]*b[1]
-
-def v2_length2( a ):
-   return v2_dot( a, a )
-
-def v3_length2( a ):
-   return v3_dot( a, a )
-
-def v3_length( a ):
-   return sqrt( v3_length2(a) )
-
-def v2_length( a ):
-   return sqrt( v2_length2(a) )
-
-def v3_normalize( a ):
-   v3_muls( a, 1.0 / v3_length( a ), a )
-
-def m3x3_identity( a ):
-   a[0][0] = 1.0
-   a[0][1] = 0.0
-   a[0][2] = 0.0
-   a[1][0] = 0.0
-   a[1][1] = 1.0
-   a[1][2] = 0.0
-   a[2][0] = 0.0
-   a[2][1] = 0.0
-   a[2][2] = 1.0
-
-def m4x3_mul( a, b, d ):
-   a00 = a[0][0]
-   a01 = a[0][1]
-   a02 = a[0][2]
-   a10 = a[1][0]
-   a11 = a[1][1]
-   a12 = a[1][2]
-   a20 = a[2][0]
-   a21 = a[2][1]
-   a22 = a[2][2]
-   a30 = a[3][0]
-   a31 = a[3][1]
-   a32 = a[3][2]
-   b00 = b[0][0]
-   b01 = b[0][1]
-   b02 = b[0][2]
-   b10 = b[1][0]
-   b11 = b[1][1]
-   b12 = b[1][2]
-   b20 = b[2][0]
-   b21 = b[2][1]
-   b22 = b[2][2]
-   b30 = b[3][0]
-   b31 = b[3][1]
-   b32 = b[3][2]
-
-   d[0][0] = a00*b00 + a10*b01 + a20*b02
-   d[0][1] = a01*b00 + a11*b01 + a21*b02
-   d[0][2] = a02*b00 + a12*b01 + a22*b02
-   d[1][0] = a00*b10 + a10*b11 + a20*b12
-   d[1][1] = a01*b10 + a11*b11 + a21*b12
-   d[1][2] = a02*b10 + a12*b11 + a22*b12
-   d[2][0] = a00*b20 + a10*b21 + a20*b22
-   d[2][1] = a01*b20 + a11*b21 + a21*b22
-   d[2][2] = a02*b20 + a12*b21 + a22*b22
-   d[3][0] = a00*b30 + a10*b31 + a20*b32 + a30
-   d[3][1] = a01*b30 + a11*b31 + a21*b32 + a31
-   d[3][2] = a02*b30 + a12*b31 + a22*b32 + a32
-
-def m4x3_mulv( m, v, d ):
-   res = [0,0,0]
-   res[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2] + m[3][0]
-   res[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2] + m[3][1]
-   res[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2] + m[3][2]
-   v3_copy( res, d )
-
-def vg_clampf( a, minf, maxf ):
-   return max( min(maxf,a), minf )
-
-class ik_basic_t():
-   def __init__(_):
-      _.base = [0,0,0]
-      _.pole = [0,0,0]
-      _.end = [0,0,0]
-      _.l1 = 0
-      _.l2 = 0
-
-k_ikX = 0
-k_iknX = 1
-k_ikY = 2
-k_iknY = 3
-k_ikZ = 4
-k_iknZ = 5
-
-def ik_track_to( m, pos, target, axis, fwd, up ):
-   dirr = [0,0,0]
-   other = [0,0,0]
-   v3_sub( target, pos, dirr )
-   v3_normalize(dirr)
-   v3_cross(dirr,axis,other)
-
-   if fwd == k_ikX and up == k_ikY:
-      v3_copy( axis, m[0] )
-      v3_copy( dirr, m[1] )
-      v3_copy( other, m[2] )
-   if fwd == k_ikY and up == k_ikX:
-      v3_negate( axis, m[2] )
-      v3_copy( dirr, m[1] )
-      v3_negate( other, m[0] )
-   if fwd == k_ikY and up == k_iknX:
-      v3_negate( axis, m[2] )
-      v3_negate( dirr, m[1] )
-      v3_copy( other, m[0] )
-   if fwd == k_ikZ and up == k_ikY:
-      v3_copy( axis, m[1] )
-      v3_copy( dirr, m[2] )
-      v3_negate( other, m[0] )
-   if fwd == k_iknZ and up == k_ikY:
-      v3_negate( axis, m[1] )
-      v3_negate( dirr, m[2] )
-      v3_negate( other, m[0] )
-   v3_copy( pos, m[3] )
-
-def ik_basic( ik, m1, m2, fwd, up ):
-   v0 = [0,0,0]
-   v1 = [0,0,0]
-   axis = [0,0,0]
-
-   v3_sub( ik.base, ik.pole, v0 )
-   v3_sub( ik.end, ik.pole, v1 )
-
-   v3_cross( v0, v1, axis )
-   v3_normalize( v0 )
-   v3_normalize( axis )
-   v3_cross( axis, v0, v1 )
-
-   base = [ v3_dot(v0,ik.base), v3_dot(v1,ik.base) ]
-   end = [ v3_dot(v0,ik.end), v3_dot(v1,ik.end) ]
-   knee = [0,0]
-   delta = [0,0]
-   
-   v2_sub( end, base, delta )
-
-   d = vg_clampf( v2_length(delta), abs(ik.l1-ik.l2), ik.l1+ik.l2-0.00001)
-   c = acos( (ik.l1*ik.l1 + d*d - ik.l2*ik.l2) / (2.0*ik.l1*d) )
-   rot = atan2( delta[1], delta[0] ) + c - 3.14159265/2.0
-
-   knee[0] = sin(-rot) * ik.l1
-   knee[1] = cos(-rot) * ik.l1
-
-   world_knee = [0,0,0]
-   v3_muladds( ik.base, v0, knee[0], world_knee )
-   v3_muladds( world_knee, v1, knee[1], world_knee )
-
-   ik_track_to( m1, ik.base, world_knee, axis, fwd, up )
-   ik_track_to( m2, world_knee, ik.end, axis, fwd, up )
-
-def get_location_obj( obj, v ):
-   v[0] =  obj.location[0]
-   v[1] =  obj.location[2]
-   v[2] = -obj.location[1]
-
-def get_location( obj, v ):
-   v[0] =  obj.matrix_world.translation[0]
-   v[1] =  obj.matrix_world.translation[2]
-   v[2] = -obj.matrix_world.translation[1]
-
-def matrix_ready( a ):
-   b2gl =  [[1.0,0.0,0.0],[0.0,0.0,-1.0],[0.0,1.0,0.0],[0.0,0.0,0.0]]
-   fixer = [[1.0,0.0,0.0],[0.0,0.0,1.0],[0.0,-1.0,0.0],[0.0,0.0,0.0]]
-   m4x3_mul( a, b2gl, a )
-   m4x3_mul( fixer, a, a )
-
-   a[0][3] = 0.0
-   a[1][3] = 0.0
-   a[2][3] = 0.0
-   a[3][3] = 1.0
-
-def make_offset( n1, n2, v ):
-   a = [0,0,0]
-   b = [0,0,0]
-
-   get_location_obj( bpy.data.objects[n1], a )
-   get_location_obj( bpy.data.objects[n2], b )
-
-   v3_sub( b, a, v )
-
-def get_dist( n1, n2 ):
-   c = [0,0,0]
-   make_offset( n1, n2, c )
-   return v3_length( c )
-
-# Measure distances
-ik_body = ik_basic_t()
-ik_body.l1 = get_dist( "ch_default_body0", "ch_default_body1" )
-ik_body.l2 = get_dist( "ch_default_body1", "ch_default_neck" )
-
-ik_arm_l = ik_basic_t()
-ik_arm_l.l1 = get_dist( "ch_default_arm_l0", "ch_default_arm_l1" )
-ik_arm_l.l2 = get_dist( "ch_default_arm_l1", "ch_default_hand_l" )
-ik_arm_r = ik_basic_t()
-ik_arm_r.l1 = get_dist( "ch_default_arm_r0", "ch_default_arm_r1" )
-ik_arm_r.l2 = get_dist( "ch_default_arm_r1", "ch_default_hand_r" )
-
-ik_leg_l = ik_basic_t()
-ik_leg_l.l1 = get_dist( "ch_default_leg_l0", "ch_default_leg_l1" )
-ik_leg_l.l2 = get_dist( "ch_default_leg_l1", "ch_default_foot_l" )
-ik_leg_r = ik_basic_t()
-ik_leg_r.l1 = get_dist( "ch_default_leg_r0", "ch_default_leg_r1" )
-ik_leg_r.l2 = get_dist( "ch_default_leg_r1", "ch_default_foot_r" )
-
-offs_arm_l = [0,0,0]
-offs_arm_r = [0,0,0]
-offs_leg_l = [0,0,0]
-offs_leg_r = [0,0,0]
-make_offset( "ch_default_body1", "ch_default_arm_l0", offs_arm_l )
-make_offset( "ch_default_body1", "ch_default_arm_r0", offs_arm_r )
-make_offset( "ch_default_body0", "ch_default_leg_l0", offs_leg_l )
-make_offset( "ch_default_body0", "ch_default_leg_r0", offs_leg_r )
-
-# character_eval() clone
-#
-cam_pos = [0,0,0]
-
-get_location( bpy.data.objects["BODY0"], ik_body.base )
-get_location( bpy.data.objects["BODY1"], ik_body.end )
-get_location( bpy.data.objects["POLE"], ik_body.pole )
-get_location( bpy.data.objects["FOOT_L"], ik_leg_l.end )
-get_location( bpy.data.objects["POLE_LEG_L"], ik_leg_l.pole )
-get_location( bpy.data.objects["FOOT_R"], ik_leg_r.end )
-get_location( bpy.data.objects["POLE_LEG_R"], ik_leg_r.pole )
-get_location( bpy.data.objects["HAND_L"], ik_arm_l.end )
-get_location( bpy.data.objects["POLE_ARM_L"], ik_arm_l.pole )
-get_location( bpy.data.objects["HAND_R"], ik_arm_r.end )
-get_location( bpy.data.objects["POLE_ARM_R"], ik_arm_r.pole )
-get_location( bpy.data.objects["CAMERA"], cam_pos )
-
-m1 = [[0,0,0,0] for _ in range(4)]
-m2 = [[0,0,0,0] for _ in range(4)]
-
-ik_basic( ik_body, m1, m2, k_ikY, k_ikX )
-
-m4x3_mulv( m2, offs_arm_l, ik_arm_l.base )
-m4x3_mulv( m2, offs_arm_r, ik_arm_r.base )
-m4x3_mulv( m1, offs_leg_l, ik_leg_l.base )
-m4x3_mulv( m1, offs_leg_r, ik_leg_r.base )
-
-matrix_ready(m1)
-matrix_ready(m2)
-bpy.data.objects["_body0"].matrix_world = m1
-bpy.data.objects["_body1"].matrix_world = m2
-
-# Arms and legs ik
-ik_basic( ik_arm_l, m1, m2, k_ikZ, k_ikY )
-matrix_ready(m1)
-matrix_ready(m2)
-bpy.data.objects["_arm_l0"].matrix_world = m1
-bpy.data.objects["_arm_l1"].matrix_world = m2
-
-ik_basic( ik_arm_r, m1, m2, k_iknZ, k_ikY )
-matrix_ready(m1)
-matrix_ready(m2)
-bpy.data.objects["_arm_r0"].matrix_world = m1
-bpy.data.objects["_arm_r1"].matrix_world = m2
-
-ik_basic( ik_leg_l, m1, m2, k_ikY, k_iknX )
-matrix_ready(m1)
-matrix_ready(m2)
-bpy.data.objects["_leg_l0"].matrix_world = m1
-bpy.data.objects["_leg_l1"].matrix_world = m2
-
-ik_basic( ik_leg_r, m1, m2, k_ikY, k_iknX )
-matrix_ready(m1)
-matrix_ready(m2)
-bpy.data.objects["_leg_r0"].matrix_world = m1
-bpy.data.objects["_leg_r1"].matrix_world = m2
-
-def strv3( v ):
-   return '{'+ F"{v[0]:.4f}f, {v[1]:.4f}f, {v[2]:.4f}f" + '}'
-
-print( F"""
-  .b0 =  {strv3(ik_body.base)},
-  .b1 =  {strv3(ik_body.end)},
-  .p =   {strv3(ik_body.pole)},
-  .fr =  {strv3(ik_leg_r.end)},
-  .fl =  {strv3(ik_leg_l.end)},
-  .pl =  {strv3(ik_leg_l.pole)},
-  .pr =  {strv3(ik_leg_r.pole)},
-  .hl =  {strv3(ik_arm_l.end)},
-  .hr =  {strv3(ik_arm_r.end)},
-  .apl = {strv3(ik_arm_l.pole)},
-  .apr = {strv3(ik_arm_r.pole)},
-  .cam = {strv3(cam_pos)}
-""")
diff --git a/lighting.h b/lighting.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mesh.h b/mesh.h
deleted file mode 100644 (file)
index e69de29..0000000
index 10e85dc231314fffb46fe60a7727373b2d787e4e..6783769fda2667528754896679b162336d360e68 100644 (file)
--- a/network.h
+++ b/network.h
@@ -1,3 +1,8 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ * All trademarks are property of their respective owners
+ */
+
 #ifndef NETWORK_H
 #define NETWORK_H
 
@@ -357,7 +362,7 @@ static void network_end(void*_)
 
 #else /* SR_NETWORKED */
 
-static int network_init(void){ return 1; }
+static void network_init(void){}
 static void network_update(void){}
 static void network_end(void*_){}
 
index 0a0d1f820b0417e9c0dbed5dd29a4b17381a850d..221e6ef1260d2b7050191f46b15a805574c36ce4 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef NETWORK_MSG_H
 #define NETWORK_MSG_H
 
index 33a6b6b7f8c56b70a75470da8e96ea55b3d9eb90..243de364933859c3d08881c5584fcf9295cfba08 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef PHYSICS_TEST_H
 #define PHYSICS_TEST_H
 
@@ -139,7 +143,7 @@ static void physics_test_start(void)
       }
    }
 
-   free( mdl );
+   vg_free( mdl );
    scene_bh_create( &epic_scene );
 
    rb_init( &epic_scene_rb );
@@ -227,26 +231,26 @@ static void physics_test_update(void)
    
    /* POSITION OVERRIDE */
    {
-   if(glfwGetKey( vg_window, GLFW_KEY_L ))
+   if(glfwGetKey( vg.window, GLFW_KEY_L ))
    {
       m4x3_mulv( player.camera, (v3f){0.0f,0.0f,-5.0f}, marko.co );
       v3_zero( marko.v );
       v3_zero( marko.w );
    }
-   if(glfwGetKey( vg_window, GLFW_KEY_K ))
+   if(glfwGetKey( vg.window, GLFW_KEY_K ))
    {
       m4x3_mulv( player.camera, (v3f){0.0f,0.0f,-5.0f}, ball.co );
       v3_zero( ball.v );
       v3_zero( ball.w );
    }
-   if(glfwGetKey( vg_window, GLFW_KEY_J ))
+   if(glfwGetKey( vg.window, GLFW_KEY_J ))
    {
       m4x3_mulv( player.camera, (v3f){0.0f,0.0f,-5.0f}, ball1.co );
       v3_zero( ball1.v );
       v3_zero( ball1.w );
    }
 
-   if(glfwGetKey( vg_window, GLFW_KEY_H ))
+   if(glfwGetKey( vg.window, GLFW_KEY_H ))
    {
       reorg_jeffs();
    }
index f03747a5098cf5afc8effde12f13fc0dce416a8b..5dd9401dbfca38fd3b922622aeff98b11de9eb4e 100644 (file)
--- a/player.h
+++ b/player.h
@@ -1,10 +1,5 @@
 /*
- * Copyright 2021-2022 (C) Mount0 Software, Harry Godden - All Rights Reserved
- * -----------------------------------------------------------------------------
- *
- * Player head module
- *
- * -----------------------------------------------------------------------------
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
  */
 
 #ifndef PLAYER_H
index 02b4d255ef17a8ef1bb8289fb4b41c9da126a575..94664f7d65c4c671665de1cb438f694908df20cf 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef PLAYER_ANIMATION_H
 #define PLAYER_ANIMATION_H
 
index 3071af3097802e2ec7870bf8bb6abdca8806a47f..f46d67084171c38961fb437aa4931aa257fa3018 100644 (file)
@@ -1,10 +1,5 @@
 /*
- * Copyright 2021-2022 (C) Mount0 Software, Harry Godden - All Rights Reserved
- * -----------------------------------------------------------------------------
- *
- * Player audio
- *
- * -----------------------------------------------------------------------------
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
  */
 
 #ifndef PLAYER_AUDIO_H
index 97b476897c3500a1bfde5e17e1f7340717887b4f..20e5c0a46c4d8e0d80d35279b70f7d09ade974d6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2022 (C) Mount0 Software, Harry Godden - All Rights Reserved
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
  */
 
 #ifndef CHARACTER_H 
index ebcb55e32a3de4bacb70e7bdbbddf380e12c8edf..f71568bb0fa242848fa3348f755beb21e9e1ac5f 100644 (file)
@@ -1,11 +1,5 @@
 /*
- * Copyright 2021-2022 (C) Mount0 Software, Harry Godden - All Rights Reserved
- * -----------------------------------------------------------------------------
- *
- * Player physics and control submodule
- *   contains main physics models, input, and player control.
- *
- * -----------------------------------------------------------------------------
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
  */
 
 #ifndef PLAYER_PHYSICS_H
index 937c30558cb7bb95dc742390f54d24d3bf189cae..b2fff828eecec12cdbebfdbf88632148704557ec 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef PLAYER_WALKGRID_H
 #define PLAYER_WALKGRID_H
 
@@ -585,7 +589,7 @@ static void player_walkgrid_stand_cell(struct walkgrid *wg)
 
    v3f world;
    world[0] = wg->region[0][0]+((float)wg->cell_id[0]+wg->pos[0])*k_gridscale;
-   world[1] = player.rb.co[1];
+   world[1] = player.phys.rb.co[1];
    world[2] = wg->region[0][2]+((float)wg->cell_id[1]+wg->pos[1])*k_gridscale;
 
    struct grid_sample *corners[4];
@@ -721,7 +725,7 @@ static void player_walkgrid_stand_cell(struct walkgrid *wg)
       }
    }
 
-   v3_copy( world, player.rb.co );
+   v3_copy( world, player.phys.rb.co );
 }
 
 static void player_walkgrid_getsurface(void)
@@ -734,7 +738,7 @@ static void player_walkgrid_getsurface(void)
    static struct walkgrid wg;
 
    v3f cell;
-   v3_copy( player.rb.co, cell );
+   v3_copy( player.phys.rb.co, cell );
    player_walkgrid_floor( cell );
 
    v3_muladds( cell, (v3f){-1.0f,-1.0f,-1.0f}, k_region_size, wg.region[0] );
@@ -751,14 +755,14 @@ static void player_walkgrid_getsurface(void)
    /* Temp */
    if( !vg_console_enabled() )
    {
-      if( glfwGetKey( vg_window, GLFW_KEY_W ) )
+      if( glfwGetKey( vg.window, GLFW_KEY_W ) )
          v3_muladds( delta, fwd,  ktimestep*k_walkspeed, delta );
-      if( glfwGetKey( vg_window, GLFW_KEY_S ) )
+      if( glfwGetKey( vg.window, GLFW_KEY_S ) )
          v3_muladds( delta, fwd, -ktimestep*k_walkspeed, delta );
 
-      if( glfwGetKey( vg_window, GLFW_KEY_A ) )
+      if( glfwGetKey( vg.window, GLFW_KEY_A ) )
          v3_muladds( delta, side, -ktimestep*k_walkspeed, delta );
-      if( glfwGetKey( vg_window, GLFW_KEY_D ) )
+      if( glfwGetKey( vg.window, GLFW_KEY_D ) )
          v3_muladds( delta, side,  ktimestep*k_walkspeed, delta );
 
       v3_muladds( delta, fwd, 
@@ -776,8 +780,8 @@ static void player_walkgrid_getsurface(void)
 
    v2f region_pos = 
    {
-      (player.rb.co[0] - wg.region[0][0]) * (1.0f/k_gridscale),
-      (player.rb.co[2] - wg.region[0][2]) * (1.0f/k_gridscale)
+      (player.phys.rb.co[0] - wg.region[0][0]) * (1.0f/k_gridscale),
+      (player.phys.rb.co[2] - wg.region[0][2]) * (1.0f/k_gridscale)
    };
    v2f region_cell_pos;
    v2_floor( region_pos, region_cell_pos );
@@ -955,9 +959,9 @@ static void player_walkgrid(void)
 {
    player_walkgrid_getsurface();
    
-   m4x3_mulv( player.rb.to_world, (v3f){0.0f,1.8f,0.0f}, player.camera_pos );
+   m4x3_mulv(player.phys.rb.to_world, (v3f){0.0f,1.8f,0.0f}, player.camera_pos);
    player_mouseview();
-   rb_update_transform( &player.rb );
+   rb_update_transform( &player.phys.rb );
 }
 
 #endif /* PLAYER_WALKGRID_H */
diff --git a/ragdoll.h b/ragdoll.h
deleted file mode 100644 (file)
index fa51b6c..0000000
--- a/ragdoll.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef RAGDOLL_H
-#define RAGDOLL_H
-
-#include "vg/vg.h"
-#include "scene.h"
-
-
-
-#endif
index cac188d07dcbdf3fc258bcbb4a5ab45256567e50..a00c209d2697476f2eb922ae2662ee07dcaf50c5 100644 (file)
--- a/render.h
+++ b/render.h
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #include "common.h"
 #include "model.h"
 
index 0a95bddf014430f4ac7c53bab13113c4ba6296b0..a327488972dd0a5989165c8dd550caa245a30499 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 /* 
  * Resources: Box2D - Erin Catto
  *            qu3e  - Randy Gaul
diff --git a/road.h b/road.h
deleted file mode 100644 (file)
index bb4f5f6..0000000
--- a/road.h
+++ /dev/null
@@ -1,275 +0,0 @@
-float const k_road_width = 4.0f;
-
-#define ROAD_PATCH_NODES          1024
-#define ROAD_SEGMENT_VERTICES    8
-#define ROAD_SEGMENT_INDICES       ((3*2)*5)
-#define ROAD_INDEX_BUFFER_SIZE    (ROAD_SEGMENT_INDICES * (ROAD_PATCH_NODES-2))
-#define ROAD_RENDER_DIST          12
-#define ROAD_RENDER_DIST_INDICES (ROAD_SEGMENT_INDICES*ROAD_RENDER_DIST)
-
-typedef struct road_node
-{
-   v3f pos,
-       side,
-       fwd;
-   
-} road_node;
-
-typedef struct road_patch
-{
-   road_node nodes[ ROAD_PATCH_NODES ];
-   
-   int active_id;
-   road_node *active;
-} 
-road_patch;
-
-static void road_get_range( road_patch *road, int range, int *start, int *end )
-{
-   *start = VG_MIN( VG_MAX( 0, road->active_id-range ), ROAD_PATCH_NODES-2 );
-   *end   = VG_MIN( VG_MAX( 0, road->active_id+range ), ROAD_PATCH_NODES-2 );
-}
-
-static int test_edge_with_norm( v3f p0, v3f p1, v3f norm, v3f p )
-{
-   v3f edge, edge_norm, v1;
-   
-   v3_sub( p1, p0, edge );
-   v3_cross( edge, norm, edge_norm );
-   v3_sub( p0, p, v1 );
-   
-   if( v3_dot( edge_norm, v1 ) > 0.0f )
-   {
-      vg_line( p0, p1, 0xff0000ff );
-      return 0;
-   }
-   else
-   {   
-      vg_line( p0, p1, 0xff00ff00 );
-      return 1;
-   }
-}
-
-static int patch_seg_test_inside( road_node *node, v3f p )
-{
-   road_node *next = node + 1;
-
-   v3f norm,
-       sa, sb, sc, sd;
-   
-   v3_muls( node->side, -k_road_width, sa );
-   v3_add( node->pos, sa, sa );
-   
-   v3_muls( next->side, -k_road_width, sb );
-   v3_add( next->pos, sb, sb );
-   
-   v3_muls( next->side, k_road_width, sc );
-   v3_add( next->pos, sc, sc );
-   
-   v3_muls( node->side, k_road_width, sd );
-   v3_add( node->pos, sd, sd );
-   
-   v3_cross( node->side, node->fwd, norm );
-   
-   if( !test_edge_with_norm( sa, sb, norm, p ) ) return 0;
-   if( !test_edge_with_norm( sb, sc, norm, p ) ) return 0;
-   if( !test_edge_with_norm( sc, sd, norm, p ) ) return 0;
-   if( !test_edge_with_norm( sd, sa, norm, p ) ) return 0;
-   
-   return 1;
-}
-
-static void road_patch_setplayer( road_patch *road, v3f pos )
-{
-   int idx_start, idx_end;
-   road_get_range( road, ROAD_RENDER_DIST, &idx_start, &idx_end );
-   
-   for( int i = idx_start; i < idx_end; i ++ )
-   {
-      if( patch_seg_test_inside( road->nodes + i, pos ) )
-      {
-         road->active_id = i;
-         road->active = road->nodes + i;
-         return;
-      }
-   }
-}
-
-static void road_patch_init( road_patch *road )
-{
-   road->active = road->nodes + road->active_id;
-}
-
-static void road_generate( road_patch *road )
-{
-   v3f dir_fwd = { 1.0f, 0.0f, 0.0f },
-       dir_up = { 0.0f, 1.0f, 0.0f },
-       dir_side = { 0.0f, 0.0f, 1.0f },
-       current_point = { 0.0f, 0.0f, 0.0f };
-
-   float current_rotation_amt = 0.0f,
-         current_pitch_amt = -0.2f,
-         current_roll_amt = 0.00f;
-   
-   for( int i = 0; i < ROAD_PATCH_NODES; i ++ )
-   {
-      road_node *node = road->nodes + i;
-      
-      if( (float)rand()/(float)(RAND_MAX) < 0.3f )
-      {
-         current_rotation_amt = (float)rand()/(float)(RAND_MAX)*0.6f-0.3f;
-         current_pitch_amt = (float)rand()/(float)(RAND_MAX)*0.03f-0.015f;
-      }
-      
-      v3_rotate( dir_up, current_roll_amt, dir_fwd, dir_up );
-      v3_cross( dir_fwd, dir_up, dir_side );
-      dir_side[1] = 0.0f;
-      
-      v3_rotate( dir_fwd, current_rotation_amt, (v3f){0.f, 1.f, 0.f}, dir_fwd );
-      v3_rotate( dir_fwd, current_pitch_amt, dir_side, dir_fwd );
-      v3_rotate( dir_up, current_pitch_amt, dir_side, dir_up );
-      
-      v3_muladds( current_point, dir_fwd, 7.0f, current_point );
-      
-      v3_copy( current_point, node->pos );
-      v3_copy( dir_side, node->side );
-      v3_copy( dir_fwd, node->fwd );
-      current_pitch_amt = 0.f;
-
-      node->pos[1] += (float)rand()/(float)(RAND_MAX)*0.2f;
-   }
-   
-   road->active_id = 0;
-}
-
-void draw_road_patch_dev( road_patch *road )
-{
-   v3f dir;
-   v3f norm;
-   v3f p0 = { 0.0f, 0.0f, 0.0f }, p1 = { 0.0f, 0.0f, 0.0f };
-   v3f p2; v3f p3;
-   
-   for( int i = 0; i < ROAD_PATCH_NODES-1; i ++ )
-   {
-      road_node *node = &road->nodes[i];
-      road_node *next = &road->nodes[i+1];
-      
-      vg_line( node->pos, next->pos, 0x55ffcc22 );
-      
-      // Get line dir
-      v3_sub( next->pos, node->pos, dir );
-      v3_normalize( dir );
-      
-#if 0
-      // Perpendicular vector
-      norm[0] = -dir[2];
-      norm[1] = 0.f;
-      norm[2] = dir[0];
-#endif
-      
-      v3_muls( node->side,  k_road_width, p2 );
-      v3_add( p2, node->pos, p2 );
-      v3_muls( node->side, -k_road_width, p3 );
-      v3_add( p3, node->pos, p3 );
-      
-      vg_line( p3, p1, 0xccffcc22 );
-      vg_line( p2, p0, 0xccffcc22 );
-      
-      v3_copy( p3, p1 );
-      v3_copy( p2, p0 );
-   }
-}
-
-static void sample_road( road_patch *patch, v3f pos )
-{
-   v3f v1, norm;
-   v3_sub( patch->active->pos, pos, v1 );
-   v3_cross( patch->active->side, patch->active->fwd, norm );
-
-   float d = v3_dot( norm, v1 );
-   v3_muladds( pos, norm, d, pos );
-}
-
-static int triangle_raycast( v3f pA, v3f pB, v3f pC, v3f ray, float *height )
-{
-       v2f v0, v1, v2, vp, vp2;
-       float d, bca = 0.f, bcb = 0.f, bcc = 0.f;
-   
-   v0[0] = pB[0] - pA[0];
-   v0[1] = pB[2] - pA[2];
-   v1[0] = pC[0] - pA[0];
-   v1[1] = pC[2] - pA[2];
-   v2[0] = pB[0] - pC[0];
-   v2[1] = pB[2] - pC[2];
-       
-       d = 1.f / (v0[0]*v1[1] - v1[0]*v0[1]);
-
-#if 0
-       /* Backface culling */
-       if( v2_cross( v0, v1 ) > 0.f )
-               return;
-#endif
-
-   vp[0] = ray[0] - pA[0];
-   vp[1] = ray[2] - pA[2];
-
-   if( v2_cross( v0, vp ) > 0.f ) return 0;
-   if( v2_cross( vp, v1 ) > 0.f ) return 0;
-       
-   vp2[0] = ray[0] - pB[0];
-   vp2[1] = ray[2] - pB[2];
-
-   if( v2_cross( vp2, v2 ) > 0.f ) return 0;
-
-   bcb = (vp[0]*v1[1] - v1[0]*vp[1]) * d;
-   bcc = (v0[0]*vp[1] - vp[0]*v0[1]) * d;
-   bca = 1.f - bcb - bcc;
-                               
-   *height = pA[1]*bca + pB[1]*bcb + pC[1]*bcc;
-   return 1;
-}
-
-
-static int sample_road_height( road_patch *road, v3f pos )
-{
-   v3f norm, 
-       sa, sb, sc, sd;
-   
-   int idx_start, idx_end;
-   road_get_range( road, ROAD_RENDER_DIST, &idx_start, &idx_end );
-   
-   for( int i = idx_start; i < idx_end; i ++ )
-   {
-      road_node *node = &road->nodes[i],
-                *next = &road->nodes[i+1];
-
-      v3_muls( node->side, -k_road_width, sa );
-      v3_add( node->pos, sa, sa );
-      
-      v3_muls( next->side, -k_road_width, sb );
-      v3_add( next->pos, sb, sb );
-      
-      v3_muls( next->side, k_road_width, sc );
-      v3_add( next->pos, sc, sc );
-      
-      v3_muls( node->side, k_road_width, sd );
-      v3_add( node->pos, sd, sd );
-      
-      /* Triangle 1 */
-      float height;
-
-      if( triangle_raycast( sa, sc, sb, pos, &height ) )
-      {
-         pos[1] = height;
-         return 1;
-      }
-
-      if( triangle_raycast( sa, sd, sc, pos, &height ) )
-      {
-         pos[1] = height;
-         return 1;
-      }
-   }
-
-   return 0;
-}
diff --git a/scope.h b/scope.h
deleted file mode 100644 (file)
index 8807ec9..0000000
--- a/scope.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Scope debugger thing */
-#include "vg/vg_ui.h"
-#include "vg/vg_platform.h"
-
-static struct
-{
-   struct scope_log
-   {
-      ui_px buffer[128];
-   } 
-   logs[10];
-
-}
-dev_scope;
-
-static void scope_watch( const char *name, float value, float min, float max )
-{
-
-}
index 4f3ceb6b27dd7023c9473414a1d0019197741109..8225c6ecf988cd2071114e6b7617266a47cb7902 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1,4 +1,6 @@
-/* Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved */
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
 
 /*
  * This server application requires steamclient.so to be present in the 
@@ -43,14 +45,14 @@ static void recieve_http( void *callresult, void *context )
 
    SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( hSteamHTTP, request, &size );
 
-   u8 *buffer = malloc( size );
+   u8 *buffer = vg_alloc( size );
    SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( 
          hSteamHTTP, request, buffer, size );
 
    buffer[size-1] = '\0';
    vg_info( "%s\n", (char *)buffer );
 
-   free( buffer );
+   vg_free( buffer );
    SteamAPI_ISteamHTTP_ReleaseHTTPRequest( hSteamHTTP, result->m_hRequest );
 }
 
@@ -123,7 +125,7 @@ static void on_inet_auth( SteamNetworkingMessage_t *msg )
       return;
    }
 
-   vg_log( "Attempting to verify user\n" );
+   vg_low( "Attempting to verify user\n" );
 
    if( msg->m_cbSize < sizeof(netmsg_auth) )
    {
index 9130269c8a56a4f660f64401a8658203f9c186b0..b4b0f0335cce530aa1e901544a4c7330657166fc 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved
+# Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
 #
 # Shader header generator script which wraps vg's tool
 #  Stores a list of shaders to build into -> .h files
index 788bd197f9c70203244900147267f06349dc0c37..78a0b5604d5fd0facb8b903ece0631d5fcf35a15 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) Mount0 Software, Harry Godden - All Rights Reserved
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
  */
 
 #ifndef SKELETON_H
diff --git a/skeleton_animator.h b/skeleton_animator.h
deleted file mode 100644 (file)
index 3077084..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef SKELETON_ANIMATOR_H
-#define SKELETON_ANIMATOR_H
-
-#include "common.h"
-#include "skeleton.h"
-
-#endif /* SKELETON_ANIMATOR_H */
diff --git a/sprites_autocombine.h b/sprites_autocombine.h
deleted file mode 100644 (file)
index cb1229f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-enum sprites_auto_combine_index
-{
-       k_sprite_*,
-};
-
-static struct vg_sprite sprites_auto_combine[] = 
-{
-};
\ No newline at end of file
diff --git a/steam.h b/steam.h
index c0fb7894d21e97846496e1864f78b83b5cccf153..8720c08aef8314c6dfc924781958a6af9dd0ac7e 100644 (file)
--- a/steam.h
+++ b/steam.h
@@ -1,3 +1,8 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ * All trademarks are property of their respective owners
+ */
+
 #ifndef STEAM_H
 #define STEAM_H
 
diff --git a/terrain.h b/terrain.h
deleted file mode 100644 (file)
index b5e7e53..0000000
--- a/terrain.h
+++ /dev/null
@@ -1,143 +0,0 @@
-#include "common.h"
-
-static void render_terrain(m4x4f projection, v3f camera);
-static void render_sky(m4x3f camera);
-
-#if 0
-#ifndef TERRAIN_H
-#define TERRAIN_H
-
-#include "model.h"
-#include "render.h"
-#include "water.h"
-
-#include "shaders/terrain.h"
-#include "shaders/sky.h"
-#include "shaders/planeinf.h"
-
-vg_tex2d tex_terrain_colours = { .path = "textures/gradients.qoi",
-                                 .flags = VG_TEXTURE_CLAMP | VG_TEXTURE_NEAREST
-};
-vg_tex2d tex_terrain_noise = { .path = "textures/garbage.qoi",
-                                 .flags = VG_TEXTURE_NEAREST };
-
-static struct
-{
-   glmesh skydome;
-   submodel dome_upper,
-            dome_lower;
-}
-trender;
-
-static void terrain_register(void)
-{
-   shader_terrain_register();
-   shader_sky_register();
-   shader_planeinf_register();
-}
-
-static void terrain_init(void)
-{
-   vg_tex2d_init( (vg_tex2d *[]){ &tex_terrain_colours, 
-                                  &tex_terrain_noise }, 2 );
-
-
-   model *msky = vg_asset_read("models/rs_skydome.mdl");
-   model_unpack( msky, &trender.skydome );
-   
-   trender.dome_lower = *submodel_get( msky, "dome_lower" );
-   trender.dome_upper = *submodel_get( msky, "dome_upper" );
-
-   free(msky);
-}
-
-static void bind_terrain_textures(void)
-{
-   vg_tex2d_bind( &tex_terrain_noise, 0 );
-   vg_tex2d_bind( &tex_terrain_colours, 1 );
-}
-
-static void render_terrain(m4x4f projection, v3f camera)
-{
-   shader_terrain_use();
-   shader_terrain_uTexGarbage(0);
-   shader_terrain_uTexGradients(1);
-
-   vg_tex2d_bind( &tex_terrain_noise, 0 );
-   vg_tex2d_bind( &tex_terrain_colours, 1 );
-
-   m4x3f identity_matrix;
-   m4x3_identity( identity_matrix );
-   shader_terrain_uPv( projection );
-   shader_terrain_uMdl( identity_matrix );
-   shader_terrain_uCamera( camera );
-   shader_terrain_uPlane( (v4f){ 0.0f,1.0f,0.0f, wrender.height } );
-
-   glActiveTexture( GL_TEXTURE2 );
-   glBindTexture( GL_TEXTURE_2D, wrender.depthmap );
-   shader_terrain_uTexDepth( 2 );
-   shader_terrain_uDepthBounds( (v4f){ 
-         wrender.depthbounds[0][0],
-         wrender.depthbounds[0][2],
-         1.0f/ (wrender.depthbounds[1][0]-wrender.depthbounds[0][0]),
-         1.0f/ (wrender.depthbounds[1][2]-wrender.depthbounds[0][2])} );
-}
-
-static void render_lowerdome( m4x3f camera )
-{
-   m4x4f projection, full;
-   pipeline_projection( projection, 0.4f, 1000.0f );
-
-   m4x3f inverse;
-   m3x3_transpose( camera, inverse );
-   v3_copy((v3f){0.0f,0.0f,0.0f}, inverse[3]);
-   m4x3_expand( inverse, full );
-   m4x4_mul( projection, full, full );
-
-   m4x3f identity_matrix;
-   m4x3_identity( identity_matrix );
-   
-   shader_planeinf_use();
-   shader_planeinf_uMdl(identity_matrix);
-   shader_planeinf_uPv(full);
-   shader_planeinf_uCamera(camera[3]);
-   shader_planeinf_uPlane( (v4f){0.0f,1.0f,0.0f, water_height()} );
-
-   submodel_draw( &trender.dome_lower );
-}
-
-static void render_sky(m4x3f camera)
-{
-   m4x4f projection, full;
-   pipeline_projection( projection, 0.4f, 1000.0f );
-
-   m4x3f inverse;
-   m3x3_transpose( camera, inverse );
-   v3_copy((v3f){0.0f,0.0f,0.0f}, inverse[3]);
-   m4x3_expand( inverse, full );
-   m4x4_mul( projection, full, full );
-
-   m4x3f identity_matrix;
-   m4x3_identity( identity_matrix );
-   
-   shader_sky_use();
-   shader_sky_uMdl(identity_matrix);
-   shader_sky_uPv(full);
-   shader_sky_uTexGarbage(0);
-   shader_sky_uTime( vg_time );
-
-
-   vg_tex2d_bind( &tex_terrain_noise, 0 );
-
-   glDepthMask(GL_FALSE);
-   glDisable(GL_DEPTH_TEST);
-
-   mesh_bind( &trender.skydome );
-   submodel_draw( &trender.dome_upper );
-   
-   glEnable(GL_DEPTH_TEST);
-   glDepthMask(GL_TRUE);
-}
-
-#endif
-#endif
diff --git a/testaa.c b/testaa.c
deleted file mode 100644 (file)
index 0f2bd3b..0000000
--- a/testaa.c
+++ /dev/null
@@ -1,179 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stddef.h>
-#include <math.h>
-
-#include "vg/vg_platform.h"
-#include "vg/vg_stdint.h"
-#include "vg/vg_store.h"
-#include "vg/vg_io.h"
-#include "vg/vg_m.h"
-
-#include "highscores.h"
-
-int main(int argc, const char *argv[])
-{
-   vg_info( "Database test\n" );
-
-   if( !highscores_init( 200000, 100000 ) )
-      return 0;
-   
-   srand(time(0));
-   vg_log( "Inserting test records...\n" );
-   for( int i=0; i<5000; i++ )
-   {
-      highscore_record entry;
-      entry.trackid = vg_randf() * 138.0f;
-      entry.points = vg_randf() * 10000.0f;
-      entry.time = vg_randf() * 20000.0f;
-      entry.playerid = rand() % 800;
-      entry.datetime = vg_randf() * 100000.0f;
-      
-      highscores_push_record( &entry );
-   }
-
-   for( int i=0; i<800; i++ )
-   {
-      char rando[10];
-
-      int l=2+rand()%8;
-      for( int i=0; i<l; i++ )
-         rando[i] = 'a' + rand() % 10;
-      rando[l] = '\0';
-
-      highscore_set_user_nickname( rand() % 800, rando );
-   }
-
-   vg_log( "Done.\n" );
-
-#if 0
-   int ln =0, err=0;
-   aatree_show_counts( &highscore_system.aainfo_playerinfo_playerid,
-                        highscore_system.dbheader.playerinfo_root, 0,
-                        &ln, &err, _highscore_showname, 1 );
-#endif
-   
-   char testy[27*(10+3)];
-
-   for( int i=0; i<vg_list_size(track_infos); i++ )
-   {
-      highscores_board_generate( testy, i, 10 );
-      highscores_board_printf( stdout, testy, 10 );
-   }
-
-   highscores_serialize_all();
-   highscores_free();
-   return 0;
-}
-
-#if 0
-typedef struct yoyo_t yoyo_t;
-struct yoyo_t
-{
-   int my_data;
-   aatree_node anode;
-};
-
-static void yoyo_t_show( void *_data )
-{
-   yoyo_t *data = _data;
-   printf( "%d ", data->my_data );
-}
-
-static int yoyo_t_cmp( void *_a, void *_b )
-{
-   yoyo_t *a = _a, *b = _b;
-   return b->my_data - a->my_data;
-}
-
-int main(int argc, const char *argv[])
-{
-   yoyo_t *allsorts = malloc( sizeof(yoyo_t) * 10000 );
-
-   aatree test;
-   test.base = allsorts;
-   test.offset = offsetof( yoyo_t, anode );
-   test.stride = sizeof( yoyo_t );
-   test.p_cmp = yoyo_t_cmp;
-   
-   for( int i=0; i<30; i++ ) vg_randf();
-
-   for( int j=0; j<1000; j++ )
-   {
-      int spam_amt = 100;
-      aatree_ptr root = AATREE_PTR_NIL;
-      for( int i=0; i<spam_amt; i++ )
-      {
-         yoyo_t *rando = &allsorts[i];
-         rando->my_data = vg_randf() * 563.0f;
-         root = aatree_insert( &test, root, i );
-      }
-
-      int ln=0, err=0;
-      int drawting = 1;
-      aatree_show_counts( &test, root, 0, &ln, &err, yoyo_t_show, drawting );
-
-#if 0
-      int value = 3;
-      vg_info( "Ptr of %d: %u\n", value, aatree_find( &test, root, &value ) );
-
-      for( int i=0; i<20; i++ )
-      {
-         yoyo_t *v = aatree_get_data(&test,aatree_kth( &test, root, i ));
-         vg_info( "Value of [%d]: %d\n", i, v->my_data );
-      }
-#endif
-      if( ln != spam_amt || err != 0 )
-      {
-         vg_error( "ADJAWIUDWAJD\n" );
-         break;
-      }
-
-      aatree_ptr traverser = aatree_kth( &test, root, 0 );
-
-      while( traverser != AATREE_PTR_NIL )
-      {
-         yoyo_t *v = aatree_get_data( &test, traverser );
-         vg_info( "... %d\n", v->my_data );
-
-         traverser = aatree_next( &test, traverser );
-      }
-
-      int orig = spam_amt;
-      for( int i=0; i<orig; i++ )
-      {
-         int remover = vg_min( (int)(vg_randf() * spam_amt), spam_amt-1 );
-         aatree_ptr kremove = aatree_kth( &test, root, remover );
-
-         vg_info( "Removing K %d\n", remover );
-         vg_info( "id: %d\n", kremove );
-
-         if( drawting )
-         vg_info( "AND NOW REMOVE K %d (id: %d, value: %d)\n", remover, kremove,
-               *((int*)aatree_get_data( &test, kremove )) );
-
-         root = aatree_del( &test, kremove );
-
-         ln=0;
-         err=0;
-         aatree_show_counts( &test, root, 0, &ln, &err, yoyo_t_show, drawting );
-
-         if( ln != spam_amt-1 || err != 0 )
-         {
-            vg_error( "ADJAWIUDWAJD ( %d %d // %d, %d)\n",
-                        j, ln, spam_amt, err );
-            free( allsorts );
-            return 0;
-         }
-         vg_success( "%d\n", j );
-         spam_amt --;
-      }
-   }
-
-   free( allsorts );
-   return 0;
-}
-
-#endif
diff --git a/vg.conf b/vg.conf
index d0429fa41b65964aa805eb01a8ab3a1eb5d16bc4..16aec49372c7fa3cc1bdddd026110ce241fc7fde 100644 (file)
--- a/vg.conf
+++ b/vg.conf
@@ -1,3 +1,7 @@
+#
+# Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+#
+
 vg_src="main.c"
 vg_target="game"
 
index 626aef8979837f21b340f603c5bccc201ecc893a..c7655fedae8be44cc6fd4921de94750dc9dac23a 100644 (file)
@@ -1,4 +1,7 @@
-// Copyright (C) 2021 Harry Godden (hgn) - All Rights Reserved
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #define VG_CONFIG
 #include "vg/vg.h"
 
diff --git a/world.h b/world.h
index 9ae654e27937333728d5db924b404edb88723176..f18c3e55b5f12792116ca20b461c290304acd378 100644 (file)
--- a/world.h
+++ b/world.h
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #include "common.h"
 
 static int ray_world( v3f pos, v3f dir, ray_hit *hit );
@@ -10,7 +14,6 @@ static int ray_world( v3f pos, v3f dir, ray_hit *hit );
 #include "network.h"
 #include "network_msg.h"
 #include "scene.h"
-#include "terrain.h"
 #include "render.h"
 #include "rigidbody.h"
 #include "bvh.h"
index 89945b94a031a16b467db081f5b18503c4cb44ec..dd7177631836a9992567db76dde903638c6474b3 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef WORLD_GATE_H
 #define WORLD_GATE_H
 
index 030af6b8ac11628a1b9e26b3d66985ddc7eb2f59..49ea4953480bb8b3455c3a2ce1dc2ce70cf833ce 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef WORLD_GEN_H
 #define WORLD_GEN_H
 
index 215d05504bd4d49b61e1c5885ddaa472acaa4ba8..7793b1358874a3bf616e61422851d59f7058edc0 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef WORLD_INFO_H
 #define WORLD_INFO_H
 
index 52b291376d155b6ffb27afe8c2cde1fc0921dc44..aa008c5376936f8e9c86fbce900a3f41a921555f 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef WORLD_RENDER_H
 #define WORLD_RENDER_H
 
index 7920588e27e9672717669b890f7557d343d13b9a..f98fb0d850ec7ffcac20e3fd096bc93b48fdc0dc 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef ROUTES_H
 #define ROUTES_H
 
index f765910e56dd71bb7aa89eebd9ef2756d0d6934a..5bc2aaa85897d69eb012049dd968b73ed7fcfb9d 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef SFD_H
 #define SFD_H
 
index ab67e76601b1823501dc670501931e1879a2299c..249800d3569725c608e775c9215d293f0e0a5b33 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef WATER_H
 #define WATER_H