本文整理汇总了C++中calcDataHash函数的典型用法代码示例。如果您正苦于以下问题:C++ calcDataHash函数的具体用法?C++ calcDataHash怎么用?C++ calcDataHash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了calcDataHash函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: bufferSBODYLoad
/* Load the body stats */
static bool bufferSBODYLoad(const char *fileName, void **ppData)
{
WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
calcDataHash(ini, DATA_SBODY);
if (!loadBodyStats(ini) || !allocComponentList(COMP_BODY, numBodyStats))
{
return false;
}
*ppData = (void *)1;
return true;
}
开发者ID:Warzone2100,项目名称:warzone2100,代码行数:13,代码来源:data.cpp
示例2: dataScriptLoad
// All scripts, binary or otherwise are now passed through this routine
static bool dataScriptLoad(const char* fileName, void **ppData)
{
static const bool printHack = false;
SCRIPT_CODE** psProg = (SCRIPT_CODE**)ppData;
PHYSFS_file* fileHandle;
uint8_t *pBuffer;
PHYSFS_sint64 fileSize = 0;
debug(LOG_WZ, "COMPILING SCRIPT ...%s", GetLastResourceFilename());
fileHandle = PHYSFS_openRead(fileName);
debug(LOG_WZ, "Reading...[directory: %s] %s", PHYSFS_getRealDir(fileName), fileName);
if (fileHandle == NULL)
{
return false;
}
// due to the changes in r2531 we must do this routine a bit different.
fileSize = PHYSFS_fileLength(fileHandle);
pBuffer = malloc(fileSize * sizeof(char));
if (pBuffer == NULL)
{
debug(LOG_FATAL, "Fatal memory allocation, couldn't allocate %lld buffer", fileSize);
abort();
}
PHYSFS_read(fileHandle, pBuffer, 1, fileSize);
calcDataHash(pBuffer, fileSize, DATA_SCRIPT);
free(pBuffer);
PHYSFS_seek(fileHandle, 0); //reset position
*psProg = scriptCompile(fileHandle, SCRIPTTYPE);
PHYSFS_close(fileHandle);
if (!*psProg) // see script.h
{
debug(LOG_ERROR, "Script %s did not compile", GetLastResourceFilename());
return false;
}
if (printHack)
{
cpPrintProgram(*psProg);
}
return true;
}
开发者ID:blezek,项目名称:warzone2100,代码行数:53,代码来源:data.c
示例3: bufferSBRAINLoad
/* Load the Brain stats */
static bool bufferSBRAINLoad(const char *fileName, void **ppData)
{
WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
calcDataHash(ini, DATA_SBRAIN);
if (!loadBrainStats(ini) || !allocComponentList(COMP_BRAIN, numBrainStats))
{
return false;
}
//not interested in this value
*ppData = nullptr;
return true;
}
开发者ID:Warzone2100,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例4: bufferSSTRMODLoad
/* Load the Structure strength modifier stats */
static bool bufferSSTRMODLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_SSTRMOD);
if (!loadStructureStrengthModifiers(pBuffer, size))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例5: bufferSTEMPLLoad
/* Load the Template stats */
static bool bufferSTEMPLLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_STEMP);
if (!loadDroidTemplates(pBuffer, size))
{
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例6: bufferRFUNCLoad
/* Load the research functions */
static bool bufferRFUNCLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_RFUNC);
if (!loadResearchFunctions(pBuffer, size))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例7: bufferSTERRTABLELoad
/* Load the STERRTABLE stats */
static bool bufferSTERRTABLELoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_STERRT);
if (!loadTerrainTable(pBuffer, size))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例8: bufferSFEATLoad
/* Load the Feature stats */
static bool bufferSFEATLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_SFEAT);
if (!loadFeatureStats(pBuffer, size))
{
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例9: bufferSTEMPWEAPLoad
/* Load the Template weapons stats */
static bool bufferSTEMPWEAPLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_STEMPWEAP);
if (!loadDroidWeapons(pBuffer, size))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例10: bufferRCOMPREDLoad
/* Load the research components made redundant */
static bool bufferRCOMPREDLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_RCOMPRED);
if (!loadResearchArtefacts(pBuffer, size, RED_LIST))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例11: bufferRSTRRESLoad
/* Load the research structure results */
static bool bufferRSTRRESLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_RSTRRES);
if (!loadResearchStructures(pBuffer, size, RES_LIST))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例12: bufferSFEATLoad
/* Load the Feature stats */
static bool bufferSFEATLoad(const char *fileName, void **ppData)
{
WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
calcDataHash(ini, DATA_SFEAT);
if (!loadFeatureStats(ini))
{
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return true;
}
开发者ID:Warzone2100,项目名称:warzone2100,代码行数:14,代码来源:data.cpp
示例13: bufferSBODYLoad
/* Load the body stats */
static bool bufferSBODYLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_SBODY);
if (!loadBodyStats(pBuffer, size)
|| !allocComponentList(COMP_BODY, numBodyStats))
{
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:15,代码来源:data.cpp
示例14: bufferSPROPTYPESLoad
/* Load the PropulsionType stats */
static bool bufferSPROPTYPESLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_SPROPTY);
if (!loadPropulsionTypes(pBuffer, size))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:15,代码来源:data.cpp
示例15: bufferSBRAINLoad
/* Load the Brain stats */
static bool bufferSBRAINLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_SBRAIN);
if (!loadBrainStats(pBuffer, size)
|| !allocComponentList(COMP_BRAIN, numBrainStats))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:15,代码来源:data.cpp
示例16: bufferSREPAIRLoad
/* Load the Repair stats */
static bool bufferSREPAIRLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_SREPAIR);
if (!loadRepairStats(pBuffer, size)
|| !allocComponentList(COMP_REPAIRUNIT, numRepairStats))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:15,代码来源:data.cpp
示例17: bufferSSENSORLoad
/* Load the Sensor stats */
static bool bufferSSENSORLoad(const char *pBuffer, UDWORD size, void **ppData)
{
calcDataHash((uint8_t *)pBuffer, size, DATA_SSENSOR);
if (!loadSensorStats(pBuffer, size)
|| !allocComponentList(COMP_SENSOR, numSensorStats))
{
return false;
}
//not interested in this value
*ppData = NULL;
return true;
}
开发者ID:Rimbok,项目名称:warzone2100,代码行数:15,代码来源:data.cpp
示例18: bufferSPROPLoad
/* Load the Propulsion stats */
static bool bufferSPROPLoad(const char *fileName, void **ppData)
{
WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
calcDataHash(ini, DATA_SPROP);
if (!loadPropulsionStats(ini) || !allocComponentList(COMP_PROPULSION, numPropulsionStats))
{
return false;
}
//not interested in this value
*ppData = (void *)1;
return true;
}
开发者ID:Warzone2100,项目名称:warzone2100,代码行数:15,代码来源:data.cpp
示例19: bufferSTERRTABLELoad
/* Load the STERRTABLE stats */
static bool bufferSTERRTABLELoad(const char *fileName, void **ppData)
{
WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
calcDataHash(ini, DATA_STERRT);
if (!loadTerrainTable(ini))
{
return false;
}
//not interested in this value
*ppData = nullptr;
return true;
}
开发者ID:Warzone2100,项目名称:warzone2100,代码行数:15,代码来源:data.cpp
示例20: dataScriptLoadVals
// Load a script variable values file
static bool dataScriptLoadVals(const char* fileName, void **ppData)
{
bool success;
PHYSFS_file* fileHandle;
uint8_t *pBuffer;
PHYSFS_sint64 fileSize = 0;
*ppData = NULL;
// don't load anything if a saved game is being loaded
if (saveFlag)
{
return true;
}
debug(LOG_WZ, "Loading script data %s", GetLastResourceFilename());
fileHandle = PHYSFS_openRead(fileName);
debug(LOG_WZ, "Reading...[directory: %s] %s", PHYSFS_getRealDir(fileName), fileName);
if (fileHandle == NULL)
{
return false;
}
// due to the changes in r2532 we must do this routine a bit different.
fileSize = PHYSFS_fileLength(fileHandle);
pBuffer = malloc(fileSize * sizeof(char));
if (pBuffer == NULL)
{
debug(LOG_FATAL, "Fatal memory allocation, couldn't allocate %lld buffer", fileSize);
abort();
}
PHYSFS_read(fileHandle, pBuffer, 1, fileSize);
calcDataHash(pBuffer, fileSize, DATA_SCRIPTVAL);
free(pBuffer);
PHYSFS_seek(fileHandle, 0); //reset position
success = scrvLoad(fileHandle);
if (!success)
debug(LOG_FATAL, "Script %s did not compile", GetLastResourceFilename());
PHYSFS_close(fileHandle);
return success;
}
开发者ID:blezek,项目名称:warzone2100,代码行数:51,代码来源:data.c
注:本文中的calcDataHash函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论