quick fix
Boolean errors
This commit is contained in:
parent
62087d21cc
commit
f12754b01f
20
src/audio.c
20
src/audio.c
@ -42,9 +42,6 @@
|
||||
#include <string.h> // Required for strcmp()
|
||||
#include <stdio.h> // Used for .WAV loading
|
||||
|
||||
#define JAR_XM_IMPLEMENTATION
|
||||
#include "jar_xm.h" // For playing .xm files
|
||||
|
||||
#if defined(AUDIO_STANDALONE)
|
||||
#include <stdarg.h> // Used for functions with variable number of parameters (TraceLog())
|
||||
#else
|
||||
@ -53,7 +50,10 @@
|
||||
#endif
|
||||
|
||||
//#define STB_VORBIS_HEADER_ONLY
|
||||
#include "stb_vorbis.h" // OGG loading functions
|
||||
#include "stb_vorbis.h" // OGG loading functions
|
||||
|
||||
#define JAR_XM_IMPLEMENTATION
|
||||
#include "jar_xm.h" // For playing .xm files
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Defines and Macros
|
||||
@ -576,11 +576,11 @@ void PlayMusicStream(char *fileName)
|
||||
currentMusic.loop = true;
|
||||
|
||||
// only stereo/float is supported for xm
|
||||
if(info.channels == 2 && !jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName))
|
||||
if(!jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName))
|
||||
{
|
||||
currentMusic.format = AL_FORMAT_STEREO_FLOAT32;
|
||||
jar_xm_set_max_loop_count(currentMusic.chipctx, 0); //infinite number of loops
|
||||
//currentMusic.totalSamplesLeft = ; // Unsure of how to calculate this
|
||||
currentMusic.format = AL_FORMAT_STEREO16; // AL_FORMAT_STEREO_FLOAT32;
|
||||
jar_xm_set_max_loop_count(currentMusic.chipctx, 0); // infinite number of loops
|
||||
currentMusic.totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic.chipctx);
|
||||
musicEnabled = true;
|
||||
}
|
||||
}
|
||||
@ -712,8 +712,8 @@ static bool BufferMusicStream(ALuint buffer)
|
||||
{
|
||||
if (currentMusic.chipTune)
|
||||
{
|
||||
jar_xm_generate_samples(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size) / 2);
|
||||
streamedBytes = (MUSIC_BUFFER_SIZE - size)/2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes.
|
||||
jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size) / 2);
|
||||
streamedBytes = (MUSIC_BUFFER_SIZE - size) * 2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -59,10 +59,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -261,7 +261,8 @@
|
||||
//----------------------------------------------------------------------------------
|
||||
#ifndef __cplusplus
|
||||
// Boolean type
|
||||
typedef enum { false, true } bool;
|
||||
#include <stdbool.h>
|
||||
//typedef enum { false, true } bool;
|
||||
#endif
|
||||
|
||||
// byte type
|
||||
|
Loading…
Reference in New Issue
Block a user