You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
927 B

/**
* @file wave.cpp
*
* Implementation of functionality for loading fies and processing wave files.
*/
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
DEVILUTION_BEGIN_NAMESPACE
void WCloseFile(HANDLE file)
{
SFileCloseFile(file);
}
LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh, const char *FileName)
{
LONG ret;
8 years ago
if ((ret = SFileGetFileSize(hsFile, lpFileSizeHigh)) == 0)
FileErrDlg(FileName);
8 years ago
return ret;
}
BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist)
{
if (!SFileOpenFile(FileName, phsFile))
FileErrDlg(FileName);
return TRUE;
}
void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read, const char *FileName)
{
if (SFileSetFilePointer(hsFile, 0, NULL, DVL_FILE_CURRENT) == -1)
FileErrDlg(FileName);
if (!SFileReadFile(hsFile, buf, to_read, NULL, NULL))
FileErrDlg(FileName);
}
DEVILUTION_END_NAMESPACE