bool ConditionsWriter::WriteCondition (iFile* cacheFile, CS::PluginCommon::ShaderCacheHelper::StringStoreWriter& strStore, const CondOperation& cond) { uint32 leftOperation = 0; uint32 rightOperation = 0; if (cond.left.type == operandOperation) leftOperation = GetDiskID (cond.left.operation); if (cond.right.type == operandOperation) rightOperation = GetDiskID (cond.right.operation); ConditionHeader head; head.op = cond.operation; head.leftType = cond.left.type; if ((cond.left.type >= operandSV) && (cond.left.svLocation.indices != 0)) head.flags |= ConditionHeader::leftHasIndices; head.rightType = cond.right.type; if ((cond.right.type >= operandSV) && (cond.right.svLocation.indices != 0)) head.flags |= ConditionHeader::rightHasIndices; if (cacheFile->Write ((char*)&head, sizeof (head)) != sizeof (head)) return false; if (!WriteCondOperand (cacheFile, strStore, cond.left, leftOperation)) return false; if (!WriteCondOperand (cacheFile, strStore, cond.right, rightOperation)) return false; return true; }
bool CMachineID::Init() { GetCPUID(); GetDiskID(); return true; }