Commit graph

133 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 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 692bede8c3 Fix -Wshadow warnings in gr_toggle_fullscreen 2016-05-22 17:49:31 +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 0dcfa6fba5 Pass color to ogl_urect 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 905d935a6b Remove write-only cv_drawmode 2016-01-29 04:05:47 +00:00
Kp dacf771d43 Remove sprintf from OGL gr.cpp 2016-01-09 16:38:16 +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
Kp 948fa32f9c Move SysNoBorders to CArg 2015-12-24 04:01:27 +00:00
Kp 4ac7055928 Move SysWindow to CArg 2015-12-24 04:01:27 +00:00
Kp 18cca1d33c Remove unnecessary gr_check_fullscreen ?: 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 132367ce27 Fix SDL-only build after namespace changes 2015-12-18 04:08:24 +00:00
Kp 900bebe799 Move DbgGlRGBA2Ok to CArg 2015-12-18 04:08:24 +00:00
Kp fa17246b7b Move DbgGlLuminance4Alpha4Ok to CArg 2015-12-18 04:08:24 +00:00
Kp 7022d20b1e Move DbgGlGetTexLevelParamOk to CArg 2015-12-18 04:08:24 +00:00
Kp 4a280e4556 Move DbgGlReadPixelsOk to CArg 2015-12-18 04:08:24 +00:00
Kp b3e6dd3eb5 Move DbgGlIntensity4Ok to CArg 2015-12-18 04:08:23 +00:00
Kp cdae6cad4d Move DbgBpp to CArg 2015-12-18 04:08:23 +00:00
Kp e0a88f4b7b Move TexFilt to CCfg 2015-12-18 04:08:23 +00:00
Kp 22901a6636 Move WindowMode 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 09eba7f48a Use inline namespace dsx for similar/arch/ogl/ 2015-12-13 18:00:48 +00:00
Kp 85d7c495e8 Use inline namespace dsx for similar/2d 2015-12-13 18:00:48 +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 e77a6ea923 Remove write-only variable r_upixelc 2015-12-04 03:36:32 +00:00
Kp ed55763603 Remove unused symbols 2015-12-04 03:36:31 +00:00
Kp 7034b68357 Manage world time automatically where possible
For all cases where world time nests, use automatic management.  Some
sites disable time in one function and enable it elsewhere.  These are
untouched.
2015-10-09 02:46:09 +00:00
zico 51049794ce Break screenshot numbering on 9999 instead of 99999 due to formatting of the string (it's still enough) 2015-09-01 19:06:14 +02:00
zico 818017398d Added a little failsafe to screenshot function to make sure the game will not cause an endless loop if savenum ever rolls over 2015-08-30 12:47:47 +02:00
Kp bbcdf9f7d2 Fix LTO -Wodr for GameCfg 2015-07-18 03:49:47 +00:00
Kp 0ece005dfa Use screen_mode for screen resolution 2015-05-14 02:23:13 +00:00
Kp e592f3a0bb Inline call to gr_set_mode(0) 2015-05-14 02:23:13 +00:00
Kp 2d9af1e348 Propagate gr_init argument 2015-05-14 02:23:13 +00:00
derhass 49e7cfe37e GLES: never declare the unused variable gl_draw_buffer
Move the declarition directly to the code part where it is used
(always in a #ifndef OGLES block).
2015-04-04 22:58:02 +02:00
derhass 639b569496 Merge branch 'unification/master' into unification/syncgl_v2
Conflicts:
	similar/arch/ogl/gr.cpp
	similar/misc/args.cpp
2015-03-23 20:18:17 +01:00
derhass 6d41224638 move GL synchronization code into its own class 2015-03-22 21:19:06 +01:00
derhass db267af6f2 add basic OpenGL extension handling
Currently only used for fence sync objects.
2015-03-22 20:32:14 +01:00
Kp 2b44a352ca Remove redundant sc_mode
sc_mode is a packed copy of sc_w/sc_h.  Switch to an accessor that uses
the copy.
2015-03-22 18:49:21 +00:00
Kp fca381727c Add wrappers for screen width/height 2015-03-22 18:49:21 +00:00
Kp 8daa014d53 Remove unused gr_check_mode 2015-03-22 18:49:21 +00:00
Kp 6c861b61cd Move RPI variables to usage site 2015-03-22 18:49:21 +00:00
Kp f098471e54 Make sdl_video_flags static 2015-03-22 18:49:21 +00:00
Kp 4afeba001a Move gl_* variables to local scope 2015-03-22 18:49:21 +00:00
Kp 08c0c3768c Remove unused gr_set_draw_buffer 2015-03-22 18:49:21 +00:00
derhass 2cd73b6dfe Import the syncgl patch based on 0.58.1 into unification code base
I also changed the command line arguments a bit, gl_syncmethod and
gl_sycnwait are used now. Furthermore, I added the ew mode AUTO. This is
a conservative mode and the default for now: if GL_ARB_sync is available,
use the FENCE_SLEEP mode, otherwise, disable it completely.

Conflicts:
	include/args.h
	misc/args.c
	similar/arch/ogl/gr.cpp
2015-03-22 18:17:11 +01:00
derhass a8283a9d45 Merge branch 'unification/master' into unification/rpi
Kp already incorporated some small changes I made in my rpi branch into
unification/master. However, besides making the rpi helper functions
static as I did, he also changed the prototype from (void) parameters
to C++ style (). I've incorporated his version here.

Conflicts:
	similar/arch/ogl/gr.cpp
2015-03-21 18:02:16 +01:00
derhass f46e4a2a7c RPi: use -isystem for the VideoCore library header path
Rebirth builds with -Werror=redundant-decls -Werror=undef, which are
triggered by the bcm_host.h. Making gcc treat those paths as
system headers avoids these issues. This was suggested by Kp.
2015-03-21 17:53:13 +01:00
Kp cf687a9a0a Make RPi OGL functions static 2015-03-20 03:30:20 +00:00
derhass c1a38e4433 RPi: Use explicit type casts for DISPMANX_TRANSFORM_T 2015-03-18 21:30:50 +01:00
derhass 7ce066cb8b GLES/RPi: Declare internal helper functions static 2015-03-18 21:07:57 +01:00
derhass c23c98562b GLES: Fix const correctness and for TestEGLError() 2015-03-18 21:05:34 +01:00
Kp f900d4a5ee Remove RAIIdmem::operator pointer
Mac OS X defines uint_fast32_t to unsigned int, causing ambiguous
overloads between RAIIdmem::operator[](std::size_t) and
RAIIdmem::operator[](int).  Adding a disambiguating overload for OS X
breaks Windows.  Remove operator pointer and operator[].  Rely on the
inherited operator[] for indexing.  Require users to call ->get() to
convert to a simple pointer.

First btb ambiguity reported: https://github.com/dxx-rebirth/dxx-rebirth/pull/34
Second btb ambiguity reported: https://github.com/dxx-rebirth/dxx-rebirth/pull/43
2015-02-17 03:52:59 +00:00
Kp ff4a0ccd70 Fix RAIIdmem array usage
Some RAIIdmem instances managed a T[], but were declared to manage a T.
2015-01-28 03:42:53 +00:00
Kp f7815810e8 Use RAIIPHYSFS_File to manage PHYSFS_File
Fixes a few leaks on error paths.
2015-01-17 18:31:42 +00:00
Kp f2797ddf1e Pass gr_init_canvas arg by & 2015-01-17 18:31:40 +00:00
Kp 5eddc2c197 Make bitmap bm_data const where easy 2014-12-02 03:24:38 +00:00
Kp 0790eda153 Use new/delete for grs_screen 2014-11-30 22:09:19 +00:00
Kp ad3a240958 Pass ogl_ugpixel arg by & 2014-11-30 22:09:18 +00:00
Kp 917ca43524 Propagate for variables in similar/arch/ogl/gr.cpp 2014-09-26 02:42:13 +00:00
Kp d3d457cf19 Pass array<> to gr_list_modes to preserve size information 2014-07-17 03:29:57 +00:00
Kp 256e86b2b6 List initialize grd_curscreen 2014-07-04 03:56:40 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00
Kp e9f9cb676f Centralize palette utilities 2013-12-22 00:05:13 +00:00
Kp a3d66a3b37 Add typedef palette_array_t for palette data 2013-12-22 00:05:13 +00:00
Kp 50b1717ae3 Use common helper to copy and bound palettes 2013-12-22 00:05:13 +00:00
zico c4f14f1044 Small change in ogl_ulinec to haround up right and bottom properly 2013-12-14 02:34:13 +01:00
Kp 3b9b5ebfb0 Use RAII to manage function-local heap objects 2013-12-08 19:04:52 +00:00
Kp 4d261232c6 Remove useless allocation when saving screenshot 2013-12-08 18:26:19 +00:00
Kp 75c229c6bf Normalize con_printf newline usage 2013-12-07 21:13:37 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp b5414edcd0 Fix Win32 OpenGL build 2013-10-26 03:50:27 +00:00
Kp d21b7b7b6e Explicitly narrow GL floats for C++11 2013-10-09 01:54:12 +00:00
Kp b7db46a43a Switch to std::min 2013-09-15 04:06:07 +00:00
Kp 20cf3f4cdb Mark various OGL functions static 2013-08-24 16:44:23 +00:00
Kp 4e6142d779 Move similar/arch/ogl/gr.c -> similar/arch/ogl/gr.cpp 2013-08-10 03:56:14 +00:00
Renamed from similar/arch/ogl/gr.c (Browse further)