Commit graph

374 commits

Author SHA1 Message Date
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
Kp ecb71ba22e Pass color to gr_ucircle 2016-02-12 04:02:28 +00:00
Kp 0dcfa6fba5 Pass color to ogl_urect 2016-02-12 04:02:28 +00:00
Kp 2a50243a07 Separate out ogl_ubitmapm_cs color setup 2016-02-12 04:02:28 +00:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp 4aea3b8fdc Shorten ogl_set_blending 2016-02-12 04:02:28 +00:00
Kp 230f2dbb19 Make cv_blend_func OGL-specific 2016-02-12 04:02:28 +00:00
Kp b57f08c798 Use partial_const_range 2016-02-12 04:02:28 +00:00
Kp 2acad85061 Remove unnecessary zero-fill in ogl_ubitmapm_cs 2016-02-11 03:25:52 +00:00
Kp 905d935a6b Remove write-only cv_drawmode 2016-01-29 04:05:47 +00:00
Kp b8026fa2d5 Factor out some texture precache calls 2016-01-17 05:19:10 +00:00
Kp dacf771d43 Remove sprintf from OGL gr.cpp 2016-01-09 16:38:16 +00:00
Kp 7c8b36ec1d Use automatic cleanup of GL client state 2016-01-09 16:38:10 +00:00
Kp 048615f95e Move DbgRenderStats to CArg 2015-12-24 04:01:28 +00:00
Kp ee98ef18f3 Move DbgSdlASyncBlit to CArg 2015-12-24 04:01:28 +00:00
Kp 94616f5e1c Move DbgSdlHWSurface to CArg 2015-12-24 04:01:27 +00:00
Kp 2c3f64478d Move OglSyncWait to CArg 2015-12-24 04:01:27 +00:00
Kp 9ec7e766cf Move OglSyncMethod to CArg 2015-12-24 04:01:27 +00:00