本文整理汇总了C++中REV32函数的典型用法代码示例。如果您正苦于以下问题:C++ REV32函数的具体用法?C++ REV32怎么用?C++ REV32使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了REV32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void REFRRecord::REFRXSED::Write(FileWriter &writer)
{
if(isOffset)
writer.record_write_subrecord(REV32(XSED), &offset, 1);
else
writer.record_write_subrecord(REV32(XSED), &seed, 4);
}
示例2: WRITE
SINT32 GMSTRecord::WriteRecord(FileWriter &writer)
{
if(EDID.IsLoaded()) //Should only be false if the record was marked deleted
{
WRITE(EDID);
UINT8 null = 0;
switch(DATA.format)
{
case 'i':
writer.record_write_subrecord(REV32(DATA), &DATA.i, 4);
break;
case 'f':
writer.record_write_subrecord(REV32(DATA), &DATA.f, 4);
break;
case 's':
if(DATA.s != NULL)
writer.record_write_subrecord(REV32(DATA), DATA.s, (UINT32)strlen(DATA.s) + 1);
else
writer.record_write_subrecord(REV32(DATA), &null, 1);
break;
default:
printer("Unknown GMST format (%c) when writing: %s\n", DATA.format, EDID.value);
break;
}
}
return -1;
}
示例3: while
int32_t RGDLRecord::ParseRecord(unsigned char *buffer, unsigned char *end_buffer, bool CompressedOnDisk)
{
uint32_t subType = 0;
uint32_t subSize = 0;
while(buffer < end_buffer){
subType = *(uint32_t *)buffer;
buffer += 4;
switch(subType)
{
case REV32(XXXX):
buffer += 2;
subSize = *(uint32_t *)buffer;
buffer += 4;
subType = *(uint32_t *)buffer;
buffer += 6;
break;
default:
subSize = *(uint16_t *)buffer;
buffer += 2;
break;
}
switch(subType)
{
case REV32(EDID):
EDID.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(NVER):
NVER.Read(buffer, subSize);
break;
case REV32(DATA):
DATA.Read(buffer, subSize);
break;
case REV32(XNAM):
XNAM.Read(buffer, subSize);
break;
case REV32(TNAM):
TNAM.Read(buffer, subSize);
break;
case REV32(RAFD):
RAFD.Read(buffer, subSize);
break;
case REV32(RAFB):
RAFB.Read(buffer, subSize);
break;
case REV32(RAPS):
RAPS.Read(buffer, subSize);
break;
case REV32(ANAM):
ANAM.Read(buffer, subSize, CompressedOnDisk);
break;
default:
UnrecognizedSubRecord(formID, subType, subSize, buffer, end_buffer);
break;
}
};
return 0;
}
示例4: switch
void VMADRecord::Read(unsigned char *&buffer, const uint32_t &subSize, const uint32_t &recordType, bool CompressedOnDisk)
{
unsigned char *end_buffer = buffer + subSize;
// objFormat/version
int16_t version = *(int16_t *)buffer;
buffer += 2;
int16_t objFormat = *(int16_t *)buffer;
buffer += 2;
// Scripts
uint16_t count = *(uint16_t *)buffer;
buffer += 2;
for (uint16_t i = 0; i < count; ++i)
{
scripts.push_back(new Script);
scripts.back()->Read(buffer, version, objFormat, CompressedOnDisk);
}
// Check for script fragments
fragment = NULL;
if (buffer < end_buffer)
{
switch (recordType)
{
case REV32(INFO):
fragment = (Fragments *)new FragmentINFO;
((FragmentINFO *)fragment)->Read(buffer, CompressedOnDisk);
break;
case REV32(PACK):
fragment = (Fragments *)new FragmentPACK;
((FragmentPACK *)fragment)->Read(buffer, CompressedOnDisk);
break;
case REV32(PERK):
fragment = (Fragments *)new FragmentPERK;
((FragmentPERK *)fragment)->Read(buffer, CompressedOnDisk);
break;
case REV32(QUST):
fragment = (Fragments *)new FragmentQUST;
((FragmentQUST *)fragment)->Read(buffer, version, objFormat, CompressedOnDisk);
break;
case REV32(SCEN):
fragment = (Fragments *)new FragmentSCEN;
((FragmentSCEN *)fragment)->Read(buffer, CompressedOnDisk);
break;
default:
// TODO: error message
break;
};
}
else if (buffer > end_buffer)
{
// TODO: error message
}
buffer = end_buffer;
}
示例5: readSecondary
int readSecondary(OPENML_SECONDARY_INDEX *index,FILE *fd)
{
if(1!=fread(index,sizeof(OPENML_SECONDARY_INDEX),1,fd)) return 0;
#ifdef ADM_BIG_ENDIAN
REV16(longsPerEntry);
REV32(nbEntryInUse);
REV32(chunkId);
REV64(base);
REV32(reserver);
#endif
return 1;
}
示例6: while
SINT32 LVSPRecord::ParseRecord(unsigned char *buffer, unsigned char *end_buffer, bool CompressedOnDisk)
{
UINT32 subType = 0;
UINT32 subSize = 0;
while(buffer < end_buffer){
subType = *(UINT32 *)buffer;
buffer += 4;
switch(subType)
{
case REV32(XXXX):
buffer += 2;
subSize = *(UINT32 *)buffer;
buffer += 4;
subType = *(UINT32 *)buffer;
buffer += 6;
break;
default:
subSize = *(UINT16 *)buffer;
buffer += 2;
break;
}
switch(subType)
{
case REV32(EDID):
EDID.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(LVLD):
LVLD.Read(buffer, subSize);
if((LVLD.value & fAltCalcFromAllLevels) != 0)
{
LVLD.value &= ~fAltCalcFromAllLevels;
IsCalcFromAllLevels(true);
}
break;
case REV32(LVLF):
LVLF.Read(buffer, subSize);
break;
case REV32(LVLO):
Entries.Read(buffer, subSize);
break;
default:
//printer("FileName = %s\n", FileName);
printer(" LVSP: %08X - Unknown subType = %04x\n", formID, subType);
CBASH_CHUNK_DEBUG
printer(" Size = %i\n", subSize);
printer(" CurPos = %04x\n\n", buffer - 6);
buffer = end_buffer;
break;
}
};
return 0;
}
示例7: while
SINT32 STATRecord::ParseRecord(unsigned char *buffer, unsigned char *end_buffer, bool CompressedOnDisk)
{
UINT32 subType = 0;
UINT32 subSize = 0;
while(buffer < end_buffer){
subType = *(UINT32 *)buffer;
buffer += 4;
switch(subType)
{
case REV32(XXXX):
buffer += 2;
subSize = *(UINT32 *)buffer;
buffer += 4;
subType = *(UINT32 *)buffer;
buffer += 6;
break;
default:
subSize = *(UINT16 *)buffer;
buffer += 2;
break;
}
switch(subType)
{
case REV32(EDID):
EDID.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(MODL):
MODL.Load();
MODL->MODL.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(MODB):
MODL.Load();
MODL->MODB.Read(buffer, subSize);
break;
case REV32(MODT):
MODL.Load();
MODL->MODT.Read(buffer, subSize, CompressedOnDisk);
break;
default:
//printer("FileName = %s\n", FileName);
printer(" STAT: %08X - Unknown subType = %04x\n", formID, subType);
CBASH_CHUNK_DEBUG
printer(" Size = %i\n", subSize);
printer(" CurPos = %04x\n\n", buffer - 6);
buffer = end_buffer;
break;
}
};
return 0;
}
示例8: readMasterIndex
/*
Go here to solve endianness issues
*/
int readMasterIndex(OPENDML_INDEX *index,FILE *fd)
{
if(1!=fread(index,sizeof(OPENDML_INDEX),1,fd)) return 0;
#ifdef ADM_BIG_ENDIAN
#define REV16(x) index->x=R16(index->x)
#define REV32(x) index->x=R32(index->x)
#define REV64(x) index->x=R64(index->x)
REV16(longsPerEntry);
REV32(nbEntryInUse);
REV32(chunkId);
#endif
return 1;
}
示例9: GetParentMod
int32_t SHOURecord::ParseRecord(unsigned char *buffer, unsigned char *end_buffer, bool CompressedOnDisk)
{
uint32_t subType = 0;
uint32_t subSize = 0;
StringLookups *LookupStrings = GetParentMod()->TES4.LookupStrings;
while(buffer < end_buffer)
{
subType = *(uint32_t *)buffer;
buffer += 4;
switch(subType)
{
case REV32(XXXX):
buffer += 2;
subSize = *(uint32_t *)buffer;
buffer += 4;
subType = *(uint32_t *)buffer;
buffer += 6;
break;
default:
subSize = *(uint16_t *)buffer;
buffer += 2;
break;
}
switch(subType)
{
case REV32(EDID):
EDID.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(FULL):
FULL.Read(buffer, subSize, CompressedOnDisk, LookupStrings);
break;
case REV32(MDOB):
MDOB.Read(buffer, subSize);
break;
case REV32(SNAM):
SNAM.Read(buffer, subSize);
break;
default:
//printer("Filename = %s\n", FileName);
printer(" AACT: %08X - Unknown subType = %04x\n", formID, subType);
CBASH_CHUNK_DEBUG
printer(" Size = %i\n", subSize);
printer(" CurPos = %04x\n", buffer - 6);
buffer = end_buffer;
break;
}
};
return 0;
}
示例10: fseek
//read big endian 32-Bit from fileposition(position)
uint32_t AudioPlaySdAac::fread32(size_t position)
{
uint32_t tmp32;
fseek(position);
fread((uint8_t *) &tmp32, sizeof(tmp32));
return REV32(tmp32);
}
示例11: WRITE
int32_t CREARecord::WriteRecord(FileWriter &writer)
{
WRITE(EDID);
WRITE(FULL);
MODL.Write(writer);
WRITE(SPLO);
WRITE(NIFZ);
WRITE(NIFT);
WRITE(ACBS);
WRITE(SNAM);
WRITE(INAM);
WRITE(SCRI);
WRITE(CNTO);
WRITE(AIDT);
PKID.Write(REV32(PKID), writer, true);
WRITE(KFFZ);
WRITE(DATA);
WRITE(RNAM);
WRITE(ZNAM);
WRITE(TNAM);
WRITE(BNAM);
WRITE(WNAM);
WRITE(CSCR);
WRITE(NAM0);
WRITE(NAM1);
Sounds.Write(writer);
return -1;
}
示例12: readSuperEntries
int readSuperEntries(OPENDML_ENTRY *entries,int count,FILE *fd)
{
if(1!=fread(entries,sizeof(OPENDML_ENTRY)*count,1,fd)) return 0;
#ifdef ADM_BIG_ENDIAN
OPENDML_ENTRY *index;
for(int i=0;i<count;i++)
{
index=&(entries[i]);
REV64(offset);
REV32(size);
REV32(duration);
}
#endif
return 1;
}
示例13: while
int32_t EYESRecord::ParseRecord(unsigned char *buffer, unsigned char *end_buffer, bool CompressedOnDisk)
{
uint32_t subType = 0;
uint32_t subSize = 0;
while(buffer < end_buffer){
subType = *(uint32_t *)buffer;
buffer += 4;
switch(subType)
{
case REV32(XXXX):
buffer += 2;
subSize = *(uint32_t *)buffer;
buffer += 4;
subType = *(uint32_t *)buffer;
buffer += 6;
break;
default:
subSize = *(uint16_t *)buffer;
buffer += 2;
break;
}
switch(subType)
{
case REV32(EDID):
EDID.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(FULL):
FULL.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(ICON):
ICON.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(DATA):
DATA.Read(buffer, subSize);
break;
default:
//printer("FileName = %s\n", FileName);
printer(" EYES: %08X - Unknown subType = %04x\n", formID, subType);
CBASH_CHUNK_DEBUG
printer(" Size = %i\n", subSize);
printer(" CurPos = %04x\n\n", buffer - 6);
buffer = end_buffer;
break;
}
};
return 0;
}
示例14: while
SINT32 EYESRecord::ParseRecord(unsigned char *buffer, unsigned char *end_buffer, bool CompressedOnDisk)
{
UINT32 subType = 0;
UINT32 subSize = 0;
while(buffer < end_buffer){
subType = *(UINT32 *)buffer;
buffer += 4;
switch(subType)
{
case REV32(XXXX):
buffer += 2;
subSize = *(UINT32 *)buffer;
buffer += 4;
subType = *(UINT32 *)buffer;
buffer += 6;
break;
default:
subSize = *(UINT16 *)buffer;
buffer += 2;
break;
}
switch(subType)
{
case REV32(EDID):
EDID.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(FULL):
FULL.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(ICON):
ICON.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(DATA):
DATA.Read(buffer, subSize);
break;
default:
//printer("FileName = %s\n", FileName);
printer(" EYES: Unknown subType = %04X\n", subType);
printer(" Size = %i\n", subSize);
printer(" CurPos = %04x\n\n", buffer - 6);
buffer = end_buffer;
break;
}
};
return 0;
}
示例15: while
int32_t RCPERecord::ParseRecord(unsigned char *buffer, unsigned char *end_buffer, bool CompressedOnDisk)
{
uint32_t subType = 0;
uint32_t subSize = 0;
while(buffer < end_buffer){
subType = *(uint32_t *)buffer;
buffer += 4;
switch(subType)
{
case REV32(XXXX):
buffer += 2;
subSize = *(uint32_t *)buffer;
buffer += 4;
subType = *(uint32_t *)buffer;
buffer += 6;
break;
default:
subSize = *(uint16_t *)buffer;
buffer += 2;
break;
}
switch(subType)
{
case REV32(EDID):
EDID.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(FULL):
FULL.Read(buffer, subSize, CompressedOnDisk);
break;
case REV32(CTDA):
//CTDA.Read(buffer, subSize);
break;
case REV32(DATA):
//DATA.Read(buffer, subSize);
break;
case REV32(RCIL):
//RCIL.Read(buffer, subSize);
break;
case REV32(RCQY):
//RCQY.Read(buffer, subSize);
break;
case REV32(RCOD):
//RCOD.Read(buffer, subSize);
break;
default:
//printf("FileName = %s\n", FileName);
printf(" RCPE: %08X - Unknown subType = %04x\n", formID, subType);
printf(" Size = %i\n", subSize);
printf(" CurPos = %04x\n\n", buffer - 6);
buffer = end_buffer;
break;
}
};
return 0;
}