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
+3 -7
View File
@@ -681,13 +681,9 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
if(gbPixelDepth==16)
{
// BLIT HERE
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
UnLockVideoSurface(FRAME_BUFFER);
UnLockVideoSurface(guiSAVEBUFFER);
+2 -6
View File
@@ -9048,12 +9048,8 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
// clip to view region
ClipBlitsToMapViewRegionForRectangleAndABit( uiDestPitchBYTES );
if(gbPixelDepth==16)
{
// DB Need to add a radar color for 8-bit
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + UI_MAP.GridSize.iX, sScreenY + UI_MAP.GridSize.iY - 1, usLineColor, pDestBuf );
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + UI_MAP.GridSize.iX + 1 + 1, sScreenY + UI_MAP.GridSize.iY + 1 - 1 );
}
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + UI_MAP.GridSize.iX, sScreenY + UI_MAP.GridSize.iY - 1, usLineColor, pDestBuf );
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + UI_MAP.GridSize.iX + 1 + 1, sScreenY + UI_MAP.GridSize.iY + 1 - 1 );
RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES );
UnLockVideoSurface( FRAME_BUFFER );
+3 -16
View File
@@ -461,14 +461,7 @@ BOOLEAN InitializeTacticalInterface( )
// failing the CHECKF after this will cause you to lose your mouse
if ( GETPIXELDEPTH() == 8 )
{
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT_8.pcx" );
}
else if ( GETPIXELDEPTH() == 16 )
{
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" );
}
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" );
if( !AddVideoSurface( &vs_desc, &guiINTEXT ) )
AssertMsg( 0, "Missing INTERFACE\\In_text.sti");
@@ -3562,10 +3555,7 @@ void DrawBarsInUIBox( SOLDIERTYPE *pSoldier , INT16 sXPos, INT16 sYPos, INT16 sW
}
if ( pSoldier->ubID == gusSelectedSoldier )
{
if(gbPixelDepth==16)
RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf);
else
RectangleDraw8( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color8, pDestBuf);
RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf);
}
}
@@ -5812,10 +5802,7 @@ void DrawBar( INT32 x, INT32 y, INT32 width, INT32 height, UINT16 color8, UINT16
{
for( INT32 i=0; i < height; i++ )
{
if(gbPixelDepth==16)
LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf );
else if(gbPixelDepth==8)
LineDraw8( TRUE, x, y+i, x+width-1, y+i, color8, pDestBuf );
LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf );
}
}
}
+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
+1 -22
View File
@@ -15,8 +15,6 @@
extern BOOLEAN GetCDromDriveLetter( STR8 pString );
#define DATA_8_BIT_DIR "8-Bit\\"
BOOLEAN PerformTimeLimitedCheck();
// WANNE: Given a string, replaces all instances of "oldpiece" with "newpiece"
@@ -97,26 +95,7 @@ BOOLEAN PerformTimeLimitedCheck();
//#define TIME_LIMITED_VERSION
void FilenameForBPP(STR pFilename, STR pDestination)
{
CHAR8 Drive[128], Dir[128], Name[128], Ext[128];
if(GETPIXELDEPTH()==16)
{
// no processing for 16 bit names
strcpy(pDestination, pFilename);
}
else
{
_splitpath(pFilename, Drive, Dir, Name, Ext);
strcat(Name, "_8");
strcpy(pDestination, Drive);
//strcat(pDestination, Dir);
strcat(pDestination, DATA_8_BIT_DIR);
strcat(pDestination, Name);
strcat(pDestination, Ext);
}
strcpy(pDestination, pFilename);
}
BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColFile )
-2
View File
@@ -5,8 +5,6 @@
#include "sgp.h"
#define GETPIXELDEPTH( ) ( gbPixelDepth )
// WANNE: Maximum number of characters in german description (German xml files)
#define MAXLINE 200
@@ -42,10 +42,5 @@ namespace ja2xp
UINT32 UnpackETRLEImageToBuffer(UINT8 *pBuffer, image_type *pImage, UINT16 ueETRLEIndex);
UINT32 UnpackETRLEImageToRGBABuffer(UINT8 *pBuffer, image_type *pImage, UINT16 ueETRLEIndex);
/**
* NOTE: implemented in msvc inline assembler
* does not work with gcc -> use 'UnpackETRLEImageToBuffer'
*/
BOOLEAN Blt8BPPDataTo8BPPBuffer( UINT8 *pBuffer, UINT32 uiDestPitchBYTES, image_type *hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
};
#endif // _STCI_IMAGE_UTILS_H_
+35 -120
View File
@@ -794,10 +794,7 @@ BOOLEAN InitializeButtonImageManager(INT32 DefaultBuffer, INT32 DefaultPitch, IN
return(FALSE);
}
if(GETPIXELDEPTH()==16)
GenericButtonFillColors[0]=GenericButtonOffNormal[0]->p16BPPPalette[Pix];
else if(GETPIXELDEPTH()==8)
GenericButtonFillColors[0]=COLOR_DKGREY;
GenericButtonFillColors[0]=GenericButtonOffNormal[0]->p16BPPPalette[Pix];
return(TRUE);
}
@@ -3689,145 +3686,63 @@ void DrawGenericButton(GUI_BUTTON *b)
else
ImgNum=1;
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)(b->XLoc + (q*iBorderWidth)),
(INT32)b->YLoc,
(UINT16)ImgNum, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)(b->XLoc + (q*iBorderWidth)),
(INT32)b->YLoc,
(UINT16)ImgNum, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)(b->XLoc + (q*iBorderWidth)),
(INT32)b->YLoc,
(UINT16)ImgNum, &ClipRect );
if(q==0)
ImgNum=5;
else
ImgNum=6;
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)(b->XLoc + (q*iBorderWidth)),
cy, (UINT16)ImgNum, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip((UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)(b->XLoc + (q*iBorderWidth)),
cy, (UINT16)ImgNum, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)(b->XLoc + (q*iBorderWidth)),
cy, (UINT16)ImgNum, &ClipRect );
}
// Blit the right side corners
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)b->YLoc,
2, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)b->YLoc,
2, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)b->YLoc,
2, &ClipRect );
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, cy, 7, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, cy, 7, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, cy, 7, &ClipRect );
// Draw the vertical members of the button's borders
NumChunksHigh--;
if(hremain!=0)
{
q=NumChunksHigh;
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)b->XLoc,
(INT32)(b->YLoc + (q*iBorderHeight) - (iBorderHeight-hremain)),
3, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)b->XLoc,
(INT32)(b->YLoc + (q*iBorderHeight) - (iBorderHeight-hremain)),
3, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)b->XLoc,
(INT32)(b->YLoc + (q*iBorderHeight) - (iBorderHeight-hremain)),
3, &ClipRect );
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)(b->YLoc + (q*iBorderHeight) - (iBorderHeight-hremain)),
4, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip((UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)(b->YLoc + (q*iBorderHeight) - (iBorderHeight-hremain)),
4, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)(b->YLoc + (q*iBorderHeight) - (iBorderHeight-hremain)),
4, &ClipRect );
}
for(q=1;q<NumChunksHigh;q++)
{
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)b->XLoc,
(INT32)(b->YLoc + (q*iBorderHeight)),
3, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip((UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)b->XLoc,
(INT32)(b->YLoc + (q*iBorderHeight)),
3, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
(INT32)b->XLoc,
(INT32)(b->YLoc + (q*iBorderHeight)),
3, &ClipRect );
if(gbPixelDepth==16)
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)(b->YLoc + (q*iBorderHeight)),
4, &ClipRect );
}
else if(gbPixelDepth==8)
{
Blt8BPPDataTo8BPPBufferTransparentClip((UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)(b->YLoc + (q*iBorderHeight)),
4, &ClipRect );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf,
uiDestPitchBYTES, BPic,
cx, (INT32)(b->YLoc + (q*iBorderHeight)),
4, &ClipRect );
}
// Unlock buffer
+7 -63
View File
@@ -1042,15 +1042,7 @@ UINT8 *pDestBuf;
desty+=GetHeight(FontObjs[FontDefault], transletter);
}
// Blit directly
if ( gbPixelDepth == 8 )
{
Blt8BPPDataTo8BPPBufferMonoShadowClip(pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground8, FontBackground8);
}
else
{
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
}
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
destx+=GetWidth(FontObjs[FontDefault], transletter);
}
@@ -1156,15 +1148,7 @@ UINT8 *pDestBuf;
desty+=GetHeight(FontObjs[FontDefault], transletter);
}
// Blit directly
if ( gbPixelDepth == 8 )
{
Blt8BPPDataTo8BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
}
else
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
destx+=GetWidth(FontObjs[FontDefault], transletter);
}
@@ -1214,15 +1198,7 @@ UINT8 *pDestBuf;
desty+=GetHeight(FontObjs[FontDefault], transletter);
}
// Blit directly
if ( gbPixelDepth == 8 )
{
Blt8BPPDataTo8BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
}
else
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
destx+=GetWidth(FontObjs[FontDefault], transletter);
}
@@ -1271,15 +1247,7 @@ CHAR16 string[512];
desty+=GetHeight(FontObjs[FontType], transletter);
}
// Blit directly
if ( gbPixelDepth == 8 )
{
Blt8BPPDataTo8BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
}
else
{
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
}
Blt8BPPDataTo16BPPBufferTransparentClip( (UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion );
destx+=GetWidth(FontObjs[FontType], transletter);
}
@@ -1323,15 +1291,7 @@ CHAR16 string[512];
desty+=GetHeight(FontObjs[FontDefault], transletter);
}
// Blit directly
if ( gbPixelDepth == 8 )
{
Blt8BPPDataTo8BPPBufferMonoShadowClip(pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground8, FontBackground8);
}
else
{
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
}
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
destx+=GetWidth(FontObjs[FontDefault], transletter);
}
@@ -1390,15 +1350,7 @@ UINT16 usOldForeColor;
desty+=GetHeight(FontObjs[FontDefault], transletter);
}
// Blit directly
if ( gbPixelDepth == 8 )
{
Blt8BPPDataTo8BPPBufferMonoShadowClip(pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground8, FontBackground8);
}
else
{
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
}
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
destx+=GetWidth(FontObjs[FontDefault], transletter);
}
@@ -1469,15 +1421,7 @@ UINT8 *pDestBuf;
return 0;
}
// Blit directly
if ( gbPixelDepth == 8 )
{
Blt8BPPDataTo8BPPBufferMonoShadowClip(pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground8, FontBackground8);
}
else
{
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
}
Blt8BPPDataTo16BPPBufferMonoShadowClip((UINT16*)pDestBuf, uiDestPitchBYTES, FontObjs[FontDefault], destx, desty, transletter, &FontDestRegion, FontForeground16, FontBackground16, FontShadow16 );
destx+=GetWidth(FontObjs[FontDefault], transletter);
}
-260
View File
@@ -30,11 +30,6 @@ void DrawHorizontalRun(UINT8 **ScreenPtr, int XAdvance, int RunLength,
void DrawVerticalRun(UINT8 **ScreenPtr, int XAdvance, int RunLength,
int Color, int ScreenWidth);
void DrawHorizontalRun8(UINT8 **ScreenPtr, int XAdvance,
int RunLength, int Color, int ScreenWidth);
void DrawVerticalRun8(UINT8 **ScreenPtr, int XAdvance,
int RunLength, int Color, int ScreenWidth);
void SetClippingRegionAndImageWidth(
int iImageWidth,
@@ -426,258 +421,3 @@ void RectangleDraw( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, shor
LineDraw( fClip, XStart, YStart, XStart, YEnd, Color, ScreenPtr);
LineDraw( fClip, XEnd, YStart, XEnd, YEnd, Color, ScreenPtr);
}
/***********************************************************************************
* 8-Bit Versions
*
*
*
* Added by Derek Beland
***********************************************************************************/
/* Draws a rectangle between the specified endpoints in color Color. */
void RectangleDraw8( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Color, UINT8 *ScreenPtr)
{
LineDraw8( fClip, XStart, YStart, XEnd, YStart, Color, ScreenPtr);
LineDraw8( fClip, XStart, YEnd, XEnd, YEnd, Color, ScreenPtr);
LineDraw8( fClip, XStart, YStart, XStart, YEnd, Color, ScreenPtr);
LineDraw8( fClip, XEnd, YStart, XEnd, YEnd, Color, ScreenPtr);
}
/* Draws a line between the specified endpoints in color Color. */
void LineDraw8( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Color, UINT8 *ScreenPtr)
{
int Temp, AdjUp, AdjDown, ErrorTerm, XAdvance, XDelta, YDelta;
int WholeStep, InitialPixelCount, FinalPixelCount, i, RunLength;
int ScreenWidth = giImageWidth;
UINT8 col1 = Color & 0x00FF;
if ( fClip )
{
if ( !Clip2D( &XStart, &YStart, &XEnd, &YEnd ) )
return;
}
/* We'll always draw top to bottom, to reduce the number of cases we have to
handle, and to make lines between the same endpoints draw the same pixels */
if (YStart > YEnd) {
Temp = YStart;
YStart = YEnd;
YEnd = Temp;
Temp = XStart;
XStart = XEnd;
XEnd = Temp;
}
// point to the bitmap address first pixel to draw
ScreenPtr = ScreenPtr + YStart*giImageWidth + XStart;
/* Figure out whether we're going left or right, and how far we're
going horizontally */
if ((XDelta = XEnd - XStart) < 0)
{
XAdvance = -1;
XDelta = -XDelta;
}
else
{
XAdvance = 1;
}
/* Figure out how far we're going vertically */
YDelta = YEnd - YStart;
/* Special-case horizontal, vertical, and diagonal lines, for speed
and to avoid nasty boundary conditions and division by 0 */
if (XDelta == 0)
{
/* Vertical line */
for (i=0; i<=YDelta; i++)
{
*ScreenPtr = col1;
ScreenPtr += giImageWidth;
}
return;
}
if (YDelta == 0)
{
/* Horizontal line */
for (i=0; i<=XDelta; i++)
{
*ScreenPtr = col1;
ScreenPtr += XAdvance;
}
return;
}
if (XDelta == YDelta)
{
/* Diagonal line */
for (i=0; i<=XDelta; i++)
{
*ScreenPtr = col1;
ScreenPtr += (XAdvance + giImageWidth);
}
return;
}
/* Determine whether the line is X or Y major, and handle accordingly */
if (XDelta >= YDelta)
{
/* X major line */
/* Minimum # of pixels in a run in this line */
WholeStep = XDelta / YDelta;
/* Error term adjust each time Y steps by 1; used to tell when one
extra pixel should be drawn as part of a run, to account for
fractional steps along the X axis per 1-pixel steps along Y */
AdjUp = (XDelta % YDelta) * 2;
/* Error term adjust when the error term turns over, used to factor
out the X step made at that time */
AdjDown = YDelta * 2;
/* Initial error term; reflects an initial step of 0.5 along the Y
axis */
ErrorTerm = (XDelta % YDelta) - (YDelta * 2);
/* The initial and last runs are partial, because Y advances only 0.5
for these runs, rather than 1. Divide one full run, plus the
initial pixel, between the initial and last runs */
InitialPixelCount = (WholeStep / 2) + 1;
FinalPixelCount = InitialPixelCount;
/* If the basic run length is even and there's no fractional
advance, we have one pixel that could go to either the initial
or last partial run, which we'll arbitrarily allocate to the
last run */
if ((AdjUp == 0) && ((WholeStep & 0x01) == 0))
{
InitialPixelCount--;
}
/* If there're an odd number of pixels per run, we have 1 pixel that can't
be allocated to either the initial or last partial run, so we'll add 0.5
to error term so this pixel will be handled by the normal full-run loop */
if ((WholeStep & 0x01) != 0)
{
ErrorTerm += YDelta;
}
/* Draw the first, partial run of pixels */
DrawHorizontalRun8(&ScreenPtr, XAdvance, InitialPixelCount, Color, ScreenWidth);
/* Draw all full runs */
for (i=0; i<(YDelta-1); i++)
{
RunLength = WholeStep; /* run is at least this long */
/* Advance the error term and add an extra pixel if the error
term so indicates */
if ((ErrorTerm += AdjUp) > 0)
{
RunLength++;
ErrorTerm -= AdjDown; /* reset the error term */
}
/* Draw this scan line's run */
DrawHorizontalRun8(&ScreenPtr, XAdvance, RunLength, Color, ScreenWidth);
}
/* Draw the final run of pixels */
DrawHorizontalRun8(&ScreenPtr, XAdvance, FinalPixelCount, Color, ScreenWidth);
return;
}
else
{
/* Y major line */
/* Minimum # of pixels in a run in this line */
WholeStep = YDelta / XDelta;
/* Error term adjust each time X steps by 1; used to tell when 1 extra
pixel should be drawn as part of a run, to account for
fractional steps along the Y axis per 1-pixel steps along X */
AdjUp = (YDelta % XDelta) * 2;
/* Error term adjust when the error term turns over, used to factor
out the Y step made at that time */
AdjDown = XDelta * 2;
/* Initial error term; reflects initial step of 0.5 along the X axis */
ErrorTerm = (YDelta % XDelta) - (XDelta * 2);
/* The initial and last runs are partial, because X advances only 0.5
for these runs, rather than 1. Divide one full run, plus the
initial pixel, between the initial and last runs */
InitialPixelCount = (WholeStep / 2) + 1;
FinalPixelCount = InitialPixelCount;
/* If the basic run length is even and there's no fractional advance, we
have 1 pixel that could go to either the initial or last partial run,
which we'll arbitrarily allocate to the last run */
if ((AdjUp == 0) && ((WholeStep & 0x01) == 0))
{
InitialPixelCount--;
}
/* If there are an odd number of pixels per run, we have one pixel
that can't be allocated to either the initial or last partial
run, so we'll add 0.5 to the error term so this pixel will be
handled by the normal full-run loop */
if ((WholeStep & 0x01) != 0)
{
ErrorTerm += XDelta;
}
/* Draw the first, partial run of pixels */
DrawVerticalRun8(&ScreenPtr, XAdvance, InitialPixelCount, Color, ScreenWidth);
/* Draw all full runs */
for (i=0; i<(XDelta-1); i++)
{
RunLength = WholeStep; /* run is at least this long */
/* Advance the error term and add an extra pixel if the error
term so indicates */
if ((ErrorTerm += AdjUp) > 0)
{
RunLength++;
ErrorTerm -= AdjDown; /* reset the error term */
}
/* Draw this scan line's run */
DrawVerticalRun8(&ScreenPtr, XAdvance, RunLength, Color, ScreenWidth);
}
/* Draw the final run of pixels */
DrawVerticalRun8(&ScreenPtr, XAdvance, FinalPixelCount, Color, ScreenWidth);
return;
}
}
/* Draws a horizontal run of pixels, then advances the bitmap pointer to
the first pixel of the next run. */
void DrawHorizontalRun8(UINT8 **ScreenPtr, int XAdvance,
int RunLength, int Color, int ScreenWidth)
{
int i;
UINT8 *WorkingScreenPtr = *ScreenPtr;
UINT8 col1 = Color & 0x00FF;
for (i=0; i<RunLength; i++)
{
*WorkingScreenPtr = col1;
WorkingScreenPtr += XAdvance;
}
/* Advance to the next scan line */
WorkingScreenPtr += giImageWidth;
*ScreenPtr = WorkingScreenPtr;
}
/* Draws a vertical run of pixels, then advances the bitmap pointer to
the first pixel of the next run. */
void DrawVerticalRun8(UINT8 **ScreenPtr, int XAdvance,
int RunLength, int Color, int ScreenWidth)
{
int i;
UINT8 *WorkingScreenPtr = *ScreenPtr;
UINT8 col1 = Color & 0x00FF;
for (i=0; i<RunLength; i++)
{
*WorkingScreenPtr = col1;
WorkingScreenPtr += giImageWidth;
}
/* Advance to the next column */
WorkingScreenPtr += XAdvance;
*ScreenPtr = WorkingScreenPtr;
}
-2
View File
@@ -63,9 +63,7 @@ void PixelAlterColour( BOOLEAN fClip, INT32 xp, INT32 yp, INT16 sColor, UINT8 *p
void LineDraw( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Color, UINT8 *ScreenPtr);
void LineDraw( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Color, UINT8 *ScreenPtr);
void LineDraw8( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Color, UINT8 *ScreenPtr);
void RectangleDraw( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Color, UINT8 *ScreenPtr);
void RectangleDraw8( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Color, UINT8 *ScreenPtr);
// *****************************************************************************
-5
View File
@@ -175,9 +175,6 @@ CHAR8 gzCommandLine[100]; // Command line given
CHAR8 gzErrorMsg[2048]="";
BOOLEAN gfIgnoreMessages=FALSE;
// GLOBAL VARIBLE, SET TO DEFAULT BUT CAN BE CHANGED BY THE GAME IF INIT FILE READ
UINT8 gbPixelDepth = PIXEL_DEPTH;
INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam)
{
@@ -1195,8 +1192,6 @@ void GetRuntimeSettings( )
iResY = iResY - 70;
}
// Adjust again
gbPixelDepth = PIXEL_DEPTH;
SCREEN_WIDTH = iResX;
SCREEN_HEIGHT = iResY;
-1
View File
@@ -15,7 +15,6 @@ extern "C" {
extern BOOLEAN gfProgramIsRunning; // Turn this to FALSE to exit program
extern CHAR8 gzCommandLine[100]; // Command line given
extern UINT8 gbPixelDepth; // GLOBAL RUN-TIME SETTINGS
extern BOOLEAN gfDontUseDDBlits; // GLOBAL FOR USE OF DD BLITTING
+2 -7
View File
@@ -356,7 +356,7 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void *
//
if( 0==iScreenMode ) /* Fullscreen mode */
{
ReturnCode = IDirectDraw2_SetDisplayMode( gpDirectDrawObject, SCREEN_WIDTH, SCREEN_HEIGHT, gbPixelDepth, 0, 0 );
ReturnCode = IDirectDraw2_SetDisplayMode( gpDirectDrawObject, SCREEN_WIDTH, SCREEN_HEIGHT, PIXEL_DEPTH, 0, 0 );
if (ReturnCode != DD_OK)
{
IDirectDraw2_SetCooperativeLevel(gpDirectDrawObject, ghWindow, DDSCL_NORMAL);
@@ -372,7 +372,7 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void *
gusScreenWidth = SCREEN_WIDTH;
gusScreenHeight = SCREEN_HEIGHT;
gubScreenPixelDepth = gbPixelDepth;
gubScreenPixelDepth = PIXEL_DEPTH;
/////////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -2756,11 +2756,6 @@ BOOLEAN GetRGBDistribution(void)
Assert ( gpPrimarySurface != NULL );
// ONLY DO IF WE ARE IN 16BIT MODE
if ( gbPixelDepth == 8 )
{
return( TRUE );
}
ZEROMEM(SurfaceDescription);
SurfaceDescription.dwSize = sizeof (DDSURFACEDESC);
+15 -37
View File
@@ -959,45 +959,23 @@ BOOLEAN BltVideoObjectToBuffer( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJE
// Switch based on flags given
do
{
if(gbPixelDepth==16)
if ( fBltFlags & VO_BLT_SRCTRANSPARENCY )
{
if ( fBltFlags & VO_BLT_SRCTRANSPARENCY )
{
if(BltIsClipped(hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect))
Blt8BPPDataTo16BPPBufferTransparentClip( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect);
else
Blt8BPPDataTo16BPPBufferTransparent( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex );
break;
}
else if ( fBltFlags & VO_BLT_SHADOW )
{
if(BltIsClipped(hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect))
Blt8BPPDataTo16BPPBufferShadowClip( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect);
else
Blt8BPPDataTo16BPPBufferShadow( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex );
break;
}
if(BltIsClipped(hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect))
Blt8BPPDataTo16BPPBufferTransparentClip( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect);
else
Blt8BPPDataTo16BPPBufferTransparent( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex );
break;
}
else if ( fBltFlags & VO_BLT_SHADOW )
{
if(BltIsClipped(hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect))
Blt8BPPDataTo16BPPBufferShadowClip( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect);
else
Blt8BPPDataTo16BPPBufferShadow( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex );
break;
}
}
else if(gbPixelDepth==8)
{
if ( fBltFlags & VO_BLT_SRCTRANSPARENCY )
{
if(BltIsClipped(hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect))
Blt8BPPDataTo8BPPBufferTransparentClip( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect);
else
Blt8BPPDataTo8BPPBufferTransparent( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex );
break;
}
else if ( fBltFlags & VO_BLT_SHADOW )
{
if(BltIsClipped(hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect))
Blt8BPPDataTo8BPPBufferShadowClip( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect);
else
Blt8BPPDataTo8BPPBufferShadow( pBuffer, uiDestPitchBYTES, hSrcVObject, iDestX, iDestY, usIndex );
break;
}
}
// Use default blitter here
//Blt8BPPDataTo16BPPBuffer( hDestVObject, hSrcVObject, (UINT16)iDestX, (UINT16)iDestY, (SGPRect*)&SrcRect );
File diff suppressed because it is too large Load Diff
+1 -56
View File
@@ -53,50 +53,9 @@ CHAR8 BltIsClippedOrOffScreen( HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16
UINT16 *InitZBuffer(UINT32 uiPitch, UINT32 uiHeight);
BOOLEAN ShutdownZBuffer(UINT16 *pBuffer);
// 8-Bit to 8-Bit Blitters
//BOOLEAN Blt8BPPDataTo8BPPBufferTransZIncClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferTransZNBColor( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, UINT8 ubColor);
BOOLEAN Blt8BPPDataTo8BPPBufferTransZNBClipColor( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion, UINT8 ubColor);
// pixelation blitters
BOOLEAN Blt8BPPDataTo8BPPBufferTransZPixelate( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferTransZClipPixelate( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferTransZNBPixelate( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferTransZNBClipPixelate( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferMonoShadowClip( UINT8 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion, UINT8 ubForeground, UINT8 ubBackground);
BOOLEAN Blt8BPPDataTo8BPPBufferTransparent( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferTransparentClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo16BPPBufferTransMirror( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferTransZ( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferTransZNB( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferTransZClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferTransZNBClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferShadowZ( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferShadowZNB( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBufferShadowZClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferShadowZNBClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferTransShadowZ( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, UINT16 *p16BPPPalette );
BOOLEAN Blt8BPPDataTo8BPPBufferTransShadowZNB( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, UINT16 *p16BPPPalette );
BOOLEAN Blt8BPPDataTo8BPPBufferTransShadowZClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion, UINT16 *p16BPPPalette );
BOOLEAN Blt8BPPDataTo8BPPBufferTransShadowZNBClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion, UINT16 *p16BPPPalette );
BOOLEAN Blt8BPPDataTo8BPPBufferShadowClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo8BPPBufferShadow( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo8BPPBuffer( UINT8 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
// 8-Bit to 16-Bit Blitters
BOOLEAN Blt8BPPDataTo16BPPBufferTransMirror( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo16BPPBufferTransZNBColor( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, UINT16 usColor);
BOOLEAN Blt8BPPDataTo16BPPBufferTransZNBClipColor( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion, UINT16 usColor);
@@ -152,19 +111,13 @@ BOOLEAN Blt8BPPDataTo16BPPBufferTransShadow(UINT16 *pBuffer, UINT32 uiDestPitchB
BOOLEAN Blt8BPPDataTo16BPPBufferTransShadowAlpha(UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, HVOBJECT hAlphaVObject, INT32 iX, INT32 iY, UINT16 usIndex, UINT16 *p16BPPPalette, BOOLEAN fIgnoreShadows);
BOOLEAN Blt8BPPDataTo16BPPBufferShadowClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN DDBlt8BPPDataTo16BPPBufferShadow( HVOBJECT hDestVObject, HVOBJECT hSrcVObject, UINT8 level, COLORVAL maskrgb, UINT16 usX, UINT16 usY, SGPRect *srcRect);
BOOLEAN Blt8BPPTo8BPP(UINT8 *pDest, UINT32 uiDestPitch, UINT8 *pSrc, UINT32 uiSrcPitch, INT32 iDestXPos, INT32 iDestYPos, INT32 iSrcXPos, INT32 iSrcYPos, UINT32 uiWidth, UINT32 uiHeight);
BOOLEAN Blt16BPPTo16BPP(UINT16 *pDest, UINT32 uiDestPitch, UINT16 *pSrc, UINT32 uiSrcPitch, INT32 iDestXPos, INT32 iDestYPos, INT32 iSrcXPos, INT32 iSrcYPos, UINT32 uiWidth, UINT32 uiHeight);
BOOLEAN Blt16BPPTo16BPPTrans(UINT16 *pDest, UINT32 uiDestPitch, UINT16 *pSrc, UINT32 uiSrcPitch, INT32 iDestXPos, INT32 iDestYPos, INT32 iSrcXPos, INT32 iSrcYPos, UINT32 uiWidth, UINT32 uiHeight, UINT16 usTrans);
BOOLEAN Blt16BPPTo16BPPTransShadow(UINT16 *pDest, UINT32 uiDestPitch, UINT16 *pSrc, UINT32 uiSrcPitch, INT32 iDestXPos, INT32 iDestYPos, INT32 iSrcXPos, INT32 iSrcYPos, UINT32 uiWidth, UINT32 uiHeight, UINT16 usTrans);
BOOLEAN Blt16BPPTo16BPPFog(UINT16 *pDest, UINT32 uiDestPitch, UINT16 *pSrc, UINT32 uiSrcPitch, INT32 iDestXPos, INT32 iDestYPos, INT32 iSrcXPos, INT32 iSrcYPos, UINT32 uiWidth, UINT32 uiHeight, UINT8 *pFog, UINT16 usFogPitch);
BOOLEAN Blt16BPPTo16BPPMirror(UINT16 *pDest, UINT32 uiDestPitch, UINT16 *pSrc, UINT32 uiSrcPitch, INT32 iDestXPos, INT32 iDestYPos, INT32 iSrcXPos, INT32 iSrcYPos, UINT32 uiWidth, UINT32 uiHeight);
BOOLEAN Blt8BPPDataTo16BPPBufferFogZ( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo16BPPBufferFogZClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo16BPPBufferFogZNB( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN Blt8BPPDataTo16BPPBufferFogZNBClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt16BPPBufferPixelateRectWithColor( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, SGPRect *area, UINT8 Pattern[8][8], UINT16 usColor );
BOOLEAN Blt16BPPBufferPixelateRect(UINT16 *pBuffer, UINT32 uiDestPitchBYTES, SGPRect *area, UINT8 Pattern[8][8]);
@@ -186,12 +139,6 @@ BOOLEAN Blt8BPPDataSubTo16BPPBuffer( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, H
BOOLEAN Blt8BPPDataTo16BPPBufferHalf( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVSURFACE hSrcVSurface, UINT8 *pSrcBuffer, UINT32 uiSrcPitch, INT32 iX, INT32 iY);
BOOLEAN Blt8BPPDataTo16BPPBufferHalfRect( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVSURFACE hSrcVSurface, UINT8 *pSrcBuffer, UINT32 uiSrcPitch, INT32 iX, INT32 iY, SGPRect *pRect);
BOOLEAN DDBlt8BPPDataTo16BPPBuffer( HVOBJECT hDestVObject, HVOBJECT hSrcVObject, UINT16 usX, UINT16 usY, SGPRect *srcRect );
BOOLEAN DDBlt8BPPDataTo16BPPBufferFullTransparent( HVOBJECT hDestVObject, HVOBJECT hSrcVObject, UINT16 usX, UINT16 usY, SGPRect *srcRect );
BOOLEAN DDFillSurface( HVOBJECT hDestVObject, blt_fx *pBltFx );
BOOLEAN DDFillSurfaceRect( HVOBJECT hDestVObject, blt_fx *pBltFx );
BOOLEAN BltVObjectUsingDD( HVOBJECT hDestVObject, HVOBJECT hSrcVObject, UINT32 fBltFlags, INT32 iDestX, INT32 iDestY, RECT *SrcRect );
BOOLEAN BlitZRect(UINT16 *pZBuffer, UINT32 uiPitch, INT16 sLeft, INT16 sTop, INT16 sRight, INT16 sBottom, UINT16 usZValue);
@@ -202,7 +149,6 @@ BOOLEAN Blt32BPPTo16BPPTransShadow(UINT16 *pDest, UINT32 uiDestPitch, UINT32 *pS
BOOLEAN Blt16BPPDataTo16BPPBufferTransparentClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt16BPPDataTo16BPPBufferTransZClip( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt16BPPDataTo16BPPBufferTransparent( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
// ATE: New blitters for showing an outline at color 254
BOOLEAN Blt8BPPDataTo16BPPBufferOutline( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, INT16 s16BPPColor, BOOLEAN fDoOutline );
@@ -226,7 +172,6 @@ BOOLEAN Blt8BPPDataTo16BPPBufferTransShadowZNBObscuredClipAlpha(UINT16 *pBuffer,
BOOLEAN Blt8BPPDataTo16BPPBufferTransZClipPixelateObscured( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex, SGPRect *clipregion);
BOOLEAN Blt8BPPDataTo16BPPBufferTransZPixelateObscured( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex );
BOOLEAN FillRect8BPP(UINT8 *pBuffer, UINT32 uiDestPitchBYTES, INT32 x1, INT32 y1, INT32 x2, INT32 y2, UINT8 color);
BOOLEAN FillRect16BPP(UINT16 *pBuffer, UINT32 uiDestPitchBYTES, INT32 x1, INT32 y1, INT32 x2, INT32 y2, UINT16 color);
/*