From 7c0c02b9afe69991d3d7bf260f1b74e3a4b4faed Mon Sep 17 00:00:00 2001 From: shylie Date: Wed, 18 Dec 2024 19:40:08 -0500 Subject: [PATCH] Fix image size/stride error in test program --- tests/basic.cpp | 2 +- tests/test-common/test-common.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/basic.cpp b/tests/basic.cpp index dd27cb8..0acd72f 100644 --- a/tests/basic.cpp +++ b/tests/basic.cpp @@ -15,7 +15,7 @@ namespace for (int i = 0; i < GRID_HEIGHT; i++) { - glerminal_set(i + 1, i + 1, 0, 1); + glerminal_set(i, i, 0, 1); } glerminal_flush(); diff --git a/tests/test-common/test-common.cpp b/tests/test-common/test-common.cpp index 3effeb0..97394ba 100644 --- a/tests/test-common/test-common.cpp +++ b/tests/test-common/test-common.cpp @@ -8,7 +8,7 @@ namespace { - unsigned char pixels[(GRID_WIDTH * CELL_SCALE * 8) * (GRID_HEIGHT * CELL_SCALE * 8) * 3]; + unsigned char pixels[(GRID_WIDTH * 8) * (GRID_HEIGHT * 8) * 3]; } void glerminal_test_save_image() @@ -21,5 +21,5 @@ void glerminal_test_save_image() glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); stbi_flip_vertically_on_write(true); - stbi_write_png("image.png", GRID_WIDTH * CELL_SCALE * 8, GRID_HEIGHT * CELL_SCALE * 8, 3, pixels, GRID_WIDTH * CELL_SCALE * 8 * 3); + stbi_write_png("image.png", GRID_WIDTH * 8, GRID_HEIGHT * 8, 3, pixels, GRID_WIDTH * 8 * 3); } \ No newline at end of file