Fix rendering of rects, draw debug target reticule
This commit is contained in:
parent
d0b4c99787
commit
d74cabf5c6
@ -127,8 +127,7 @@ INTERNAL void renderObject(Renderer *renderer, v2 pos, v2 size, f32 rotate,
|
|||||||
void renderer_rect(Renderer *const renderer, v4 cameraBounds, v2 pos, v2 size,
|
void renderer_rect(Renderer *const renderer, v4 cameraBounds, v2 pos, v2 size,
|
||||||
f32 rotate, Texture *tex, v4 texRect, v4 color)
|
f32 rotate, Texture *tex, v4 texRect, v4 color)
|
||||||
{
|
{
|
||||||
v4 quadRect = math_getRect(pos, size);
|
RenderQuad quad = createDefaultTexQuad(renderer, texRect, tex);
|
||||||
RenderQuad quad = createTexQuad(renderer, quadRect, texRect, tex);
|
|
||||||
updateBufferObject(renderer, &quad, 1);
|
updateBufferObject(renderer, &quad, 1);
|
||||||
|
|
||||||
// NOTE(doyle): Get the origin of cameraBounds in world space, bottom left
|
// NOTE(doyle): Get the origin of cameraBounds in world space, bottom left
|
||||||
|
@ -477,9 +477,10 @@ void worldTraveller_gameUpdateAndRender(GameState *state, const f32 dt)
|
|||||||
#endif
|
#endif
|
||||||
Texture *emptyTex =
|
Texture *emptyTex =
|
||||||
asset_getTexture(assetManager, texlist_empty);
|
asset_getTexture(assetManager, texlist_empty);
|
||||||
renderer_rect(renderer, cameraBounds, hero->pos,
|
v2 heroCenter = v2_add(hero->pos, v2_scale(hero->size, 0.5f));
|
||||||
V2(distance, 100.0f), 0, emptyTex, V4(0, 1, 1, 0),
|
renderer_rect(renderer, cameraBounds, heroCenter,
|
||||||
V4(1, 0, 0, 1));
|
V2(distance, 10.0f), 0, emptyTex, V4(0, 1, 1, 0),
|
||||||
|
V4(1, 0, 0, 0.5f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user