If you want to speed up loading and reduce the impact on memory.
I recommend starting with the ZzzOpenData.cpp file.
This is very bad!
PHP Code:
//////////////////////////////////////////////////////////////////////////
// °Ë. MODEL_SWORD
//////////////////////////////////////////////////////////////////////////
#ifdef _VS2008PORTING
for(int i=0;i<17;i++)
#else // _VS2008PORTING
for(i=0;i<17;i++)
#endif // _VS2008PORTING
AccessModel(MODEL_SWORD+i ,"Data\\Item\\","Sword" ,i+1); // °Ë.
AccessModel(MODEL_SWORD+17 ,"Data\\Item\\","Sword" ,18); // ´ŮĹ©şę·ąŔĚÄż.
AccessModel(MODEL_SWORD+18 ,"Data\\Item\\","Sword" ,19); // Ľ±´ő şę·ąŔ̵ĺ.
AccessModel(MODEL_SWORD+19 ,"Data\\Item\\","Sword" ,20); // ´ëõ»çŔÇ Ŕý´ë°Ë.
AccessModel(MODEL_SWORD+20 ,"Data\\Item\\","Sword" ,21); // ¸¶°Ë»ç Ăß°ˇ°Ë
AccessModel(MODEL_SWORD+21 ,"Data\\Item\\","Sword" ,22); // ±â»ç Ăß°ˇ°Ë
AccessModel ( MODEL_SWORD+31, "Data\\Item\\", "Sword", 32 ); // ¸¶°Ë»ç ¸¶ąý°Ë.
What about?
PHP Code:
void OpenSwordItems()
{
int i = 0;
int maxSword = 32;
for(i=0; i<maxSword; i++) // <= Indicate the actual number of weapons.
{
//If you want to skip an item.
if ((i >= 0 && i <= 21)
|| i == 31)
{
AccessModel(MODEL_SWORD+i ,"Data\\Item\\","Sword" ,i+1); // °Ë.
}
#ifdef ADD_SOCKET_ITEM
else if ((i >= 26 && i <= 28))
{
AccessModel(MODEL_SWORD+i ,"Data\\Item\\","Sword_" ,i+1); // °Ë.
}
#endif
else if (i == 22)
{
AccessModel(MODEL_SWORD+i, "Data\\Item\\", "HDK_Sword");
}
else if (i == 23)
{
AccessModel(MODEL_SWORD+i, "Data\\Item\\", "HDK_Sword2");
}
else if (i == 24)
{
AccessModel(MODEL_SWORD+i, "Data\\Item\\", "CW_Sword");
}
else if (i == 25)
{
AccessModel(MODEL_SWORD+i, "Data\\Item\\", "CW_Sword2");
}
}
}
It is much better to create a function that loads all sword models in one cycle.
Everything is in one place and there is no need to write anything outside the cycle.
It is not the cleanest solution.
It is better to load all swords in one way like Sword_XXX.bmd. Then there is no need to make an exception on the id.
The ZzzOpenData.cpp file is full of errors. These mistakes are really terrible and I can't explain how someone could have made them.