Fix OpenGL 1.1 dedicated graphics backend not having rendered sprite blocks in the world for the past two years (Thanks joshyfishy22)

Was introduced in c2fc17f0deb87d39c55c2e8c2bc3a27615231647
This commit is contained in:
UnknownShadow200 2023-07-02 12:14:21 +10:00
parent bfc5fd4be8
commit d7e401e44c
6 changed files with 21 additions and 10 deletions

View File

@ -94,7 +94,7 @@ ifeq ($(PLAT),beos)
OBJECTS+=src/interop_BeOS.o OBJECTS+=src/interop_BeOS.o
CFLAGS=-g -pipe CFLAGS=-g -pipe
LDFLAGS=-g LDFLAGS=-g
LIBS=-lm -lexecinfo -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker LIBS=-lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
endif endif
ifeq ($(PLAT),serenityos) ifeq ($(PLAT),serenityos)

View File

@ -223,7 +223,8 @@ typedef cc_uint8 cc_bool;
#define CC_BUILD_BEOS #define CC_BUILD_BEOS
#define CC_BUILD_POSIX #define CC_BUILD_POSIX
#define CC_BUILD_GL #define CC_BUILD_GL
#define CC_BUILD_CURL #define CC_BUILD_GL11
#define CC_BUILD_HTTPCLIENT
#define CC_BUILD_OPENAL #define CC_BUILD_OPENAL
#elif defined __sgi #elif defined __sgi
#define CC_BUILD_IRIX #define CC_BUILD_IRIX

View File

@ -158,7 +158,8 @@ static void RenderNormalBatch(int batch) {
Gfx_SetFaceCulling(true); Gfx_SetFaceCulling(true);
/* TODO: fix to not render them all */ /* TODO: fix to not render them all */
#ifdef CC_BUILD_GL11 #ifdef CC_BUILD_GL11
Gfx_DrawIndexedTris_T2fC4b(part.Vbs[FACE_COUNT], 0); Gfx_BindVb(part.Vbs[FACE_COUNT]);
Gfx_DrawIndexedTris_T2fC4b(0, 0);
Game_Vertices += count * 4; Game_Vertices += count * 4;
Gfx_SetFaceCulling(false); Gfx_SetFaceCulling(false);
continue; continue;

View File

@ -48,7 +48,7 @@ const cc_result ReturnCode_DirectoryExists = EEXIST;
#include <sys/systeminfo.h> #include <sys/systeminfo.h>
#elif defined CC_BUILD_BSD #elif defined CC_BUILD_BSD
#include <sys/sysctl.h> #include <sys/sysctl.h>
#elif defined CC_BUILD_HAIKU #elif defined CC_BUILD_HAIKU || defined CC_BUILD_BEOS
/* TODO: Use load_image/resume_thread instead of fork */ /* TODO: Use load_image/resume_thread instead of fork */
/* Otherwise opening browser never works because fork fails */ /* Otherwise opening browser never works because fork fails */
#include <kernel/image.h> #include <kernel/image.h>
@ -226,7 +226,7 @@ cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCall
len = String_Length(src); len = String_Length(src);
String_AppendUtf8(&path, src, len); String_AppendUtf8(&path, src, len);
#if defined CC_BUILD_HAIKU || defined CC_BUILD_SOLARIS || defined CC_BUILD_IRIX #if defined CC_BUILD_HAIKU || defined CC_BUILD_SOLARIS || defined CC_BUILD_IRIX || defined CC_BUILD_BEOS
{ {
char full_path[NATIVE_STR_LEN]; char full_path[NATIVE_STR_LEN];
struct stat sb; struct stat sb;
@ -483,6 +483,10 @@ void Platform_LoadSysFonts(void) {
static const cc_string dirs[] = { static const cc_string dirs[] = {
String_FromConst("/system/data/fonts") String_FromConst("/system/data/fonts")
}; };
#elif defined CC_BUILD_BEOS
static const cc_string dirs[] = {
String_FromConst("/boot/beos/etc/fonts")
};
#elif defined CC_BUILD_DARWIN #elif defined CC_BUILD_DARWIN
static const cc_string dirs[] = { static const cc_string dirs[] = {
String_FromConst("/System/Library/Fonts"), String_FromConst("/System/Library/Fonts"),

View File

@ -45,8 +45,10 @@ void* Mem_Realloc(void* mem, cc_uint32 numElems, cc_uint32 elemsSize, const char
} }
static CC_NOINLINE cc_uint32 CalcMemSize(cc_uint32 numElems, cc_uint32 elemsSize) { static CC_NOINLINE cc_uint32 CalcMemSize(cc_uint32 numElems, cc_uint32 elemsSize) {
cc_uint32 numBytes;
if (!numElems) return 1; /* treat 0 size as 1 byte */ if (!numElems) return 1; /* treat 0 size as 1 byte */
cc_uint32 numBytes = numElems * elemsSize; /* TODO: avoid overflow here */
numBytes = numElems * elemsSize; /* TODO: avoid overflow here */
if (numBytes < numElems) return 0; /* TODO: Use proper overflow checking */ if (numBytes < numElems) return 0; /* TODO: Use proper overflow checking */
return numBytes; return numBytes;
} }

View File

@ -12,7 +12,6 @@ extern "C" {
// Other // Other
#include <errno.h> #include <errno.h>
#include <Url.h>
// AppKit // AppKit
#include <Application.h> #include <Application.h>
#include <Clipboard.h> #include <Clipboard.h>
@ -48,7 +47,7 @@ cc_result Process_StartOpen(const cc_string* args) {
cc_bool https = String_CaselessStarts(args, &https_protocol); cc_bool https = String_CaselessStarts(args, &https_protocol);
const char* mime = https ? "application/x-vnd.Be.URL.https" : "application/x-vnd.Be.URL.http"; const char* mime = https ? "application/x-vnd.Be.URL.https" : "application/x-vnd.Be.URL.http";
const char* argv[] = { str, NULL }; char* argv[] = { str, NULL };
return be_roster->Launch(mime, 1, argv); return be_roster->Launch(mime, 1, argv);
} }
@ -555,12 +554,16 @@ class CC_BRefFilter : public BRefFilter
public: public:
CC_BRefFilter() : BRefFilter() { } CC_BRefFilter() : BRefFilter() { }
#if defined CC_BUILD_BEOS
bool Filter(const entry_ref* ref, BNode* node, struct stat* st, const char* filetype) {
#else
bool Filter(const entry_ref* ref, BNode* node, stat_beos* st, const char* filetype) override { bool Filter(const entry_ref* ref, BNode* node, stat_beos* st, const char* filetype) override {
#endif
BPath path(ref);
cc_string str; cc_string str;
int i; int i;
if (node->IsDirectory()) return true;
BPath path(ref); if (node->IsDirectory()) return true;
str = String_FromReadonly(path.Path()); str = String_FromReadonly(path.Path());
for (i = 0; file_filters[i]; i++) for (i = 0; file_filters[i]; i++)