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:
parent
b914c8dc2f
commit
54be20c5e1
|
@ -4,6 +4,7 @@ D2X-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
|
||||
--------
|
||||
|
|
|
@ -506,7 +506,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])
|
||||
|
@ -960,7 +960,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);
|
||||
|
||||
|
|
|
@ -793,11 +793,10 @@ void toggle_cockpit()
|
|||
|
||||
int last_drawn_cockpit = -1;
|
||||
extern void ogl_loadbmtexture(grs_bitmap *bm);
|
||||
|
||||
// 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;
|
||||
|
||||
|
@ -807,6 +806,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;
|
||||
|
@ -816,7 +816,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);
|
||||
|
@ -826,7 +826,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;
|
||||
|
|
Loading…
Reference in a new issue