diff --git a/readme.md b/readme.md index 07fe8d282..2b96568a7 100644 --- a/readme.md +++ b/readme.md @@ -162,7 +162,7 @@ Install libexecinfo, curl and openal-soft package if needed Install openal_devel and libexecinfo_devel package if needed -```cc *.c -o ClassiCube -lm -lexecinfo -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker``` +```cc *.c Window_Haiku.cpp -o ClassiCube -lm -lexecinfo -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker``` #### SerenityOS diff --git a/src/Core.h b/src/Core.h index 92908bcfa..d3a55f503 100644 --- a/src/Core.h +++ b/src/Core.h @@ -245,7 +245,6 @@ Thus it is **NOT SAFE** to allocate a string on the stack. */ #define CC_BUILD_GL #define CC_BUILD_CURL #define CC_BUILD_OPENAL -#define CC_BUILD_SDL #elif defined __EMSCRIPTEN__ #define CC_BUILD_WEB #define CC_BUILD_GL diff --git a/src/Vorbis.c b/src/Vorbis.c index bd02d9551..33dc000dd 100644 --- a/src/Vorbis.c +++ b/src/Vorbis.c @@ -1009,7 +1009,7 @@ void imdct_init(struct imdct_state* state, int n) { } void imdct_calc(float* in, float* out, struct imdct_state* state) { - int k, k2, k4, k8, n = state->n; + int k, k2, k4, n = state->n; int n2 = n >> 1, n4 = n >> 2, n8 = n >> 3, n3_4 = n - n4; int l, log2_n; cc_uint32* reversed; @@ -1025,7 +1025,7 @@ void imdct_calc(float* in, float* out, struct imdct_state* state) { float x_1, x_2, y_1, y_2; - /* spectral coefficients, step 1, step 2 */ + /* spectral coefficients, step 1, step 2 */ /* TODO avoid k */ for (k = 0, k2 = 0, k4 = 0; k < n8; k++, k2 += 2, k4 += 4) { e_1 = -in[k4+3]; e_2 = -in[k4+1]; g_1 = e_1 * A[n2-1-k2] + e_2 * A[n2-2-k2]; @@ -1071,7 +1071,7 @@ void imdct_calc(float* in, float* out, struct imdct_state* state) { /* step 4, step 5, step 6, step 7, step 8, output */ reversed = state->reversed; - for (k = 0, k2 = 0, k8 = 0; k < n8; k++, k2 += 2, k8 += 8) { + for (k = 0, k2 = 0; k < n8; k++, k2 += 2) { cc_uint32 j = reversed[k], j4 = j << 2; e_1 = u[n2-j4-1]; e_2 = u[n2-j4-2]; f_1 = u[j4+1]; f_2 = u[j4+0]; diff --git a/src/Window.h b/src/Window.h index ff7bd106c..01aad3348 100644 --- a/src/Window.h +++ b/src/Window.h @@ -179,6 +179,7 @@ void Window_UpdateRawMouse(void); /* Cursor will also be unhidden and moved back to window centre. */ void Window_DisableRawMouse(void); +/* OpenGL contexts are heavily tied to the window, so for simplicitly are also provided here */ #ifdef CC_BUILD_GL #define GLCONTEXT_DEFAULT_DEPTH 24 /* Creates an OpenGL context, then makes it the active context. */ diff --git a/src/_GLShared.h b/src/_GLShared.h index 86cef4628..c0ddae60e 100644 --- a/src/_GLShared.h +++ b/src/_GLShared.h @@ -22,6 +22,13 @@ /*########################################################################################################################* *---------------------------------------------------------General---------------------------------------------------------* *#########################################################################################################################*/ +static void GLContext_GetAll(const struct DynamicLibSym* syms, int count) { + int i; + for (i = 0; i < count; i++) { + *syms[i].symAddr = GLContext_GetAddress(syms[i].name); + } +} + static void GL_UpdateVsync(void) { GLContext_SetFpsLimit(gfx_vsync, gfx_minFrameMs); } diff --git a/src/_WindowBase.h b/src/_WindowBase.h index 75cb1a0c2..aed97891e 100644 --- a/src/_WindowBase.h +++ b/src/_WindowBase.h @@ -105,21 +105,11 @@ static void InitGraphicsMode(struct GraphicsMode* m) { } } -#ifdef CC_BUILD_GL -/* OpenGL contexts are heavily tied to the window, so for simplicitly are also included here */ -/* EGL is window system agnostic, other OpenGL context backends are tied to one windowing system. */ - -void GLContext_GetAll(const struct DynamicLibSym* syms, int count) { - int i; - for (i = 0; i < count; i++) { - *syms[i].symAddr = GLContext_GetAddress(syms[i].name); - } -} - +/* EGL is window system agnostic, other OpenGL context backends are tied to one windowing system */ +#if defined CC_BUILD_GL && defined CC_BUILD_EGL /*########################################################################################################################* *-------------------------------------------------------EGL OpenGL--------------------------------------------------------* *#########################################################################################################################*/ -#if defined CC_BUILD_EGL #include static EGLDisplay ctx_display; static EGLContext ctx_context; @@ -225,4 +215,3 @@ void GLContext_SetFpsLimit(cc_bool vsync, float minFrameMs) { } void GLContext_GetApiInfo(cc_string* info) { } #endif -#endif