mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-18 04:06:45 -04:00
game folder "just" compiles (not link)
This commit is contained in:
parent
13d3908273
commit
1b0f7fe0c2
135 changed files with 2161 additions and 2336 deletions
42
libs/wav.c
Normal file
42
libs/wav.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
#include <skeldal_win.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "WAV.H"
|
||||
|
||||
int find_chunk(FILE *riff,char *name)
|
||||
{
|
||||
char chunk_name[4];
|
||||
long next;
|
||||
|
||||
fseek(riff,12,SEEK_SET);
|
||||
do
|
||||
{
|
||||
fread(chunk_name,1,4,riff);
|
||||
if (!strncmp(name,chunk_name,4)) return ftell(riff);
|
||||
if (fread(&next,1,4,riff)==0) return -1 ;
|
||||
if (fseek(riff,next,SEEK_CUR))return -1 ;
|
||||
}
|
||||
while (!feof(riff));
|
||||
return -1;
|
||||
}
|
||||
|
||||
int get_chunk_size(FILE *riff)
|
||||
{
|
||||
long size;
|
||||
|
||||
fread(&size,1,4,riff);
|
||||
fseek(riff,-4,SEEK_CUR);
|
||||
return(size);
|
||||
}
|
||||
|
||||
int read_chunk(FILE *riff,void *mem)
|
||||
{
|
||||
long size,res;
|
||||
|
||||
fread(&size,1,4,riff);
|
||||
res=fread(mem,1,size,riff);
|
||||
return res==size;
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue