mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
SoftGPU: Don't render clouds or sky
This commit is contained in:
parent
829511a337
commit
e86caaa4e1
@ -316,11 +316,12 @@ void Drawer2D_MakeTextTexture(struct Texture* tex, struct DrawTextArgs* args) {
|
||||
|
||||
void Context2D_MakeTexture(struct Texture* tex, struct Context2D* ctx) {
|
||||
int flags = TEXTURE_FLAG_NONPOW2 | TEXTURE_FLAG_LOWRES;
|
||||
int nouv = Gfx.Limitations & GFX_LIMIT_NO_UV_SUPPORT;
|
||||
Gfx_RecreateTexture(&tex->ID, &ctx->bmp, flags, false);
|
||||
|
||||
/* TODO need to find a better solution in NoUVSupport case */
|
||||
tex->width = Gfx.NoUVSupport ? ctx->bmp.width : ctx->width;
|
||||
tex->height = Gfx.NoUVSupport ? ctx->bmp.height : ctx->height;
|
||||
tex->width = nouv ? ctx->bmp.width : ctx->width;
|
||||
tex->height = nouv ? ctx->bmp.height : ctx->height;
|
||||
|
||||
tex->uv.u1 = 0.0f; tex->uv.v1 = 0.0f;
|
||||
tex->uv.u2 = (float)ctx->width / (float)ctx->bmp.width;
|
||||
|
@ -475,7 +475,13 @@ static void Game_Load(void) {
|
||||
}
|
||||
|
||||
entTaskI = ScheduledTask_Add(GAME_DEF_TICKS, Entities_Tick);
|
||||
if (Gfx_WarnIfNecessary()) EnvRenderer_SetMode(EnvRenderer_Minimal | ENV_LEGACY);
|
||||
Gfx_WarnIfNecessary();
|
||||
|
||||
if (Gfx.Limitations & GFX_LIMIT_VERTEX_ONLY_FOG)
|
||||
EnvRenderer_SetMode(EnvRenderer_Minimal | ENV_LEGACY);
|
||||
if (Gfx.BackendType == CC_GFX_BACKEND_SOFTGPU)
|
||||
EnvRenderer_SetMode(ENV_MINIMAL);
|
||||
|
||||
Server.BeginConnect();
|
||||
}
|
||||
|
||||
|
@ -68,9 +68,8 @@ CC_VAR extern struct _GfxData {
|
||||
struct Matrix View, Projection;
|
||||
/* Whether the graphics backend supports non power of two textures */
|
||||
cc_bool SupportsNonPowTwoTextures;
|
||||
/* Whether the graphics backend supports U/V that don't occupy whole texture */
|
||||
/* e.g. Saturn, 3D0 systems don't support it */
|
||||
cc_bool NoUVSupport;
|
||||
/* Limitations of the graphics backend, see GFX_LIMIT values */
|
||||
cc_bool Limitations;
|
||||
/* Type of the backend (e.g. OpenGL, Direct3D 9, etc)*/
|
||||
cc_uint8 BackendType;
|
||||
cc_bool __pad;
|
||||
@ -86,6 +85,13 @@ CC_VAR extern struct _GfxData {
|
||||
GfxResourceID DefaultIb;
|
||||
} Gfx;
|
||||
|
||||
/* Whether the graphics backend supports U/V that don't occupy whole texture */
|
||||
/* e.g. Saturn, 3D0 systems don't support it */
|
||||
#define GFX_LIMIT_NO_UV_SUPPORT 0x01
|
||||
/* Whether the graphics backend requires very large quads to be broken
|
||||
/* up into smaller quads, to reduce fog interpolation artifacts */
|
||||
#define GFX_LIMIT_VERTEX_ONLY_FOG 0x02
|
||||
|
||||
extern const cc_string Gfx_LowPerfMessage;
|
||||
|
||||
#define ICOUNT(verticesCount) (((verticesCount) >> 2) * 6)
|
||||
|
@ -500,6 +500,8 @@ cc_bool Gfx_WarnIfNecessary(void) {
|
||||
Chat_AddRaw("&cSoftware rendering is being used, performance will greatly suffer.");
|
||||
Chat_AddRaw("&cVSync may not work, and you may see disappearing clouds and map edges.");
|
||||
Chat_AddRaw("&cYou may need to install video card drivers.");
|
||||
|
||||
Gfx.Limitations |= GFX_LIMIT_VERTEX_ONLY_FOG;
|
||||
return true;
|
||||
}
|
||||
if (String_ContainsConst(&renderer, "Intel")) {
|
||||
@ -508,6 +510,8 @@ cc_bool Gfx_WarnIfNecessary(void) {
|
||||
#ifdef CC_BUILD_WIN
|
||||
Chat_AddRaw("&cTry downloading the Direct3D 9 build instead.");
|
||||
#endif
|
||||
|
||||
Gfx.Limitations |= GFX_LIMIT_VERTEX_ONLY_FOG;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -101,7 +101,7 @@ void Gfx_Create(void) {
|
||||
Gfx.MaxTexWidth = 128;
|
||||
Gfx.MaxTexHeight = 16; // 128
|
||||
Gfx.Created = true;
|
||||
Gfx.NoUVSupport = true;
|
||||
Gfx.Limitations = GFX_LIMIT_NO_UV_SUPPORT;
|
||||
}
|
||||
|
||||
void Gfx_Free(void) {
|
||||
|
@ -1609,13 +1609,14 @@ cc_result Platform_Decrypt(const void* data, int len, cc_string* dst) {
|
||||
}
|
||||
|
||||
cc_result Platform_GetEntropy(void* data, int len) {
|
||||
int ret;
|
||||
int fd = open("/dev/urandom", O_RDONLY);
|
||||
if (fd < 0) return ERR_NOT_SUPPORTED;
|
||||
|
||||
// TODO: check return code? and partial reads?
|
||||
read(fd, data, len);
|
||||
ret = read(fd, data, len);
|
||||
close(fd);
|
||||
return 0;
|
||||
return ret == -1 ? errno : 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -439,8 +439,14 @@ static void DoCreateWindow(int width, int height) {
|
||||
XGetInputFocus(win_display, &focus, &focusRevert);
|
||||
if (focus == win) Window_Main.Focused = true;
|
||||
}
|
||||
void Window_Create2D(int width, int height) { DoCreateWindow(width, height); }
|
||||
void Window_Create3D(int width, int height) { DoCreateWindow(width, height); }
|
||||
|
||||
void Window_Create2D(int width, int height) {
|
||||
DoCreateWindow(width, height);
|
||||
}
|
||||
|
||||
void Window_Create3D(int width, int height) {
|
||||
DoCreateWindow(width, height);
|
||||
}
|
||||
|
||||
void Window_Destroy(void) {
|
||||
Window win = Window_Main.Handle.val;
|
||||
|
Loading…
x
Reference in New Issue
Block a user