Commit graph

142 commits

Author SHA1 Message Date
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
Kp c00f918a8e Propagate bm_mode::linear into bald_guy_load 2016-05-28 17:31:26 +00:00
Kp 3fb16c1d7a Propagate bm_mode::linear into pcx_read_bitmap 2016-05-28 17:31:26 +00:00
Kp 398596c468 Use enum for bitmap mode 2016-05-28 17:31:26 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp 6edab5ca0a Pass cv_font to get_centered_x 2016-02-12 04:02:28 +00:00
Kp a92ab4079f Cache font extent while drawing 2016-02-12 04:02:28 +00:00
Kp 85129248c9 Combine gr_internal_string0_template VideoOffset updates 2016-02-12 04:02:28 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 2016-02-12 04:02:28 +00:00
Kp 23047b1165 Pass color to gr_rect 2016-02-12 04:02:28 +00:00
Kp f235d6b12b Pass color to gr_pixel 2016-02-12 04:02:28 +00:00
Kp 1c04cb70d9 Change ogl_ubitmapm_cs constant -1 to const white 2016-02-12 04:02:28 +00:00
Kp e07c9a5f87 Combine ft_chars, ft_allocdata into one allocation 2016-02-12 04:02:28 +00:00
Kp 17c750a101 Cache font scale values at function scope 2016-02-10 03:58:05 +00:00
Kp 5c75d19dba Fold ogl_internal_string calls to ogl_ubitmapm_cs 2016-02-10 03:58:05 +00:00
Kp 71d4c3a0e1 Reuse gr_init_font for gr_remap_font 2016-02-06 22:12:55 +00:00
Kp 5d9c64e8fc Fuse gr_string test/add 2016-02-06 22:12:55 +00:00
Kp 499060ef4c Use open_font[] only for color fonts 2016-01-10 21:18:09 +00:00
Kp 677c70c64e Move font filename into grs_font 2016-01-10 21:18:09 +00:00
Kp 54d5ab84ca Refactor gr_string delegation 2016-01-10 21:18:09 +00:00
Kp 609f4e9261 Remove vsprintf in 2d/font.cpp 2016-01-10 21:18:08 +00:00
Kp 5d4fff1534 Combine gr_printf/gr_uprintf into template 2016-01-10 21:18:08 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp be04d3a4f9 Rewrite CLI
Remove artificial length limit on input.
Enable multi-line display of input.
2015-12-22 04:18:52 +00:00
Kp 8d7a78d448 Pass font to get_char_width 2015-12-22 04:18:50 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp e59fde57e7 Enable gr_remap_color_fonts in D1
This looks like a useful fix that was developed after Descent 1 was
released.  Backport it.  This reduces differences between the engines.
2015-12-18 04:08:24 +00:00
Kp e0a88f4b7b Move TexFilt to CCfg 2015-12-18 04:08:23 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp 85d7c495e8 Use inline namespace dsx for similar/2d 2015-12-13 18:00:48 +00:00
Kp aaaa7e6aa4 Make font datasize const after fixup 2015-12-04 03:36:32 +00:00
Kp 8a97c173a3 Remove useless gr_remap_mono_fonts
gr_remap_mono_fonts searches for fonts with !(font->ft_flags & FT_COLOR)
and calls gr_remap_font on any it finds.

gr_remap_font starts with:

	if (!(font->ft_flags & FT_COLOR))
		return;
2015-12-04 03:36:32 +00:00
Kp f509073b65 Move font allocdata pointer to grs_font 2015-11-14 18:17:21 +00:00
Kp 74290b5150 Add some error checking to font loader 2015-11-14 18:17:21 +00:00
Kp b36d95dccd Use generate_n to initialize font chars 2015-10-09 02:46:09 +00:00
Kp 50f672ba34 Reuse computed string length 2015-09-29 02:41:22 +00:00
Kp 0c0c93ca34 Refactor gr_string clipping checks 2015-09-29 02:41:22 +00:00
Kp d9cef82f81 Allow nullptr for gr_get_string_size 2015-09-29 02:41:22 +00:00
Kp 609e6ca584 Flip direction of bit scan
Fixes: b1c112d121 ("Fix -Og -Wuninitialized warning in gr_internal_string_clipped_template")
2015-09-24 03:05:16 +00:00
Kp 3c29742698 Flip direction of bit scan
Fixes: fc5611dc77 ("Fix -Og -Wuninitialized warning in gr_internal_string0_template")
2015-09-24 03:05:16 +00:00
Kp b1c112d121 Fix -Og -Wuninitialized warning in gr_internal_string_clipped_template 2015-09-13 21:02:19 +00:00
Kp fc5611dc77 Fix -Og -Wuninitialized warning in gr_internal_string0_template 2015-09-13 21:02:19 +00:00
Kp c4a8432081 Remove WORDS_NEED_ALIGNMENT memcpy src cast to const uint8_t*
The cast provokes a warning on systems that require alignment, so remove
it.  memcpy takes const void* input, so the cast is unnecessary.

Reported-by: MattWatt <https://github.com/dxx-rebirth/dxx-rebirth/issues/119>
2015-09-13 21:02:19 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp c942d28197 Use accessor for grs_bitmap::bm_type 2015-07-25 23:10:47 +00:00
Kp 78f6dc29a6 Cache font scale Y float 2015-06-13 22:42:20 +00:00
Kp 869d0ffdc5 Optimize gr_get_string_size
Cache cv_font.
Defer updating longest_width.
Compute line height once at the end.
2015-06-13 22:42:20 +00:00
Kp e57afde68b Hoist store in gr_internal_string0_template 2015-05-09 17:39:02 +00:00
Kp 8ac92b098f Cache variables in gr_internal_string0_template 2015-05-09 17:39:02 +00:00