Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » bold border on the inventory items
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: bold border on the inventory items[message #257571]
|
Mon, 26 July 2010 17:04 
|
|
mgl |
  |
Messages:255
Registered:December 2007 Location: France |
|
|
I think it's more a problem in the code with the outline function and the compiler from Microsoft than a setting. The outline function uses the "TRANSPARENT" keyword (as a palette index or a colour value for a pixel, I don't know yet), which is another name for 0. It seems that MSVC uses that keyword too, but as a name for another value than 0.
BirdFlu noticed the problem with "TRANSPARENT" and MSVC some time ago. But his fix was not included in svn.
If 7059hotfix3 was built with MSVC, it's probably the problem.
@BirdFlu
Do you have a diff file rather than the painful list of changes to do by hand that I linked ?
*Edit:*
I did the diff file myself from the SMP project files:
TRANSPARENT is now called TRANSPARENT_INDEX as suggested by BirdFlu
INPUT_MOUSE is now called SGP_INPUT_MOUSE (unrelated to this problem but related to MSVC).
The updated files are:
Build/Laptop/AIMMembers.cc
Build/Laptop/Personnel.cc
Build/Tactical/Interface_Items.cc
Build/Tactical/ShopKeeper_Interface.cc
Build/Tactical/Interface_Panels.cc
Build/Editor/EditorItems.cc
Build/Editor/EditorMercs.cc
Build/Strategic/Map_Screen_Interface_Map_Inventory.cc
Build/Strategic/MapScreen.cc
Build/TileEngine/RenderWorld.cc
sgp/Cursor_Control.cc
sgp/VObject_Blitters.cc
sgp/Types.h
Build/GameLoop.cc
sgp/Input.h
The diff file for people who can build the program themselves: "keywords_MSVC.diff"
It's rather big and I had to remove several chunks which were parts of some of my patches, two reasons why I'm not sure that the "patch" program will be successful.
I will host it somewhere with my other fixes which were not included to stracciatella.
Index: Build/Laptop/AIMMembers.cc
===================================================================
--- Build/Laptop/AIMMembers.cc (revision 7065)
+++ Build/Laptop/AIMMembers.cc (working copy)
@@ -896,7 +896,7 @@
// Blt the shadow of the item
BltVideoObjectOutlineShadow(FRAME_BUFFER, &item_vo, item.ubGraphicNum, sCenX - 2, sCenY + 2);
// Blt the item
- BltVideoObjectOutline( FRAME_BUFFER, &item_vo, item.ubGraphicNum, sCenX, sCenY, TRANSPARENT);
+ BltVideoObjectOutline( FRAME_BUFFER, &item_vo, item.ubGraphicNum, sCenX, sCenY, TRANSPARENT_INDEX);
/* If there are more then 1 piece of equipment in the current slot, display
* how many there are */
Index: Build/Laptop/Personnel.cc
===================================================================
--- Build/Laptop/Personnel.cc (revision 7065)
+++ Build/Laptop/Personnel.cc (working copy)
@@ -1163,7 +1163,7 @@
ETRLEObject const& pTrav = gfx.SubregionProperties(item.ubGraphicNum);
INT16 const cen_x = PosX + abs(57 - pTrav.usWidth) / 2 - pTrav.sOffsetX;
INT16 const cen_y = PosY + abs(22 - pTrav.usHeight) / 2 - pTrav.sOffsetY;
- BltVideoObjectOutline(FRAME_BUFFER, &gfx, item.ubGraphicNum, cen_x, cen_y, TRANSPARENT);
+ BltVideoObjectOutline(FRAME_BUFFER, &gfx, item.ubGraphicNum, cen_x, cen_y, TRANSPARENT_INDEX);
SetFontDestBuffer(FRAME_BUFFER);
Index: Build/Tactical/Interface_Items.cc
===================================================================
--- Build/Tactical/Interface_Items.cc (revision 7065)
+++ Build/Tactical/Interface_Items.cc (working copy)
@@ -800,7 +800,7 @@
MOUSE_REGION& r = gSMInvRegion[pocket];
bool hatch_out = false;
- UINT16 outline = TRANSPARENT;
+ UINT16 outline = TRANSPARENT_INDEX;
if (dirty_level == DIRTYLEVEL2)
{
wchar_t buf[150];
@@ -2296,7 +2308,7 @@
INT16 const item_y = agi.item_box.y + y;
INT16 const item_w = agi.item_box.w;
INT16 const item_h = agi.item_box.h;
- INVRenderItem(guiSAVEBUFFER, NULL, obj, item_x, item_y, item_w, item_h, DIRTYLEVEL2, RENDER_ITEM_ATTACHMENT1 + i, TRANSPARENT);
+ INVRenderItem(guiSAVEBUFFER, NULL, obj, item_x, item_y, item_w, item_h, DIRTYLEVEL2, RENDER_ITEM_ATTACHMENT1 + i, TRANSPARENT_INDEX);
INT16 const bar_x = agi.bar_box.x + x;
INT16 const bar_h = agi.bar_box.h;
@@ -3870,7 +3891,7 @@
INT16 sX = gsItemPopupX + cnt * usWidth + 11;
INT16 sY = gsItemPopupY + 3;
- INVRenderItem(FRAME_BUFFER, NULL, *gpItemPopupObject, sX, sY, 29, 23, DIRTYLEVEL2, RENDER_ITEM_NOSTATUS, TRANSPARENT);
+ INVRenderItem(FRAME_BUFFER, NULL, *gpItemPopupObject, sX, sY, 29, 23, DIRTYLEVEL2, RENDER_ITEM_NOSTATUS, TRANSPARENT_INDEX);
// Do status bar here...
INT16 sNewX = gsItemPopupX + cnt * usWidth + 7;
@@ -4047,7 +4068,7 @@
o.usItem = FIRST_KEY + LockTable[key->ubKeyID].usKeyItem;
DrawItemUIBarEx(o, 0, x + 7, y + 24, ITEM_BAR_HEIGHT, Get16BPPColor(STATUS_BAR), Get16BPPColor(STATUS_BAR_SHADOW), FRAME_BUFFER);
- INVRenderItem(FRAME_BUFFER, NULL, o, x + 8, y, box_w - 8, box_h - 2, DIRTYLEVEL2, 0, TRANSPARENT);
+ INVRenderItem(FRAME_BUFFER, NULL, o, x + 8, y, box_w - 8, box_h - 2, DIRTYLEVEL2, 0, TRANSPARENT_INDEX);
}
InvalidateRegion(dx, dy, dx + gsKeyRingPopupInvWidth, dy + gsKeyRingPopupInvHeight);
@@ -4731,7 +4752,7 @@
// ATE: Adjust to basic shade.....
te->hTileSurface->CurrentShade(4);
- UINT16 const outline = (menu.pfSelectedArray[cnt + menu.ubScrollAnchor] ? outline_col : TRANSPARENT);
+ UINT16 const outline = (menu.pfSelectedArray[cnt + menu.ubScrollAnchor] ? outline_col : TRANSPARENT_INDEX);
Blt8BPPDataTo16BPPBufferOutline(pDestBuf, uiDestPitchBYTES, te->hTileSurface, sX, sY, te->usRegionIndex, outline);
if (o.ubNumberOfObjects > 1)
Index: Build/Tactical/ShopKeeper_Interface.cc
===================================================================
--- Build/Tactical/ShopKeeper_Interface.cc (revision 7065)
+++ Build/Tactical/ShopKeeper_Interface.cc (working copy)
@@ -2053,7 +2053,7 @@
}
else if (gubSkiDirtyLevel != SKI_DIRTY_LEVEL0)
{
- outline = TRANSPARENT;
+ outline = TRANSPARENT_INDEX;
}
else
{ // The item is not highlighted and we are not rerendering the screen
Index: Build/Tactical/Interface_Panels.cc
===================================================================
--- Build/Tactical/Interface_Panels.cc (revision 7065)
+++ Build/Tactical/Interface_Panels.cc (working copy)
@@ -2946,7 +2946,7 @@
}
else
{ // Look in primary hand
- INVRenderItem(buf, &s, s.inv[HANDPOS], x, y, w, h, dirty_level, 0, TRANSPARENT);
+ INVRenderItem(buf, &s, s.inv[HANDPOS], x, y, w, h, dirty_level, 0, TRANSPARENT_INDEX);
}
y += TM_INV_HAND_SEPY;
@@ -2957,7 +2957,7 @@
}
else
{ // Do secondary hand
- INVRenderItem(buf, &s, s.inv[SECONDHANDPOS], x, y, w, h, dirty_level, 0, TRANSPARENT);
+ INVRenderItem(buf, &s, s.inv[SECONDHANDPOS], x, y, w, h, dirty_level, 0, TRANSPARENT_INDEX);
}
}
Index: Build/Editor/EditorItems.cc
===================================================================
--- Build/Editor/EditorItems.cc (revision 7065)
+++ Build/Editor/EditorItems.cc (working copy)
@@ -316,7 +316,7 @@
swprintf(pStr, lengthof(pStr), L"%hs", LockTable[i].ubEditorName);
DisplayWrappedString(x, y + 25, 60, 2, SMALLCOMPFONT, FONT_WHITE, pStr, FONT_BLACK, CENTER_JUSTIFIED | MARK_DIRTY);
- DrawItemCentered(Item[item_id], eInfo.uiBuffer, x, y + 2, TRANSPARENT);
+ DrawItemCentered(Item[item_id], eInfo.uiBuffer, x, y + 2, TRANSPARENT_INDEX);
//cycle through the various slot positions (0,0), (0,40), (60,0), (60,40), (120,0)...
if( y == 0 )
@@ -444,7 +444,7 @@
}
DisplayWrappedString(x, y + 25, 60, 2, SMALLCOMPFONT, FONT_WHITE, pStr, FONT_BLACK, CENTER_JUSTIFIED | MARK_DIRTY);
- DrawItemCentered(*item, eInfo.uiBuffer, x, y + 2, TRANSPARENT);
+ DrawItemCentered(*item, eInfo.uiBuffer, x, y + 2, TRANSPARENT_INDEX);
//cycle through the various slot positions (0,0), (0,40), (60,0), (60,40), (120,0)...
if( y == 0 )
Index: Build/Editor/EditorMercs.cc
===================================================================
--- Build/Editor/EditorMercs.cc (revision 7065)
+++ Build/Editor/EditorMercs.cc (working copy)
@@ -2163,7 +2163,7 @@
//now draw the fullsize item into the temp buffer
INVTYPE const& item = Item[gusMercsNewItemIndex];
SGPVObject const& vo = GetInterfaceGraphicForItem(item);
- BltVideoObjectOutline(uiSrcID, &vo, item.ubGraphicNum, 0, 0, TRANSPARENT);
+ BltVideoObjectOutline(uiSrcID, &vo, item.ubGraphicNum, 0, 0, TRANSPARENT_INDEX);
//crop the source image
ETRLEObject const& pObject = vo.SubregionProperties(item.ubGraphicNum);
Index: Build/Strategic/Map_Screen_Interface_Map_Inventory.cc
===================================================================
--- Build/Strategic/Map_Screen_Interface_Map_Inventory.cc (revision 7065)
+++ Build/Strategic/Map_Screen_Interface_Map_Inventory.cc (working copy)
@@ -205,7 +205,7 @@
SetFontDestBuffer(guiSAVEBUFFER);
const SGPBox* const item_box = &g_sector_inv_item_box;
- const UINT16 outline = (fMapInventoryItemCompatable[iCurrentSlot] ? Get16BPPColor(FROMRGB(255, 255, 255)) : TRANSPARENT);
+ const UINT16 outline = (fMapInventoryItemCompatable[iCurrentSlot] ? Get16BPPColor(FROMRGB(255, 255, 255)) : TRANSPARENT_INDEX);
INVRenderItem(guiSAVEBUFFER, NULL, item->o, dx + item_box->x, dy + item_box->y, item_box->w, item_box->h, DIRTYLEVEL2, 0, outline);
// draw bar for condition
Index: Build/Strategic/MapScreen.cc
===================================================================
--- Build/Strategic/MapScreen.cc (revision 7065)
+++ Build/Strategic/MapScreen.cc (working copy)
@@ -712,7 +712,7 @@
SOLDIERTYPE const* const s = GetSelectedInfoChar();
if (!s || s->bLife == 0) return;
- INVRenderItem(guiSAVEBUFFER, s, s->inv[HANDPOS], SOLDIER_HAND_X, SOLDIER_HAND_Y, 58, 23, DIRTYLEVEL2, 0, TRANSPARENT);
+ INVRenderItem(guiSAVEBUFFER, s, s->inv[HANDPOS], SOLDIER_HAND_X, SOLDIER_HAND_Y, 58, 23, DIRTYLEVEL2, 0, TRANSPARENT_INDEX);
}
Index: Build/TileEngine/RenderWorld.cc
===================================================================
--- Build/TileEngine/RenderWorld.cc (revision 7065)
+++ Build/TileEngine/RenderWorld.cc (working copy)
@@ -1280,7 +1285,7 @@
}
else if (bBlitClipVal == TRUE)
{
- Blt8BPPDataTo16BPPBufferOutlineClip(pDestBuf, uiDestPitchBYTES, hVObject, sXPos, sYPos, usImageIndex, TRANSPARENT, &gClippingRect);
+ Blt8BPPDataTo16BPPBufferOutlineClip(pDestBuf, uiDestPitchBYTES, hVObject, sXPos, sYPos, usImageIndex, TRANSPARENT_INDEX, &gClippingRect);
}
}
}
Index: sgp/Cursor_Control.cc
===================================================================
--- sgp/Cursor_Control.cc (revision 7065)
+++ sgp/Cursor_Control.cc (working copy)
@@ -206,7 +206,7 @@
UINT16 const usEffHeight = pTrav.usHeight + pTrav.sOffsetY;
UINT16 const usEffWidth = pTrav.usWidth + pTrav.sOffsetX;
- BltVideoObjectOutline(MOUSE_BUFFER, guiExternVo, gusExternVoSubIndex, 0, 0, TRANSPARENT);
+ BltVideoObjectOutline(MOUSE_BUFFER, guiExternVo, gusExternVoSubIndex, 0, 0, TRANSPARENT_INDEX);
// Hook into hook function
if (gMouseBltOverride != NULL) gMouseBltOverride();
Index: sgp/VObject_Blitters.cc
===================================================================
--- sgp/VObject_Blitters.cc (revision 7065)
+++ sgp/VObject_Blitters.cc (working copy)
@@ -6653,7 +6653,7 @@
}
-// ATE New blitter for rendering a differrent color for value 254. Can be transparent if outline is TRANSPARENT
+// ATE New blitter for rendering a differrent color for value 254. Can be transparent if outline is TRANSPARENT_INDEX
void Blt8BPPDataTo16BPPBufferOutline(UINT16* const buf, UINT32 const uiDestPitchBYTES, SGPVObject const* const hSrcVObject, INT32 const iX, INT32 const iY, UINT16 const usIndex, INT16 const outline)
{
Assert(hSrcVObject);
@@ -6699,7 +6699,7 @@
{
*dst = pal[px];
}
- else if (outline != TRANSPARENT)
+ else if (outline != TRANSPARENT_INDEX)
{
*dst = outline;
}
@@ -6783,7 +6783,7 @@
}
-// ATE New blitter for rendering a differrent color for value 254. Can be transparent if s16BPPColor is TRANSPARENT
+// ATE New blitter for rendering a differrent color for value 254. Can be transparent if s16BPPColor is TRANSPARENT_INDEX
void Blt8BPPDataTo16BPPBufferOutlineClip(UINT16* const pBuffer, const UINT32 uiDestPitchBYTES, const SGPVObject* const hSrcVObject, const INT32 iX, const INT32 iY, const UINT16 usIndex, const INT16 s16BPPColor, const SGPRect* const clipregion)
{
UINT32 Unblitted;
@@ -6920,7 +6920,7 @@
{
*(UINT16*)DestPtr = p16BPPPalette[src];
}
- else if (s16BPPColor != TRANSPARENT)
+ else if (s16BPPColor != TRANSPARENT_INDEX)
{
*(UINT16*)DestPtr = s16BPPColor;
}
Index: sgp/Types.h
===================================================================
--- sgp/Types.h (revision 7065)
+++ sgp/Types.h (working copy)
@@ -140,7 +140,7 @@
typedef SGPFile* HWFILE;
-#define TRANSPARENT ((UINT16)0)
+#define TRANSPARENT_INDEX ((UINT16)0)
#ifdef __cplusplus
Index: Build/GameLoop.cc
===================================================================
--- Build/GameLoop.cc (revision 7065)
+++ Build/GameLoop.cc (working copy)
@@ -208,7 +208,7 @@
MouseSystemHook(MOUSE_POS, MousePos.iX, MousePos.iY);
MusicPoll();
- while (DequeueSpecificEvent(&InputEvent, INPUT_MOUSE))
+ while (DequeueSpecificEvent(&InputEvent, SGP_INPUT_MOUSE))
{
MouseSystemHook(InputEvent.usEvent, MousePos.iX, MousePos.iY);
}
Index: sgp/Input.h
===================================================================
--- sgp/Input.h (revision 7065)
+++ sgp/Input.h (working copy)
@@ -18,7 +18,7 @@
#define MOUSE_POS 0x0400
#define MOUSE_WHEEL_UP 0x0800
#define MOUSE_WHEEL_DOWN 0x1000
-#define INPUT_MOUSE 0x1FF8
+#define SGP_INPUT_MOUSE 0x1FF8
#define SHIFT_DOWN 0x01
#define CTRL_DOWN 0x02
[Updated on: Mon, 26 July 2010 20:50] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu May 14 07:10:46 GMT+3 2026
Total time taken to generate the page: 0.00734 seconds
|