Compare commits
No commits in common. "3b66e51cc6a2f0269250a279b2bf05567d6a50b2" and "eb62e9ad72cab1e484700dfc0757281a50d37f19" have entirely different histories.
3b66e51cc6
...
eb62e9ad72
@ -9,7 +9,6 @@ enum CmdType {
|
||||
CMD_UPDATE_ATLAS,
|
||||
CMD_SPRITE,
|
||||
CMD_SCISSOR,
|
||||
CMD_REQ_SKIP_FRAME,
|
||||
}
|
||||
|
||||
// command to draw a rect
|
||||
@ -108,8 +107,6 @@ fn usz? Cmd.to_format(Cmd* cmd, Formatter *f) @dynamic
|
||||
case CMD_UPDATE_ATLAS:
|
||||
ret += f.print("CmdUpdateAtlas")!;
|
||||
ret += io::struct_to_format(cmd.update_atlas, f, false)!;
|
||||
case CMD_REQ_SKIP_FRAME:
|
||||
ret += f.print("Skip Frame Request")!;
|
||||
}
|
||||
|
||||
ret += f.print("}")!;
|
||||
|
@ -120,8 +120,6 @@ struct Ctx {
|
||||
Font font;
|
||||
SpriteAtlas sprite_atlas;
|
||||
|
||||
bool skip_frame;
|
||||
|
||||
bool has_focus;
|
||||
InputData input, current_input;
|
||||
|
||||
@ -264,8 +262,6 @@ fn void? Ctx.frame_begin(&ctx)
|
||||
elem.layout.h = @exact(ctx.height);
|
||||
|
||||
ctx.div_scissor = elem.bounds;
|
||||
|
||||
ctx.skip_frame = false;
|
||||
}
|
||||
|
||||
fn void? Ctx.frame_end(&ctx)
|
||||
@ -311,11 +307,6 @@ fn void? Ctx.frame_end(&ctx)
|
||||
ctx.sprite_atlas.should_update = false;
|
||||
}
|
||||
|
||||
// send skip frame request
|
||||
if (ctx.skip_frame) {
|
||||
ctx.cmd_queue.push({.type = CMD_REQ_SKIP_FRAME});
|
||||
}
|
||||
|
||||
// sort the command buffer by the z-index
|
||||
// FIXME: sorting the buffer fucks with scissor commands that have to be kept in place
|
||||
// TODO: instead of sorting at the end perform ordered inserts into the command buffer
|
||||
|
@ -208,8 +208,6 @@ macro Point Point.neg(Point p) @operator_s(-) => {-p.x, -p.y};
|
||||
macro Point Point.max(Point a, Point b) => {.x = max(a.x, b.x), .y = max(a.y, b.y)};
|
||||
macro Point Point.min(Point a, Point b) => {.x = min(a.x, b.x), .y = min(a.y, b.y)};
|
||||
|
||||
macro bool Point.equals(Point a, Point b) @operator_s(==) => a.x == b.x && a.y == b.y;
|
||||
|
||||
// ---------------------------------------------------------------------------------- //
|
||||
// COLOR //
|
||||
// ---------------------------------------------------------------------------------- //
|
||||
|
@ -211,13 +211,6 @@ fn bool? Ctx.popup_begin_id(&ctx,
|
||||
.origin.y = pos.y - parent.bounds.y,
|
||||
};
|
||||
|
||||
// if the position is not the one expected then request a frame-skip to not flash appear in the
|
||||
// wrong position for one frame
|
||||
if (elem.bounds.position() != pos) {
|
||||
ctx.skip_frame = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
ctx.push_rect(elem.bounds.pad(style.margin), elem.z_index, style)!;
|
||||
|
||||
// update the ctx scissor, it HAS to be after drawing the background
|
||||
|
@ -988,7 +988,6 @@ fn void Renderer.render_ugui(&self, CmdQueue* queue)
|
||||
self.start_render_pass("UGUI_PIPELINE");
|
||||
self.bind_textures_id(self.font_atlas_id, self.sprite_atlas_id);
|
||||
|
||||
bool no_draws;
|
||||
uint calls = 0;
|
||||
uint off;
|
||||
while (true) {
|
||||
@ -998,8 +997,6 @@ fn void Renderer.render_ugui(&self, CmdQueue* queue)
|
||||
break;
|
||||
}
|
||||
switch (cmd.type) {
|
||||
case CMD_REQ_SKIP_FRAME:
|
||||
no_draws = true;
|
||||
case CMD_UPDATE_ATLAS:
|
||||
// TODO: verify the correct type
|
||||
CmdUpdateAtlas u = cmd.update_atlas;
|
||||
@ -1015,8 +1012,6 @@ fn void Renderer.render_ugui(&self, CmdQueue* queue)
|
||||
self.scissor_w = s.w;
|
||||
self.scissor_h = s.h;
|
||||
default:
|
||||
if (no_draws) break;
|
||||
|
||||
self.set_scissor(self.scissor_x, self.scissor_y, self.scissor_w, self.scissor_h);
|
||||
uint count = 1;
|
||||
while (queue.len() != 0 && (queue.get(0).type == CMD_RECT || queue.get(0).type == CMD_SPRITE)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user