diff options
-rwxr-xr-x | build.sh | 2 | ||||
-rwxr-xr-x | source/main.cpp | 19 | ||||
-rwxr-xr-x | source/math.h | 8 |
3 files changed, 14 insertions, 15 deletions
@@ -14,7 +14,7 @@ build_opts="$build_dir/main" lib_path="libs/SDL2 libs/freetype/libfreetype.so" link_opts="-L $lib_path -lSDL2" -build_command="clang++ -std=c++11 -g -O0 $include_opts $files $link_opts -o $build_opts" +build_command="clang++ -std=c++11 -g -O2 $include_opts $files $link_opts -o $build_opts" printf "Building Project...\n" printf "$build_command\n\n" diff --git a/source/main.cpp b/source/main.cpp index a4d7b2c..8a88231 100755 --- a/source/main.cpp +++ b/source/main.cpp @@ -690,8 +690,8 @@ Vec3 get_screen_position_from_percent(GameState state, Vec3 v) { int main(int argc, char* argv[]) { - u32 scr_width = 1024; - u32 scr_height = 768; + u32 scr_width = 1920; + u32 scr_height = 1080; if (SDL_Init(SDL_INIT_VIDEO) != 0) { @@ -896,7 +896,7 @@ int main(int argc, char* argv[]) { update_frame_timer(&timer); //enforce_frame_rate(&timer, 60); - hp_ticks = SDL_GetPerformanceCounter(); + //hp_ticks = SDL_GetPerformanceCounter(); cum_math_ticks = 0; controller.jump = 0; @@ -1277,8 +1277,7 @@ int main(int argc, char* argv[]) u32 max_col_ele = max_cq_count/max_row_ele; Vec2 screen_render_size = (state.render_scale * state.screen_size)/2.0f; Vec2 based_size = Vec2{ - screen_render_size.x / max_row_ele, - screen_render_size.y / max_col_ele + 16.0f, 16.0f }; #if 1 for (int i=0;i<max_cq_count;i++) { @@ -1315,12 +1314,12 @@ int main(int argc, char* argv[]) renderer->cq_batch_count = 0; // render ui text - u64 new_ticks = SDL_GetPerformanceCounter(); - r64 hp_time = (r64)(new_ticks - hp_ticks) / (r64) hp_tick_freq; - SDL_Log("ticks time: %fs", hp_time); + //u64 new_ticks = SDL_GetPerformanceCounter(); + //r64 hp_time = (r64)(new_ticks - hp_ticks) / (r64) hp_tick_freq; + //SDL_Log("ticks time: %fs", hp_time); - cum_math_time = (r64)cum_math_ticks/(r64)tick_freq; - SDL_Log("multiply4mv time: %fs", cum_math_time); + //cum_math_time = (r64)cum_math_ticks/(r64)tick_freq; + //SDL_Log("multiply4mv time: %fs", cum_math_time); if (is_collide_x || is_collide_y) { diff --git a/source/math.h b/source/math.h index 1ac3605..1d7924c 100755 --- a/source/math.h +++ b/source/math.h @@ -10,7 +10,7 @@ // @todo: // - make everything simd -#define USE_SSE 1 +#define USE_SSE 0 r32 clampf(r32 x, r32 bottom, r32 top) { @@ -393,7 +393,7 @@ Mat4 subtract4m(Mat4 a, Mat4 b) Vec4 multiply4mv(Mat4 m, Vec4 v) { - r64 prev_tick = SDL_GetPerformanceCounter(); + //r64 prev_tick = SDL_GetPerformanceCounter(); Vec4 res = vec4(0); #if USE_SSE @@ -434,8 +434,8 @@ Vec4 multiply4mv(Mat4 m, Vec4 v) res.w += v.w*m.data[3][3]; #endif - r64 curr_tick = SDL_GetPerformanceCounter(); - cum_math_ticks += curr_tick - prev_tick; + //r64 curr_tick = SDL_GetPerformanceCounter(); + //cum_math_ticks += curr_tick - prev_tick; return res; } |