- Reverted the usage of the externalized XML tileset structure (ja2Set.dat.xml) and also removed the additional P4-P9 items

o Disabled the usage, because it seems to cause some problems when loading the maps (reported by Smeagol)
o Now it is possible again to choose if we want the XML tileset structure or the binary one (ja2.ini -> USE_XML_TILESETS)
o If we later need the additional P4-P9 items we can enable it again and have to check carefully what causes the problems

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5205 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-04-12 20:53:38 +00:00
parent 83c4ebc8c6
commit 5817dee775
5 changed files with 280 additions and 277 deletions
+4 -2
View File
@@ -1484,8 +1484,10 @@ void GetRuntimeSettings( )
// Yes, you have to start a game with an older executable where p4-p9 is not integrated (see: TileDat.h -> enum TileTypeDefines)
// Once the game reaches the main menu, the ja2Set.dat.xml file will be
// available in the "Profiles" folder of the MOD
//g_bUseXML_Tilesets = oProps.getBoolProperty(L"Ja2 Settings", L"USE_XML_TILESETS", false);
g_bUseXML_Tilesets = true;
//g_bUseXML_Tilesets = true;
// WANNE: Yes, make it optional again
g_bUseXML_Tilesets = oProps.getBoolProperty(L"Ja2 Settings", L"USE_XML_TILESETS", false);
g_bUseXML_Strings = oProps.getBoolProperty(L"Ja2 Settings", L"USE_XML_STRINGS", false);
s_bExportStrings = oProps.getBoolProperty(L"Ja2 Settings", L"EXPORT_STRINGS", false);
+124 -123
View File
@@ -9193,37 +9193,38 @@ UINT32 GetInterfaceGraphicForItem( INVTYPE *pItem )
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP3ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP3ITEMS,
L"Failed to retrieve P3 item image" );
}
//MM: New item tileslots start here
else if ( pItem->ubGraphicType == 4 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP4ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP4ITEMS,
L"Failed to retrieve P4 item image" );
}
else if ( pItem->ubGraphicType == 5 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP5ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP5ITEMS,
L"Failed to retrieve P5 item image" );
}
else if ( pItem->ubGraphicType == 6 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP6ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP6ITEMS,
L"Failed to retrieve P6 item image" );
}
else if ( pItem->ubGraphicType == 7 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP7ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP7ITEMS,
L"Failed to retrieve P7 item image" );
}
else if ( pItem->ubGraphicType == 8 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP8ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP8ITEMS,
L"Failed to retrieve P8 item image" );
}
else
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP9ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP9ITEMS,
L"Failed to retrieve P9 item image" );
}
////MM: New item tileslots start here
//else if ( pItem->ubGraphicType == 4 )
//{
// SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP4ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP4ITEMS,
// L"Failed to retrieve P4 item image" );
//}
//else if ( pItem->ubGraphicType == 5 )
//{
// SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP5ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP5ITEMS,
// L"Failed to retrieve P5 item image" );
//}
//else if ( pItem->ubGraphicType == 6 )
//{
// SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP6ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP6ITEMS,
// L"Failed to retrieve P6 item image" );
//}
//else if ( pItem->ubGraphicType == 7 )
//{
// SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP7ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP7ITEMS,
// L"Failed to retrieve P7 item image" );
//}
//else if ( pItem->ubGraphicType == 8 )
//{
// SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP8ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP8ITEMS,
// L"Failed to retrieve P8 item image" );
//}
//else
//{
// SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP9ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP9ITEMS,
// L"Failed to retrieve P9 item image" );
//}
return id;
}
@@ -9251,31 +9252,31 @@ UINT16 GetTileGraphicForItem( INVTYPE *pItem )
{
GetTileIndexFromTypeSubIndex( P3ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
//MM: New item tileslots start here
else if ( pItem->ubGraphicType == 4 )
{
GetTileIndexFromTypeSubIndex( P4ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 5 )
{
GetTileIndexFromTypeSubIndex( P5ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 6 )
{
GetTileIndexFromTypeSubIndex( P6ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 7 )
{
GetTileIndexFromTypeSubIndex( P7ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 8 )
{
GetTileIndexFromTypeSubIndex( P8ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else
{
GetTileIndexFromTypeSubIndex( P9ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
////MM: New item tileslots start here
//else if ( pItem->ubGraphicType == 4 )
//{
// GetTileIndexFromTypeSubIndex( P4ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 5 )
//{
// GetTileIndexFromTypeSubIndex( P5ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 6 )
//{
// GetTileIndexFromTypeSubIndex( P6ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 7 )
//{
// GetTileIndexFromTypeSubIndex( P7ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else if ( pItem->ubGraphicType == 8 )
//{
// GetTileIndexFromTypeSubIndex( P8ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
//else
//{
// GetTileIndexFromTypeSubIndex( P9ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
//}
if ( pItem->ubClassIndex >= M900 )
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("GetTileGraphicForItem: db index %d",usIndex));
@@ -9344,73 +9345,73 @@ BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo )
sprintf( zName, "p3item%d", ubGraphic );
}
}
//MM: New item tileslots start here
else if ( pItem->ubGraphicType == 4 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p4item0%d", ubGraphic );
}
else
{
sprintf( zName, "p4item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 5 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p5item0%d", ubGraphic );
}
else
{
sprintf( zName, "p5item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 6 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p6item0%d", ubGraphic );
}
else
{
sprintf( zName, "p6item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 7 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p7item0%d", ubGraphic );
}
else
{
sprintf( zName, "p7item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 8 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p8item0%d", ubGraphic );
}
else
{
sprintf( zName, "p8item%d", ubGraphic );
}
}
else
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p9item0%d", ubGraphic );
}
else
{
sprintf( zName, "p9item%d", ubGraphic );
}
}
////MM: New item tileslots start here
//else if ( pItem->ubGraphicType == 4 )
//{
// if ( ubGraphic < 10 )
// {
// sprintf( zName, "p4item0%d", ubGraphic );
// }
// else
// {
// sprintf( zName, "p4item%d", ubGraphic );
// }
//}
//else if ( pItem->ubGraphicType == 5 )
//{
// if ( ubGraphic < 10 )
// {
// sprintf( zName, "p5item0%d", ubGraphic );
// }
// else
// {
// sprintf( zName, "p5item%d", ubGraphic );
// }
//}
//else if ( pItem->ubGraphicType == 6 )
//{
// if ( ubGraphic < 10 )
// {
// sprintf( zName, "p6item0%d", ubGraphic );
// }
// else
// {
// sprintf( zName, "p6item%d", ubGraphic );
// }
//}
//else if ( pItem->ubGraphicType == 7 )
//{
// if ( ubGraphic < 10 )
// {
// sprintf( zName, "p7item0%d", ubGraphic );
// }
// else
// {
// sprintf( zName, "p7item%d", ubGraphic );
// }
//}
//else if ( pItem->ubGraphicType == 8 )
//{
// if ( ubGraphic < 10 )
// {
// sprintf( zName, "p8item0%d", ubGraphic );
// }
// else
// {
// sprintf( zName, "p8item%d", ubGraphic );
// }
//}
//else
//{
// if ( ubGraphic < 10 )
// {
// sprintf( zName, "p9item0%d", ubGraphic );
// }
// else
// {
// sprintf( zName, "p9item%d", ubGraphic );
// }
//}
//Load item
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+71 -71
View File
@@ -173,82 +173,82 @@ bool RegisterItemImages()
//MM: New item tileslots start here
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp4items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP4ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp4items.sti" );
}
else if(!g_oP4ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP4ITEMS/*.png"))
{
return false;
}
//if(!g_bUsePngItemImages)
//{
// VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// FilenameForBPP("INTERFACE\\mdp4items.sti", VObjectDesc.ImageFile);
// if( !AddVideoObject( &VObjectDesc, &guiP4ITEMS ) )
// AssertMsg(0, "Missing INTERFACE\\mdp4items.sti" );
//}
//else if(!g_oP4ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP4ITEMS/*.png"))
//{
// return false;
//}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp5items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP5ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp5items.sti" );
}
else if(!g_oP5ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP5ITEMS/*.png"))
{
return false;
}
// // LOAD INTERFACE ITEM PICTURES
//if(!g_bUsePngItemImages)
//{
// VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// FilenameForBPP("INTERFACE\\mdp5items.sti", VObjectDesc.ImageFile);
// if( !AddVideoObject( &VObjectDesc, &guiP5ITEMS ) )
// AssertMsg(0, "Missing INTERFACE\\mdp5items.sti" );
//}
//else if(!g_oP5ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP5ITEMS/*.png"))
//{
// return false;
//}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp6items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP6ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp6items.sti" );
}
else if(!g_oP6ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP6ITEMS/*.png"))
{
return false;
}
// // LOAD INTERFACE ITEM PICTURES
//if(!g_bUsePngItemImages)
//{
// VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// FilenameForBPP("INTERFACE\\mdp6items.sti", VObjectDesc.ImageFile);
// if( !AddVideoObject( &VObjectDesc, &guiP6ITEMS ) )
// AssertMsg(0, "Missing INTERFACE\\mdp6items.sti" );
//}
//else if(!g_oP6ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP6ITEMS/*.png"))
//{
// return false;
//}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp7items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP7ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp7items.sti" );
}
else if(!g_oP7ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP7ITEMS/*.png"))
{
return false;
}
// // LOAD INTERFACE ITEM PICTURES
//if(!g_bUsePngItemImages)
//{
// VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// FilenameForBPP("INTERFACE\\mdp7items.sti", VObjectDesc.ImageFile);
// if( !AddVideoObject( &VObjectDesc, &guiP7ITEMS ) )
// AssertMsg(0, "Missing INTERFACE\\mdp7items.sti" );
//}
//else if(!g_oP7ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP7ITEMS/*.png"))
//{
// return false;
//}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp8items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP8ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp8items.sti" );
}
else if(!g_oP8ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP8ITEMS/*.png"))
{
return false;
}
// // LOAD INTERFACE ITEM PICTURES
//if(!g_bUsePngItemImages)
//{
// VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// FilenameForBPP("INTERFACE\\mdp8items.sti", VObjectDesc.ImageFile);
// if( !AddVideoObject( &VObjectDesc, &guiP8ITEMS ) )
// AssertMsg(0, "Missing INTERFACE\\mdp8items.sti" );
//}
//else if(!g_oP8ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP8ITEMS/*.png"))
//{
// return false;
//}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp9items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP9ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp9items.sti" );
}
else if(!g_oP9ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP9ITEMS/*.png"))
{
return false;
}
// // LOAD INTERFACE ITEM PICTURES
//if(!g_bUsePngItemImages)
//{
// VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// FilenameForBPP("INTERFACE\\mdp9items.sti", VObjectDesc.ImageFile);
// if( !AddVideoObject( &VObjectDesc, &guiP9ITEMS ) )
// AssertMsg(0, "Missing INTERFACE\\mdp9items.sti" );
//}
//else if(!g_oP9ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP9ITEMS/*.png"))
//{
// return false;
//}
return true;
}
+7 -7
View File
@@ -588,13 +588,13 @@ UINT16 gNumTilesPerType[ NUMBEROFTILETYPES ] =
THIRDMISS14 - THIRDMISS1 + 1,
WIREFRAMES15 - WIREFRAMES1 + 1,
//MM: New item tileslots start here
P4ITEM5000 - P4ITEM1 + 1,
P5ITEM5000 - P5ITEM1 + 1,
P6ITEM5000 - P6ITEM1 + 1,
P7ITEM5000 - P7ITEM1 + 1,
P8ITEM5000 - P8ITEM1 + 1,
P9ITEM5000 - P9ITEM1 + 1
////MM: New item tileslots start here
// P4ITEM5000 - P4ITEM1 + 1,
// P5ITEM5000 - P5ITEM1 + 1,
// P6ITEM5000 - P6ITEM1 + 1,
// P7ITEM5000 - P7ITEM1 + 1,
// P8ITEM5000 - P8ITEM1 + 1,
// P9ITEM5000 - P9ITEM1 + 1
};
+74 -74
View File
@@ -3014,78 +3014,78 @@ enum TileDefines
WIREFRAMES14,
WIREFRAMES15,
//MM: New item tileslots start here
P4ITEM1,
P4ITEM2,
P4ITEM3,
P4ITEM4,
P4ITEM5,
P4ITEM6,
P4ITEM7,
P4ITEM8,
P4ITEM9,
P4ITEM10,
P4ITEM5000 = P4ITEM10 + 4990,
////MM: New item tileslots start here
//P4ITEM1,
//P4ITEM2,
//P4ITEM3,
//P4ITEM4,
//P4ITEM5,
//P4ITEM6,
//P4ITEM7,
//P4ITEM8,
//P4ITEM9,
//P4ITEM10,
//P4ITEM5000 = P4ITEM10 + 4990,
P5ITEM1,
P5ITEM2,
P5ITEM3,
P5ITEM4,
P5ITEM5,
P5ITEM6,
P5ITEM7,
P5ITEM8,
P5ITEM9,
P5ITEM10,
P5ITEM5000 = P5ITEM10 + 4990,
//P5ITEM1,
//P5ITEM2,
//P5ITEM3,
//P5ITEM4,
//P5ITEM5,
//P5ITEM6,
//P5ITEM7,
//P5ITEM8,
//P5ITEM9,
//P5ITEM10,
//P5ITEM5000 = P5ITEM10 + 4990,
P6ITEM1,
P6ITEM2,
P6ITEM3,
P6ITEM4,
P6ITEM5,
P6ITEM6,
P6ITEM7,
P6ITEM8,
P6ITEM9,
P6ITEM10,
P6ITEM5000 = P6ITEM10 + 4990,
//P6ITEM1,
//P6ITEM2,
//P6ITEM3,
//P6ITEM4,
//P6ITEM5,
//P6ITEM6,
//P6ITEM7,
//P6ITEM8,
//P6ITEM9,
//P6ITEM10,
//P6ITEM5000 = P6ITEM10 + 4990,
P7ITEM1,
P7ITEM2,
P7ITEM3,
P7ITEM4,
P7ITEM5,
P7ITEM6,
P7ITEM7,
P7ITEM8,
P7ITEM9,
P7ITEM10,
P7ITEM5000 = P7ITEM10 + 4990,
//P7ITEM1,
//P7ITEM2,
//P7ITEM3,
//P7ITEM4,
//P7ITEM5,
//P7ITEM6,
//P7ITEM7,
//P7ITEM8,
//P7ITEM9,
//P7ITEM10,
//P7ITEM5000 = P7ITEM10 + 4990,
P8ITEM1,
P8ITEM2,
P8ITEM3,
P8ITEM4,
P8ITEM5,
P8ITEM6,
P8ITEM7,
P8ITEM8,
P8ITEM9,
P8ITEM10,
P8ITEM5000 = P8ITEM10 + 4990,
//P8ITEM1,
//P8ITEM2,
//P8ITEM3,
//P8ITEM4,
//P8ITEM5,
//P8ITEM6,
//P8ITEM7,
//P8ITEM8,
//P8ITEM9,
//P8ITEM10,
//P8ITEM5000 = P8ITEM10 + 4990,
P9ITEM1,
P9ITEM2,
P9ITEM3,
P9ITEM4,
P9ITEM5,
P9ITEM6,
P9ITEM7,
P9ITEM8,
P9ITEM9,
P9ITEM10,
P9ITEM5000 = P9ITEM10 + 4990,
//P9ITEM1,
//P9ITEM2,
//P9ITEM3,
//P9ITEM4,
//P9ITEM5,
//P9ITEM6,
//P9ITEM7,
//P9ITEM8,
//P9ITEM9,
//P9ITEM10,
//P9ITEM5000 = P9ITEM10 + 4990,
NUMBEROFTILES
};
@@ -3290,13 +3290,13 @@ enum TileTypeDefines
WIREFRAMES,
//MM: New item tileslots start here
P4ITEMS,
P5ITEMS,
P6ITEMS,
P7ITEMS,
P8ITEMS,
P9ITEMS,
////MM: New item tileslots start here
//P4ITEMS,
//P5ITEMS,
//P6ITEMS,
//P7ITEMS,
//P8ITEMS,
//P9ITEMS,
NUMBEROFTILETYPES
};