Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ packages/
*.so
*.so.*
*.dll
*.h.pch
./*.obj

# Emscripten
emsdk
Expand All @@ -81,6 +83,7 @@ DerivedData/

# VSCode project
.vscode
.clangd

# Jetbrains project
.idea/
Expand Down
4 changes: 2 additions & 2 deletions src/external/RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -7727,8 +7727,8 @@ RGFW_bool RGFW_monitor_requestMode(RGFW_monitor mon, RGFW_monitorMode mode, RGFW
dm.dmBitsPerPel = (DWORD)(mode.red + mode.green + mode.blue);
}

if (ChangeDisplaySettingsEx(dd.DeviceName, &dm, NULL, CDS_TEST, NULL) == DISP_CHANGE_SUCCESSFUL) {
if (ChangeDisplaySettingsEx(dd.DeviceName, &dm, NULL, CDS_UPDATEREGISTRY, NULL) == DISP_CHANGE_SUCCESSFUL)
if (ChangeDisplaySettingsExA((LPCSTR)dd.DeviceName, (DEVMODE *)&dm, NULL, CDS_TEST, NULL) == DISP_CHANGE_SUCCESSFUL) {
if (ChangeDisplaySettingsExA((LPCSTR)dd.DeviceName, (DEVMODE *)&dm, NULL, CDS_UPDATEREGISTRY, NULL) == DISP_CHANGE_SUCCESSFUL)
return RGFW_TRUE;
return RGFW_FALSE;
} else return RGFW_FALSE;
Expand Down
17 changes: 8 additions & 9 deletions src/external/glfw/src/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
window->context.source = ctxconfig->source;
window->context.client = GLFW_OPENGL_API;

previous = _glfwPlatformGetTls(&_glfw.contextSlot);
previous = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
glfwMakeContextCurrent((GLFWwindow*) window);
if (_glfwPlatformGetTls(&_glfw.contextSlot) != window)
return GLFW_FALSE;
Expand Down Expand Up @@ -615,12 +615,12 @@ GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions

GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
_GLFWwindow* window = (_GLFWwindow *) handle;
_GLFWwindow* previous;

_GLFW_REQUIRE_INIT();

previous = _glfwPlatformGetTls(&_glfw.contextSlot);
previous = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);

if (window && window->context.client == GLFW_NO_API)
{
Expand All @@ -642,12 +642,12 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
GLFWAPI GLFWwindow* glfwGetCurrentContext(void)
{
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
return _glfwPlatformGetTls(&_glfw.contextSlot);
return (GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
}

GLFWAPI void glfwSwapBuffers(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
_GLFWwindow* window = (_GLFWwindow *) handle;
assert(window != NULL);

_GLFW_REQUIRE_INIT();
Expand All @@ -668,7 +668,7 @@ GLFWAPI void glfwSwapInterval(int interval)

_GLFW_REQUIRE_INIT();

window = _glfwPlatformGetTls(&_glfw.contextSlot);
window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
if (!window)
{
_glfwInputError(GLFW_NO_CURRENT_CONTEXT,
Expand All @@ -686,7 +686,7 @@ GLFWAPI int glfwExtensionSupported(const char* extension)

_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);

window = _glfwPlatformGetTls(&_glfw.contextSlot);
window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
if (!window)
{
_glfwInputError(GLFW_NO_CURRENT_CONTEXT,
Expand Down Expand Up @@ -752,7 +752,7 @@ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname)

_GLFW_REQUIRE_INIT_OR_RETURN(NULL);

window = _glfwPlatformGetTls(&_glfw.contextSlot);
window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
if (!window)
{
_glfwInputError(GLFW_NO_CURRENT_CONTEXT,
Expand All @@ -762,4 +762,3 @@ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname)

return window->context.getProcAddress(procname);
}

11 changes: 5 additions & 6 deletions src/external/glfw/src/egl_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
return GLFW_FALSE;
}

nativeConfigs = _glfw_calloc(nativeCount, sizeof(EGLConfig));
nativeConfigs = (EGLConfig *)_glfw_calloc(nativeCount, sizeof(EGLConfig));
eglGetConfigs(_glfw.egl.display, nativeConfigs, nativeCount, &nativeCount);

usableConfigs = _glfw_calloc(nativeCount, sizeof(_GLFWfbconfig));
usableConfigs = (_GLFWfbconfig *)_glfw_calloc(nativeCount, sizeof(_GLFWfbconfig));
usableCount = 0;

for (i = 0; i < nativeCount; i++)
Expand Down Expand Up @@ -308,7 +308,7 @@ static int extensionSupportedEGL(const char* extension)

static GLFWglproc getProcAddressEGL(const char* procname)
{
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
_GLFWwindow* window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
assert(window != NULL);

if (window->context.egl.client)
Expand Down Expand Up @@ -883,7 +883,7 @@ GLFWAPI EGLDisplay glfwGetEGLDisplay(void)

GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
_GLFWwindow* window = (_GLFWwindow *) handle;
_GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_CONTEXT);

if (window->context.source != GLFW_EGL_CONTEXT_API)
Expand All @@ -897,7 +897,7 @@ GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)

GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
_GLFWwindow* window = (_GLFWwindow *) handle;
_GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_SURFACE);

if (window->context.source != GLFW_EGL_CONTEXT_API)
Expand All @@ -908,4 +908,3 @@ GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)

return window->context.egl.surface;
}

8 changes: 4 additions & 4 deletions src/external/jar_mod.h
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ static bool jar_mod_load( jar_mod_context_t * modctx, void * mod_data, int mod_d
{
// 15 Samples modules support
// Shift the whole datas to make it look likes a standard 4 channels mod.
memcopy(&(modctx->song.signature), "M.K.", 4);
memcopy(&(modctx->song.signature), (void *)"M.K.", 4);
memcopy(&(modctx->song.length), &(modctx->song.samples[15]), 130);
memclear(&(modctx->song.samples[15]), 0, 480);
modmemory += 600;
Expand Down Expand Up @@ -1535,13 +1535,13 @@ mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename)

if(fsize && fsize < 32*1024*1024)
{
modctx->modfile = JARMOD_MALLOC(fsize);
modctx->modfile = (muchar *) JARMOD_MALLOC(fsize);
modctx->modfilesize = fsize;
memset(modctx->modfile, 0, fsize);
fread(modctx->modfile, fsize, 1, f);
fclose(f);
if(!jar_mod_load(modctx, (void*)modctx->modfile, fsize)) fsize = 0;

if(!jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0;
} else fsize = 0;
}
return fsize;
Expand Down
38 changes: 19 additions & 19 deletions src/external/jar_xm.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsam
// * @param output buffer of 2*numsamples elements (A left and right value for each sample)
// * @param numsamples number of samples to generate
void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) {
float* musicBuffer = JARXM_MALLOC((2*numsamples)*sizeof(float));
float* musicBuffer = (float *)JARXM_MALLOC((2*numsamples)*sizeof(float));
jar_xm_generate_samples(ctx, musicBuffer, numsamples);

if(output){
Expand All @@ -136,7 +136,7 @@ void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t
// * @param output buffer of 2*numsamples elements (A left and right value for each sample)
// * @param numsamples number of samples to generate
void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) {
float* musicBuffer = JARXM_MALLOC((2*numsamples)*sizeof(float));
float* musicBuffer = (float *)JARXM_MALLOC((2*numsamples)*sizeof(float));
jar_xm_generate_samples(ctx, musicBuffer, numsamples);

if(output){
Expand Down Expand Up @@ -543,7 +543,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
#endif

bytes_needed = jar_xm_get_memory_needed_for_context(moddata, moddata_length);
mempool = JARXM_MALLOC(bytes_needed);
mempool = (char *)JARXM_MALLOC(bytes_needed);
if(mempool == NULL && bytes_needed > 0) { /* JARXM_MALLOC() failed, trouble ahead */
DEBUG("call to JARXM_MALLOC() failed, returned %p", (void*)mempool);
return 2;
Expand All @@ -558,11 +558,11 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz

ctx->rate = rate;
mempool = jar_xm_load_module(ctx, moddata, moddata_length, mempool);
mempool = ALIGN_PTR(mempool, 16);
mempool = (char *)ALIGN_PTR(mempool, 16);

ctx->channels = (jar_xm_channel_context_t*)mempool;
mempool += ctx->module.num_channels * sizeof(jar_xm_channel_context_t);
mempool = ALIGN_PTR(mempool, 16);
mempool = (char *)ALIGN_PTR(mempool, 16);

ctx->default_global_volume = 1.f;
ctx->global_volume = ctx->default_global_volume;
Expand All @@ -583,7 +583,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
ch->actual_panning = .5f;
}

mempool = ALIGN_PTR(mempool, 16);
mempool = (char *)ALIGN_PTR(mempool, 16);
ctx->row_loop_count = (uint8_t *)mempool;
mempool += MAX_NUM_ROWS * sizeof(uint8_t);

Expand Down Expand Up @@ -681,14 +681,14 @@ uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t *ctx, uint16_t ch

//* Bound reader macros.
//* If we attempt to read the buffer out-of-bounds, pretend that the buffer is infinitely padded with zeroes.
#define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t*)(moddata + (offset))) : 0)
#define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t *)(moddata + (offset))) : 0)
#define READ_U16(offset) ((uint16_t)READ_U8(offset) | ((uint16_t)READ_U8((offset) + 1) << 8))
#define READ_U32(offset) ((uint32_t)READ_U16(offset) | ((uint32_t)READ_U16((offset) + 2) << 16))
#define READ_MEMCPY(ptr, offset, length) memcpy_pad(ptr, length, moddata, moddata_length, offset)

static void memcpy_pad(void *dst, size_t dst_len, const void *src, size_t src_len, size_t offset) {
uint8_t *dst_c = dst;
const uint8_t *src_c = src;
uint8_t *dst_c = (uint8_t *)dst;
const uint8_t *src_c = (uint8_t *)src;

/* how many bytes can be copied without overrunning `src` */
size_t copy_bytes = (src_len >= offset) ? (src_len - offset) : 0;
Expand Down Expand Up @@ -808,10 +808,10 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
mod->linear_interpolation = 1; // Linear interpolation can be set after loading
mod->ramping = 1; // ramping can be set after loading
mempool += mod->num_patterns * sizeof(jar_xm_pattern_t);
mempool = ALIGN_PTR(mempool, 16);
mempool = (char *)ALIGN_PTR(mempool, 16);
mod->instruments = (jar_xm_instrument_t*)mempool;
mempool += mod->num_instruments * sizeof(jar_xm_instrument_t);
mempool = ALIGN_PTR(mempool, 16);
mempool = (char *)ALIGN_PTR(mempool, 16);
uint16_t flags = READ_U32(offset + 14);
mod->frequency_type = (flags & (1 << 0)) ? jar_xm_LINEAR_FREQUENCIES : jar_xm_AMIGA_FREQUENCIES;
ctx->default_tempo = READ_U16(offset + 16);
Expand Down Expand Up @@ -884,7 +884,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd

offset += packed_patterndata_size;
}
mempool = ALIGN_PTR(mempool, 16);
mempool = (char *)ALIGN_PTR(mempool, 16);

/* Read instruments */
for(uint16_t i = 0; i < ctx->module.num_instruments; ++i) {
Expand Down Expand Up @@ -928,11 +928,11 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
instr->panning_envelope.enabled = flags & (1 << 0);
instr->panning_envelope.sustain_enabled = flags & (1 << 1);
instr->panning_envelope.loop_enabled = flags & (1 << 2);
instr->vibrato_type = READ_U8(offset + 235);
instr->vibrato_type = (jar_xm_waveform_type_t)READ_U8(offset + 235);
if(instr->vibrato_type == 2) {
instr->vibrato_type = 1;
instr->vibrato_type = (jar_xm_waveform_type_t)1;
} else if(instr->vibrato_type == 1) {
instr->vibrato_type = 2;
instr->vibrato_type = (jar_xm_waveform_type_t)2;
}
instr->vibrato_sweep = READ_U8(offset + 236);
instr->vibrato_depth = READ_U8(offset + 237);
Expand Down Expand Up @@ -976,7 +976,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
sample->panning = (float)READ_U8(offset + 15) / 255.f;
sample->relative_note = (int8_t)READ_U8(offset + 16);
READ_MEMCPY(sample->name, 18, SAMPLE_NAME_LENGTH);
sample->data = (float*)mempool;
sample->data = (float *)mempool;
if(sample->bits == 16) {
/* 16 bit sample */
mempool += sample->length * (sizeof(float) >> 1);
Expand Down Expand Up @@ -1475,7 +1475,7 @@ static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_chan
jar_xm_pitch_slide(ctx, ch, ch->fine_portamento_down_param);
break;
case 4: /* E4y: Set vibrato control */
ch->vibrato_waveform = s->effect_param & 3;
ch->vibrato_waveform = (jar_xm_waveform_type_t)(s->effect_param & 3);
ch->vibrato_waveform_retrigger = !((s->effect_param >> 2) & 1);
break;
case 5: /* E5y: Set finetune */
Expand All @@ -1502,7 +1502,7 @@ static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_chan
}
break;
case 7: /* E7y: Set tremolo control */
ch->tremolo_waveform = s->effect_param & 3;
ch->tremolo_waveform = (jar_xm_waveform_type_t)(s->effect_param & 3);
ch->tremolo_waveform_retrigger = !((s->effect_param >> 2) & 1);
break;
case 0xA: /* EAy: Fine volume slide up */
Expand Down Expand Up @@ -2223,7 +2223,7 @@ int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const
return 4;
}

char* data = JARXM_MALLOC(size + 1);
char* data = (char *)JARXM_MALLOC(size + 1);
if(!data || fread(data, 1, size, xmf) < size) {
fclose(xmf);
DEBUG_ERR(data ? "fread() failed" : "JARXM_MALLOC() failed");
Expand Down
6 changes: 3 additions & 3 deletions src/external/qoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ void *qoa_encode(const short *sample_data, qoa_desc *qoa, unsigned int *out_len)
num_frames * QOA_LMS_LEN * 4 * qoa->channels + /* 4 * 4 bytes lms state per channel */
num_slices * 8 * qoa->channels; /* 8 byte slices */

unsigned char *bytes = QOA_MALLOC(encoded_size);
unsigned char *bytes = (unsigned char *)QOA_MALLOC(encoded_size);

for (unsigned int c = 0; c < qoa->channels; c++) {
/* Set the initial LMS weights to {0, 0, -1, 2}. This helps with the
Expand Down Expand Up @@ -657,7 +657,7 @@ short *qoa_decode(const unsigned char *bytes, int size, qoa_desc *qoa) {

/* Calculate the required size of the sample buffer and allocate */
int total_samples = qoa->samples * qoa->channels;
short *sample_data = QOA_MALLOC(total_samples * sizeof(short));
short *sample_data = (short *)QOA_MALLOC(total_samples * sizeof(short));

unsigned int sample_index = 0;
unsigned int frame_len;
Expand Down Expand Up @@ -733,7 +733,7 @@ void *qoa_read(const char *filename, qoa_desc *qoa) {
bytes_read = fread(data, 1, size, f);
fclose(f);

sample_data = qoa_decode(data, bytes_read, qoa);
sample_data = qoa_decode((const unsigned char *)data, bytes_read, qoa);
QOA_FREE(data);
return sample_data;
}
Expand Down
4 changes: 2 additions & 2 deletions src/external/qoaplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ qoaplay_desc *qoaplay_open(const char *path)
// + a buffer to hold one frame of encoded data
unsigned int buffer_size = qoa_max_frame_size(&qoa);
unsigned int sample_data_size = qoa.channels*QOA_FRAME_LEN*sizeof(short)*2;
qoaplay_desc *qoa_ctx = QOA_MALLOC(sizeof(qoaplay_desc) + buffer_size + sample_data_size);
qoaplay_desc *qoa_ctx = (qoaplay_desc *)QOA_MALLOC(sizeof(qoaplay_desc) + buffer_size + sample_data_size);
memset(qoa_ctx, 0, sizeof(qoaplay_desc));

qoa_ctx->file = file;
Expand Down Expand Up @@ -136,7 +136,7 @@ qoaplay_desc *qoaplay_open_memory(const unsigned char *data, int data_size)
// + the sample data for one frame
// + a buffer to hold one frame of encoded data
unsigned int sample_data_size = qoa.channels*QOA_FRAME_LEN*sizeof(short)*2;
qoaplay_desc *qoa_ctx = QOA_MALLOC(sizeof(qoaplay_desc) + sample_data_size + data_size);
qoaplay_desc *qoa_ctx = (qoaplay_desc *)QOA_MALLOC(sizeof(qoaplay_desc) + sample_data_size + data_size);
memset(qoa_ctx, 0, sizeof(qoaplay_desc));

qoa_ctx->file = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/external/tinyobj_loader_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static void parseFloat3(float *x, float *y, float *z, const char **token) {
}

static unsigned int my_strnlen(const char *s, unsigned int n) {
const char *p = memchr(s, 0, n);
const char *p = (const char *)memchr(s, 0, n);
return p ? (unsigned int)(p - s) : n;
}

Expand Down
Loading