Remove 8bit mode

Obsolete and doesn't work

* Remove gbPixelDepth
* Remove 8-bit to 8-bit blitters
* FileNameForBPP now only calls strcopy
This commit is contained in:
Asdow
2025-02-24 21:42:36 +02:00
parent 9c951adfea
commit fffb3a45fb
20 changed files with 644 additions and 6603 deletions
+71 -94
View File
@@ -493,30 +493,21 @@ void RenderRadarScreen( )
if( !( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) )
{
if(gbPixelDepth==16)
// WANNE: Correct radar rectangle size if it is too large to fit in radar screen [2007-05-14]
if (fAllowRadarMovementHor == FALSE)
{
// WANNE: Correct radar rectangle size if it is too large to fit in radar screen [2007-05-14]
if (fAllowRadarMovementHor == FALSE)
{
sRadarTLX = RADAR_WINDOW_TM_X;
sRadarBRX = RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH;
}
if (fAllowRadarMovementVer == FALSE)
{
sRadarTLY = RADAR_WINDOW_TM_Y;
sRadarBRY = RADAR_WINDOW_TM_Y + RADAR_WINDOW_HEIGHT;
}
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
RectangleDraw( TRUE, sRadarTLX, sRadarTLY, sRadarBRX, sRadarBRY - 1, usLineColor, pDestBuf );
sRadarTLX = RADAR_WINDOW_TM_X;
sRadarBRX = RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH;
}
else if(gbPixelDepth==8)
if (fAllowRadarMovementVer == FALSE)
{
// DB Need to change this to a color from the 8-but standard palette
usLineColor = COLOR_GREEN;
RectangleDraw8( TRUE, sRadarTLX + 1, sRadarTLY + 1, sRadarBRX + 1, sRadarBRY + 1, usLineColor, pDestBuf );
sRadarTLY = RADAR_WINDOW_TM_Y;
sRadarBRY = RADAR_WINDOW_TM_Y + RADAR_WINDOW_HEIGHT;
}
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
RectangleDraw( TRUE, sRadarTLX, sRadarTLY, sRadarBRX, sRadarBRY - 1, usLineColor, pDestBuf );
}
// Cycle fFlash variable
@@ -556,24 +547,20 @@ void RenderRadarScreen( )
sXSoldRadar += RADAR_WINDOW_TM_X;
sYSoldRadar += gsRadarY;
// if we are in 16 bit mode....kind of redundant
if(gbPixelDepth==16)
if( ( fFlashHighLightInventoryItemOnradarMap ) )
{
if( ( fFlashHighLightInventoryItemOnradarMap ) )
{
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
}
else
{
// DB Need to add a radar color for 8-bit
usLineColor = Get16BPPColor( FROMRGB( 255, 255, 255 ) );
}
}
else
{
// DB Need to add a radar color for 8-bit
usLineColor = Get16BPPColor( FROMRGB( 255, 255, 255 ) );
}
if( iCurrentlyHighLightedItem == iCounter )
{
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar + 1, sYSoldRadar + 1, usLineColor, pDestBuf );
}
if( iCurrentlyHighLightedItem == iCounter )
{
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar + 1, sYSoldRadar + 1, usLineColor, pDestBuf );
}
}
}
@@ -632,77 +619,67 @@ void RenderRadarScreen( )
sXSoldRadar += gsRadarX;
sYSoldRadar += gsRadarY;
if(gbPixelDepth==16)
{
// DB Need to add a radar color for 8-bit
// Are we a selected guy?
if ( pSoldier->ubID == gusSelectedSoldier )
// Are we a selected guy?
if ( pSoldier->ubID == gusSelectedSoldier )
{
if ( gfRadarCurrentGuyFlash )
{
if ( gfRadarCurrentGuyFlash )
{
usLineColor = 0;
}
else
{
// If on roof, make darker....
if ( pSoldier->pathing.bLevel > 0 )
{
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
}
else
{
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
}
}
usLineColor = 0;
}
else
{
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
if ( pSoldier->bTeam == CIV_TEAM )
{
// Override civ team with red if hostile...
if ( pSoldier->bSide != gbPlayerNum && !pSoldier->aiData.bNeutral )
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
// if uncovered, different colour (so the player doesn't have to search for us)
else if ( gGameExternalOptions.fKnownNPCsUseDifferentColour && pSoldier->ubProfile != NO_PROFILE && !zHiddenNames[pSoldier->ubProfile].Hidden )
usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) );
}
// Flugente 18-04-15: observed an odd bug: if we play with a release build and see a creature for the first time, their overhead/radar map pins do not have the correct colour.
// Bizarrely enough, the issue seems dependent on the colour value (pink, RGB: 255/0/255) itself.
// Saving and reloading solves the issue, but I am not sure why. As a fix we now use a slightly dampened pink.
if ( pSoldier->bTeam == CREATURE_TEAM )
{
usLineColor = Get16BPPColor( FROMRGB( 247, 0, 247 ) );
}
// Flugente: if we are a (still covert) enemy assassin, colour us like militia, so that the player wont notice us
if ( pSoldier->usSoldierFlagMask & SOLDIER_ASSASSIN && pSoldier->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER )
usLineColor = Get16BPPColor( gTacticalStatus.Team[ MILITIA_TEAM ].RadarColor );
// Render different color if an enemy and he's unconscious
if ( pSoldier->bTeam != gbPlayerNum && pSoldier->stats.bLife < OKLIFE )
{
usLineColor = Get16BPPColor( FROMRGB( 128, 128, 128 ) );
}
// If on roof, make darker....
if ( pSoldier->bTeam == gbPlayerNum && pSoldier->pathing.bLevel > 0 )
if ( pSoldier->pathing.bLevel > 0 )
{
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
}
else
{
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
}
}
}
else
{
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
if ( pSoldier->bTeam == CIV_TEAM )
{
// Override civ team with red if hostile...
if ( pSoldier->bSide != gbPlayerNum && !pSoldier->aiData.bNeutral )
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
// if uncovered, different colour (so the player doesn't have to search for us)
else if ( gGameExternalOptions.fKnownNPCsUseDifferentColour && pSoldier->ubProfile != NO_PROFILE && !zHiddenNames[pSoldier->ubProfile].Hidden )
usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) );
}
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar+1, sYSoldRadar+1, usLineColor, pDestBuf );
}
else if(gbPixelDepth==8)
{
// DB Need to change this to a color from the 8-but standard palette
usLineColor = COLOR_BLUE;
RectangleDraw8( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar+1, sYSoldRadar+1, usLineColor, pDestBuf );
// Flugente 18-04-15: observed an odd bug: if we play with a release build and see a creature for the first time, their overhead/radar map pins do not have the correct colour.
// Bizarrely enough, the issue seems dependent on the colour value (pink, RGB: 255/0/255) itself.
// Saving and reloading solves the issue, but I am not sure why. As a fix we now use a slightly dampened pink.
if ( pSoldier->bTeam == CREATURE_TEAM )
{
usLineColor = Get16BPPColor( FROMRGB( 247, 0, 247 ) );
}
// Flugente: if we are a (still covert) enemy assassin, colour us like militia, so that the player wont notice us
if ( pSoldier->usSoldierFlagMask & SOLDIER_ASSASSIN && pSoldier->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER )
usLineColor = Get16BPPColor( gTacticalStatus.Team[ MILITIA_TEAM ].RadarColor );
// Render different color if an enemy and he's unconscious
if ( pSoldier->bTeam != gbPlayerNum && pSoldier->stats.bLife < OKLIFE )
{
usLineColor = Get16BPPColor( FROMRGB( 128, 128, 128 ) );
}
// If on roof, make darker....
if ( pSoldier->bTeam == gbPlayerNum && pSoldier->pathing.bLevel > 0 )
{
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
}
}
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar+1, sYSoldRadar+1, usLineColor, pDestBuf );
}
}
}
+23 -74
View File
@@ -604,20 +604,9 @@ BOOLEAN UpdateSaveBuffer(void)
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
if(gbPixelDepth==16)
{
// BLIT HERE
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, gsVIEWPORT_WINDOW_START_Y, 0, gsVIEWPORT_WINDOW_START_Y, usWidth, ( gsVIEWPORT_WINDOW_END_Y - gsVIEWPORT_WINDOW_START_Y ) );
}
else if(gbPixelDepth==8)
{
// BLIT HERE
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
pSrcBuf, uiSrcPitchBYTES,
0, gsVIEWPORT_WINDOW_START_Y, 0, gsVIEWPORT_WINDOW_START_Y, usWidth, gsVIEWPORT_WINDOW_END_Y );
}
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, gsVIEWPORT_WINDOW_START_Y, 0, gsVIEWPORT_WINDOW_START_Y, usWidth, ( gsVIEWPORT_WINDOW_END_Y - gsVIEWPORT_WINDOW_START_Y ) );
UnLockVideoSurface(guiRENDERBUFFER);
UnLockVideoSurface(guiSAVEBUFFER);
@@ -643,22 +632,11 @@ BOOLEAN RestoreExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT1
pDestBuf = LockVideoSurface(guiRENDERBUFFER, &uiDestPitchBYTES);
pSrcBuf = LockVideoSurface(guiSAVEBUFFER, &uiSrcPitchBYTES);
if(gbPixelDepth==16)
{
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
}
else if(gbPixelDepth==8)
{
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
}
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
UnLockVideoSurface(guiRENDERBUFFER);
UnLockVideoSurface(guiSAVEBUFFER);
@@ -695,22 +673,11 @@ BOOLEAN RestoreExternBackgroundRectGivenID( INT32 iBack )
pDestBuf = LockVideoSurface(guiRENDERBUFFER, &uiDestPitchBYTES);
pSrcBuf = LockVideoSurface(guiSAVEBUFFER, &uiSrcPitchBYTES);
if(gbPixelDepth==16)
{
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
}
else if(gbPixelDepth==8)
{
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
}
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
UnLockVideoSurface(guiRENDERBUFFER);
UnLockVideoSurface(guiSAVEBUFFER);
@@ -730,22 +697,11 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
if(gbPixelDepth==16)
{
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
}
else if(gbPixelDepth==8)
{
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
}
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
sLeft , sTop,
sLeft , sTop,
sWidth, sHeight);
UnLockVideoSurface(guiSAVEBUFFER);
UnLockVideoSurface(guiRENDERBUFFER);
@@ -1342,18 +1298,11 @@ BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
usHeight = sBottom - sTop;
usWidth = sRight - sLeft;
if(gbPixelDepth==16)
{
Blt16BPPTo16BPP((UINT16 *)(UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)gVideoOverlays[uiCount].pSaveArea, gBackSaves[ iBackIndex ].sWidth*2,
sLeft, sTop,
uiLeftSkip, uiTopSkip,
usWidth, usHeight );
}
else if(gbPixelDepth==8)
{
}
Blt16BPPTo16BPP((UINT16 *)(UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)gVideoOverlays[uiCount].pSaveArea, gBackSaves[ iBackIndex ].sWidth*2,
sLeft, sTop,
uiLeftSkip, uiTopSkip,
usWidth, usHeight );
// Once done, check for pending deletion
if ( gVideoOverlays[uiCount].fDeletionPending )
+1 -2
View File
@@ -1367,8 +1367,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
GetCurrentVideoSettings(&usWidth, &usHeight, &ubBitDepth);
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
if(gbPixelDepth == 16)// BLIT HERE
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, (UINT16 *)pSrcBuf, uiSrcPitchBYTES, 0, 0, 0, 0, usWidth, usHeight);
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, (UINT16 *)pSrcBuf, uiSrcPitchBYTES, 0, 0, 0, 0, usWidth, usHeight);
UnLockVideoSurface(guiRENDERBUFFER);
UnLockVideoSurface(guiSAVEBUFFER);
}
+480 -569
View File
File diff suppressed because it is too large Load Diff