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
b2213b6f2e
commit
483a981d2f
|
@ -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*
|
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/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
|
20081031
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -507,7 +507,7 @@ void ogl_draw_reticle(int cross,int primary,int secondary)
|
||||||
glPushMatrix();
|
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);
|
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.
|
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);
|
OGL_DISABLE(TEXTURE_2D);
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
if (!cross_lh[cross])
|
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);
|
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);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
|
|
||||||
glLineWidth(SHEIGHT/480);
|
glLineWidth(SHEIGHT<480?1:SHEIGHT/480);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
|
|
|
@ -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
|
// 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)
|
void cockpit_decode_alpha(grs_bitmap *bm)
|
||||||
{
|
{
|
||||||
unsigned char decodebuf[1024*1024];
|
|
||||||
int i=0,x=0,y=0;
|
int i=0,x=0,y=0;
|
||||||
static ubyte *cur=NULL;
|
static ubyte *cur=NULL;
|
||||||
|
|
||||||
|
@ -242,6 +241,7 @@ void cockpit_decode_alpha(grs_bitmap *bm)
|
||||||
|
|
||||||
// decode the bitmap
|
// decode the bitmap
|
||||||
if (bm->bm_flags & BM_FLAG_RLE){
|
if (bm->bm_flags & BM_FLAG_RLE){
|
||||||
|
static unsigned char cockpitbuf[1024*1024];
|
||||||
unsigned char * dbits;
|
unsigned char * dbits;
|
||||||
unsigned char * sbits;
|
unsigned char * sbits;
|
||||||
int i, data_offset;
|
int i, data_offset;
|
||||||
|
@ -251,7 +251,7 @@ void cockpit_decode_alpha(grs_bitmap *bm)
|
||||||
data_offset = 2;
|
data_offset = 2;
|
||||||
|
|
||||||
sbits = &bm->bm_data[4 + (bm->bm_h * data_offset)];
|
sbits = &bm->bm_data[4 + (bm->bm_h * data_offset)];
|
||||||
dbits = decodebuf;
|
dbits = cockpitbuf;
|
||||||
|
|
||||||
for (i=0; i < bm->bm_h; i++ ) {
|
for (i=0; i < bm->bm_h; i++ ) {
|
||||||
gr_rle_decode(sbits,dbits);
|
gr_rle_decode(sbits,dbits);
|
||||||
|
@ -261,7 +261,7 @@ void cockpit_decode_alpha(grs_bitmap *bm)
|
||||||
sbits += (int)bm->bm_data[4+i];
|
sbits += (int)bm->bm_data[4+i];
|
||||||
dbits += bm->bm_w;
|
dbits += bm->bm_w;
|
||||||
}
|
}
|
||||||
bm->bm_data=decodebuf;
|
bm->bm_data=cockpitbuf;
|
||||||
}
|
}
|
||||||
bm->bm_flags &= ~BM_FLAG_RLE;
|
bm->bm_flags &= ~BM_FLAG_RLE;
|
||||||
bm->bm_flags &= ~BM_FLAG_RLE_BIG;
|
bm->bm_flags &= ~BM_FLAG_RLE_BIG;
|
||||||
|
|
Loading…
Reference in a new issue