Fix rendering of rects, draw debug target reticule

This commit is contained in:
Doyle Thai 2016-07-16 17:41:17 +10:00
parent d0b4c99787
commit d74cabf5c6
2 changed files with 5 additions and 5 deletions

View File

@ -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,
f32 rotate, Texture *tex, v4 texRect, v4 color)
{
v4 quadRect = math_getRect(pos, size);
RenderQuad quad = createTexQuad(renderer, quadRect, texRect, tex);
RenderQuad quad = createDefaultTexQuad(renderer, texRect, tex);
updateBufferObject(renderer, &quad, 1);
// NOTE(doyle): Get the origin of cameraBounds in world space, bottom left

View File

@ -477,9 +477,10 @@ void worldTraveller_gameUpdateAndRender(GameState *state, const f32 dt)
#endif
Texture *emptyTex =
asset_getTexture(assetManager, texlist_empty);
renderer_rect(renderer, cameraBounds, hero->pos,
V2(distance, 100.0f), 0, emptyTex, V4(0, 1, 1, 0),
V4(1, 0, 0, 1));
v2 heroCenter = v2_add(hero->pos, v2_scale(hero->size, 0.5f));
renderer_rect(renderer, cameraBounds, heroCenter,
V2(distance, 10.0f), 0, emptyTex, V4(0, 1, 1, 0),
V4(1, 0, 0, 0.5f));
}
}