| 469 | } |
| 470 | |
| 471 | asQWORD CScriptFile::ReadUInt(asUINT bytes) |
| 472 | { |
| 473 | if( file == 0 ) |
| 474 | return 0; |
| 475 | |
| 476 | if( bytes > 8 ) bytes = 8; |
| 477 | if( bytes == 0 ) return 0; |
| 478 | |
| 479 | unsigned char buf[8]; |
| 480 | size_t r = fread(buf, bytes, 1, file); |
| 481 | if( r == 0 ) return 0; |
| 482 | |
| 483 | asQWORD val = 0; |
| 484 | if( mostSignificantByteFirst ) |
| 485 | { |
| 486 | unsigned int n = 0; |
| 487 | for( ; n < bytes; n++ ) |
| 488 | val |= asQWORD(buf[n]) << ((bytes-n-1)*8); |
| 489 | } |
| 490 | else |
| 491 | { |
| 492 | unsigned int n = 0; |
| 493 | for( ; n < bytes; n++ ) |
| 494 | val |= asQWORD(buf[n]) << (n*8); |
| 495 | } |
| 496 | |
| 497 | return val; |
| 498 | } |
| 499 | |
| 500 | float CScriptFile::ReadFloat() |
| 501 | { |
no outgoing calls
no test coverage detected