include_directories("/usr/X11R6/include")
endif()
-add_compile_options(-Wall -Wextra -Wpedantic -Werror)
+add_compile_options(-Wall -Wextra -Werror)
set(DEPS_SOURCES
"${DEPS_DIR}/dragontype/array.c"
{
mat4x4 m;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_transpose(m, view_proj);
-#pragma GCC diagnostic pop
vec4_add(frustum.planes[PLANE_LEFT], m[3], m[0]);
vec4_sub(frustum.planes[PLANE_RIGHT], m[3], m[0]);
mat4x4_translate(element->transform, element->pos.x - element->def.margin.x, element->pos.y - element->def.margin.y, 0.0f);
mat4x4_translate(element->text_transform, element->pos.x, element->pos.y, 0.0f);
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_scale_aniso(element->transform, element->transform, element->scale.x + element->def.margin.x * 2.0f, element->scale.y + element->def.margin.y * 2.0f, 1.0f);
-#pragma GCC diagnostic pop
bintree_traverse(&element->children, BTT_INORDER, &bintree_calculate_element_transform, NULL);
}
void object_transform(Object *obj)
{
mat4x4_translate(obj->transform, obj->pos.x, obj->pos.y, obj->pos.z);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_rotate(obj->transform, obj->transform, obj->rot.x, obj->rot.y, obj->rot.z, obj->angle);
mat4x4_scale_aniso(obj->transform, obj->transform, obj->scale.x, obj->scale.y, obj->scale.z);
-#pragma GCC diagnostic pop
}
bool object_before_render(Object *obj, f64 dtime)
void scene_render(f64 dtime)
{
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_mul(scene.VP, scene.projection, camera.view);
-#pragma GCC diagnostic pop
vec4 base_sunlight_dir = {0.0f, 0.0f, -1.0f, 1.0f};
vec4 sunlight_dir;
mat4x4 sunlight_mat;
mat4x4_identity(sunlight_mat);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_rotate(sunlight_mat, sunlight_mat, 1.0f, 0.0f, 0.0f, get_sun_angle() + M_PI / 2.0f);
mat4x4_mul_vec4(sunlight_dir, sunlight_mat, base_sunlight_dir);
-#pragma GCC diagnostic pop
frustum_update(scene.VP);
mesh_delete(sky.sun_mesh);
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
+
void sky_render()
{
f64 daylight = get_daylight();
glDepthFunc(GL_LESS);
glEnable(GL_CULL_FACE);
}
-#pragma GCC diagnostic pop
static void apply_translation(Voxelctx *ctx, v3f32 translate)
{
vec4 translate_vec;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_mul_vec4(translate_vec, VOXELCTXSTATE(ctx).mat, (vec4) {translate.x, translate.y, translate.z, 0.0f});
-#pragma GCC diagnostic pop
vec4_add(VOXELCTXSTATE(ctx).pos, VOXELCTXSTATE(ctx).pos, translate_vec);
}
void voxelctx_rx(Voxelctx *ctx, f32 value)
{
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_rotate_X(VOXELCTXSTATE(ctx).mat, VOXELCTXSTATE(ctx).mat, value * M_PI / 180.0f);
-#pragma GCC diagnostic pop
}
// swap y and z
void voxelctx_rz(Voxelctx *ctx, f32 value)
{
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
-
mat4x4_rotate_Y(VOXELCTXSTATE(ctx).mat, VOXELCTXSTATE(ctx).mat, value * M_PI / 180.0f);
-#pragma GCC diagnostic pop
}
void voxelctx_ry(Voxelctx *ctx, f32 value)
{
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_rotate_Z(VOXELCTXSTATE(ctx).mat, VOXELCTXSTATE(ctx).mat, value * M_PI / 180.0f);
-#pragma GCC diagnostic pop
}
static void apply_scale(Voxelctx *ctx, v3f32 scale)
VOXELCTXSTATE(ctx).scale[1] *= scale.y;
VOXELCTXSTATE(ctx).scale[2] *= scale.z;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_scale_aniso(VOXELCTXSTATE(ctx).mat, VOXELCTXSTATE(ctx).mat, scale.x, scale.y, scale.z);
-#pragma GCC diagnostic pop
}
void voxelctx_sx(Voxelctx *ctx, f32 value)
s32 max_len = 0;
vec4 center;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
+
mat4x4_mul_vec4(center, VOXELCTXSTATE(ctx).mat, (vec4) {0.5f, 0.5f, 0.5f});
-#pragma GCC diagnostic pop
for (int i = 0; i < 8; i++) {
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
mat4x4_mul_vec4(corners[i], VOXELCTXSTATE(ctx).mat, base_corners[i]);
-#pragma GCC diagnostic pop
vec3 from_center;
vec3_sub(from_center, corners[i], center);