| 599 | } |
| 600 | |
| 601 | int 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 | |
| 622 | int CScriptFile::WriteFloat(float f) |
| 623 | { |
no outgoing calls
no test coverage detected