code: disable prediction for now

isolation_bkp/dynres
Dominik Madarász 2021-08-12 02:31:07 +02:00
parent 0a6f2485a2
commit 2b891f1cb1
4 changed files with 19 additions and 3 deletions

View File

@ -23,7 +23,7 @@ static bool request_shutdown;
void platform_init() {
InitWindow(screenWidth, screenHeight, "eco2d");
SetWindowState(FLAG_WINDOW_UNDECORATED|FLAG_WINDOW_MAXIMIZED|FLAG_WINDOW_RESIZABLE);
SetWindowState(FLAG_WINDOW_UNDECORATED|FLAG_WINDOW_MAXIMIZED|FLAG_WINDOW_RESIZABLE|FLAG_MSAA_4X_HINT);
SetTargetFPS(60);
screenWidth = GetScreenWidth();

View File

@ -76,11 +76,12 @@ void lerp_entity_positions(uint64_t key, entity_view *data) {
if (data->flag == EFLAG_INTERP) {
#if 1
#if 0
data->x = smooth_val(data->x, data->tx, view->delta_time[data->layer_id]);
data->y = smooth_val(data->y, data->ty, view->delta_time[data->layer_id]);
data->heading = smooth_val_spherical(data->heading, data->theading, view->delta_time[data->layer_id]);
#else
(void)view;
data->x = data->tx;
data->y = data->ty;
data->heading = data->theading;

View File

@ -13,13 +13,27 @@ void DEBUG_draw_ground_3d(uint64_t key, entity_view * data) {
world_view *view = game_world_view_get_active();
int32_t size = view->chunk_size * WORLD_BLOCK_SIZE;
int32_t half_size = size >> 1;
int32_t half_block_size = WORLD_BLOCK_SIZE >> 1;
int16_t offset = 0;
float x = data->x * size + offset;
float y = data->y * size + offset;
RenderTexture2D tex = GetChunkTexture(key);
DrawCubeTexture(tex.texture, (Vector3){x+half_size, 0.0f, y+half_size}, size, 1.0f, size, WHITE);
DrawCubeTexture(tex.texture, (Vector3){x+half_size, 0.0f, y+half_size}, size, 0.01f, size, WHITE);
for (int by = 0; by < 16; by++) {
for (int bx = 0; bx < 16; bx++) {
switch (blocks_get_flags(data->blocks[by*16+bx])) {
case BLOCK_FLAG_COLLISION:{
DrawCubeWires((Vector3){x + bx*WORLD_BLOCK_SIZE+half_block_size, 34.f, y + by*WORLD_BLOCK_SIZE+half_block_size}, 64, 66, 64, BLUE);
}break;
case BLOCK_FLAG_HAZARD:{
DrawCubeWires((Vector3){x + bx*WORLD_BLOCK_SIZE+half_block_size, 16.667f, y + by*WORLD_BLOCK_SIZE+half_block_size}, 64, 33, 64, RED);
}break;
}
}
}
}break;
default:break;

View File

@ -131,4 +131,5 @@ void SystemsImport(ecs_world_t *ecs) {
ECS_SYSTEM(ecs, UpdateTrackerPos, EcsPostUpdate, components.Position);
ECS_SYSTEM(ecs, ClearVehicle, EcsUnSet, components.Vehicle);
}