Update EditorItems.cpp

Improve readability
This commit is contained in:
Asdow
2022-11-07 19:42:08 +02:00
parent af9e221578
commit f4e729ee80
+8 -4
View File
@@ -502,13 +502,16 @@ void RenderEditorItemsInfo()
} }
} }
} }
//draw item index no & the numbers of each visible item that currently resides in the world.
//draw item graphics, name, index number & the numbers of each visible item that currently resides in the world.
maxIndex = min( maxIndex, eInfo.sNumItems-1 ); maxIndex = min( maxIndex, eInfo.sNumItems-1 );
for( i = minIndex; i <= maxIndex; i++ ) for( i = minIndex; i <= maxIndex; i++ )
{ {
x = iScreenWidthOffset + (i/2 - eInfo.sScrollIndex)*60 + 110; x = iScreenWidthOffset + (i/2 - eInfo.sScrollIndex)*60 + 110;
y = 2 * iScreenHeightOffset + 360 + (i % 2) * 40; y = 2 * iScreenHeightOffset + 360 + (i % 2) * 40;
// Blit item graphics on demand based on what is visible // Blit item graphics on demand based on what is visible
UINT16 itemIndex = eInfo.pusItemIndex[i]; UINT16 itemIndex = eInfo.pusItemIndex[i];
item = &Item[itemIndex]; item = &Item[itemIndex];
@@ -526,6 +529,8 @@ void RenderEditorItemsInfo()
sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX; sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX;
sStart = x + (60 - sWidth - sOffset * 2) / 2; sStart = x + (60 - sWidth - sOffset * 2) / 2;
BltVideoObjectOutlineFromIndex(FRAME_BUFFER, uiVideoObjectIndex, usGraphicNum, sStart, y + 2, Get16BPPColor(FROMRGB(250, 0, 0)), FALSE); BltVideoObjectOutlineFromIndex(FRAME_BUFFER, uiVideoObjectIndex, usGraphicNum, sStart, y + 2, Get16BPPColor(FROMRGB(250, 0, 0)), FALSE);
// Display item name // Display item name
CHAR16 pStr[100]; CHAR16 pStr[100];
CHAR16 pItemName[SIZE_ITEM_NAME]; CHAR16 pItemName[SIZE_ITEM_NAME];
@@ -583,16 +588,15 @@ void RenderEditorItemsInfo()
SetFont(BLOCKFONTNARROW); SetFont(BLOCKFONTNARROW);
SetFontForeground(FONT_LTGREEN); SetFontForeground(FONT_LTGREEN);
SetFontShadow(FONT_NEARBLACK); SetFontShadow(FONT_NEARBLACK);
// item index no // item index number
mprintf( x + 12, y + 18, L"%d", eInfo.pusItemIndex[ i ] ); mprintf( x + 12, y + 18, L"%d", eInfo.pusItemIndex[ i ] );
// index no within usItemClass // index number within usItemClass
SetFontForeground( FONT_LTBLUE ); SetFontForeground( FONT_LTBLUE );
mprintf( x + 40, y + 18, L"%d", i ); mprintf( x + 40, y + 18, L"%d", i );
// numbers of each visible item // numbers of each visible item
usNumItems = CountNumberOfEditorPlacementsInWorld( i, &usQuantity ); usNumItems = CountNumberOfEditorPlacementsInWorld( i, &usQuantity );
if( usNumItems ) if( usNumItems )
{ {
SetFont( FONT10ARIAL ); SetFont( FONT10ARIAL );