Fixed misuse of gr_bitblt_find_transparent_area() caused rear view to be shifted on some cockpits

This commit is contained in:
zicodxx 2011-09-25 01:01:51 +02:00
parent 0df7146226
commit 80e69421d8
2 changed files with 8 additions and 3 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog
20110925
--------
main/game.c: Fixed misuse of gr_bitblt_find_transparent_area() caused rear view to be shifted on some cockpits
20110924
--------
main/fvi.c, main/gameseg.c, main/object.c: Consistency check for segment number in find_vector_intersection() and obj_create(); Added more debug output for invalid segment numberin get_seg_masks()

View file

@ -213,13 +213,14 @@ void init_cockpit()
break;
case CM_REAR_VIEW:
{ int x = 0, y = 0, w = SWIDTH, h = (SHEIGHT*2)/3;
{
int x1 = 0, y1 = 0, x2 = SWIDTH, y2 = (SHEIGHT*2)/3;
grs_bitmap *bm;
PIGGY_PAGE_IN(cockpit_bitmap[PlayerCfg.CockpitMode[1]]);
bm = &GameBitmaps[cockpit_bitmap[PlayerCfg.CockpitMode[1]].index];
gr_bitblt_find_transparent_area(bm, &x, &y, &w, &h);
game_init_render_sub_buffers(x*((float)SWIDTH/bm->bm_w), y*((float)SHEIGHT/bm->bm_h), w*((float)SWIDTH/bm->bm_w), h*((float)SHEIGHT/bm->bm_h));
gr_bitblt_find_transparent_area(bm, &x1, &y1, &x2, &y2);
game_init_render_sub_buffers(x1*((float)SWIDTH/bm->bm_w), y1*((float)SHEIGHT/bm->bm_h), (x2-x1+1)*((float)SWIDTH/bm->bm_w), (y2-y1+2)*((float)SHEIGHT/bm->bm_h));
break;
}
case CM_FULL_SCREEN: