From 9d2c03d3e07d2252ea9107a9c7f0cf9397f5edb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Sun, 25 Oct 2026 06:38:42 +0300 Subject: [PATCH] smaller --- components/raybri/raybri.c | 6 ++---- components/raybri/raybri.h | 22 ++++---------------- components/raybri/raybriConst.h | 6 ++++++ ogs-blue/ver-mac/src/raybri/raybriConst.h | 1 + ogs-chkgfx/ver-mac/src/raybri/raybriConst.h | 1 + ogs-mahjong/ver-mac/src/raybri/raybriConst.h | 1 + 6 files changed, 15 insertions(+), 22 deletions(-) create mode 100644 components/raybri/raybriConst.h create mode 120000 ogs-blue/ver-mac/src/raybri/raybriConst.h create mode 120000 ogs-chkgfx/ver-mac/src/raybri/raybriConst.h create mode 120000 ogs-mahjong/ver-mac/src/raybri/raybriConst.h diff --git a/components/raybri/raybri.c b/components/raybri/raybri.c index 3273a19..b3af940 100644 --- a/components/raybri/raybri.c +++ b/components/raybri/raybri.c @@ -1,13 +1,11 @@ #include "raybri.h" - +#include "raybriConst.h" #include "rlgl.h" - #include #include static int sr_width = 1; static int sr_height = 1; - static int sr_ready = 0; // raylib is built as a static/dynamic library with GLFW baked in, but we never @@ -18,7 +16,7 @@ static void *sr_gl_loader(const char *name) static void *handle = NULL; if (handle == NULL) { - handle = dlopen("/System/Library/Frameworks/OpenGL.framework/OpenGL", RTLD_LAZY | RTLD_LOCAL); + handle = dlopen(RAYBRI_MAC_GL, RTLD_LAZY | RTLD_LOCAL); } if (handle == NULL) return NULL; return dlsym(handle, name); diff --git a/components/raybri/raybri.h b/components/raybri/raybri.h index fb6f21a..076866d 100644 --- a/components/raybri/raybri.h +++ b/components/raybri/raybri.h @@ -1,23 +1,9 @@ -#ifndef OGS_MAHJONG_RAYLIB_BRIDGE_H -#define OGS_MAHJONG_RAYLIB_BRIDGE_H +#ifndef RAYBRI_H +#define RAYBRI_H -#ifdef __cplusplus -extern "C" { -#endif - -// Initialise the OpenGL-backed raylib scene (no raylib window is created). void raybri_init(void); - -// Resize the viewport. -void raybri_resize(int width, int height); - void raybri_render(void); - -// Release all GPU resources. +void raybri_resize(int width, int height); void raybri_shutdown(void); -#ifdef __cplusplus -} -#endif - -#endif +#endif // RAYBRI_H diff --git a/components/raybri/raybriConst.h b/components/raybri/raybriConst.h new file mode 100644 index 0000000..d35046f --- /dev/null +++ b/components/raybri/raybriConst.h @@ -0,0 +1,6 @@ +#ifndef RAYBRI_CONST_H +#define RAYBRI_CONST_H + +static const char RAYBRI_MAC_GL[] = "/System/Library/Frameworks/OpenGL.framework/OpenGL"; + +#endif // RAYBRI_CONST_H diff --git a/ogs-blue/ver-mac/src/raybri/raybriConst.h b/ogs-blue/ver-mac/src/raybri/raybriConst.h new file mode 120000 index 0000000..7e1b994 --- /dev/null +++ b/ogs-blue/ver-mac/src/raybri/raybriConst.h @@ -0,0 +1 @@ +../../../../components/raybri/raybriConst.h \ No newline at end of file diff --git a/ogs-chkgfx/ver-mac/src/raybri/raybriConst.h b/ogs-chkgfx/ver-mac/src/raybri/raybriConst.h new file mode 120000 index 0000000..7e1b994 --- /dev/null +++ b/ogs-chkgfx/ver-mac/src/raybri/raybriConst.h @@ -0,0 +1 @@ +../../../../components/raybri/raybriConst.h \ No newline at end of file diff --git a/ogs-mahjong/ver-mac/src/raybri/raybriConst.h b/ogs-mahjong/ver-mac/src/raybri/raybriConst.h new file mode 120000 index 0000000..7e1b994 --- /dev/null +++ b/ogs-mahjong/ver-mac/src/raybri/raybriConst.h @@ -0,0 +1 @@ +../../../../components/raybri/raybriConst.h \ No newline at end of file