remove UTIL and JA2 preprocessor definitions (#66)

UTIL is never used, and JA2 is always used. assumption being we'll never make 1.13 for Wizardry 8.

video2.h doesn't exist, which prevented me from deleting it.
This commit is contained in:
majcosta
2023-01-05 20:40:36 +02:00
committed by GitHub
parent 24425a82b1
commit aaa8b094c9
30 changed files with 1 additions and 702 deletions
-55
View File
@@ -2,11 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "debug.h"
#if defined( JA2 ) || defined( UTIL )
#include "video.h"
#else
#include "video2.h"
#endif
#include "himage.h"
#include "vsurface.h"
#include "vsurface_private.h"
@@ -453,7 +449,6 @@ BYTE *LockVideoSurface( UINT32 uiVSurface, UINT32 *puiPitch )
//
// Check if given backbuffer or primary buffer
//
#ifdef JA2
if ( uiVSurface == PRIMARY_SURFACE )
{
return SurfaceData::SetSurfaceData(uiVSurface, (BYTE *)LockPrimarySurface( puiPitch ));
@@ -463,7 +458,6 @@ BYTE *LockVideoSurface( UINT32 uiVSurface, UINT32 *puiPitch )
{
return SurfaceData::SetSurfaceData(uiVSurface, (BYTE *)LockBackBuffer( puiPitch ));
}
#endif
if ( uiVSurface == FRAME_BUFFER )
{
@@ -509,7 +503,6 @@ void UnLockVideoSurface( UINT32 uiVSurface )
//
// Check if given backbuffer or primary buffer
//
#ifdef JA2
if ( uiVSurface == PRIMARY_SURFACE )
{
UnlockPrimarySurface();
@@ -521,7 +514,6 @@ void UnLockVideoSurface( UINT32 uiVSurface )
UnlockBackBuffer();
return;
}
#endif
if ( uiVSurface == FRAME_BUFFER )
{
@@ -680,7 +672,6 @@ BOOLEAN SetPrimaryVideoSurfaces( )
//
// Get Primary surface
//
#ifdef JA2
pSurface = GetPrimarySurfaceObject();
CHECKF( pSurface != NULL );
@@ -709,7 +700,6 @@ BOOLEAN SetPrimaryVideoSurfaces( )
CHECKF( ghMouseBuffer != NULL );
SurfaceData::RegisterSurface(MOUSE_BUFFER,ghMouseBuffer);
#endif
//
// Get frame buffer surface
@@ -990,11 +980,9 @@ HVSURFACE CreateVideoSurface( VSURFACE_DESC *VSurfaceDesc )
UINT8 ubBitDepth;
UINT32 fMemUsage;
//#ifdef JA2
UINT32 uiRBitMask;
UINT32 uiGBitMask;
UINT32 uiBBitMask;
//#endif
//Clear the memory
memset( &SurfaceDescription, 0, sizeof( DDSURFACEDESC ) );
@@ -1008,11 +996,7 @@ HVSURFACE CreateVideoSurface( VSURFACE_DESC *VSurfaceDesc )
//
// The description structure contains memory usage flag
//
#ifdef JA2
fMemUsage = VSurfaceDesc->fCreateFlags;
#else
fMemUsage = VSURFACE_SYSTEM_MEM_USAGE;
#endif
//
// Check creation options
@@ -1110,16 +1094,10 @@ HVSURFACE CreateVideoSurface( VSURFACE_DESC *VSurfaceDesc )
// We're using pixel formats too -- DB/Wiz
//#ifdef JA2
CHECKF( GetPrimaryRGBDistributionMasks( &uiRBitMask, &uiGBitMask, &uiBBitMask ) );
PixelFormat.dwRBitMask = uiRBitMask;
PixelFormat.dwGBitMask = uiGBitMask;
PixelFormat.dwBBitMask = uiBBitMask;
//#else
// PixelFormat.dwRBitMask = 0xf800;
// PixelFormat.dwGBitMask = 0x7e0;
// PixelFormat.dwBBitMask = 0x1f;
//#endif
break;
default:
@@ -1392,10 +1370,6 @@ BYTE *LockVideoSurfaceBuffer( HVSURFACE hVSurface, UINT32 *pPitch )
Assert( hVSurface != NULL );
Assert( pPitch != NULL );
#ifndef JA2
if(hVSurface==ghFrameBuffer)
return(LockFrameBuffer(pPitch));
#endif
DDLockSurface( (LPDIRECTDRAWSURFACE2)hVSurface->pSurfaceData, NULL, &SurfaceDescription, 0, NULL);
@@ -1408,13 +1382,6 @@ void UnLockVideoSurfaceBuffer( HVSURFACE hVSurface )
{
Assert( hVSurface != NULL );
#ifndef JA2
if(hVSurface==ghFrameBuffer)
{
UnlockFrameBuffer();
return;
}
#endif
DDUnlockSurface( (LPDIRECTDRAWSURFACE2)hVSurface->pSurfaceData, NULL );
@@ -2088,28 +2055,6 @@ BOOLEAN BltVideoSurfaceToVideoSurface( HVSURFACE hDestVSurface, HVSURFACE hSrcVS
return(TRUE);
}
// For testing with non-DDraw blitting, uncomment to test -- DB
#ifndef JA2
else
{
if((pSrcSurface16=(UINT16 *)LockVideoSurfaceBuffer(hSrcVSurface, &uiSrcPitch))==NULL)
{
DbgMessage(TOPIC_VIDEOSURFACE, DBG_LEVEL_2, String( "Failed on lock of 16BPP surface for blitting" ));
return(FALSE);
}
if((pDestSurface16=(UINT16 *)LockVideoSurfaceBuffer(hDestVSurface, &uiDestPitch))==NULL)
{
UnLockVideoSurfaceBuffer(hSrcVSurface);
DbgMessage(TOPIC_VIDEOSURFACE, DBG_LEVEL_2, String( "Failed on lock of 16BPP dest surface for blitting" ));
return(FALSE);
}
Blt16BPPTo16BPP(pDestSurface16, uiDestPitch, pSrcSurface16, uiSrcPitch, iDestX, iDestY, SrcRect.left, SrcRect.top, uiWidth, uiHeight);
UnLockVideoSurfaceBuffer(hSrcVSurface);
UnLockVideoSurfaceBuffer(hDestVSurface);
return(TRUE);
}
#endif
CHECKF( BltVSurfaceUsingDD( hDestVSurface, hSrcVSurface, fBltFlags, iDestX, iDestY, &SrcRect ) );