Classic mode should only show players up to 64 blocks away

This commit is contained in:
UnknownShadow200 2024-06-10 08:41:00 +10:00
parent 25ecbf379e
commit 08e5d21d4b
3 changed files with 10 additions and 4 deletions

View File

@ -15,7 +15,7 @@ jobs:
build: build:
env: env:
GHCR_ACCESS_KEY: ${{ secrets.GHCR_ACCESS_KEY }} GHCR_ACCESS_KEY: ${{ secrets.GHCR_ACCESS_KEY }}
if: env.GHCR_ACCESS_KEY if: ${{ env.GHCR_ACCESS_KEY != '' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ghcr.io/classicube/minimal-osxcross:latest image: ghcr.io/classicube/minimal-osxcross:latest

View File

@ -1028,6 +1028,9 @@ static void NetPlayer_RenderModel(struct Entity* e, float delta, float t) {
AnimatedComp_GetCurrent(e, t); AnimatedComp_GetCurrent(e, t);
e->ShouldRender = Model_ShouldRender(e); e->ShouldRender = Model_ShouldRender(e);
/* Original classic only shows players up to 64 blocks away */
if (Game_ClassicMode) e->ShouldRender &= Model_RenderDistance(e) <= 64 * 64;
if (e->ShouldRender) Model_Render(e->Model, e); if (e->ShouldRender) Model_Render(e->Model, e);
} }

View File

@ -7,6 +7,9 @@
#include "_GraphicsBase.h" #include "_GraphicsBase.h"
#include "Errors.h" #include "Errors.h"
#include "Window.h" #include "Window.h"
#ifdef CC_BUILD_WIN
#define CC_BUILD_GL11_FALLBACK
#endif
/* The OpenGL backend is a bit of a mess, since it's really 2 backends in one: /* The OpenGL backend is a bit of a mess, since it's really 2 backends in one:
* - OpenGL 1.1 (completely lacking GPU, fallbacks to say Windows built-in software rasteriser) * - OpenGL 1.1 (completely lacking GPU, fallbacks to say Windows built-in software rasteriser)
@ -41,7 +44,7 @@ static void GLContext_GetAll(const struct DynamicLibSym* syms, int count) {
} }
#if defined CC_BUILD_WIN && !defined CC_BUILD_GL11 #if defined CC_BUILD_GL11_FALLBACK && !defined CC_BUILD_GL11
/* Note the following about calling OpenGL functions on Windows */ /* Note the following about calling OpenGL functions on Windows */
/* 1) wglGetProcAddress returns a context specific address */ /* 1) wglGetProcAddress returns a context specific address */
/* 2) dllimport functions are implemented using indirect function pointers */ /* 2) dllimport functions are implemented using indirect function pointers */
@ -506,7 +509,7 @@ cc_bool Gfx_WarnIfNecessary(void) {
static void GLBackend_Init(void) { MakeIndices(gl_indices, GFX_MAX_INDICES, NULL); } static void GLBackend_Init(void) { MakeIndices(gl_indices, GFX_MAX_INDICES, NULL); }
#else #else
#if defined CC_BUILD_WIN #ifdef CC_BUILD_GL11_FALLBACK
static FP_glDrawElements _realDrawElements; static FP_glDrawElements _realDrawElements;
static FP_glColorPointer _realColorPointer; static FP_glColorPointer _realColorPointer;
static FP_glTexCoordPointer _realTexCoordPointer; static FP_glTexCoordPointer _realTexCoordPointer;
@ -670,7 +673,7 @@ static void GLBackend_Init(void) {
/* Version string is always: x.y. (and whatever afterwards) */ /* Version string is always: x.y. (and whatever afterwards) */
int major = ver[0] - '0', minor = ver[2] - '0'; int major = ver[0] - '0', minor = ver[2] - '0';
#ifdef CC_BUILD_WIN #ifdef CC_BUILD_GL11_FALLBACK
LoadCoreFuncs(); LoadCoreFuncs();
#endif #endif
customMipmapsLevels = true; customMipmapsLevels = true;