hot reload working
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
fn rn_cmd_t *rn_get_cmd(rn_cmd_kind_t kind) {
|
||||
b32 alloc_new = false;
|
||||
if (rn_state.last_cmd == NULL) {
|
||||
if (rn->last_cmd == NULL) {
|
||||
alloc_new = true;
|
||||
} else if (rn_state.last_cmd->kind != kind) {
|
||||
} else if (rn->last_cmd->kind != kind) {
|
||||
alloc_new = true;
|
||||
}
|
||||
|
||||
rn_cmd_t *result = rn_state.last_cmd;
|
||||
rn_cmd_t *result = rn->last_cmd;
|
||||
if (alloc_new) {
|
||||
result = ma_push_type(tcx.temp, rn_cmd_t);
|
||||
result = ma_push_type(tcx->temp, rn_cmd_t);
|
||||
result->kind = kind;
|
||||
SLLQ_APPEND(rn_state.first_cmd, rn_state.last_cmd, result);
|
||||
SLLQ_APPEND(rn->first_cmd, rn->last_cmd, result);
|
||||
|
||||
if (rn_cmd_kind_quad) {
|
||||
result->vertex = rn_state.vertices + rn_state.len;
|
||||
result->vertex = rn->vertices + rn->len;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ fn rn_cmd_t *rn_get_cmd(rn_cmd_kind_t kind) {
|
||||
|
||||
fn rn_vertex_t *rn_push_vertex(rn_cmd_t *cmd, u32 count) {
|
||||
rn_vertex_t *result = cmd->vertex + cmd->len;
|
||||
rn_state.len += count;
|
||||
rn->len += count;
|
||||
cmd->len += count;
|
||||
return result;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ fn void rn_push_quad(r2f32_t rect, r2f32_t tex, v4f32_t color) {
|
||||
}
|
||||
|
||||
fn void rn_draw_rect(r2f32_t rect, v4f32_t color) {
|
||||
rn_push_quad(rect, rn_state.main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(rect, rn->main_font->white_texture_bounding_box, color);
|
||||
}
|
||||
|
||||
fn void rn_draw_rect_border(r2f32_t rect, v4f32_t color, f32 border_thickness) {
|
||||
@@ -71,10 +71,10 @@ fn void rn_draw_rect_border(r2f32_t rect, v4f32_t color, f32 border_thickness) {
|
||||
r2f32_t right = r2f32_cut_right(&rect, border_thickness);
|
||||
r2f32_t top = r2f32_cut_top(&rect, border_thickness);
|
||||
r2f32_t bottom = r2f32_cut_bottom(&rect, border_thickness);
|
||||
rn_push_quad(left, rn_state.main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(right, rn_state.main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(top, rn_state.main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(bottom, rn_state.main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(left, rn->main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(right, rn->main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(top, rn->main_font->white_texture_bounding_box, color);
|
||||
rn_push_quad(bottom, rn->main_font->white_texture_bounding_box, color);
|
||||
}
|
||||
|
||||
fn i64 rn_get_char_spacing(rn_font_t *font, u32 codepoint) {
|
||||
@@ -113,7 +113,7 @@ fn v2f32_t rn_draw_string(rn_font_t *font, v2f32_t pos, v4f32_t color, s8_t stri
|
||||
}
|
||||
|
||||
fn v2f32_t rn_draw_stringf(rn_font_t *font, v2f32_t pos, v4f32_t color, char *str, ...) {
|
||||
S8_FMT(tcx.temp, str, result);
|
||||
S8_FMT(tcx->temp, str, result);
|
||||
return rn_draw_string(font, pos, color, result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user