Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions code/vqalib/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void StartAddr(void)
* SYNOPSIS
* Error = VQA_OpenAudio(VQAHandleP)
*
* long VQA_OpenAudio(VQAHandleP *);
* VQAErrorType VQA_OpenAudio(VQAHandleP *);
*
* FUNCTION
* Initialise the sound system. Create a direct sound object and the
Expand All @@ -110,10 +110,9 @@ static void StartAddr(void)
*
****************************************************************************/

long VQA_OpenAudio(VQAHandleP *vqap)
VQAErrorType VQA_OpenAudio(VQAHandleP *vqap)
{
VQAAudio *audio;
long rc;

/* Dereference data memebers for quicker access. */
audio = &vqap->Audio;
Expand All @@ -134,16 +133,17 @@ long VQA_OpenAudio(VQAHandleP *vqap)
params.Callback1 = VQA_AudioFillCallback;
params.Callback2 = VQA_AudioDoneCallback;

rc = (long)vqap->Config.AudioHandler((VQAHandle *)vqap, VQAAUDIO_OPEN, &params, sizeof(params));
if (rc >= VQAERR_OK || rc == VQAERR_NONE) {
auto const opened = vqap->Config.AudioHandler((VQAHandle *)vqap, VQAAUDIO_OPEN, &params, sizeof(params));

if (opened >= VQAERR_OK || opened == VQAERR_NONE) {

/* Lock the memory occupied by this module. */
if ((audio->Flags & VQAAUDF_MODLOCKED) == 0) {
audio->Flags |= VQAAUDF_MODLOCKED;
}
return(VQAERR_NONE);
}
return(rc);
return((VQAErrorType)opened);
}


Expand Down
6 changes: 3 additions & 3 deletions code/vqalib/buffer_.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <string.h>
#include "vqamem.h"

extern long VQA_Set_DrawBuffer(VQAHandle *vqa, unsigned char *buffer, unsigned long width, unsigned long height, long xpos, long ypos);
extern VQAErrorType VQA_Set_DrawBuffer(VQAHandle *vqa, unsigned char *buffer, unsigned long width, unsigned long height, long xpos, long ypos);


_STATIC void VQA_BufferPerpareLoop(VQAHandleP *vqap, long * needs_start_cb, long * needs_end_cb);
Expand Down Expand Up @@ -58,7 +58,7 @@ _STATIC void VQA_BufferPerpareLoop(VQAHandleP *vqap, long * needs_start_cb, long
*
****************************************************************************/

STATIC long AllocBuffers(VQAHandleP *vqap)
STATIC VQAErrorType AllocBuffers(VQAHandleP *vqap)
{
long needs_start_cb;
long needs_end_cb;
Expand Down Expand Up @@ -706,7 +706,7 @@ STATIC void FreeBuffers(VQAHandleP *vqap)
}


long VQA_Configure_Buffer(VQAHandleP *vqap)
VQAErrorType VQA_Configure_Buffer(VQAHandleP *vqap)
{
unsigned char *buf;
int w;
Expand Down
44 changes: 22 additions & 22 deletions code/vqalib/drawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@
#include "../lcw.h"

//forward declarations
_STATIC long Select_Frame(VQAHandleP *vqap);
_STATIC VQAErrorType Select_Frame(VQAHandleP *vqap);
_STATIC void Prepare_Frame(VQAHandleP *vqap);

long DrawFrame_MCGABuf(VQAHandle *vqa);
long PageFlip_MCGABuf(VQAHandle *vqa);
long DrawFrame_MCGA(VQAHandle *vqa);
long PageFlip_MCGA(VQAHandle *vqa);
VQAErrorType DrawFrame_MCGABuf(VQAHandle *vqa);
VQAErrorType PageFlip_MCGABuf(VQAHandle *vqa);
VQAErrorType DrawFrame_MCGA(VQAHandle *vqa);
VQAErrorType PageFlip_MCGA(VQAHandle *vqa);

void __cdecl UnVQ_Nop(uint8_t *codebook, uint8_t *pointers, uint8_t *buffer, size_t blocksperrow, size_t numrows, size_t bufwidth);
long PageFlip_Nop(VQAHandle *vqa);
VQAErrorType PageFlip_Nop(VQAHandle *vqa);

void VQA_SetTimer(VQAHandleP *vqap, long time);
void VQA_StepTimer(VQAHandleP *vqap, long step);
unsigned long VQA_GetTime(VQAHandleP *vqap);
_STATIC long VQA_SetCurrentFrameAsLast(VQAHandleP *vqap);
_STATIC VQAErrorType VQA_SetCurrentFrameAsLast(VQAHandleP *vqap);
_STATIC void VQA_SetPreviousFrameNode(VQAHandleP *vqap);
_STATIC long VQA_CalcFramesSinceDrawn(VQAHandleP *vqap);

Expand All @@ -103,7 +103,7 @@ void VQA_DispatchFrameChunks(VQAHandleP *vqap, long frame);
/// no frame has been drawn yet.
/// </summary>
/// <returns>Returns with VQAERR_NONE.</returns>
long VQA_ResetLastFrameNum(VQAHandle *vqa)
VQAErrorType VQA_ResetLastFrameNum(VQAHandle *vqa)
{
VQAHandleP *vqap;
VQADrawer *drawer;
Expand Down Expand Up @@ -139,7 +139,7 @@ long VQA_ResetLastFrameNum(VQAHandle *vqa)
*
****************************************************************************/

long VQA_Configure_Drawer(VQAHandleP *vqap)
VQAErrorType VQA_Configure_Drawer(VQAHandleP *vqap)
{
VQAConfig *config;
VQAHeader *header;
Expand Down Expand Up @@ -252,7 +252,7 @@ long VQA_Configure_Drawer(VQAHandleP *vqap)
* SYNOPSIS
* Error = Select_Frame(VQA)
*
* long Select_Frame(VQAHandleP *);
* VQAErrorType Select_Frame(VQAHandleP *);
*
* FUNCTION
* Select a frame to draw. This is were the frame skipping/delay is
Expand All @@ -266,7 +266,7 @@ long VQA_Configure_Drawer(VQAHandleP *vqap)
*
****************************************************************************/

STATIC long Select_Frame(VQAHandleP *vqap)
STATIC VQAErrorType Select_Frame(VQAHandleP *vqap)
{
VQADrawer *drawer;
VQAConfig *config;
Expand Down Expand Up @@ -669,7 +669,7 @@ long VQA_CalcFramesSinceDrawn(VQAHandleP *vqap)
/// notion of playback progress once a frame has been committed.
/// </summary>
/// <returns>Returns with VQAERR_NONE.</returns>
long VQA_SetCurrentFrameAsLast(VQAHandleP *vqap)
VQAErrorType VQA_SetCurrentFrameAsLast(VQAHandleP *vqap)
{
VQADrawer * drawer;

Expand Down Expand Up @@ -864,7 +864,7 @@ void VQA_UnVQFrame(VQAHandleP *vqap, VQAFrameNode *frame)
* SYNOPSIS
* Error = DrawFrame_MCGA(VQA)
*
* long DrawFrame_MCGA(VQAHandle *);
* VQAErrorType DrawFrame_MCGA(VQAHandle *);
*
* FUNCTION
* Algorithm:
Expand Down Expand Up @@ -894,12 +894,12 @@ void VQA_UnVQFrame(VQAHandleP *vqap, VQAFrameNode *frame)
*
****************************************************************************/

long DrawFrame_MCGA(VQAHandle *vqa)
VQAErrorType DrawFrame_MCGA(VQAHandle *vqa)
{
VQAHandleP *vqap;
VQADrawer *drawer;
VQAFrameNode *curframe;
long rc;
VQAErrorType rc;

/* Dereference commonly used data members for quicker access */
vqap = (VQAHandleP *)vqa;
Expand Down Expand Up @@ -939,7 +939,7 @@ long DrawFrame_MCGA(VQAHandle *vqa)
* SYNOPSIS
* PageFlip_MCGA(VQA)
*
* long PageFlip_MCGA(VQAHandle *);
* VQAErrorType PageFlip_MCGA(VQAHandle *);
*
* FUNCTION
* Since the MCGA mode only has one buffer, the drawing is actually done
Expand All @@ -953,7 +953,7 @@ long DrawFrame_MCGA(VQAHandle *vqa)
*
****************************************************************************/

STATIC long PageFlip_MCGA(VQAHandle *vqa)
STATIC VQAErrorType PageFlip_MCGA(VQAHandle *vqa)
{
VQAHandleP *vqap;
VQADrawer *drawer;
Expand Down Expand Up @@ -1022,7 +1022,7 @@ STATIC long PageFlip_MCGA(VQAHandle *vqa)
* SYNOPSIS
* Error = DrawFrame_MCGABuf(VQA)
*
* long DrawFrame_MCGABuf(VQAHandle *);
* VQAErrorType DrawFrame_MCGABuf(VQAHandle *);
*
* FUNCTION
* Algorithm:
Expand Down Expand Up @@ -1054,9 +1054,9 @@ STATIC long PageFlip_MCGA(VQAHandle *vqa)
*
****************************************************************************/

STATIC long DrawFrame_MCGABuf(VQAHandle *vqa)
STATIC VQAErrorType DrawFrame_MCGABuf(VQAHandle *vqa)
{
long rc;
VQAErrorType rc;
VQAHandleP *vqap;
VQADrawer *drawer;
VQAFrameNode *curframe;
Expand Down Expand Up @@ -1112,7 +1112,7 @@ STATIC long DrawFrame_MCGABuf(VQAHandle *vqa)
*
****************************************************************************/

STATIC long PageFlip_MCGABuf(VQAHandle *vqa)
STATIC VQAErrorType PageFlip_MCGABuf(VQAHandle *vqa)
{
VQAHandleP *vqap;
VQADrawer *drawer;
Expand Down Expand Up @@ -1238,7 +1238,7 @@ STATIC void __cdecl UnVQ_Nop(uint8_t *codebook, uint8_t *pointers,
*
****************************************************************************/

STATIC long PageFlip_Nop(VQAHandle *vqa)
STATIC VQAErrorType PageFlip_Nop(VQAHandle *vqa)
{
//shut up compiler warnings
vqa = vqa;
Expand Down
Loading