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

This commit is contained in:
zicodxx 2011-04-10 12:28:19 +02:00
parent 035c6d2b06
commit 6459b6ed8a
2 changed files with 3 additions and 8 deletions

View file

@ -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
--------

View file

@ -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)))
{