mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
fix: Y origin in prepare_chipmunk_shader
Convert surface_area from top-left pixels to bottom-left UVs so `bot_left`/`top_right` align with `tex_coord` and the clip box is correct.
This commit is contained in:
+3
-2
@@ -109,8 +109,9 @@ static void prepare_chipmunk_shader(struct gfx_render_job *job, void *data)
|
||||
r = (Rectangle) { 0, 0, sp->rect.w, sp->rect.h };
|
||||
}
|
||||
|
||||
glUniform2f(s->bot_left, r.x, r.y);
|
||||
glUniform2f(s->top_right, r.x + r.w, r.y + r.h);
|
||||
int sy_bottom = sp->rect.h - (r.y + r.h);
|
||||
glUniform2f(s->bot_left, r.x, sy_bottom);
|
||||
glUniform2f(s->top_right, r.x + r.w, sy_bottom + r.h);
|
||||
}
|
||||
|
||||
void sprite_init_sact(void)
|
||||
|
||||
Reference in New Issue
Block a user