diff --git a/Editor/EditorItems.cpp b/Editor/EditorItems.cpp index 457162626..60afbaf29 100644 --- a/Editor/EditorItems.cpp +++ b/Editor/EditorItems.cpp @@ -137,11 +137,7 @@ void EntryInitEditorItemsInfo() { INT32 i; INVTYPE *item; - eInfo.uiBuffer = 0; - eInfo.fKill = 0; eInfo.fActive = 0; - eInfo.sWidth = 0; - eInfo.sHeight = 0; eInfo.sScrollIndex = 0; eInfo.sSelItemIndex = 0; eInfo.sHilitedItemIndex = -1; @@ -223,20 +219,10 @@ void EntryInitEditorItemsInfo() void InitEditorItemsInfo(UINT32 uiItemType) { - VSURFACE_DESC vs_desc; - UINT8 *pDestBuf, *pSrcBuf; - UINT32 uiSrcPitchBYTES, uiDestPitchBYTES; INVTYPE *item; - SGPRect SaveRect, NewRect; - HVOBJECT hVObject; - UINT32 uiVideoObjectIndex; - UINT16 usUselessWidth, usUselessHeight; - INT32 sWidth, sOffset, sStart; - INT32 i, x, y; + SGPRect SaveRect; + INT32 i; UINT16 usCounter; - CHAR16 pStr[ 100 ];//, pStr2[ 100 ]; - CHAR16 pItemName[SIZE_ITEM_NAME]; - UINT8 ubBitDepth; BOOLEAN fTypeMatch; INT32 iEquipCount = 0; @@ -327,95 +313,23 @@ void InitEditorItemsInfo(UINT32 uiItemType) //Allocate memory to store all the item pointers. if(eInfo.sNumItems)//dnl ch78 271113 eInfo.pusItemIndex = (UINT16*)MemAlloc( sizeof(UINT16) * eInfo.sNumItems ); + //Disable the appropriate scroll buttons based on the saved scroll index if applicable - //Left most scroll position DetermineItemsScrolling(); - //calculate the width of the buffer based on the number of items. - //every pair of items (odd rounded up) requires 60 pixels for width. - //the minimum buffer size is 420. Height is always 80 pixels. - eInfo.sWidth = (eInfo.sNumItems > 12) ? (((INT32) eInfo.sNumItems+1)/2)*60 : 360;//dnl ch77 251113 was (SCREEN_HEIGHT - 120) but editor crash if resolution is 1024x768 - eInfo.sHeight = 80; - // Create item buffer - GetCurrentVideoSettings( &usUselessWidth, &usUselessHeight, &ubBitDepth ); - vs_desc.fCreateFlags = VSURFACE_CREATE_DEFAULT | VSURFACE_SYSTEM_MEM_USAGE; - vs_desc.usWidth = eInfo.sWidth; - vs_desc.usHeight = eInfo.sHeight; - vs_desc.ubBitDepth = ubBitDepth; - - //!!!Memory check. Create the item buffer - if(!AddVideoSurface( &vs_desc, &eInfo.uiBuffer )) - { - eInfo.fKill = TRUE; - eInfo.fActive = FALSE; - return; - } - - pDestBuf = LockVideoSurface(eInfo.uiBuffer, &uiDestPitchBYTES); - pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES); - - //copy a blank chunk of the editor interface to the new buffer. - for( i=0; iubGraphicNum; - //Calculate the center position of the graphic in a 60 pixel wide area. - sWidth = hVObject->pETRLEObject[usGraphicNum].usWidth; - sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX; - sStart = x + (60 - sWidth - sOffset*2) / 2; - - BltVideoObjectOutlineFromIndex( eInfo.uiBuffer, uiVideoObjectIndex, usGraphicNum, sStart, y+2, 0, FALSE ); - - //cycle through the various slot positions (0,0), (0,40), (60,0), (60,40), (120,0)... - if( y == 0 ) - { - y = 40; - } - else - { - y = 0; - x += 60; - } + eInfo.pusItemIndex[i] = KeyTable[LockTable[i].usKeyItem].usItem; } } else for( i = 0; i < eInfo.sNumItems; i++ ) { - // Go through the items, and divide them into different classes. Store the item index for blitting later in RenderEditorItemsInfo() fTypeMatch = FALSE; while( usCounter