Commit graph

391 commits

Author SHA1 Message Date
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
Kp 1d1f3f6568 Allocate fewer jukebox pointers for small files 2016-08-08 00:07:19 +00:00
Kp 7ac89d0a14 Update jukebox song count at end of read_m3u 2016-08-08 00:07:19 +00:00
Kp 2885070ba8 Remove unnecessary ~jukebox_songs
The storage is managed by a unique_ptr, so the default destructor is
sufficient.
2016-08-08 00:07:19 +00:00
Kp 68ac4acd10 Combine jukebox allocations 2016-08-06 19:55:26 +00:00
Kp 8247713850 Use RAII for m3u FILE* 2016-08-06 19:55:26 +00:00
Kp 5b71faacda Use RAII to remove temporary PHYSFS search path 2016-08-06 19:55:25 +00:00
Kp a98510b17e Move CMLevelMusicTrack to CCfg 2016-08-06 19:55:25 +00:00
Kp 50599c0dad Move CMLevelMusicPath to CCfg 2016-08-06 19:55:25 +00:00
Kp a1ab71f5ad Avoid calling make_unique<...>({})
The compiler may or may not recognize that the temporary T{} passed to
make_unique can be omitted.  Help it by passing nothing, then explicitly
clearing the returned data as a separate step.
2016-08-06 19:55:24 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp 7d07c24a5a Invert sense of digi.cpp firstplay to already_playing
Invert the sense so that the variable can be bss-initialized.  Rename
the variable to reflect the inverted sense.
2016-07-09 17:58:34 +00:00
Kp 2ccfdfcbc3 Make digi_win32_midi_song_playing static 2016-07-09 17:58:34 +00:00
Kp b0a2205a4e Convert various pointer casts to reinterpret_cast 2016-07-06 01:54:24 +00:00
Kp 492cc5788a Fix -Wshadow error in SDL-only build 2016-07-02 02:04:11 +00:00
Kp 65f68877aa Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
2016-06-16 03:56:44 +00:00
Kp 1b12a3f7ef Add parentheses around target of more complicated casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of some C casts.

This pass attempts to process expressions that involve parenthesized or
bracketed subexpressions, but only if those subexpressions do not
themselves contain parenthesized or bracketed subexpressions.

	(int) f(1);	// changed
	(int) f(g());	// not changed

perl -p -i -e 's/(\(\s*((?:un)?signed|int|char|short|long|float|double|s?size_t|(?:u?int[[:digit:]]+_t))\s*\**\s*\)\s*)([&+-]?)([[:alnum:]_.]+\s*->\s*)*([[:alnum:]_.]+)((?:\s*(?:\[[^][]*\])*|(?:\([^()]*\))*))(\s*([;+>*\/^%,|&<>])|$|(\s*-\s*[^>]))/\1\(\3\4\5\6\)\7/g'
2016-06-12 03:45:37 +00:00
Kp b282bea173 Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
2016-06-05 01:04:26 +00:00
Kp 7fdce88558 Add parentheses around target of simple casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

This pass does not attempt to process expressions that involve
any subexpression that can nest arbitrarily, such as parentheses or
brackets.  It also works only on commonly used standard types.

	(int) a->b;	// changed
	(int) a[b];	// not changed

s/\((\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\**\s*)\s*\)\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/\1(\5\6\7)\8/g
2016-06-05 01:04:25 +00:00
zico a8ed0aaa9c Added breaks in event.cpp to prevent unwanted events if -nomouse and/or -nojoystick is given; Added automap_apply_input() to prevent multiple inputs per frame causing multiple movement applications. 2016-05-30 13:17:42 +02:00
Kp 398596c468 Use enum for bitmap mode 2016-05-28 17:31:26 +00:00
Kp a0cc2bfc7e Pass canvas to ogl_upixelc 2016-05-28 17:31:26 +00:00
Kp 0253907a88 Factor out ogl_upixelc palette lookups 2016-05-28 17:31:26 +00:00
Kp ed330960f5 Fix -Wshadow warnings in _g3_draw_poly 2016-05-22 17:49:31 +00:00
Kp 692bede8c3 Fix -Wshadow warnings in gr_toggle_fullscreen 2016-05-22 17:49:31 +00:00
Kp 176d9c0837 Fix -Wshadow warnings in read_m3u 2016-05-21 17:24:51 +00:00
Kp f091ffad39 Factor out ogl_draw_vertex_reticle conditional calls 2016-04-05 01:10:18 +00:00
zico 081e5d5e3c Removed rounding offset of x starting coordinate in ogl_ulinec which should hopefully unwanted horizontal offsets in Status Bar energy and afterburner gauges (without causing more problems) if Multisampling is applied 2016-02-14 13:59:02 +01:00
Kp 08de1bbff0 Remove cv_color
It is only ever set to 0 or copied from other canvases.  Set it to zero
everywhere.
2016-02-12 04:02:28 +00:00
Kp d08bfc3170 Pass color to g3_draw_sphere 2016-02-12 04:02:28 +00:00
Kp 1b4b6673ee Pass color to g3_draw_poly 2016-02-12 04:02:28 +00:00
Kp 8c24eaa721 Pass color to g3_draw_line 2016-02-12 04:02:28 +00:00
Kp 3c73d44771 Pass color to gr_disk 2016-02-12 04:02:28 +00:00