projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chaos caused by async
[carveJwlIkooP6JGAAIwe30JlM.git]
/
skaterift.c
diff --git
a/skaterift.c
b/skaterift.c
index d943c2d07a13c55831527a4954d3031031dc913d..54e5feb5d202c3f3849be04f1a67cec2a42a4dbb 100644
(file)
--- a/
skaterift.c
+++ b/
skaterift.c
@@
-25,6
+25,7
@@
VG_STATIC struct player_avatar localplayer_avatar;
VG_STATIC struct player_model localplayer_models[3];
VG_STATIC struct player_board localplayer_boards[1];
VG_STATIC struct player_avatar localplayer_avatar;
VG_STATIC struct player_model localplayer_models[3];
VG_STATIC struct player_board localplayer_boards[1];
+VG_STATIC int skaterift_status = 0;
#include "network.h"
#include "menu.h"
#include "network.h"
#include "menu.h"
@@
-103,6
+104,14
@@
void temp_update_playermodel(void){
player__use_model( &localplayer, &localplayer_models[cl_playermdl_id] );
}
player__use_model( &localplayer, &localplayer_models[cl_playermdl_id] );
}
+VG_STATIC void async_skaterift_complete( void *payload, u32 size )
+{
+ skaterift_status = 1;
+
+ localplayer.viewable_world = get_active_world();
+ localplayer_cmd_respawn( 1, (const char *[]){ "start" } );
+}
+
VG_STATIC void vg_load(void)
{
vg_loader_step( render_init, NULL );
VG_STATIC void vg_load(void)
{
vg_loader_step( render_init, NULL );
@@
-150,12
+159,9
@@
VG_STATIC void vg_load(void)
#endif
vg_console_load_autos();
#endif
vg_console_load_autos();
-}
-VG_STATIC void vg_start(void)
-{
- localplayer.viewable_world = get_active_world();
- localplayer_cmd_respawn( 1, (const char *[]){ "start" } );
+ vg_async_item *call = vg_async_alloc(0);
+ vg_async_dispatch( call, async_skaterift_complete );
}
VG_STATIC void draw_origin_axis(void)
}
VG_STATIC void draw_origin_axis(void)
@@
-169,7
+175,7
@@
VG_STATIC void vg_update(void)
{
steam_update();
{
steam_update();
- if(
vg.is_loaded
){
+ if(
skaterift_status == 1
){
draw_origin_axis();
network_update();
draw_origin_axis();
network_update();
@@
-182,7
+188,7
@@
VG_STATIC void vg_update(void)
VG_STATIC void vg_update_fixed(void)
{
VG_STATIC void vg_update_fixed(void)
{
- if(
vg.is_loaded
){
+ if(
skaterift_status == 1
){
world_routes_fixedupdate( get_active_world() );
player__update( &localplayer );
world_routes_fixedupdate( get_active_world() );
player__update( &localplayer );
@@
-215,7
+221,7
@@
VG_STATIC void vg_update_fixed(void)
VG_STATIC void vg_update_post(void)
{
VG_STATIC void vg_update_post(void)
{
- if(
vg.is_loaded
){
+ if(
skaterift_status == 1
){
player__post_update( &localplayer );
float dist;
player__post_update( &localplayer );
float dist;
@@
-428,6
+434,11
@@
VG_STATIC void render_main_game(void)
VG_STATIC void vg_render(void)
{
VG_STATIC void vg_render(void)
{
+ if( skaterift_status == 0 ){
+ _vg_loader_render();
+ return;
+ }
+
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
glViewport( 0,0, vg.window_x, vg.window_y );
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
glViewport( 0,0, vg.window_x, vg.window_y );
@@
-449,6
+460,10
@@
VG_STATIC void vg_render(void)
VG_STATIC void vg_ui(void)
{
VG_STATIC void vg_ui(void)
{
+ if( skaterift_status == 0 ){
+ return;
+ }
+
#if 0
player__im_gui( &localplayer );
#endif
#if 0
player__im_gui( &localplayer );
#endif