From 0624680953e236b8cd785dcba64ab9aaaa75718e Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 24 May 2025 07:41:43 +1000 Subject: [PATCH] Symbian: Minor code tidy up --- misc/opengl/GLCommon.h | 1 + src/Graphics_GL1.c | 5 ++--- src/Platform_Symbian.cpp | 24 ------------------------ src/Window_Symbian.cpp | 2 +- 4 files changed, 4 insertions(+), 28 deletions(-) diff --git a/misc/opengl/GLCommon.h b/misc/opengl/GLCommon.h index 7de47a0eb..525db8fc5 100644 --- a/misc/opengl/GLCommon.h +++ b/misc/opengl/GLCommon.h @@ -71,6 +71,7 @@ typedef cc_uintptr GLpointer; #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_DEPTH_BITS 0x0D56 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #define GL_FOG_HINT 0x0C54 #define GL_NICEST 0x1102 #define GL_COMPILE 0x1300 diff --git a/src/Graphics_GL1.c b/src/Graphics_GL1.c index 68ddccf62..43fa20577 100644 --- a/src/Graphics_GL1.c +++ b/src/Graphics_GL1.c @@ -480,9 +480,8 @@ static void Gfx_RestoreState(void) { gfx_format = -1; _glHint(GL_FOG_HINT, GL_NICEST); -#if defined CC_BUILD_SYMBIAN - _glHint(0x0C50 /*GL_PERSPECTIVE_CORRECTION_HINT*/, GL_NICEST); -#endif + _glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + _glAlphaFunc(GL_GREATER, 0.5f); _glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); _glDepthFunc(GL_LEQUAL); diff --git a/src/Platform_Symbian.cpp b/src/Platform_Symbian.cpp index 448e3859d..ca8c4cb1d 100644 --- a/src/Platform_Symbian.cpp +++ b/src/Platform_Symbian.cpp @@ -217,17 +217,12 @@ cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCall len = String_Length(src); String_AppendUtf8(&path, src, len); -#if defined CC_BUILD_SYMBIAN { char full_path[NATIVE_STR_LEN]; struct stat sb; String_EncodeUtf8(full_path, &path); is_dir = stat(full_path, &sb) == 0 && S_ISDIR(sb.st_mode); } -#else - is_dir = entry->d_type == DT_DIR; - /* TODO: fallback to stat when this fails */ -#endif callback(&path, obj, is_dir); errno = 0; @@ -552,9 +547,6 @@ void Socket_Close(cc_socket s) { close(s); } -#if defined CC_BUILD_DARWIN || defined CC_BUILD_BEOS || defined CC_BUILD_SYMBIAN -/* poll is broken on old OSX apparently https://daniel.haxx.se/docs/poll-vs-select.html */ -/* BeOS lacks support for poll */ static cc_result Socket_Poll(cc_socket s, int mode, cc_bool* success) { fd_set set; struct timeval time = { 0 }; @@ -572,22 +564,6 @@ static cc_result Socket_Poll(cc_socket s, int mode, cc_bool* success) { if (selectCount == -1) { *success = false; return errno; } *success = FD_ISSET(s, &set) != 0; return 0; } -#else -#include -static cc_result Socket_Poll(cc_socket s, int mode, cc_bool* success) { - struct pollfd pfd; - int flags; - - pfd.fd = s; - pfd.events = mode == SOCKET_POLL_READ ? POLLIN : POLLOUT; - if (poll(&pfd, 1, 0) == -1) { *success = false; return errno; } - - /* to match select, closed socket still counts as readable */ - flags = mode == SOCKET_POLL_READ ? (POLLIN | POLLHUP) : POLLOUT; - *success = (pfd.revents & flags) != 0; - return 0; -} -#endif cc_result Socket_CheckReadable(cc_socket s, cc_bool* readable) { return Socket_Poll(s, SOCKET_POLL_READ, readable); diff --git a/src/Window_Symbian.cpp b/src/Window_Symbian.cpp index f6b1945f3..c609f053d 100644 --- a/src/Window_Symbian.cpp +++ b/src/Window_Symbian.cpp @@ -615,7 +615,7 @@ cc_result CWindow::OpenBrowser(const cc_string* url) { } void Window_PreInit(void) { - NormDevice.defaultBinds = symbian_binds; + //NormDevice.defaultBinds = symbian_binds; TODO only use on devices with limited hardware CCoeEnv* env = new (ELeave) CCoeEnv(); TRAPD(err, env->ConstructL(ETrue, 0));