本文整理汇总了C++中common::InSaveFile::readFloatLE方法的典型用法代码示例。如果您正苦于以下问题:C++ InSaveFile::readFloatLE方法的具体用法?C++ InSaveFile::readFloatLE怎么用?C++ InSaveFile::readFloatLE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::InSaveFile
的用法示例。
在下文中一共展示了InSaveFile::readFloatLE方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadGame
bool loadGame(const Common::String &fname) {
Common::InSaveFile *fp = g_system->getSavefileManager()->openForLoading(fname);
FILETIME savedGameTime;
while (allRunningFunctions)
finishFunction(allRunningFunctions);
if (fp == NULL)
return false;
bool headerBad = false;
if (fp->readByte() != 'S')
headerBad = true;
if (fp->readByte() != 'L')
headerBad = true;
if (fp->readByte() != 'U')
headerBad = true;
if (fp->readByte() != 'D')
headerBad = true;
if (fp->readByte() != 'S')
headerBad = true;
if (fp->readByte() != 'A')
headerBad = true;
if (headerBad) {
fatal(ERROR_GAME_LOAD_NO, fname);
return NULL;
}
char c;
c = fp->readByte();
while ((c = fp->readByte()))
;
int majVersion = fp->readByte();
int minVersion = fp->readByte();
ssgVersion = VERSION(majVersion, minVersion);
if (ssgVersion >= VERSION(1, 4)) {
if (!g_sludge->_gfxMan->skipThumbnail(fp))
return fatal(ERROR_GAME_LOAD_CORRUPT, fname);
}
uint32 bytes_read = fp->read(&savedGameTime, sizeof(FILETIME));
if (bytes_read != sizeof(FILETIME) && fp->err()) {
warning("Reading error in loadGame.");
}
if (savedGameTime.dwLowDateTime != fileTime.dwLowDateTime || savedGameTime.dwHighDateTime != fileTime.dwHighDateTime) {
return fatal(ERROR_GAME_LOAD_WRONG, fname);
}
// DON'T ADD ANYTHING NEW BEFORE THIS POINT!
if (ssgVersion >= VERSION(1, 4)) {
allowAnyFilename = fp->readByte();
}
captureAllKeys = fp->readByte();
fp->readByte(); // updateDisplay (part of movie playing)
g_sludge->_txtMan->loadFont(ssgVersion, fp);
killAllPeople();
killAllRegions();
int camerX = fp->readUint16BE();
int camerY = fp->readUint16BE();
float camerZ;
if (ssgVersion >= VERSION(2, 0)) {
camerZ = fp->readFloatLE();
} else {
camerZ = 1.0;
}
brightnessLevel = fp->readByte();
g_sludge->_gfxMan->loadHSI(fp, 0, 0, true);
g_sludge->_evtMan->loadHandlers(fp);
loadRegions(fp);
if (!g_sludge->_cursorMan->loadCursor(fp)) {
return false;
}
LoadedFunction *rFunc;
LoadedFunction **buildList = &allRunningFunctions;
int countFunctions = fp->readUint16BE();
while (countFunctions--) {
rFunc = loadFunction(fp);
rFunc->next = NULL;
(*buildList) = rFunc;
buildList = &(rFunc->next);
}
for (int a = 0; a < numGlobals; a++) {
unlinkVar(globalVars[a]);
loadVariable(&globalVars[a], fp);
}
loadPeople(fp);
//.........这里部分代码省略.........