restored fix for savegame screenshot

fix for heretic filter + cleanup
This commit is contained in:
Emanuele Disco 2021-06-19 09:35:50 +09:00
parent 329dee523c
commit 2c531e54f9
4 changed files with 29 additions and 7 deletions

View File

@ -32,7 +32,7 @@ LOCAL_SRC_FILES = \
C/LzFind.c \ C/LzFind.c \
C/Lzma2Dec.c \ C/Lzma2Dec.c \
C/LzmaDec.c \ C/LzmaDec.c \
C/LzmaEnc.c \ C/LzmaEnc.c \
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)

View File

@ -5,7 +5,7 @@ LOCAL_PATH := $(call my-dir)/../libraries/zlib
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := zlib_lz LOCAL_MODULE := zlib_lz
LOCAL_CFLAGS = -Wall LOCAL_CFLAGS = -Wall

View File

@ -1007,6 +1007,21 @@ void FGLRenderer::RenderView (player_t* player)
// Render the view to a savegame picture // 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; i<width*height; i++) {
for (int j=0; j<3; j++)
*(dst++) = *(src++);
src++;
}
return dst;
}
#endif
void GLSceneDrawer::WriteSavePic (player_t *player, FileWriter *file, int width, int height) void GLSceneDrawer::WriteSavePic (player_t *player, FileWriter *file, int width, int height)
{ {
@ -1040,9 +1055,16 @@ void GLSceneDrawer::WriteSavePic (player_t *player, FileWriter *file, int width,
GLRenderer->CopyToBackbuffer(&bounds, false); GLRenderer->CopyToBackbuffer(&bounds, false);
glFlush(); 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); uint8_t * scr = (uint8_t *)M_Malloc(width * height * 3);
glReadPixels(0,0,width, height,GL_RGB,GL_UNSIGNED_BYTE,scr); 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); M_CreatePNG (file, scr + ((height-1) * width * 3), NULL, SS_RGB, width, height, -width * 3, Gamma);
#endif
M_Free(scr); M_Free(scr);
} }

View File

@ -1733,7 +1733,7 @@ flickerlight TIMEBOMB_X1
attenuate 1 attenuate 1
} }
flickerlight TIMEBOMB_X1 flickerlight TIMEBOMB_X2
{ {
color 0.8 0.4 0.3 color 0.8 0.4 0.3
size 88 size 88
@ -1742,7 +1742,7 @@ flickerlight TIMEBOMB_X1
attenuate 1 attenuate 1
} }
flickerlight TIMEBOMB_X1 flickerlight TIMEBOMB_X3
{ {
color 0.6 0.3 0.2 color 0.6 0.3 0.2
size 96 size 96
@ -1751,7 +1751,7 @@ flickerlight TIMEBOMB_X1
attenuate 1 attenuate 1
} }
flickerlight TIMEBOMB_X1 flickerlight TIMEBOMB_X4
{ {
color 0.4 0.2 0.1 color 0.4 0.2 0.1
size 108 size 108
@ -1760,7 +1760,7 @@ flickerlight TIMEBOMB_X1
attenuate 1 attenuate 1
} }
flickerlight TIMEBOMB_X1 flickerlight TIMEBOMB_X5
{ {
color 0.2 0.1 0.0 color 0.2 0.1 0.0
size 120 size 120
@ -1774,7 +1774,7 @@ object ActivatedTimeBomb
frame XPL1A { light TIMEBOMB_X1 } frame XPL1A { light TIMEBOMB_X1 }
frame XPL1B { light TIMEBOMB_X2 } frame XPL1B { light TIMEBOMB_X2 }
frame XPL1C { light TIMEBOMB_X3 } frame XPL1C { light TIMEBOMB_X3 }
frame XPL1D { light TIMEBOMB_X4 } frame XPL1D { light TIMEBOMB_X12 }
frame XPL1E { light TIMEBOMB_X5 } frame XPL1E { light TIMEBOMB_X5 }
frame XPL1F { light TIMEBOMB_X5 } frame XPL1F { light TIMEBOMB_X5 }
} }