From 6459b6ed8ad8bd2850d0900f4ada9c981bb37abd Mon Sep 17 00:00:00 2001 From: zicodxx Date: Sun, 10 Apr 2011 12:28:19 +0200 Subject: [PATCH] Smash texture list when switching between window mode and fullscreen prevent invalid textures; Made code to capture Screenshots more similar between OpenGL and OpenGL ES --- CHANGELOG.txt | 2 +- arch/ogl/gr.c | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index db5a2b57f..7dfcc7ff3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,7 +4,7 @@ D1X-Rebirth Changelog -------- main/net_udp.c: Allow multi_send_fire when necessary and not crop to PPS so fix weapons with high firing rate main/game.c, main/gamerend.c, main/gauges.c, main/net_udp.c, main/titles.c: Fixed text-related annoyances: "Show reticle names" now named "Show player names on HUD"; Fixed positions of strings TXT_CLOAKED and TXT_CRUISE in CM_FULL_SCREEN; Fixed typo in tracker timeout screen; Fixed scaling of tab_stop in briefings (again); Removed some little D2 code for briefings as it broke some briefing screens -INSTALL.txt: Tell people about The Unarchiver for installing from the Mac game CD (thanks, Jonathan!) +arch/ogl/gr.c: Smash texture list when switching between window mode and fullscreen prevent invalid textures; Made code to capture Screenshots more similar between OpenGL and OpenGL ES 20110408 -------- diff --git a/arch/ogl/gr.c b/arch/ogl/gr.c index f30ca6479..069e29b8a 100644 --- a/arch/ogl/gr.c +++ b/arch/ogl/gr.c @@ -230,6 +230,7 @@ int gr_toggle_fullscreen(void) glLoadIdentity();//clear matrix glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ogl_smash_texture_list_internal();//if we are or were fullscreen, changing vid mode will invalidate current textures } GameCfg.WindowMode = (sdl_video_flags & SDL_FULLSCREEN)?0:1; return (sdl_video_flags & SDL_FULLSCREEN)?1:0; @@ -738,14 +739,11 @@ void write_bmp(char *savename,int w,int h,unsigned char *buf) PHYSFS_file* TGAFile; TGA_header TGA; GLbyte HeightH,HeightL,WidthH,WidthL; -#ifdef OGLES unsigned int pixel; unsigned char *rgbaBuf; -#endif - buf = (unsigned char*)d_calloc(w*h*3,sizeof(unsigned char)); + buf = (unsigned char*)d_calloc(w*h*4,sizeof(unsigned char)); -#ifdef OGLES rgbaBuf = (unsigned char*) d_calloc(w * h * 4, sizeof(unsigned char)); glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, rgbaBuf); for(pixel = 0; pixel < w * h; pixel++) { @@ -754,9 +752,6 @@ void write_bmp(char *savename,int w,int h,unsigned char *buf) *(buf + pixel * 3 + 2) = *(rgbaBuf + pixel * 4); } d_free(rgbaBuf); -#else - glReadPixels(0,0,w,h,GL_BGR_EXT,GL_UNSIGNED_BYTE,buf); -#endif if (!(TGAFile = PHYSFSX_openWriteBuffered(savename))) {