Commit graph

423 commits

Author SHA1 Message Date
Kp 6b8f08142f Pass canvas to LINE_SPACING
Macro LINE_SPACING previously used global grd_curcanv implicitly.
Change it to take a canvas argument.  Change all callers to pass
grd_curcanv, so that usage is explicit.
2017-02-11 21:42:42 +00:00
Kp 48bf96fe6a Pass canvas to g3_draw_bitmap 2017-02-11 21:42:42 +00:00
Kp f279bb8497 Pass canvas to _g3_draw_tmap_2 2017-02-11 21:42:41 +00:00
Kp ac7eac1269 Factor out _g3_draw_tmap_2 lighting checks 2017-02-11 21:42:41 +00:00
Kp 66ee668e48 Pass canvas to _g3_draw_poly 2017-02-11 21:42:41 +00:00
Kp 4791a40007 Pass canvas to _g3_draw_tmap 2017-02-11 21:42:39 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +00:00
Kp 740b3a9649 Pass canvas to ogl_start_frame 2017-02-11 21:42:33 +00:00
Kp 80e7ade6a1 Pass canvas to g3_draw_sphere 2017-02-11 21:42:33 +00:00
Kp 513e7ceceb Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp 0dcae721d9 Make canvas an explicit argument to gr_printf
Previously, a macro implied *grd_curcanv as the canvas.  Pass the canvas
explicitly so that callers can choose the canvas to use.
2017-02-11 21:42:32 +00:00
Kp 8783c22003 Remove obsolete ogl_pal 2017-02-11 21:42:31 +00:00
Kp c1440ff995 Factor out RLE expansion
Many sites open-coded walking a bitmap and handling whether it was
RLE_BIG.  Factor that out into a helper class and redirect those sites
to use it.
2017-02-11 21:42:30 +00:00
Kp 1b81013a9b Pass active palette to ogl_loadtexture 2017-01-15 00:03:13 +00:00
Kp 764d20d4e1 Make grs_bitmap::bm_flags private 2017-01-15 00:03:13 +00:00
Kp 362d526546 Pass canvas to gr_disk 2016-12-29 03:27:13 +00:00
Kp acd309099b Pass canvas to gr_ucircle 2016-12-29 03:27:13 +00:00
Kp 99f5cfbb10 Pass canvas to ogl_ubitmapm_cs 2016-12-29 03:27:12 +00:00
Kp 1ed06c91b7 Pass canvas to ogl_ulinec 2016-12-29 03:27:09 +00:00
Kp fee4346dc1 Pass canvas to ogl_urect 2016-12-29 03:27:08 +00:00
Kp 290cb6e7c0 Use array<> for ogl_urect float arrays 2016-12-29 03:27:08 +00:00
derhass 551570d29b Unify OpenGL extension handling between OpenGL and OpenGL ES code paths.
Split ogl_get_verinfo() into ogl_tune_for_current() and
ogl_extensions_init(), and consolidate all the OpenGL extension handling
into ogl_extensions.cpp. Unify the code paths for texture anisotropy and
GPU synchronization for OpenGL and OpenGL ES.

Currently, our renderer only uses GLES 1.0, so no real world implementation
will support sync objects for such an old context, but the logic is valid,
and this way, the GLES specific code paths are reduced.

This patch also fixes an issue where the old ogl_get_verinfo() did modify
the texture filtering mode if no anisotropic filter was available. This
was some leftover from the time when the anisotropic filter was a just
a specific CGameConfig.TexFilt mode, and not a separate, orthogonal setting
CGameCfg.TexAnisotropy that it is now.
2016-11-03 21:59:11 +01:00
Kp 52667fae6c Merge branch derhass/patches/ogles-warning-cleanup
derhass reports that OpenGL ES builds warn for unused parameter
`texanis`.  This parameter controls a feature that is not available in
current Rebirth OpenGL ES builds.  Cast the parameter to void to silence
the warning.  Long term, the code ought to be changed to advise the user
when their platform lacks this feature.  In the short term, merge this
fix so that the build will succeed.

https://github.com/dxx-rebirth/dxx-rebirth/pull/256
2016-10-30 18:30:48 +00:00
derhass b144badb11 fix old-style casts in the DXX_USE_OGLES code paths 2016-10-29 23:58:28 +00:00
derhass 1c756316cb fix a -Wunused-parameter warning in the DXX_USE_OGLES code path
The `texanis` parameter is not used in OpenGL ES, but in desktop GL.
2016-10-29 23:57:03 +00:00
Kp ffa53eb3c4 Page in textures before caching them
Some custom levels attempt to use texture overrides that reference
textures that are not yet paged in.  It is not legal to access the data
of a paged-out texture, but ogl_loadbmtexture_f attempted to access it
anyway, causing a crash.  Page in the texture before calling
ogl_loadbmtexture_f.  Old versions of the engine would have cached
garbage data when this happened.

Reported-by: kreator <https://github.com/dxx-rebirth/dxx-rebirth/issues/228>
Fixes: 3c20c24ac0 ("Disable piggy_bitmap_page_out_all")
2016-10-23 20:33:14 +00:00
Kp d955eda96f Fix fullscreen checkbox handling
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/224>
Fixes: 7128141c55 ("Use enum for newmenu item type")
2016-10-18 02:26:30 +00:00
Kp 61a53fb875 Use range_for in ogl_cache_level_textures 2016-10-15 00:53:17 +00:00
Kp a468e2612b Factor out gr_set_attributes SDL_GL_SetAttribute calls 2016-10-02 19:35:34 +00:00
Kp 797554f80a Move Multisample to CCfg 2016-10-02 19:35:33 +00:00
Kp b8f58309f0 Reuse computed filename for screenshot 2016-10-02 00:34:49 +00:00
Kp 2289ed473d Unify computing write_bmp output size requirement 2016-10-02 00:34:49 +00:00
Kp 10f4f87a36 Fix _g3_draw_poly declaration/definition inconsistency
_g3_draw_poly uses type cg3s_point which is const in OGL and non-const
in SDL.  gcc-6 with LTO reports a One Definition Rule violation for this
mismatch:

    typedef const int cint;
    void f(cint *);
    void f(const int *) {}

The code ran correctly as it was, but the fix is trivial and has no
effect on the generated code, so fix it to satisfy the compiler.
2016-09-26 00:50:09 +00:00
Kp ef6f803200 Remove unnecessary nullptr test on nonnull parameter
gcc-6 warns about this test because the caller is not permitted to pass
nullptr here, so the test is unnecessary.
2016-09-26 00:50:09 +00:00
Kp 3544ea097d Move OGLES to dxxsconf.h; rename to DXX_USE_OGLES
Rename symbol OGLES to DXX_USE_OGLES to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -lzw OGLES -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGLES/\1 DXX_USE_OGLES/' -e 's/\(\s*#\s*if\)ndef OGLES/\1 !DXX_USE_OGLES/'
2016-09-24 18:06:11 +00:00
Kp 7a13d3f228 Include dxxsconf.h explicitly and earlier 2016-09-24 18:06:10 +00:00
zico 1e6a5ec528 Addition for 6c6a32ba92, allowing edge padding for overlaying level textures, disabling it for base textures. This isn't needed and improves visual appearence of base textures with transparency (fuelcenters, forcefields, grates, etc) when texture filtering is enabled. 2016-09-17 18:26:59 +02:00
zico 1f144f167c Addition for 6c6a32ba92, allowing edge padding for level and polymodel texturees only but disable it for sprites, fonts, hud images, etc. as those looked bad with this form of color bleeding in combination with various texture filtering mechanics. 2016-09-17 15:56:43 +02:00
Kp ddf888cd72 Move USE_SDLMIXER to dxxsconf.h; rename to DXX_USE_SDLMIXER
Rename symbol USE_SDLMIXER to DXX_USE_SDLMIXER to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct and
inferno.cpp were manual.

git grep -l USE_SDLMIXER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_SDLMIXER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_SDLMIXER\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
Kp 3fc1441b3f Remove unused Win32 OpenGL indirections 2016-09-04 19:10:43 +00:00
Kp c7041a9b26 Use reinterpret_cast for digi magic value (void*)-1 2016-09-04 19:10:43 +00:00
Kp 53196ec990 Switch similar/arch/ogl to C++ casts 2016-09-04 00:02:53 +00:00
Kp 30a7c28cc5 Switch gr.cpp write_bmp to static_cast 2016-09-04 00:02:51 +00:00
Kp 8d019a63fb Fold glTexParameteri calls 2016-09-03 17:30:18 +00:00
Kp 9d2fd0ebfa Fold glScalef calls 2016-09-03 17:30:17 +00:00
zico b2cad09c26 Added new texture filtering options based on patch of user 'beware' 2016-08-29 20:53:10 +02:00
zico 6c6a32ba92 Added patch by user 'beware' to remove dark edges around textures and added command-line/INI option to disable this patch if desired (nostalgia). Fixed misleading indentation in ogl.cpp along the way. 2016-08-29 17:07:30 +02:00
Kp 37fed077ee Remove useless casts in similar/arch/ogl/ogl.cpp 2016-08-17 04:44:22 +00:00
Kp 9b3adfb020 Remove useless casts in similar/arch/ogl/gr.cpp 2016-08-17 04:44:22 +00:00