mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged New Inventory Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include "sgp.h"
|
||||
#include "sgp.h"
|
||||
#include "himage.h"
|
||||
#include "vobject.h"
|
||||
#include "interface utils.h"
|
||||
@@ -21,17 +21,17 @@
|
||||
#include "WCheck.h"
|
||||
#include "Vehicles.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define LIFE_BAR_SHADOW FROMRGB( 108, 12, 12 )
|
||||
#define LIFE_BAR FROMRGB( 200, 0, 0 )
|
||||
#define BANDAGE_BAR_SHADOW FROMRGB( 156, 60, 60 )
|
||||
#define BANDAGE_BAR FROMRGB( 222, 132, 132 )
|
||||
#define BLEEDING_BAR_SHADOW FROMRGB( 128, 128, 60 )
|
||||
#define BLEEDING_BAR FROMRGB( 240, 240, 20 )
|
||||
#define BLEEDING_BAR FROMRGB( 240, 240, 20 )
|
||||
#define CURR_BREATH_BAR_SHADOW FROMRGB( 8, 12, 118 ) // the MAX max breatth, always at 100%
|
||||
#define CURR_BREATH_BAR FROMRGB( 8, 12, 160 )
|
||||
#define CURR_MAX_BREATH FROMRGB( 0, 0, 0 ) // the current max breath, black
|
||||
#define CURR_MAX_BREATH_SHADOW FROMRGB( 0, 0, 0 )
|
||||
#define CURR_MAX_BREATH FROMRGB( 0, 0, 0 ) // the current max breath, black
|
||||
#define CURR_MAX_BREATH_SHADOW FROMRGB( 0, 0, 0 )
|
||||
#define MORALE_BAR_SHADOW FROMRGB( 8, 112, 12 )
|
||||
#define MORALE_BAR FROMRGB( 8, 180, 12 )
|
||||
#define BREATH_BAR_SHADOW FROMRGB( 60, 108, 108 ) // the lt blue current breath
|
||||
@@ -73,7 +73,7 @@ STR pbCarPortraitFileNames[ ]={
|
||||
BOOLEAN LoadCarPortraitValues( void )
|
||||
{
|
||||
INT32 iCounter = 0;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
if( giCarPortraits[ 0 ] != -1 )
|
||||
{
|
||||
@@ -110,13 +110,13 @@ void UnLoadCarPortraits( void )
|
||||
|
||||
void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer )
|
||||
{
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
INT8 bBandage;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
INT8 bBandage;
|
||||
|
||||
// Erase what was there
|
||||
if( fErase )
|
||||
@@ -124,34 +124,34 @@ void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWi
|
||||
RestoreExternBackgroundRect( sXPos, (INT16)(sYPos - sHeight), sWidth, (INT16)(sHeight + 1 ) );
|
||||
}
|
||||
|
||||
if( pSoldier->bLife == 0 )
|
||||
if( pSoldier->stats.bLife == 0 )
|
||||
{
|
||||
// are they dead?
|
||||
return;
|
||||
}
|
||||
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
|
||||
|
||||
// FIRST DO MAX LIFE
|
||||
dPercentage = (FLOAT)pSoldier->bLife / (FLOAT)100;
|
||||
dPercentage = (FLOAT)pSoldier->stats.bLife / (FLOAT)100;
|
||||
dEnd = dPercentage * sHeight;
|
||||
dStart = sYPos;
|
||||
|
||||
usLineColor = Get16BPPColor( LIFE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( LIFE_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( LIFE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
// NOW DO BANDAGE
|
||||
|
||||
// Calculate bandage
|
||||
bBandage = pSoldier->bLifeMax - pSoldier->bLife - pSoldier->bBleeding;
|
||||
bBandage = pSoldier->stats.bLifeMax - pSoldier->stats.bLife - pSoldier->bBleeding;
|
||||
|
||||
if ( bBandage )
|
||||
{
|
||||
@@ -160,13 +160,13 @@ void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWi
|
||||
dEnd = ( dPercentage * sHeight );
|
||||
|
||||
usLineColor = Get16BPPColor( BANDAGE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( BANDAGE_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( BANDAGE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
// NOW DO BLEEDING
|
||||
@@ -177,15 +177,15 @@ void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWi
|
||||
dEnd = ( dPercentage * sHeight );
|
||||
|
||||
usLineColor = Get16BPPColor( BLEEDING_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( BLEEDING_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( BLEEDING_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
|
||||
UnLockVideoSurface( uiBuffer );
|
||||
|
||||
}
|
||||
@@ -193,12 +193,12 @@ void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWi
|
||||
|
||||
void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer )
|
||||
{
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
HVOBJECT hHandle;
|
||||
|
||||
// Erase what was there
|
||||
@@ -207,15 +207,15 @@ void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 s
|
||||
RestoreExternBackgroundRect( sXPos, (INT16)(sYPos - sHeight), sWidth, (INT16)(sHeight + 1 ) );
|
||||
}
|
||||
|
||||
if( pSoldier->bLife == 0 )
|
||||
if( pSoldier->stats.bLife == 0 )
|
||||
{
|
||||
// are they dead?
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// DO MAX MAX BREATH
|
||||
|
||||
// DO MAX MAX BREATH
|
||||
dPercentage = 1.;
|
||||
dEnd = dPercentage * sHeight;
|
||||
dStart = sYPos;
|
||||
@@ -229,24 +229,24 @@ void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 s
|
||||
if( gusSelectedSoldier == pSoldier->ubID && gTacticalStatus.ubCurrentTeam == OUR_TEAM && OK_INTERRUPT_MERC( pSoldier ) )
|
||||
{
|
||||
// gold, the second entry in the .sti
|
||||
BltVideoObject( uiBuffer , hHandle, 1, sXPos, ( INT16 )( sYPos - sHeight ), VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObject( uiBuffer , hHandle, 1, sXPos, ( INT16 )( sYPos - sHeight ), VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// brown, first entry
|
||||
BltVideoObject( uiBuffer , hHandle, 0, sXPos, ( INT16 )( sYPos - sHeight ), VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObject( uiBuffer , hHandle, 0, sXPos, ( INT16 )( sYPos - sHeight ), VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// brown, first entry
|
||||
BltVideoObject( uiBuffer , hHandle, 0, sXPos, ( INT16 )( sYPos - sHeight ), VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObject( uiBuffer , hHandle, 0, sXPos, ( INT16 )( sYPos - sHeight ), VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
}
|
||||
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
|
||||
if( pSoldier->bBreathMax <= 97 )
|
||||
@@ -257,15 +257,15 @@ void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 s
|
||||
|
||||
// the old background colors for breath max diff
|
||||
usLineColor = Get16BPPColor( BREATH_BAR_SHAD_BACK );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( BREATH_BAR_SHAD_BACK );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( BREATH_BAR_SHAD_BACK );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -274,13 +274,13 @@ void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 s
|
||||
dStart = sYPos;
|
||||
|
||||
usLineColor = Get16BPPColor( CURR_MAX_BREATH_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( CURR_MAX_BREATH );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( CURR_MAX_BREATH_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
|
||||
// NOW DO BREATH
|
||||
@@ -289,27 +289,27 @@ void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 s
|
||||
dStart = sYPos;
|
||||
|
||||
usLineColor = Get16BPPColor( CURR_BREATH_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( CURR_BREATH_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( CURR_BREATH_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
|
||||
|
||||
UnLockVideoSurface( uiBuffer );
|
||||
|
||||
}
|
||||
|
||||
void DrawMoraleUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer )
|
||||
{
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
|
||||
// Erase what was there
|
||||
if ( fErase )
|
||||
@@ -317,66 +317,75 @@ void DrawMoraleUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 s
|
||||
RestoreExternBackgroundRect( sXPos, (INT16)(sYPos - sHeight), sWidth, (INT16)(sHeight + 1 ) );
|
||||
}
|
||||
|
||||
if( pSoldier->bLife == 0 )
|
||||
if( pSoldier->stats.bLife == 0 )
|
||||
{
|
||||
// are they dead?
|
||||
return;
|
||||
}
|
||||
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
|
||||
|
||||
// FIRST DO BREATH
|
||||
dPercentage = (FLOAT)pSoldier->bMorale / (FLOAT)100;
|
||||
dPercentage = (FLOAT)pSoldier->aiData.bMorale / (FLOAT)100;
|
||||
dEnd = dPercentage * sHeight;
|
||||
dStart = sYPos;
|
||||
|
||||
usLineColor = Get16BPPColor( MORALE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( MORALE_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( MORALE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
|
||||
|
||||
UnLockVideoSurface( uiBuffer );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, INT16 sColor1, INT16 sColor2, BOOLEAN fErase, UINT32 uiBuffer )
|
||||
void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, INT16 sColor1, INT16 sColor2, BOOLEAN fErase, UINT32 uiBuffer, UINT8 iter )
|
||||
{
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
FLOAT dStart, dEnd, dPercentage;
|
||||
//UINT16 usLineColor;
|
||||
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
INT16 sValue;
|
||||
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
INT16 sValue;
|
||||
|
||||
|
||||
if ( ubStatus >= DRAW_ITEM_STATUS_ATTACHMENT1 )
|
||||
{
|
||||
sValue = pObject->bAttachStatus[ ubStatus - DRAW_ITEM_STATUS_ATTACHMENT1 ];
|
||||
sValue = 0;
|
||||
OBJECTTYPE* pAttachment = (*pObject)[iter]->GetAttachmentAtIndex( ubStatus - DRAW_ITEM_STATUS_ATTACHMENT1 );
|
||||
if (pAttachment) {
|
||||
sValue = (*pAttachment)[iter]->data.objectStatus;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sValue = pObject->ItemData.Generic.bStatus[ ubStatus ];
|
||||
if (ubStatus < pObject->ubNumberOfObjects) {
|
||||
sValue = (*pObject)[ ubStatus ]->data.objectStatus;
|
||||
}
|
||||
else {
|
||||
sValue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust for ammo, other thingys..
|
||||
if( Item[ pObject->usItem ].usItemClass & IC_AMMO )
|
||||
{
|
||||
|
||||
|
||||
sValue = sValue * 100 / Magazine[ Item[ pObject->usItem ].ubClassIndex ].ubMagSize;
|
||||
|
||||
if ( sValue < 0 )
|
||||
{
|
||||
sValue = pObject->ItemData.Ammo.ubShotsLeft[0] * 100 / Magazine[ Item[ pObject->usItem ].ubClassIndex ].ubMagSize;
|
||||
DebugMsg ( TOPIC_JA2, DBG_LEVEL_3, String("Ammo status: shots left %d * 100 / Mag Size %d = value %d",pObject->ubShotsLeft[0],Magazine[ Item[ pObject->usItem ].ubClassIndex ].ubMagSize,sValue ));
|
||||
sValue = (*pObject)[iter]->data.ubShotsLeft * 100 / Magazine[ Item[ pObject->usItem ].ubClassIndex ].ubMagSize;
|
||||
DebugMsg ( TOPIC_JA2, DBG_LEVEL_3, String("Ammo status: shots left %d * 100 / Mag Size %d = value %d",(*pObject)[iter]->data.ubShotsLeft,Magazine[ Item[ pObject->usItem ].ubClassIndex ].ubMagSize,sValue ));
|
||||
}
|
||||
if ( sValue > 100 )
|
||||
{
|
||||
@@ -390,11 +399,11 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
|
||||
sValue =100;
|
||||
}
|
||||
|
||||
// ATE: Subtract 1 to exagerate bad status
|
||||
if ( sValue < 100 && sValue > 1 )
|
||||
{
|
||||
sValue--;
|
||||
}
|
||||
// ATE: Subtract 1 to exagerate bad status
|
||||
if ( sValue < 100 && sValue > 1 )
|
||||
{
|
||||
sValue--;
|
||||
}
|
||||
|
||||
// Erase what was there
|
||||
if ( fErase )
|
||||
@@ -402,7 +411,7 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
|
||||
//RestoreExternBackgroundRect( sXPos, (INT16)(sYPos - sHeight), sWidth, (INT16)(sHeight + 1 ) );
|
||||
}
|
||||
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
|
||||
|
||||
@@ -413,12 +422,12 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
|
||||
|
||||
//usLineColor = Get16BPPColor( STATUS_BAR );
|
||||
usLineColor = sColor1;
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = sColor2;
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dStart, sXPos + 1, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
|
||||
|
||||
UnLockVideoSurface( uiBuffer );
|
||||
|
||||
if ( uiBuffer == guiSAVEBUFFER )
|
||||
@@ -435,14 +444,13 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
|
||||
void RenderSoldierFace( SOLDIERTYPE *pSoldier, INT16 sFaceX, INT16 sFaceY, BOOLEAN fAutoFace )
|
||||
{
|
||||
BOOLEAN fDoFace = FALSE;
|
||||
INT32 iFaceIndex = -1;
|
||||
UINT8 ubVehicleType = 0;
|
||||
|
||||
|
||||
if ( pSoldier->bActive )
|
||||
{
|
||||
|
||||
if( pSoldier->uiStatusFlags & SOLDIER_VEHICLE )
|
||||
if( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
// get the type of vehicle
|
||||
ubVehicleType = pVehicleList[ pSoldier->bVehicleID ].ubVehicleType;
|
||||
@@ -461,7 +469,7 @@ void RenderSoldierFace( SOLDIERTYPE *pSoldier, INT16 sFaceX, INT16 sFaceY, BOOLE
|
||||
{
|
||||
// Render as an extern face...
|
||||
fAutoFace = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAutoFaceActiveFromSoldier( FRAME_BUFFER, guiSAVEBUFFER, pSoldier->ubID , sFaceX, sFaceY );
|
||||
|
||||
Reference in New Issue
Block a user