Skip to content

Commit

Permalink
Fixed the build with CONFIG_GL_RENDERER=OFF: #412
Browse files Browse the repository at this point in the history
  • Loading branch information
apanteleev committed Oct 21, 2024
1 parent 42e25a5 commit 642644c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions inc/common/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common/error.h"
#include "system/hunk.h"
#include "format/bsp.h"
#include "format/wal.h"

// maximum size of a PVS row, in bytes
#define VIS_MAX_BYTES (MAX_MAP_CLUSTERS >> 3)
Expand Down
6 changes: 6 additions & 0 deletions src/refresh/images.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ void stbi_write(void *context, void *data, int size)
}

extern cvar_t* vid_rtx;
#if REF_GL
extern cvar_t* gl_use_hd_assets;
#endif

/*
====================================================================
Expand Down Expand Up @@ -1455,7 +1457,11 @@ static image_t *find_or_load_image(const char *name, size_t len,
goto fail;
}

#if REF_GL
bool allow_override = cls.ref_type != REF_TYPE_GL || type == IT_PIC || gl_use_hd_assets->integer;
#else
bool allow_override = true;
#endif

if(allow_override)
{
Expand Down
4 changes: 4 additions & 0 deletions src/refresh/models.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,11 @@ qhandle_t R_RegisterModel(const char *name)
fs_flags = try_location == TRY_MODEL_SRC_GAME ? FS_PATH_GAME : FS_PATH_BASE;

char* extension = normalized + namelen - 4;
#if REF_GL
bool try_md3 = cls.ref_type == REF_TYPE_VKPT || (cls.ref_type == REF_TYPE_GL && gl_use_hd_assets->integer);
#else
bool try_md3 = true;
#endif
if (namelen > 4 && (strcmp(extension, ".md2") == 0) && try_md3)
{
memcpy(extension, ".md3", 4);
Expand Down
2 changes: 2 additions & 0 deletions src/unix/video/sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,11 @@ const vid_driver_t vid_sdl = {
.set_mode = set_mode,
.update_gamma = update_gamma,

#if REF_GL
.get_proc_addr = get_proc_addr,
.swap_buffers = swap_buffers,
.swap_interval = swap_interval,
#endif

.get_clipboard_data = get_clipboard_data,
.set_clipboard_data = set_clipboard_data,
Expand Down

0 comments on commit 642644c

Please sign in to comment.