This commit is contained in:
veclavtlica
2026-09-14 00:02:08 +03:00
parent 578c4a6d4f
commit c350d65592
5 changed files with 90 additions and 26 deletions
+17 -2
View File
@@ -145,9 +145,13 @@ extern int plr_display_x11_main(int argc, char *argv[]) {
com_vec_from(5 * COM_FIX_FRACUNIT, 0, 2 * COM_FIX_FRACUNIT);
com_vec_t v1 = com_vec_from(5 * COM_FIX_FRACUNIT, 1 * COM_FIX_FRACUNIT,
4 * COM_FIX_FRACUNIT);
com_vec_t v2 = com_vec_from(5 * COM_FIX_FRACUNIT, 2 * COM_FIX_FRACUNIT,
com_vec_t v2 = com_vec_from(5 * COM_FIX_FRACUNIT, 4 * COM_FIX_FRACUNIT,
4 * COM_FIX_FRACUNIT);
com_pnt_t uv0 = com_pnt_from(0 * COM_FIX_FRACUNIT, 0 * COM_FIX_FRACUNIT);
com_pnt_t uv1 = com_pnt_from(1 * COM_FIX_FRACUNIT, 0 * COM_FIX_FRACUNIT);
com_pnt_t uv2 = com_pnt_from(1 * COM_FIX_FRACUNIT, 1 * COM_FIX_FRACUNIT);
com_vec_t c0 = com_gem_vec_project_clip(mvp, v0);
com_vec_t c1 = com_gem_vec_project_clip(mvp, v1);
com_vec_t c2 = com_gem_vec_project_clip(mvp, v2);
@@ -161,7 +165,18 @@ extern int plr_display_x11_main(int argc, char *argv[]) {
com_pnt_print(p1);
com_pnt_print(p2);
com_gem_draw_triangle(p0, p1, p2, (uint8_t *)pixel_buffer);
uint8_t tex[32 * 32 * 3] = {0};
for (int y = 0; y < 32; ++y) {
for (int x = 0; x < 32; ++x) {
tex[(y * 32 + x) * 3 + 0] = (x / 2 + y / 2) % 2 == 0 ? 175 : 0;
tex[(y * 32 + x) * 3 + 1] = (x / 2 + y / 2) % 2 == 0 ? 0 : 0;
tex[(y * 32 + x) * 3 + 2] = (x / 2 + y / 2) % 2 == 0 ? 175 : 0;
}
}
com_gem_draw_triangle_textured(p0, p1, p2, (uint8_t *)pixel_buffer, uv0,
uv1, uv2, tex);
// com_gem_draw_triangle(p0, p1, p2, (uint8_t *)pixel_buffer);
// Draw the complete image onto the window when exposed
XPutImage(display,
+4 -5
View File
@@ -1,14 +1,13 @@
Pustina -- Player
Locked step multiplayer oriented engine with great restrictions.
Brightstone -- Player
Locked step multiplayer retro oriented engine with great restrictions.
We do not use abstractions, as the simplicity of the required set of features should allow for platform-specific implementations.
---- Restrictions ----
* Fixed sized paletted frambuffer, defaulted to 640x480. Scaling by 2 is possible.
* Fixed sized paletted frambuffer, defaulted to 640x480.
* Deterministic logic via Q15.16 fixed point numbers.
* .gam image format, derived from .gif. RLE and Delta Frame Optimiztion is added, palette is predefined.
* Images are 16x16 or multiples of it, aligning to the grid.
* Tile view is capped at 29x29, the rest is allocated to interface.
* Textures are 32x32 pixels.
* 30 FPS display rate.
* Fonts are in ASCII bitmaps. Tile slicing commands are issued to render them in.
* Audio samples are in our own .sam format (s8 frame delta + lzw).