Networking work
This commit is contained in:
@@ -140,7 +140,8 @@ screen_to_world :: (camera: Camera, screen_position: Vector2, distance: float) -
|
|||||||
pos.z = 0.0;
|
pos.z = 0.0;
|
||||||
pos.w = 1.0;
|
pos.w = 1.0;
|
||||||
|
|
||||||
success :, result := inverse(camera.projection_matrix * camera.view_matrix) * pos;
|
success, mat := inverse(camera.projection_matrix * camera.view_matrix);
|
||||||
|
result := mat * pos;
|
||||||
result.x /= result.w;
|
result.x /= result.w;
|
||||||
result.y /= result.w;
|
result.y /= result.w;
|
||||||
result.z /= result.w;
|
result.z /= result.w;
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ Entity :: struct {
|
|||||||
|
|
||||||
#if NETWORKING {
|
#if NETWORKING {
|
||||||
remote_id: Entity_Id; @DontSerialize
|
remote_id: Entity_Id; @DontSerialize
|
||||||
|
client_id: Client_Id; @DontSerialize
|
||||||
is_proxy: bool; @DontSerialize
|
is_proxy: bool; @DontSerialize
|
||||||
last_replication_time: float; @DontSerialize
|
last_replication_time: float; @DontSerialize
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ Engine_Core :: struct {
|
|||||||
input : Input_State;
|
input : Input_State;
|
||||||
current_scene: *Scene;
|
current_scene: *Scene;
|
||||||
|
|
||||||
|
automatically_load_last_opened_scene: bool = true;
|
||||||
|
|
||||||
camera_buffer : Buffer_Handle;
|
camera_buffer : Buffer_Handle;
|
||||||
time_buffer : Buffer_Handle;
|
time_buffer : Buffer_Handle;
|
||||||
screen_data_buffer : Buffer_Handle;
|
screen_data_buffer : Buffer_Handle;
|
||||||
@@ -86,13 +88,17 @@ coven_init :: (window_title: string, window_width: u32, window_height: u32, full
|
|||||||
ui_init();
|
ui_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WITH_NETWORKING {
|
||||||
|
net_init();
|
||||||
|
}
|
||||||
|
|
||||||
find_all_mesh_entities();
|
find_all_mesh_entities();
|
||||||
|
|
||||||
run_engine_inits();
|
run_engine_inits();
|
||||||
}
|
}
|
||||||
|
|
||||||
coven_run :: (game_update_proc: (float), game_editor_update_proc: (float), game_update_post_physics_proc: (float)) {
|
coven_run :: (game_update_proc: (float), game_editor_update_proc: (float), game_update_post_physics_proc: (float)) {
|
||||||
if engine.current_scene == null {
|
if engine.current_scene == null && engine.automatically_load_last_opened_scene {
|
||||||
last_opened_scene := get_last_opened_scene_file();
|
last_opened_scene := get_last_opened_scene_file();
|
||||||
if last_opened_scene.count > 0 {
|
if last_opened_scene.count > 0 {
|
||||||
engine.current_scene = load_scene(last_opened_scene);
|
engine.current_scene = load_scene(last_opened_scene);
|
||||||
|
|||||||
@@ -593,4 +593,4 @@ state : Net_Networking_State;
|
|||||||
|
|
||||||
Thread :: #import "Thread";
|
Thread :: #import "Thread";
|
||||||
#import "Basic";
|
#import "Basic";
|
||||||
Socket :: #import "Socket";
|
Socket :: #import "Socket";
|
||||||
|
|||||||
Reference in New Issue
Block a user