diff --git a/ports/doom/build.sh b/ports/doom/build.sh index 0f86548c..1fe3acec 100755 --- a/ports/doom/build.sh +++ b/ports/doom/build.sh @@ -5,7 +5,7 @@ VERSION='git' DOWNLOAD_URL="https://github.com/ozkl/doomgeneric.git#613f870b6fa83ede448a247de5a2571092fa729d" configure() { - : + make --directory doomgeneric clean } build() { diff --git a/ports/doom/patches/0001-Add-support-for-banan-os.patch b/ports/doom/patches/0001-Add-support-for-banan-os.patch index fa5a81cf..db59d0c4 100644 --- a/ports/doom/patches/0001-Add-support-for-banan-os.patch +++ b/ports/doom/patches/0001-Add-support-for-banan-os.patch @@ -79,7 +79,7 @@ new file mode 100644 index 0000000..9161771 --- /dev/null +++ b/doomgeneric/doomgeneric_banan_os.cpp -@@ -0,0 +1,138 @@ +@@ -0,0 +1,139 @@ +extern "C" +{ +#include "doomgeneric.h" @@ -166,9 +166,10 @@ index 0000000..9161771 + +void DG_DrawFrame() +{ ++ auto& texture = s_window->texture(); + for (size_t y = 0; y < DOOMGENERIC_RESY; y++) + for (size_t x = 0; x < DOOMGENERIC_RESX; x++) -+ s_window->set_pixel(x, y, 0xFF000000 | DG_ScreenBuffer[y * DOOMGENERIC_RESX + x]); ++ texture.set_pixel(x, y, 0xFF000000 | DG_ScreenBuffer[y * DOOMGENERIC_RESX + x]); + s_window->invalidate(); + s_window->poll_events(); +} diff --git a/ports/doom/patches/0003-Remove-unnecessary-copy-from-framebuffer.patch b/ports/doom/patches/0003-Remove-unnecessary-copy-from-framebuffer.patch index e54c8ea4..6f60ead5 100644 --- a/ports/doom/patches/0003-Remove-unnecessary-copy-from-framebuffer.patch +++ b/ports/doom/patches/0003-Remove-unnecessary-copy-from-framebuffer.patch @@ -25,20 +25,21 @@ diff --git a/doomgeneric/doomgeneric_banan_os.cpp b/doomgeneric/doomgeneric_bana index d00c30d..9d13b43 100644 --- a/doomgeneric/doomgeneric_banan_os.cpp +++ b/doomgeneric/doomgeneric_banan_os.cpp -@@ -80,13 +80,13 @@ void DG_Init() +@@ -80,14 +80,13 @@ void DG_Init() s_key_write_index = (s_key_write_index + 1) % s_key_queue_size; } ); + + ASSERT(DG_ScreenBuffer == nullptr); -+ DG_ScreenBuffer = s_window->pixels().data(); ++ DG_ScreenBuffer = s_window->texture().pixels().data(); } void DG_DrawFrame() { +- auto& texture = s_window->texture(); - for (size_t y = 0; y < DOOMGENERIC_RESY; y++) - for (size_t x = 0; x < DOOMGENERIC_RESX; x++) -- s_window->set_pixel(x, y, 0xFF000000 | DG_ScreenBuffer[y * DOOMGENERIC_RESX + x]); +- texture.set_pixel(x, y, 0xFF000000 | DG_ScreenBuffer[y * DOOMGENERIC_RESX + x]); s_window->invalidate(); s_window->poll_events(); }