Skip to content

Commit

Permalink
gfx: move to libtrx
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Sep 15, 2024
1 parent 5750b06 commit 8e935df
Show file tree
Hide file tree
Showing 41 changed files with 17 additions and 14,484 deletions.
38 changes: 10 additions & 28 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ project(
],
)

trx = subproject('libtrx', default_options: {'tr_version': '1'})
if host_machine.system() == 'darwin'
gfx_gl_default_backend = 'GFX_GL_33C'
else
gfx_gl_default_backend = 'GFX_GL_21'
endif

trx = subproject('libtrx', default_options: {
'tr_version': '1',
'gfx_gl_default_backend': gfx_gl_default_backend,
})
c_compiler = meson.get_compiler('c')

build_opts = [
Expand Down Expand Up @@ -264,21 +273,6 @@ sources = [
'src/game/stats.c',
'src/game/text.c',
'src/game/viewport.c',
'src/gfx/2d/2d_renderer.c',
'src/gfx/2d/2d_surface.c',
'src/gfx/3d/3d_renderer.c',
'src/gfx/3d/vertex_stream.c',
'src/gfx/context.c',
'src/gfx/gl/buffer.c',
'src/gfx/gl/gl_core_3_3.c',
'src/gfx/gl/program.c',
'src/gfx/gl/sampler.c',
'src/gfx/gl/texture.c',
'src/gfx/gl/utils.c',
'src/gfx/gl/vertex_array.c',
'src/gfx/renderers/fbo_renderer.c',
'src/gfx/renderers/legacy_renderer.c',
'src/gfx/screenshot.c',
'src/global/enum_str.c',
'src/global/vars.c',
'src/math/math.c',
Expand All @@ -305,18 +299,6 @@ dependencies = [
dep_zlib,
]

gfx_options = configuration_data()

if host_machine.system() == 'darwin'
gfx_options.set('GFX_GL_DEFAULT_BACKEND', 'GFX_GL_33C')
else
gfx_options.set('GFX_GL_DEFAULT_BACKEND', 'GFX_GL_21')
endif

configure_file(
output: 'gfx_options.h',
configuration: gfx_options)

executable(
'TR1X',
sources,
Expand Down
4 changes: 2 additions & 2 deletions src/config.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "gfx/common.h"
#include "gfx/context.h"
#include "global/types.h"

#include <libtrx/gfx/common.h>

#include <stdbool.h>
#include <stdint.h>

Expand Down
3 changes: 1 addition & 2 deletions src/game/option/option_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
#include "game/output.h"
#include "game/screen.h"
#include "game/text.h"
#include "gfx/common.h"
#include "gfx/context.h"
#include "global/const.h"

#include <libtrx/gfx/context.h>
#include <libtrx/utils.h>

#include <stdbool.h>
Expand Down
1 change: 0 additions & 1 deletion src/game/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "game/screen.h"
#include "game/sound.h"
#include "game/text.h"
#include "gfx/common.h"
#include "global/types.h"
#include "global/vars.h"
#include "specific/s_shell.h"
Expand Down
119 changes: 0 additions & 119 deletions src/gfx/2d/2d_renderer.c

This file was deleted.

28 changes: 0 additions & 28 deletions src/gfx/2d/2d_renderer.h

This file was deleted.

130 changes: 0 additions & 130 deletions src/gfx/2d/2d_surface.c

This file was deleted.

Loading

0 comments on commit 8e935df

Please sign in to comment.