mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
****************************************************************************
** Merged Source Code from Development trunk, for the Spring 2011 Release ** **************************************************************************** o Development Trunk (Revision: 4444): https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP o This trunk (the official 1.13 source trunk) will only be used for fixing bugs. No new features will be added here. New Features are only included in the Development trunk o !!! After we have fixed a bug here in this trunk, we should MANUALLY merge the bugfix in the development trunk !!! git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4446 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_ZLIB_COMPRESSION"
|
||||
@@ -104,7 +104,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION"
|
||||
RuntimeLibrary="0"
|
||||
@@ -165,7 +165,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION"
|
||||
RuntimeLibrary="0"
|
||||
@@ -226,7 +226,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_ZLIB_COMPRESSION"
|
||||
@@ -291,7 +291,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION"
|
||||
|
||||
Binary file not shown.
@@ -18,6 +18,7 @@
|
||||
#include "wcheck.h"
|
||||
#include "Compression.h"
|
||||
#include "vobject.h"
|
||||
#include "vobject_blitters.h"
|
||||
#endif
|
||||
|
||||
#include <vfs/Core/vfs.h>
|
||||
@@ -422,6 +423,19 @@ BOOLEAN CopyImageToBuffer( HIMAGE hImage, UINT32 fBufferType, BYTE *pDestBuf, UI
|
||||
return( Copy16BPPImageTo16BPPBuffer( hImage, pDestBuf, usDestWidth, usDestHeight, usX, usY, srcRect ) );
|
||||
}
|
||||
|
||||
if ( hImage->ubBitDepth == 24 && fBufferType == BUFFER_16BPP )
|
||||
{
|
||||
DbgMessage( TOPIC_HIMAGE, DBG_LEVEL_3, "Copying 24 BPP Imagery to 16BPP Buffer." );
|
||||
SGP_THROW("not yet implemented");
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if ( hImage->ubBitDepth == 32 && fBufferType == BUFFER_16BPP )
|
||||
{
|
||||
DbgMessage( TOPIC_HIMAGE, DBG_LEVEL_3, "Copying 32 BPP Imagery to 16BPP Buffer." );
|
||||
return Blt32BPPTo16BPPTrans((UINT16*)pDestBuf, usDestWidth * sizeof(UINT16), hImage->p32BPPData, usDestWidth*sizeof(UINT32), 0,0,0,0,usDestWidth, usDestHeight);
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
|
||||
}
|
||||
|
||||
@@ -1164,6 +1164,10 @@ BOOLEAN fRemoved;
|
||||
if((hFile=FileOpen(pFilename, FILE_ACCESS_READ, FALSE))!=0)
|
||||
{
|
||||
uiSize=FileGetSize(hFile);
|
||||
if(uiSize == 0)
|
||||
{
|
||||
return NO_SAMPLE;
|
||||
}
|
||||
|
||||
// if insufficient memory, start unloading old samples until either
|
||||
// there's nothing left to unload, or we fit
|
||||
|
||||
@@ -1104,6 +1104,9 @@ HVSURFACE CreateVideoSurface( VSURFACE_DESC *VSurfaceDesc )
|
||||
break;
|
||||
|
||||
case 16:
|
||||
// BF: handle 24 bpp and 32 bpp images as 16 bpp ones = convert larger color space to the smaller one
|
||||
case 24:
|
||||
case 32:
|
||||
|
||||
PixelFormat.dwFlags = DDPF_RGB;
|
||||
PixelFormat.dwRGBBitCount = 16;
|
||||
@@ -1192,19 +1195,21 @@ HVSURFACE CreateVideoSurface( VSURFACE_DESC *VSurfaceDesc )
|
||||
memset( hVSurface, 0, sizeof( SGPVSurface ) );
|
||||
CHECKF( hVSurface != NULL );
|
||||
|
||||
hVSurface->usHeight = usHeight;
|
||||
hVSurface->usWidth = usWidth;
|
||||
hVSurface->ubBitDepth = ubBitDepth;
|
||||
hVSurface->pSurfaceData1 = (PTR)lpDDS;
|
||||
hVSurface->usHeight = usHeight;
|
||||
hVSurface->usWidth = usWidth;
|
||||
// BF : since we use a 16bpp framebuffer and images are converted to that format,
|
||||
// there is no need to set the surface bit depth to a higher value than 16
|
||||
hVSurface->ubBitDepth = ubBitDepth > 16 ? 16 : ubBitDepth;
|
||||
hVSurface->pSurfaceData1 = (PTR)lpDDS;
|
||||
hVSurface->pSurfaceData = (PTR)lpDDS2;
|
||||
hVSurface->pSavedSurfaceData1 = NULL;
|
||||
hVSurface->pSavedSurfaceData = NULL;
|
||||
hVSurface->pPalette = NULL;
|
||||
hVSurface->p16BPPPalette = NULL;
|
||||
hVSurface->TransparentColor = FROMRGB( 0, 0, 0 );
|
||||
hVSurface->RegionList = CreateList( DEFAULT_NUM_REGIONS, sizeof( VSURFACE_REGION ) );
|
||||
hVSurface->fFlags = 0;
|
||||
hVSurface->pClipper = NULL;
|
||||
hVSurface->pSavedSurfaceData1 = NULL;
|
||||
hVSurface->pSavedSurfaceData = NULL;
|
||||
hVSurface->pPalette = NULL;
|
||||
hVSurface->p16BPPPalette = NULL;
|
||||
hVSurface->TransparentColor = FROMRGB( 0, 0, 0 );
|
||||
hVSurface->RegionList = CreateList( DEFAULT_NUM_REGIONS, sizeof( VSURFACE_REGION ) );
|
||||
hVSurface->fFlags = 0;
|
||||
hVSurface->pClipper = NULL;
|
||||
|
||||
//
|
||||
// Determine memory and other attributes of newly created surface
|
||||
@@ -1306,8 +1311,9 @@ HVSURFACE CreateVideoSurface( VSURFACE_DESC *VSurfaceDesc )
|
||||
//
|
||||
|
||||
hVSurface->usHeight = usHeight;
|
||||
hVSurface->usWidth = usWidth;
|
||||
hVSurface->ubBitDepth = ubBitDepth;
|
||||
hVSurface->usWidth = usWidth;
|
||||
// BF: re-set bit depth (see above)
|
||||
hVSurface->ubBitDepth = ubBitDepth > 16 ? 16 : ubBitDepth;
|
||||
|
||||
giMemUsedInSurfaces += ( hVSurface->usHeight * hVSurface->usWidth * ( hVSurface->ubBitDepth / 8 ) );
|
||||
|
||||
@@ -1432,7 +1438,7 @@ BOOLEAN SetVideoSurfaceDataFromHImage( HVSURFACE hVSurface, HIMAGE hImage, UINT1
|
||||
BYTE *pDest;
|
||||
UINT32 fBufferBPP = 0;
|
||||
UINT32 uiPitch;
|
||||
UINT16 usEffectiveWidth;
|
||||
UINT16 usPixelWidth;
|
||||
SGPRect aRect;
|
||||
|
||||
// Assertions
|
||||
@@ -1451,6 +1457,11 @@ BOOLEAN SetVideoSurfaceDataFromHImage( HVSURFACE hVSurface, HIMAGE hImage, UINT1
|
||||
{
|
||||
fBufferBPP = BUFFER_16BPP;
|
||||
}
|
||||
else if ( (hImage->ubBitDepth == 24 || hImage->ubBitDepth == 32) && hVSurface->ubBitDepth == 16 )
|
||||
{
|
||||
// convert image to 16bpp
|
||||
fBufferBPP = BUFFER_16BPP;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1476,7 +1487,7 @@ BOOLEAN SetVideoSurfaceDataFromHImage( HVSURFACE hVSurface, HIMAGE hImage, UINT1
|
||||
pDest = LockVideoSurfaceBuffer( hVSurface, &uiPitch );
|
||||
|
||||
// Effective width ( in PIXELS ) is Pitch ( in bytes ) converted to pitch ( IN PIXELS )
|
||||
usEffectiveWidth = (UINT16)( uiPitch / ( hVSurface->ubBitDepth / 8 ) );
|
||||
usPixelWidth = (UINT16)( uiPitch / ( hVSurface->ubBitDepth / 8 ) );
|
||||
|
||||
CHECKF( pDest != NULL );
|
||||
|
||||
@@ -1498,7 +1509,7 @@ BOOLEAN SetVideoSurfaceDataFromHImage( HVSURFACE hVSurface, HIMAGE hImage, UINT1
|
||||
}
|
||||
|
||||
// This HIMAGE function will transparently copy buffer
|
||||
if ( !CopyImageToBuffer( hImage, fBufferBPP, pDest, usEffectiveWidth, hVSurface->usHeight, usX, usY, &aRect ) )
|
||||
if ( !CopyImageToBuffer( hImage, fBufferBPP, pDest, usPixelWidth, hVSurface->usHeight, usX, usY, &aRect ) )
|
||||
{
|
||||
DbgMessage( TOPIC_VIDEOSURFACE, DBG_LEVEL_2, String( "Error Occured Copying HIMAGE to HVSURFACE" ));
|
||||
UnLockVideoSurfaceBuffer( hVSurface );
|
||||
|
||||
Reference in New Issue
Block a user