effort to have no warnings once again
This commit is contained in:
@ -223,6 +223,8 @@ static void render_2d(void) {
|
||||
case PRIMITIVE_2D_TEXT:
|
||||
render_text(¤t->text);
|
||||
break;
|
||||
default:
|
||||
SDL_assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -194,6 +194,8 @@ void use_2d_pipeline(void);
|
||||
|
||||
void use_texture_mode(TextureMode mode);
|
||||
|
||||
void upload_quad_vertices(Rect rect);
|
||||
|
||||
void finally_render_sprites(Primitive2D const primitives[],
|
||||
struct SpriteBatch batch,
|
||||
VertexBuffer buffer);
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
char *paths_in_use;
|
||||
static char *paths_in_use;
|
||||
|
||||
void draw_skybox(const char *paths) {
|
||||
if (paths_in_use && SDL_strcmp(paths, paths_in_use) == 0)
|
||||
|
@ -199,9 +199,14 @@ void render_sprites(const Primitive2D primitives[],
|
||||
v2 = (Vec2){ sprite.rect.x + sprite.rect.w, sprite.rect.y + sprite.rect.h };
|
||||
v3 = (Vec2){ sprite.rect.x + sprite.rect.w, sprite.rect.y };
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
|
||||
} else if (sprite.rect.w == sprite.rect.h) {
|
||||
/* rotated square case */
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
const Vec2 c = frect_center(sprite.rect);
|
||||
const Vec2 t = fast_cossine(sprite.rotation + (float)M_PI_4);
|
||||
const Vec2 d = {
|
||||
|
@ -35,7 +35,7 @@ void draw_triangle(const char *path,
|
||||
.uv2 = uv2,
|
||||
}};
|
||||
|
||||
union UncoloredSpaceTriangle *triangles = (union UncoloredSpaceTriangle *)batch_p->value.primitives;
|
||||
union UncoloredSpaceTriangle *triangles = (union UncoloredSpaceTriangle *)(void *)batch_p->value.primitives;
|
||||
|
||||
arrpush(triangles, triangle);
|
||||
batch_p->value.primitives = (uint8_t *)triangles;
|
||||
@ -66,7 +66,7 @@ void draw_uncolored_space_traingle_batch(struct MeshBatch *batch,
|
||||
/* update pixel-based uvs to correspond with texture atlases */
|
||||
for (size_t i = 0; i < primitives_len; ++i) {
|
||||
struct UncoloredSpaceTrianglePayload *payload =
|
||||
&((union UncoloredSpaceTriangle *)batch->primitives)[i].payload;
|
||||
&((union UncoloredSpaceTriangle *)(void *)batch->primitives)[i].payload;
|
||||
|
||||
payload->uv0.x = xr + ((float)payload->uv0.x / srcrect.w) * wr;
|
||||
payload->uv0.y = yr + ((float)payload->uv0.y / srcrect.h) * hr;
|
||||
|
Reference in New Issue
Block a user