I always forget glLineWidth takes previous setting if arg is <=0; Made the decodebuffer for cockpit static as the bitmap data pointer points to it

This commit is contained in:
zicodxx 2008-11-01 15:40:00 +00:00
parent b2213b6f2e
commit 483a981d2f
3 changed files with 6 additions and 5 deletions

View file

@ -4,6 +4,7 @@ D1X-Rebirth Changelog
--------
main/config.c, main/menu.c, main/newmenu.c, main/piggy.c: Fixed possible overflows in Jukebox Path; Menu GUI improvements: Correct inputbox scaling for font widths, a little performance boost when determinating string-part to show in inputbox, make it possible to flip over from first/last menu entry to last/first even if it's a ScrollBox, Scrolling via Maousebutton now works with delay; Made reading for Piggy data always break up in loops when reached end of file instead of provoking possible error if *data-count < max-data-count*
arch/sdl/key.c: Make sure that if we use UNICODE, we always take non-control type chars and - as we only want lowercase letters - convert chars if shift is pressed
arch/ogl/ogl.c. main/game.c: I always forget glLineWidth takes previous setting if arg is <=0; Made the decodebuffer for cockpit static as the bitmap data pointer points to it
20081031
--------

View file

@ -507,7 +507,7 @@ void ogl_draw_reticle(int cross,int primary,int secondary)
glPushMatrix();
glTranslatef((grd_curcanv->cv_bitmap.bm_w/2+grd_curcanv->cv_bitmap.bm_x)/(float)last_width,1.0-(grd_curcanv->cv_bitmap.bm_h/2+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,0);
glScalef(scale/320.0,scale/200.0,scale);//the positions are based upon the standard reticle at 320x200 res.
glLineWidth(SHEIGHT/240);
glLineWidth(SHEIGHT<240?1:SHEIGHT/240);
OGL_DISABLE(TEXTURE_2D);
glDisable(GL_CULL_FACE);
if (!cross_lh[cross])
@ -962,7 +962,7 @@ void ogl_start_frame(void){
OGL_VIEWPORT(grd_curcanv->cv_bitmap.bm_x,grd_curcanv->cv_bitmap.bm_y,Canvas_width,Canvas_height);
glClearColor(0.0, 0.0, 0.0, 0.0);
glLineWidth(SHEIGHT/480);
glLineWidth(SHEIGHT<480?1:SHEIGHT/480);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

View file

@ -232,7 +232,6 @@ extern int Rear_view;
// Decode cockpit bitmap and add alpha fields to weapon boxes (as it should have always been) so we later can render sub bitmaps over the window canvases
void cockpit_decode_alpha(grs_bitmap *bm)
{
unsigned char decodebuf[1024*1024];
int i=0,x=0,y=0;
static ubyte *cur=NULL;
@ -242,6 +241,7 @@ void cockpit_decode_alpha(grs_bitmap *bm)
// decode the bitmap
if (bm->bm_flags & BM_FLAG_RLE){
static unsigned char cockpitbuf[1024*1024];
unsigned char * dbits;
unsigned char * sbits;
int i, data_offset;
@ -251,7 +251,7 @@ void cockpit_decode_alpha(grs_bitmap *bm)
data_offset = 2;
sbits = &bm->bm_data[4 + (bm->bm_h * data_offset)];
dbits = decodebuf;
dbits = cockpitbuf;
for (i=0; i < bm->bm_h; i++ ) {
gr_rle_decode(sbits,dbits);
@ -261,7 +261,7 @@ void cockpit_decode_alpha(grs_bitmap *bm)
sbits += (int)bm->bm_data[4+i];
dbits += bm->bm_w;
}
bm->bm_data=decodebuf;
bm->bm_data=cockpitbuf;
}
bm->bm_flags &= ~BM_FLAG_RLE;
bm->bm_flags &= ~BM_FLAG_RLE_BIG;