Added vehicle*.dbc

This commit is contained in:
tomrus88 2008-11-26 19:47:07 +03:00
parent af6acab8f8
commit 943963df7e
8 changed files with 51 additions and 23 deletions

View file

@ -132,6 +132,8 @@ TaxiPathNodesByPath sTaxiPathNodesByPath;
static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
@ -437,6 +439,8 @@ void LoadDBCStores(std::string dataPath)
sTaxiPathNodeStore.Clear();
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTotemCategoryStore, dbcPath,"TotemCategory.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapAreaStore, dbcPath,"WorldMapArea.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldSafeLocsStore, dbcPath,"WorldSafeLocs.dbc");

View file

@ -200,6 +200,8 @@ extern TaxiMask sTaxiNodesMask;
extern TaxiPathSetBySource sTaxiPathSetBySource;
extern TaxiPathNodesByPath sTaxiPathNodesByPath;
extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
extern DBCStorage <VehicleEntry> sVehicleStore;
extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;

View file

@ -84,5 +84,7 @@ const char TaxiNodesEntryfmt[]="nifffxxxxxxxxxxxxxxxxxii";
const char TaxiPathEntryfmt[]="niii";
const char TaxiPathNodeEntryfmt[]="diiifffiixx";
const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
const char VehicleEntryfmt[]="niffffiiiiiiiiffffiiiiiifffffffffffssssfifi";
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiii";
const char WorldMapAreaEntryfmt[]="xinxffffix";
const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";

View file

@ -275,10 +275,12 @@ namespace VMAP
{
dirFileName = getDirFileName(pMapId);
}
size_t len = pBasePath.length() + dirFileName.length();
char *filenameBuffer = new char[len+1];
sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), dirFileName.c_str());
FILE* df = fopen(filenameBuffer, "rb");
//size_t len = pBasePath.length() + dirFileName.length();
//char *filenameBuffer = new char[len+1];
//sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), dirFileName.c_str());
std::string fb = pBasePath + dirFileName;
//FILE* df = fopen(filenameBuffer, "rb");
FILE* df = fopen(fb.c_str(), "rb");
if(df)
{
char lineBuffer[FILENAMEBUFFER_SIZE];
@ -288,8 +290,12 @@ namespace VMAP
chomp(name);
if(name.length() >1)
{
sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), name.c_str());
FILE* df2 = fopen(filenameBuffer, "rb");
//size_t len2 = pBasePath.length() + name.length();
//char *filenameBuffer2 = new char[len2+1];
//sprintf(filenameBuffer2, "%s%s", pBasePath.c_str(), name.c_str());
std::string fb2 = pBasePath + name;
//FILE* df2 = fopen(filenameBuffer2, "rb");
FILE* df2 = fopen(fb2.c_str(), "rb");
if(df2)
{
char magic[8];
@ -298,11 +304,12 @@ namespace VMAP
result = true;
fclose(df2);
}
//delete[] filenameBuffer2;
}
}
fclose(df);
}
delete[] filenameBuffer;
//delete[] filenameBuffer;
return result;
}
@ -659,14 +666,16 @@ namespace VMAP
bool MapTree::loadMap(const std::string& pDirFileName, unsigned int pMapTileIdent)
{
bool result = true;
size_t len = iBasePath.length() + pDirFileName.length();
char *filenameBuffer = new char[len+1];
//size_t len = iBasePath.length() + pDirFileName.length();
//char *filenameBuffer = new char[len+1];
if(!hasDirFile(pDirFileName))
{
FilesInDir filesInDir;
result = false;
sprintf(filenameBuffer, "%s%s", iBasePath.c_str(), pDirFileName.c_str());
FILE* df = fopen(filenameBuffer, "rb");
std::string fb = iBasePath + pDirFileName;
//sprintf(filenameBuffer, "%s%s", iBasePath.c_str(), pDirFileName.c_str());
//FILE* df = fopen(filenameBuffer, "rb");
FILE* df = fopen(fb.c_str(), "rb");
if(df)
{
char lineBuffer[FILENAMEBUFFER_SIZE];
@ -726,7 +735,7 @@ namespace VMAP
filesInDir.incRefCount();
}
}
delete [] filenameBuffer;
//delete [] filenameBuffer;
return (result);
}