+ return cmd;
+ }
+ }
+
+ return NULL;
+}
+
+VG_STATIC void vg_execute_console_input( const char *cmd )
+{
+ char temp[512];
+ char const *args[8];
+ int arg_count = vg_console_tokenize( cmd, temp, args );
+
+ if( arg_count == 0 )
+ return;
+
+ int data_int;
+ float data_float;
+
+ vg_var *cv = vg_console_match_var( args[0] );
+ vg_cmd *fn = vg_console_match_cmd( args[0] );
+
+ assert( !(cv && fn) );
+
+ if( cv )
+ {
+ /* Cvar Matched, try get value */
+ if( arg_count >= 2 )
+ {
+ if( (cv->data_type == k_var_dtype_u32) ||
+ (cv->data_type == k_var_dtype_i32) )
+ {
+ data_int = atoi( args[1] );
+
+ *((int *)cv->data) = cv->opt_i32.clamp?
+ VG_MIN( VG_MAX(data_int, cv->opt_i32.min), cv->opt_i32.max ):
+ data_int;
+ }
+ else if( cv->data_type == k_var_dtype_f32 )
+ {
+ data_float = atof( args[1] );
+ *((float *)cv->data) = cv->opt_f32.clamp?
+ vg_minf( vg_maxf( data_float, cv->opt_f32.min),
+ cv->opt_f32.max ):
+ data_float;
+ }
+ }
+ else
+ {
+ if( cv->data_type == k_var_dtype_i32 )
+ vg_info( "= %d\n", *((int *)cv->data) );
+ else if( cv->data_type == k_var_dtype_u32 )
+ vg_info( "= %u\n", *((u32 *)cv->data) );
+ else if( cv->data_type == k_var_dtype_f32 )
+ vg_info( "= %.4f\n", *((float *)cv->data) );
+ }
+
+ return;