MCPcopy Create free account
hub / github.com/anjo76/angelscript / WriteUInt

Method WriteUInt

sdk/add_on/scriptfile/scriptfile.cpp:601–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601int CScriptFile::WriteUInt(asQWORD val, asUINT bytes)
602{
603 if( file == 0 )
604 return 0;
605
606 unsigned char buf[8];
607 if( mostSignificantByteFirst )
608 {
609 for( unsigned int n = 0; n < bytes; n++ )
610 buf[n] = (val >> ((bytes-n-1)*8)) & 0xFF;
611 }
612 else
613 {
614 for( unsigned int n = 0; n < bytes; n++ )
615 buf[n] = (val >> (n*8)) & 0xFF;
616 }
617
618 size_t r = fwrite(&buf, bytes, 1, file);
619 return int(r);
620}
621
622int CScriptFile::WriteFloat(float f)
623{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected