mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Widescreen UI patch (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9216 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -101,6 +101,7 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
extern INV_REGION_DESC gMapScreenInvPocketXY[NUM_INV_SLOTS]; // ARRAY FOR INV PANEL INTERFACE ITEM POSITIONS
|
||||
|
||||
//CHRISL: Moved to Interface Items.h for EDB
|
||||
//#define ITEMDESC_FONT BLOCKFONT2
|
||||
@@ -1652,7 +1653,6 @@ void RenderInvBodyPanel( SOLDIERTYPE *pSoldier, INT16 sX, INT16 sY )
|
||||
else
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiBodyInvVO[ pSoldier->ubBodyType ][ bSubImageIndex ], 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2642,38 +2642,6 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
|
||||
if ( fDirtyLevel == DIRTYLEVEL2 )
|
||||
{
|
||||
// CHECK FOR COMPATIBILITY WITH MAGAZINES
|
||||
|
||||
/* OLD VERSION OF GUN/AMMO MATCH HIGHLIGHTING
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
|
||||
if ( ( Item [ pSoldier->inv[ HANDPOS ].usItem ].usItemClass & IC_GUN ) && ( Item[ pObject->usItem ].usItemClass & IC_AMMO ) )
|
||||
{
|
||||
// CHECK
|
||||
if (Weapon[pSoldier->inv[ HANDPOS ].usItem].ubCalibre == Magazine[Item[pObject->usItem].ubClassIndex].ubCalibre )
|
||||
{
|
||||
// IT's an OK calibre ammo, do something!
|
||||
// Render Item with specific color
|
||||
//fOutline = TRUE;
|
||||
//sOutlineColor = Get16BPPColor( FROMRGB( 96, 104, 128 ) );
|
||||
//sOutlineColor = Get16BPPColor( FROMRGB( 20, 20, 120 ) );
|
||||
|
||||
// Draw rectangle!
|
||||
pDestBuf = LockVideoSurface( guiSAVEBUFFER, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, 640, 480 );
|
||||
|
||||
//usLineColor = Get16BPPColor( FROMRGB( 255, 255, 0 ) );
|
||||
usLineColor = Get16BPPColor( FROMRGB( 230, 215, 196 ) );
|
||||
RectangleDraw( TRUE, (sX+1), (sY+1), (sX + gSMInvData[ sPocket ].sWidth - 2 ),( sY + gSMInvData[ sPocket ].sHeight - 2 ), usLineColor, pDestBuf );
|
||||
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, 640, 480 );
|
||||
|
||||
UnLockVideoSurface( guiSAVEBUFFER );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if ( gbCompatibleAmmo[ sPocket ] )
|
||||
{
|
||||
fOutline = TRUE;
|
||||
@@ -2693,8 +2661,9 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
|
||||
}
|
||||
else
|
||||
{
|
||||
newX = !UsingNewInventorySystem( ) ? (14 + xResOffset) : (6 + xResOffset);
|
||||
newY = !UsingNewInventorySystem( ) ? (218 + yResOffset) : (217 + yResOffset);
|
||||
newX = gMapScreenInvPocketXY[SECONDHANDPOS].sX - 10;
|
||||
newY = gMapScreenInvPocketXY[SECONDHANDPOS].sY;
|
||||
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiMapInvSecondHandBlockout, UsingNewInventorySystem(), newX, newY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
RestoreExternBackgroundRect( newX, newY, 102, 24 );
|
||||
}
|
||||
@@ -9755,7 +9724,10 @@ BOOLEAN InitSectorStackPopup( SOLDIERTYPE *pSoldier, WORLDITEM *pInventoryPoolLi
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
|
||||
gfInSectorStackPopup = TRUE;
|
||||
fShowInventoryFlag = TRUE;
|
||||
if (!isWidescreenUI())
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
}
|
||||
|
||||
//Restrict mouse cursor to panel
|
||||
aRect.iLeft = sInvX + sOffSetX;
|
||||
|
||||
@@ -80,6 +80,10 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
extern int UI_CHARINV_REGION_X;
|
||||
extern int UI_CHARINV_REGION_Y;
|
||||
extern int UI_CHARINV_REGION_W;
|
||||
extern int UI_CHARINV_REGION_H;
|
||||
|
||||
|
||||
/*
|
||||
@@ -1538,7 +1542,14 @@ BOOLEAN InitializeSMPanelCoordsOld()
|
||||
|
||||
//dnl INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
//dnl INTERFACE_CLOCK_Y = ( 119 + INV_INTERFACE_START_Y );
|
||||
INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - 86;
|
||||
}
|
||||
else
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - xResOffset - 86;
|
||||
}
|
||||
INTERFACE_CLOCK_Y = SCREEN_HEIGHT - 24;
|
||||
LOCATION_NAME_X = xResOffset + (xResSize - 92);
|
||||
LOCATION_NAME_Y = ( 65 + INTERFACE_START_Y );
|
||||
@@ -1898,7 +1909,14 @@ BOOLEAN InitializeSMPanelCoordsNew()
|
||||
|
||||
//dnl INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
//dnl INTERFACE_CLOCK_Y = ( 119 + INV_INTERFACE_START_Y );
|
||||
INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - 86;
|
||||
}
|
||||
else
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - xResOffset - 86;
|
||||
}
|
||||
INTERFACE_CLOCK_Y = SCREEN_HEIGHT - 24;
|
||||
LOCATION_NAME_X = xResOffset + (xResSize - 92);
|
||||
LOCATION_NAME_Y = ( 89 + INTERFACE_START_Y );
|
||||
@@ -7345,8 +7363,8 @@ void KeyRingItemPanelButtonCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// want the inv done button shutdown and the region behind the keyring shaded
|
||||
//ForceButtonUnDirty( giMapInvDoneButton );
|
||||
// shade the background
|
||||
ShadowVideoSurfaceRect( FRAME_BUFFER , 0, 107, 261, 359 );
|
||||
InvalidateRegion( 0, 107, 261, 359 );
|
||||
ShadowVideoSurfaceRect( FRAME_BUFFER, UI_CHARINV_REGION_X, UI_CHARINV_REGION_Y, UI_CHARINV_REGION_X + UI_CHARINV_REGION_W, UI_CHARINV_REGION_Y + UI_CHARINV_REGION_H);
|
||||
InvalidateRegion(UI_CHARINV_REGION_X, UI_CHARINV_REGION_Y, UI_CHARINV_REGION_X + UI_CHARINV_REGION_W, UI_CHARINV_REGION_Y + UI_CHARINV_REGION_H);
|
||||
}
|
||||
|
||||
//CHRISL: In OIV mode, we don't want to offset the keyring popup.
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
//const UINT32 INTERFACE_START_Y = ( SCREEN_HEIGHT - INTERFACE_HEIGHT );
|
||||
//const UINT32 INV_INTERFACE_START_Y = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
|
||||
|
||||
extern UILayout_Map UI_MAP;
|
||||
|
||||
int INTERFACE_WIDTH;// = 640;
|
||||
int INTERFACE_HEIGHT;// = 120;
|
||||
int INV_INTERFACE_HEIGHT;// = 140;
|
||||
@@ -889,7 +891,7 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
|
||||
}
|
||||
//SetButtonSavedRect( iActionIcons[ WALK_ICON ] );
|
||||
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
if (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
SetButtonFastHelpText( iActionIcons[ WALK_ICON ], TacticalStr[ DRIVE_POPUPTEXT ] );
|
||||
}
|
||||
@@ -4563,9 +4565,9 @@ void BeginMapUIMessage( UINT8 ubPosition, STR16 pFontString, ... )
|
||||
// WDS - bug fix: VideoOverlayDesc must be initialized! - 07/16/2007
|
||||
memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) );
|
||||
// Set Overlay
|
||||
VideoOverlayDesc.sLeft = 20 + MAP_VIEW_START_X + ( MAP_VIEW_WIDTH - gusUIMessageWidth ) / 2;
|
||||
VideoOverlayDesc.sLeft = 20 + UI_MAP.ViewRegion.x + (UI_MAP.ViewRegion.width - gusUIMessageWidth ) / 2;
|
||||
|
||||
VideoOverlayDesc.sTop = MAP_VIEW_START_Y + ( MAP_VIEW_HEIGHT - gusUIMessageHeight ) / 2;
|
||||
VideoOverlayDesc.sTop = UI_MAP.ViewRegion.y + (UI_MAP.ViewRegion.height - gusUIMessageHeight ) / 2;
|
||||
|
||||
if( ubPosition == MSG_MAP_UI_POSITION_UPPER )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user