New wiggle approach

This commit is contained in:
2023-12-01 22:24:00 -05:00
parent 6324234cf9
commit b5e3ccde5a
6 changed files with 60 additions and 19 deletions

View File

@@ -11,6 +11,15 @@ namespace JabyEngine {
GPU::SizeU16 font_size;
};
struct State {
GPU::PositionI16 pos;
uint8_t wiggle_count;
static constexpr State create(GPU::PositionI16 pos, uint8_t wiggle_count = 0) {
return State{.pos = pos, .wiggle_count = wiggle_count};
}
};
struct FontBufferInfo {
FontPrimitive* double_buffer[2];
size_t single_buffer_length;
@@ -24,4 +33,15 @@ namespace JabyEngine {
return FontBufferInfo{.double_buffer = {buffer[0], buffer[1]}, .single_buffer_length = N};
}
};
using Wiggle = GPU::PositionI8[8];
/*struct Wiggle {
GPU::PositionI8 offset[8];
uint8_t count;
GPU::PositionI8 next() {
return this->offset[(this->count++)&0x7];
}
};*/
}

View File

@@ -24,7 +24,7 @@ namespace JabyEngine {
FontWriter::setup(buffer_info, vram_dst, Make::SizeI16(font_info.font_size.width, font_info.font_size.height));
}
GPU::PositionI16 write(GPU::PositionI16 pos, const char* str, GPU::Color24 color = GPU::Color24::Grey(), uint8_t wiggle_count = 0);
void render();
void write(State& state, const char* str, GPU::Color24 color = GPU::Color24::Grey(), Wiggle* wiggle = nullptr);
void render();
};
}