From 2c531e54f927ade92724d3ad57b423f7b0cffdb3 Mon Sep 17 00:00:00 2001 From: Emanuele Disco Date: Sat, 19 Jun 2021 09:35:50 +0900 Subject: [PATCH] restored fix for savegame screenshot fix for heretic filter + cleanup --- .../mobile/Android_lzma.mk | 2 +- .../mobile/Android_zlib.mk | 2 +- .../src/gl/scene/gl_scene.cpp | 22 +++++++++++++++++++ .../static/filter/heretic/gldefs.txt | 10 ++++----- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_lzma.mk b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_lzma.mk index 473318f..94fe02e 100644 --- a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_lzma.mk +++ b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_lzma.mk @@ -32,7 +32,7 @@ LOCAL_SRC_FILES = \ C/LzFind.c \ C/Lzma2Dec.c \ C/LzmaDec.c \ - C/LzmaEnc.c \ + C/LzmaEnc.c \ include $(BUILD_STATIC_LIBRARY) diff --git a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_zlib.mk b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_zlib.mk index 88679a4..f1894cc 100644 --- a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_zlib.mk +++ b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/mobile/Android_zlib.mk @@ -5,7 +5,7 @@ LOCAL_PATH := $(call my-dir)/../libraries/zlib include $(CLEAR_VARS) -LOCAL_MODULE := zlib_lz +LOCAL_MODULE := zlib_lz LOCAL_CFLAGS = -Wall diff --git a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/src/gl/scene/gl_scene.cpp b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/src/gl/scene/gl_scene.cpp index 83d14c3..d639e88 100644 --- a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/src/gl/scene/gl_scene.cpp +++ b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/src/gl/scene/gl_scene.cpp @@ -1007,6 +1007,21 @@ void FGLRenderer::RenderView (player_t* player) // Render the view to a savegame picture // //=========================================================================== +#ifdef __ANDROID__ +uint8_t * gles_convertRGB(uint8_t * data, int width, int height) +{ + uint8_t *src = data; + uint8_t *dst = data; + + for (int i=0; iCopyToBackbuffer(&bounds, false); glFlush(); +#ifdef __MOBILE__ //Some androids do not like GL_RGB + uint8_t * scr = (uint8_t *)M_Malloc(width * height * 4); + glReadPixels(0,0,width, height,GL_RGBA,GL_UNSIGNED_BYTE,scr); + gles_convertRGB(scr,width,height); + M_CreatePNG (file, scr + ((height-1) * width * 3), NULL, SS_RGB, width, height, -width * 3, Gamma); +#else uint8_t * scr = (uint8_t *)M_Malloc(width * height * 3); glReadPixels(0,0,width, height,GL_RGB,GL_UNSIGNED_BYTE,scr); M_CreatePNG (file, scr + ((height-1) * width * 3), NULL, SS_RGB, width, height, -width * 3, Gamma); +#endif M_Free(scr); } diff --git a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/wadsrc_lights/static/filter/heretic/gldefs.txt b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/wadsrc_lights/static/filter/heretic/gldefs.txt index 9076b2a..65796e7 100644 --- a/Projects/Android/jni/gzdoom-g3.3mgw_mobile/wadsrc_lights/static/filter/heretic/gldefs.txt +++ b/Projects/Android/jni/gzdoom-g3.3mgw_mobile/wadsrc_lights/static/filter/heretic/gldefs.txt @@ -1733,7 +1733,7 @@ flickerlight TIMEBOMB_X1 attenuate 1 } -flickerlight TIMEBOMB_X1 +flickerlight TIMEBOMB_X2 { color 0.8 0.4 0.3 size 88 @@ -1742,7 +1742,7 @@ flickerlight TIMEBOMB_X1 attenuate 1 } -flickerlight TIMEBOMB_X1 +flickerlight TIMEBOMB_X3 { color 0.6 0.3 0.2 size 96 @@ -1751,7 +1751,7 @@ flickerlight TIMEBOMB_X1 attenuate 1 } -flickerlight TIMEBOMB_X1 +flickerlight TIMEBOMB_X4 { color 0.4 0.2 0.1 size 108 @@ -1760,7 +1760,7 @@ flickerlight TIMEBOMB_X1 attenuate 1 } -flickerlight TIMEBOMB_X1 +flickerlight TIMEBOMB_X5 { color 0.2 0.1 0.0 size 120 @@ -1774,7 +1774,7 @@ object ActivatedTimeBomb frame XPL1A { light TIMEBOMB_X1 } frame XPL1B { light TIMEBOMB_X2 } frame XPL1C { light TIMEBOMB_X3 } - frame XPL1D { light TIMEBOMB_X4 } + frame XPL1D { light TIMEBOMB_X12 } frame XPL1E { light TIMEBOMB_X5 } frame XPL1F { light TIMEBOMB_X5 } }