Commit graph

103 commits

Author SHA1 Message Date
Kp 3cca690728 Assign weakly-typed symbolic names to ogl_ubitmapm_cs special cases 2021-11-01 03:37:18 +00:00
Kp 961aae074a Remove unused ogl_ubitmapm_cs argument scale
Every caller passes `F1_0`.  Remove the argument, and propagate its
results through the function.
2021-11-01 03:37:18 +00:00
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp 775d039083 Expand gcc memcpy workaround to gcc-10
The upstream bug is still not fixed.
2021-01-17 22:23:23 +00:00
Kp fc63029833 Move more symbols into namespaces 2020-12-26 21:17:29 +00:00
Kp 6285878c4c Add color_palette_index type alias, to note palette-related uint8_t 2020-07-16 02:31:04 +00:00
Kp 8839f538e0 Refer to <array> directly, not through "compiler-array.h" 2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 9cee93abb1 Require support for C++14 std::exchange 2020-05-02 21:18:42 +00:00
Kp dd8cfa763f Expand gcc memcpy workaround
Add link to upstream bug report.
2019-07-22 00:51:01 +00:00
Kp a52d8106ce Use xrange for loops with simple identifier start and simple identifier end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*\([A-Za-z_0-9]\+\)\s*;\s*\2\s*!=\s*\([A-Za-z_0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\3, \4))/
2019-05-04 18:27:37 +00:00
Kp 3bd10610fc Use xrange for loops with zero start and simple identifier end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*0\+u\?\s*;\s*\2\s*!=\s*\([A-Za-z_0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\3))/
2019-05-04 18:27:37 +00:00
Kp 15ac8a5ac6 Add utility xrange for range-based loops with precomputed bounds
Utility xrange, inspired by the Python2 feature of the same name,
provides an object that returns successive values from [start, end).  It
is useful when the end index is known in advance, and is particularly
helpful when that index is expensive to recompute.
2019-05-04 18:27:36 +00:00
Kp b53be4943c Update memcpy blacklist 2018-08-20 00:34:16 +00:00
Kp 8684cf5571 Remove unused gr_bitblt_dest_step_shift
It is always 0, and has been since it was imported in D2X.
2017-11-01 02:01:20 +00:00
Kp 49cc3aa324 Work around i686-w64-mingw32-g++ compiler crash 2017-04-22 21:23:55 +00:00
Kp 9dbec8433d Pass grs_bitmap to gr_upixel 2017-03-11 19:56:23 +00:00
Kp d779a26307 Pass canvas to gr_bm_ubitblt0x_rle 2017-02-11 21:42:33 +00:00
Kp f8b057d43d Pass canvas to gr_bm_ubitbltm 2017-02-11 21:42:32 +00:00
Kp 9cc5d6f439 Pass canvas to gr_bm_ubitblt 2017-02-11 21:42:32 +00:00
Kp c242319829 Use RLE helper for bitblt RLE decoding 2017-02-11 21:42:30 +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 764d20d4e1 Make grs_bitmap::bm_flags private 2017-01-15 00:03:13 +00:00
Kp 96cc5a40b8 Remove dead preprocessor guards
Some bitblt code had guards of the form:

	#if A
	xxx
	#if !A
	yyy
	#endif
	zzz
	#endif

If A is true, !A is false, so the inner block can never be included.
Delete it.
2017-01-15 00:03:12 +00:00
Kp c914131009 Pass canvas to gr_rle_expand_scanline_generic 2017-01-01 00:45:45 +00:00
Kp 774dedd21d Pass canvas to gr_bm_pixel 2017-01-01 00:45:44 +00:00
Kp 1b57e9a5ff Pass canvas to show_fullscr 2017-01-01 00:45:43 +00:00
Kp 250bf58e51 Pass canvas to gr_bitmapm 2017-01-01 00:45:43 +00:00
Kp 08d0aa9b59 Pass canvas to gr_bitmap 2016-12-29 03:27:13 +00:00
Kp d7cd6d17c3 Pass canvas to gr_ubitmapm 2016-12-29 03:27:13 +00:00
Kp 6ab3b18657 Pass canvas to gr_ubitmap 2016-12-29 03:27:12 +00:00
Kp 99f5cfbb10 Pass canvas to ogl_ubitmapm_cs 2016-12-29 03:27:12 +00:00
Kp 1b617b9d5c Pass canvas to gr_ubitmapGENERICm 2016-12-29 03:27:12 +00:00
Kp ea0b0137f9 Pass canvas to gr_ubitmap012m 2016-12-29 03:27:12 +00:00
Kp aba8f163e6 Pass canvas to gr_ubitmap012 2016-12-29 03:27:12 +00:00
Kp ba70ec2142 Pass canvas to gr_for_each_bitmap_byte 2016-12-29 03:27:12 +00:00
Kp d1f1633f45 Pass canvas to gr_ubitmapGENERIC 2016-12-29 03:27:11 +00:00
Kp f4752eabb3 Pass canvas to gr_for_each_bitmap_byte callback 2016-12-29 03:27:11 +00:00
Kp ba78153f13 Pass canvas to gr_ubitmap00m 2016-12-29 03:27:11 +00:00
Kp eb5419b934 Unify gr_ubitmap00{,m} 2016-12-29 03:27:10 +00:00
Kp feb0baf040 Pass canvas to gr_ubitmap00 2016-12-29 03:27:10 +00:00
Kp 7e4d07490d Pass canvas to gr_upixel 2016-12-29 03:27:09 +00:00
Kp 62b58e9890 Move OGL to dxxsconf.h; rename to DXX_USE_OGL
Rename symbol OGL to DXX_USE_OGL 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 OGL -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGL/\1 DXX_USE_OGL/' -e 's/\(\s*#\s*if\)ndef OGL/\1 !DXX_USE_OGL/' -e 's/\(\s*#\s*if !\?\)defined(OGL)/\1DXX_USE_OGL/'
2016-09-24 18:06: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 398596c468 Use enum for bitmap mode 2016-05-28 17:31:26 +00:00
Kp 4a3abb3ca3 Cache src values in gr_ubitmap00 2016-05-28 17:31:26 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 2016-02-12 04:02:28 +00:00
Kp 659f0fb3ab Pass color to gr_upixel 2016-02-12 04:02:28 +00:00