Unverified Commit 552e619e authored by trioan's avatar trioan Committed by GitHub
Browse files

fix superclip renderer

Include world center point. Fixes Warbirds horizon.
parent f6c92c91
......@@ -649,8 +649,8 @@ ULONG CSusie::PaintSprites(void)
int screen_v_start=(SWORD)mVOFF.Word;
int screen_v_end=(SWORD)mVOFF.Word+SCREEN_HEIGHT;
int world_h_mid=screen_h_start+0x8000+(SCREEN_WIDTH/2);
int world_v_mid=screen_v_start+0x8000+(SCREEN_HEIGHT/2);
int world_h_mid=screen_h_start+(SCREEN_WIDTH/2);
int world_v_mid=screen_v_start+(SCREEN_HEIGHT/2);
TRACE_SUSIE2("PaintSprites() screen_h_start $%04x screen_h_end $%04x",screen_h_start,screen_h_end);
TRACE_SUSIE2("PaintSprites() screen_v_start $%04x screen_v_end $%04x",screen_v_start,screen_v_end);
......@@ -672,7 +672,7 @@ ULONG CSusie::PaintSprites(void)
// Check ref is inside screen area
if((SWORD)mHPOSSTRT.Word<screen_h_start || (SWORD)mHPOSSTRT.Word>=screen_h_end ||
(SWORD)mVPOSSTRT.Word<screen_v_start || (SWORD)mVPOSSTRT.Word>=screen_v_end) superclip=TRUE;
(SWORD)mVPOSSTRT.Word<screen_v_start || (SWORD)mVPOSSTRT.Word>=screen_v_end) superclip=TRUE;
TRACE_SUSIE1("PaintSprites() Superclip=%d",superclip);
......@@ -719,7 +719,7 @@ ULONG CSusie::PaintSprites(void)
// line, BUT on superclip we draw all the way to the end of any
// given line checking each pixel is on screen.
if(superclip & 0) {
if(superclip) {
// Check on the basis of each quad, we only render the quad
// IF the screen is in the quad, relative to the centre of
// the screen which is calculated below.
......@@ -749,16 +749,16 @@ ULONG CSusie::PaintSprites(void)
switch(modquad) {
case 3:
if((sprite_h>=screen_h_start || sprite_h<world_h_mid) && (sprite_v<screen_v_end || sprite_v>world_v_mid)) render=TRUE;
if((sprite_h>=screen_h_start || sprite_h<=world_h_mid) && (sprite_v<screen_v_end || sprite_v>=world_v_mid)) render=TRUE;
break;
case 2:
if((sprite_h>=screen_h_start || sprite_h<world_h_mid) && (sprite_v>=screen_v_start || sprite_v<world_v_mid)) render=TRUE;
if((sprite_h>=screen_h_start || sprite_h<=world_h_mid) && (sprite_v>=screen_v_start || sprite_v<=world_v_mid)) render=TRUE;
break;
case 1:
if((sprite_h<screen_h_end || sprite_h>world_h_mid) && (sprite_v>=screen_v_start || sprite_v<world_v_mid)) render=TRUE;
if((sprite_h<screen_h_end || sprite_h>=world_h_mid) && (sprite_v>=screen_v_start || sprite_v<=world_v_mid)) render=TRUE;
break;
default:
if((sprite_h<screen_h_end || sprite_h>world_h_mid) && (sprite_v<screen_v_end || sprite_v>world_v_mid)) render=TRUE;
if((sprite_h<screen_h_end || sprite_h>=world_h_mid) && (sprite_v<screen_v_end || sprite_v>=world_v_mid)) render=TRUE;
break;
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment