mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Various fixes/improvements (all by Moa):
- (bug) first Tooltip for weapons (secondary and tertiary values like recoil) was missing, last one showed (null,null). - (cleanup) code cosmetic/potential bug: cnt now (hopefully) match the count of actual rendered values/MouseRegions and Icons. - (feature adjustment) freshness Bar for food now shows the decay. Color values for bar range from green (over yellow) to red. hight of bar shows the percentage. - (feature adjustment) Food properties are now shown in DB. A Data patch is needed to show the new Icons, those however are placeholders for better ones, the tooltips also need a rework by a native english and translation to the different languages. - (feature adjustment) When FoodSystem is enabled the weight of a foodtype item is adjusted to account for partially eaten item. - (bug) Performance fix 1: multiple TransformIcons where rendered in DB above each other. - (bug) Performance fix 2: condition to leave loop when on end of Transform list was not met due to missing cast (65535!=-1). - (bug) 'endless dying mercs in roof edges' fix in rev.6346 condition was never met. - (bug) Popups were missplaced when clicking on a trainer-assignment multiple times to close the submenu. - (bug) Popups were missplaced when clicking on a practice-assignment multiple times to close the submenu. - (bug) Popups were missplaced when clicking on a student-assignment multiple times to close the submenu. - (bug) Popups were missplaced when clicking on a facility-assignment multiple times to close the submenu. note: the bug might only be reproducable when selecting different screensize then the 3 native ones. - (bug) MouseMasks for disabling timeCompress buttons did not match size of buttons, Clock Overlay was missing - (cleanup) Replaced Hardcoded fallback Gridnumbers with CenterGrid if no exitGrid was specified in map editor. Same behavier than before, but since we have bigmaps and possibly other mapsizes it should not be constant. - (bug) Sight range calulation uses distance visible with and without scope to get a scopeRangeMod=sDistVis/sDistVisNoScope. Blind soldiers will have 0 sDistVisNoScope, which means the scopeRangeMod is a div/0 (not defined result). After fix we get a defined result for scopeRangeMod of 1.0f in case there is a 0 distance. Also we get a defined result for sightrange since sightrange=sightrange/scopeRangeMod = 0/1.0f. - (bug) Experimental NCTH calulation did return 0 CTH with 0 aimclicks but it should return at least the base CTH. - (cleanup) added comment to get an idea of the 'magic' aiming Points formula - (feature adjustment) Flat backpack malus replaced with malus which scales linear with weight of backpack up to maximum specified in ini file. Each 5 kg 1 additional malus is applied for movement. When carrying pack in hands or inside another pocket the full malus is applied. Malus for changing stances is still 1 additional Point when carrying backpack (does not matter in which slot). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6363 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3914,13 +3914,13 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
|
||||
{
|
||||
FLOAT condition = (*pObject)[0]->data.bTemperature / OVERHEATING_MAX_TEMPERATURE;
|
||||
|
||||
UINT32 red = (UINT32) ( 127 );
|
||||
UINT32 green = (UINT32) ( 54 + 201 * ( min(1.0f, condition ) ) );
|
||||
UINT32 red = (UINT32) ( 126 + 127 * ( 1.0f - min(1.0f, condition) ) ); //127
|
||||
UINT32 green = (UINT32) ( 54 + 200 * min(1.0f, condition ) ); //54 + 201 * ( min(1.0f, condition ) )
|
||||
UINT32 blue = 0;
|
||||
|
||||
UINT16 colour = Get16BPPColor( FROMRGB( red, green, blue ) );
|
||||
|
||||
DrawItemUIBarEx( pObject, DRAW_ITEM_TEMPERATURE, sX, sY + sHeight-1, ITEMDESC_ITEM_STATUS_WIDTH, sHeight-1, colour, colour, TRUE, guiSAVEBUFFER);
|
||||
DrawItemUIBarEx( pObject, DRAW_ITEM_TEMPERATURE, sX, sY + sHeight-1, ITEMDESC_ITEM_STATUS_WIDTH, (INT16)((sHeight-1)*(1-condition)), colour, colour, TRUE, guiSAVEBUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6594,30 +6594,36 @@ void RenderItemDescriptionBox( )
|
||||
}
|
||||
else*/
|
||||
{
|
||||
for (UINT16 x = 0; x < MAXITEMS; x++)
|
||||
{
|
||||
if (Transform[x].usItem == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
//Moa: had to solve the performance issue which was caused partially here by creating multiple videoObjects.
|
||||
// Mousregions for the Transformation looks fine (line5036 in internalInitItemDescriptionBox), however still took awhile to show the DB for Items.
|
||||
// So I set up a breakpoint in the loop and figured that -1 is not a good test: Transform[] was initialized with -1 which translates to 65535 for UINT16.
|
||||
// Testing again for -1 is interpreted as (UINT16)65535 == (int)-1 which is false. instead either use MAXITEMS or 0 or test for (UINT16)-1. I decided for the latter.
|
||||
// Because 0 is also the first uiIndex in Item[]. After the change the DB loads in Debugversion in just under a second on my PC, which is still not acceptible, but in
|
||||
// Release the delay is not noticed anymore.
|
||||
|
||||
// Flugente: ok, this looks complicated. We allow a transformation option to pop up if:
|
||||
// - there is a transformation
|
||||
// - we are in the game or map screen, it is a single item, and
|
||||
// - the item is a grenade
|
||||
// - the item is a bomb and has a detonator or remote detonator attached
|
||||
if ( Transform[x].usItem == gpItemDescObject->usItem )
|
||||
// Flugente: ok, this looks complicated. We allow a transformation option to pop up if:
|
||||
// - there is a transformation
|
||||
// - we are in the game or map screen, it is a single item, and
|
||||
// - the item is a grenade
|
||||
// - the item is a bomb and has a detonator or remote detonator attached
|
||||
BOOLEAN renderTransformIcon = FALSE;
|
||||
if ( ( (guiCurrentScreen == GAME_SCREEN || guiCurrentScreen == MAP_SCREEN) && gpItemDescObject->ubNumberOfObjects == 1 ) &&
|
||||
( (Item[gpItemDescObject->usItem].usItemClass == IC_GRENADE) ||
|
||||
( (Item[gpItemDescObject->usItem].usItemClass == IC_BOMB) && HasAttachmentOfClass( gpItemDescObject, (AC_DETONATOR | AC_REMOTEDET)) ) ) )
|
||||
renderTransformIcon = TRUE;
|
||||
if (!renderTransformIcon)
|
||||
for (UINT16 x = 0; x < MAXITEMS; x++)
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiTransformIconGraphic, 0, (ITEMDESC_ITEM_X+ITEMDESC_ITEM_WIDTH)-13, (ITEMDESC_ITEM_Y+ITEMDESC_ITEM_HEIGHT)-17, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
else if ( (guiCurrentScreen == GAME_SCREEN || guiCurrentScreen == MAP_SCREEN) && gpItemDescObject->ubNumberOfObjects == 1 )
|
||||
{
|
||||
if ( (Item[gpItemDescObject->usItem].usItemClass == IC_GRENADE) || ( (Item[gpItemDescObject->usItem].usItemClass == IC_BOMB) && HasAttachmentOfClass( gpItemDescObject, (AC_DETONATOR | AC_REMOTEDET)) ) )
|
||||
if (Transform[x].usItem == (UINT16)-1)
|
||||
break;
|
||||
else if ( Transform[x].usItem == gpItemDescObject->usItem )
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiTransformIconGraphic, 0, (ITEMDESC_ITEM_X+ITEMDESC_ITEM_WIDTH)-13, (ITEMDESC_ITEM_Y+ITEMDESC_ITEM_HEIGHT)-17, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
renderTransformIcon = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (renderTransformIcon)
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiTransformIconGraphic, 0, (ITEMDESC_ITEM_X+ITEMDESC_ITEM_WIDTH)-13, (ITEMDESC_ITEM_Y+ITEMDESC_ITEM_HEIGHT)-17, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
// Display status
|
||||
@@ -6813,7 +6819,7 @@ void RenderItemDescriptionBox( )
|
||||
mprintf( ITEMDESC_NAME_X, ITEMDESC_NAME_Y, L"%s", gzItemName );
|
||||
#endif
|
||||
|
||||
// Render extra data on name bar for weapons and launchers (Caliber, Fingerprints)
|
||||
// Render extra data on name bar for weapons and launchers (Caliber, Fingerprints, Coolness)
|
||||
if ( ITEM_PROS_AND_CONS( gpItemDescObject->usItem ) )
|
||||
{
|
||||
SetFontForeground( FONT_BLACK );
|
||||
@@ -12877,7 +12883,7 @@ void ItemDescTransformRegionCallback( MOUSE_REGION *pRegion, INT32 reason )
|
||||
{
|
||||
for (INT32 x = 0; x < MAXITEMS; x++)
|
||||
{
|
||||
if (Transform[x].usItem == -1)
|
||||
if (Transform[x].usItem == (UINT16)-1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -12943,7 +12949,7 @@ void ItemDescTransformRegionCallback( MOUSE_REGION *pRegion, INT32 reason )
|
||||
INT32 iNumOptions = 0;
|
||||
for (INT32 x = 0; x < MAXITEMS; x++)
|
||||
{
|
||||
if (Transform[x].usItem == -1)
|
||||
if (Transform[x].usItem == (UINT16)-1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user