mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
fallback solution if no image is found
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8458 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1333,7 +1333,7 @@ BOOLEAN RenderShopKeeperInterface()
|
|||||||
}
|
}
|
||||||
|
|
||||||
UINT16 col_tradescreenmargin = Get16BPPColor( FROMRGB( 64, 64, 64 ) );
|
UINT16 col_tradescreenmargin = Get16BPPColor( FROMRGB( 64, 64, 64 ) );
|
||||||
UINT16 col_tradescreen = Get16BPPColor( FROMRGB( 127, 127, 127 ) );
|
UINT16 col_tradescreen = Get16BPPColor( FROMRGB( 255, 0, 255 ) );
|
||||||
UINT16 col_itembox = Get16BPPColor( FROMRGB( 74, 65, 49 ) );
|
UINT16 col_itembox = Get16BPPColor( FROMRGB( 74, 65, 49 ) );
|
||||||
UINT16 col_itemdescription = Get16BPPColor( FROMRGB( 181, 150, 74 ) );
|
UINT16 col_itemdescription = Get16BPPColor( FROMRGB( 181, 150, 74 ) );
|
||||||
UINT16 col_itemstatusbar = Get16BPPColor( FROMRGB( 57, 56, 41 ) );
|
UINT16 col_itemstatusbar = Get16BPPColor( FROMRGB( 57, 56, 41 ) );
|
||||||
@@ -1345,21 +1345,21 @@ BOOLEAN RenderShopKeeperInterface()
|
|||||||
|
|
||||||
// Flugente: because people find simple plane backgrounds to be offputting, we try for something more fancy
|
// Flugente: because people find simple plane backgrounds to be offputting, we try for something more fancy
|
||||||
// we use a very huge background picture and then display parts of it.
|
// we use a very huge background picture and then display parts of it.
|
||||||
// Given that the default picture has a size of 3088x2056, you would need a gigantic resolution for this to not work out. Nevertheless, set this to FALSE to display a simple grey background instead.
|
// Given that the default picture has a size of 3088x2056, you would need a gigantic resolution for this to not work out.
|
||||||
if ( TRUE )
|
// Flugente: guiMainTradeScreenImage is unsigned as the functions require UINT32. As it is unlikely we will ever use 2^32 pictures, this works well enough
|
||||||
|
if ( guiMainTradeScreenImage == -1 )
|
||||||
{
|
{
|
||||||
// Flugente: guiMainTradeScreenImage is unsigned as the functions require UINT32. As it is unlikely we will ever use 2^32 pictures, this works well enough
|
VSURFACE_DESC vs_desc;
|
||||||
if ( guiMainTradeScreenImage == -1 )
|
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
|
||||||
|
strcpy( vs_desc.ImageFile, "LAPTOP\\shopkeeperbackground.pcx" );
|
||||||
|
if ( FileExists( vs_desc.ImageFile ) )
|
||||||
{
|
{
|
||||||
VSURFACE_DESC vs_desc;
|
AddVideoSurface( &vs_desc, &guiMainTradeScreenImage );
|
||||||
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
|
|
||||||
strcpy( vs_desc.ImageFile, "LAPTOP\\shopkeeperbackground.pcx" );
|
|
||||||
if ( !AddVideoSurface( &vs_desc, &guiMainTradeScreenImage ) )
|
|
||||||
{
|
|
||||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_BETAVERSION, L"File LAPTOP\\shopkeeperbackground.pcx could not be opened" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( guiMainTradeScreenImage != -1 )
|
||||||
|
{
|
||||||
HVSURFACE hSrcVSurface;
|
HVSURFACE hSrcVSurface;
|
||||||
UINT32 uiDestPitchBYTES;
|
UINT32 uiDestPitchBYTES;
|
||||||
UINT32 uiSrcPitchBYTES;
|
UINT32 uiSrcPitchBYTES;
|
||||||
@@ -1398,6 +1398,7 @@ BOOLEAN RenderShopKeeperInterface()
|
|||||||
UnLockVideoSurface( guiMainTradeScreenImage );
|
UnLockVideoSurface( guiMainTradeScreenImage );
|
||||||
UnLockVideoSurface( FRAME_BUFFER );
|
UnLockVideoSurface( FRAME_BUFFER );
|
||||||
}
|
}
|
||||||
|
// if we cannot find the picture, use a fallback solution
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, SKI_TRADER_INVENTORY_BEGIN_X + SKI_MARGIN, SKI_TRADER_INVENTORY_BEGIN_Y + SKI_MARGIN,
|
ColorFillVideoSurfaceArea( FRAME_BUFFER, SKI_TRADER_INVENTORY_BEGIN_X + SKI_MARGIN, SKI_TRADER_INVENTORY_BEGIN_Y + SKI_MARGIN,
|
||||||
|
|||||||
Reference in New Issue
Block a user