mirror of
https://github.com/simtactics/niotso.git
synced 2025-07-04 13:47:05 -04:00
Removed changes by Nicholas. These will need to be re-submitted through Trac and manually validated.
Added BMP (24-bit uncompressed, 8-bit uncompressed, and RLE8) and PNG support to File::ReadImageFile(). So far everything in FileHandler is presumed to be safe with any input file except UTK decompression. Also started making use of the static keyword in various places to aid the compiler in optimization.
This commit is contained in:
parent
7442579090
commit
cb751c0bb8
29 changed files with 692 additions and 1291 deletions
|
@ -17,7 +17,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <windows.h>
|
||||
#include "read_xa.h"
|
||||
|
||||
#define HINIBBLE(byte) ((byte) >> 4)
|
||||
|
@ -56,7 +55,7 @@ unsigned xa_compressed_size(unsigned Frames, unsigned Channels)
|
|||
return Channels*SingleChannelData;
|
||||
}
|
||||
|
||||
int xa_read_header(xaheader_t * XAHeader, const uint8_t * Buffer, unsigned FileSize)
|
||||
int xa_read_header(xaheader_t * XAHeader, const uint8_t * Buffer, size_t FileSize)
|
||||
{
|
||||
if(FileSize < 24) return 0;
|
||||
memcpy(&XAHeader->szID, Buffer, 4);
|
||||
|
|
|
@ -16,15 +16,15 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
char szID[4];
|
||||
DWORD dwOutSize;
|
||||
char szID[4];
|
||||
uint32_t dwOutSize;
|
||||
/* WAVEFORMATEX */
|
||||
WORD wFormatTag;
|
||||
WORD nChannels;
|
||||
DWORD nSamplesPerSec;
|
||||
DWORD nAvgBytesPerSec;
|
||||
WORD nBlockAlign;
|
||||
WORD wBitsPerSample;
|
||||
uint16_t wFormatTag;
|
||||
uint16_t nChannels;
|
||||
uint32_t nSamplesPerSec;
|
||||
uint32_t nAvgBytesPerSec;
|
||||
uint16_t nBlockAlign;
|
||||
uint16_t wBitsPerSample;
|
||||
|
||||
unsigned Frames;
|
||||
unsigned XADataSize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue