Commit graph

287 commits

Author SHA1 Message Date
Kp 44dea8cd49 Remove unused event initialised 2015-02-08 17:43:29 +00:00
Kp 699e5d341d Merge pull #34 into unification/master
Requested by btb: https://github.com/dxx-rebirth/dxx-rebirth/pull/34
2015-02-07 04:43:00 +00:00
Kp bc761ad6ef Use unique_ptr for m3u list storage 2015-02-07 04:37:37 +00:00
Bradley Bell 03d68f44c8 use size_t for indexing array
fixes ambiguous call to operator[]
2015-02-05 16:45:53 -08:00
Kp 99a4a0ed62 Capture range_for by-value temporaries as const
Modifying a by-value temporary does not affect the underlying container,
so modifying it is almost always a bug.  Require use of a by-reference
capture when modification is desired.

sed -i -e 's/range_for\s*(\s*\(const\s\+\)\?auto\s\+\([[:alpha:]_]\)/range_for (const auto \2/g'
2015-02-05 03:03:49 +00:00
Kp ae0a00a893 Return timer_query() from timer_update()
Most timer_update sites immediately query the timer, so return it to
save them the call.
2015-02-05 03:03:48 +00:00
Kp ffc59c8172 Move timer_update static variables to bss 2015-02-05 03:03:48 +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 4a2c9325bb Fix various uninitialized accesses 2015-01-28 03:42:52 +00:00
Kp 9794cfddc9 Move some local structs into anonymous namespaces 2015-01-24 19:16:34 +00:00
Kp 18a64e4281 Use RAII for PHYSFS_enumerateFiles result 2015-01-23 03:55:05 +00:00
Kp 977f1cfeb2 Use RAII for jukebox list 2015-01-23 03:55:05 +00:00
Kp 9c58fd23f4 Use RAIIdmem for jukebox_songs list_buf 2015-01-23 03:55:05 +00:00
Kp dd3d284e03 Make jukebox_songs::max_songs static const 2015-01-23 03:55:05 +00:00
Kp 06303f9406 Fix buffer overread parsing blank m3u file 2015-01-23 03:55:05 +00:00
Kp 966f51906c Use destructor for jukebox_songs 2015-01-23 03:55:05 +00:00
Kp 492d6fd996 Remove draw_tmap from OGL build
It is only used as a placeholder.  Replace it with a number.

Compile out various non-OGL functions when building for OGL.
2015-01-22 03:34:20 +00:00
Kp bf3bb0b144 Pass uint_fast32_t nverts for texture drawers 2015-01-20 02:46:42 +00:00
Kp 84e3a03451 Remove unused parameters 2015-01-18 01:58:33 +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 9a3796d9d1 Pass window_get_next arg by & 2015-01-17 18:31:41 +00:00
Kp e7c632b741 Pass window_is_modal arg by & 2015-01-17 18:31:40 +00:00
Kp ee50d45e72 Pass window_send_event arg by & 2015-01-17 18:31:40 +00:00
Kp f2797ddf1e Pass gr_init_canvas arg by & 2015-01-17 18:31:40 +00:00
Kp c2b7990550 Pass window_get_canvas arg by & 2015-01-17 18:31:40 +00:00
Kp c7ae54c62a Use ntstring for CMLevelMusicPath 2014-12-22 04:35:47 +00:00
Kp 80aa48efb4 Pass digi_*_start_sound soundobj as sound_object* 2014-12-14 05:22:59 +00:00
Kp 657e7da49e Rework digi dispatch
Build function tables at compile time.  If !SDLMIXER, compile out the
pointer indirections.  If SDLMIXER && PIE, keep function pointers in
read-only memory.
2014-12-13 17:47:16 +00:00
Kp 1a204f61d8 Use range_for for SoundSlots 2014-12-11 02:36:01 +00:00
Kp 7b234da185 Make digi_max_channels const 2014-12-11 02:35:55 +00:00
Kp 307ad30433 Remove unused digi_*_is_sound_playing 2014-12-11 02:34:54 +00:00
Kp 53366488ac Remove unused digi_set_volume 2014-12-11 02:34:38 +00:00
Kp 6d2b707c3e Move debug-only digi functions into !RELEASE 2014-12-11 02:34:32 +00:00
Bradley Bell 5d6e6dc2e4 check for GM_MULTI before trying to do network jobs 2014-12-06 22:14:22 -08:00
Bradley Bell 3daa0f63b1 Add search SDL_mixer framework paths for headers instead of using <Framework/Header.h> notation 2014-12-03 15:14:18 -08:00
Kp 15f9d5d3f5 Pass ogl_ubitblt arg by & 2014-12-02 03:35:01 +00:00
Kp e7aae37c8d Pass ogl_ubitblt_i arg by & 2014-12-02 03:35:01 +00:00
Kp 130d7a6e52 Pass ogl_loadtexture arg by & 2014-12-02 03:35:01 +00:00
Kp 5e03871f81 Pass tex_set_size arg by & 2014-12-02 03:35:01 +00:00
Kp 818b2c61ed Pass tex_set_size1 arg as & 2014-12-02 03:35:01 +00:00
Kp 5eddc2c197 Make bitmap bm_data const where easy 2014-12-02 03:24:38 +00:00
Kp 281aed868a Use range_for on ogl_texture_list 2014-11-30 22:09:20 +00:00
Kp 0236c237ed Pass ogl_freebmtexture arg by & 2014-11-30 22:09:20 +00:00
Kp 7775b5d7d4 Pass ogl_freetexture arg by & 2014-11-30 22:09:20 +00:00
Kp 486e753a84 Pass ogl_reset_texture arg by & 2014-11-30 22:09:19 +00:00
Kp a86313e746 Pass ogl_init_texture arg by & 2014-11-30 22:09:19 +00:00
Kp 93565a2d1e Pass ogl_init_texture_stats arg by & 2014-11-30 22:09:19 +00:00
Kp 0790eda153 Use new/delete for grs_screen 2014-11-30 22:09:19 +00:00
Kp 9aa539c062 Return texmerge_get_cached_bitmap result by & 2014-11-30 22:09:19 +00:00
Kp 166f15617d Pass ogl_ubitmapm_cs arg by & 2014-11-30 22:09:18 +00:00
Kp ad3a240958 Pass ogl_ugpixel arg by & 2014-11-30 22:09:18 +00:00
Kp 634f97e8d2 Pass tmap drawer grs_bitmap by & 2014-11-30 22:09:18 +00:00
Kp f89b57047a Pass g3_draw_bitmap grs_bitmap by & 2014-11-30 22:09:17 +00:00
Kp f206b3b127 Reduce inclusion of object.h 2014-11-23 04:36:58 +00:00
Kp 11769c5fc0 Pass draw_tmap* arg as const 2014-11-16 19:14:50 +00:00
Kp c2d308807c Make various g3s_point * const 2014-11-15 03:10:06 +00:00
Kp 3a73f2c9d0 Pass g3_draw_line as const 2014-11-15 03:10:04 +00:00
Kp 8e0d85b666 Pass g3_draw_tmap arg by & 2014-11-13 03:44:04 +00:00
Kp 0a97f175df Pass ogl_loadbmtexture arg by & 2014-11-13 03:43:12 +00:00
Kp 841e037e15 Pass ogl_loadbmtexture_f arg by & 2014-11-13 03:42:41 +00:00
Kp 9baeb31162 Pass rle_end arg by & 2014-11-13 03:41:38 +00:00
Kp 207dceba33 Pass g3_draw_sphere arg by & 2014-11-13 03:22:49 +00:00
Kp aba13a0bd0 Pass g3_draw_line arg by & 2014-11-13 03:19:52 +00:00
Kp 18e4ca1b2c Fix SDL build after for propagation 2014-11-11 04:21:57 +00:00
Kp df6b4bd783 Add vm_vec_rotate that returns result 2014-11-04 01:31:22 +00:00
Kp 5bb9c88979 Add vm_vec_sub that returns result 2014-10-29 03:24:31 +00:00
Kp fb641b3250 Wrap object iteration idiom 2014-10-12 23:05:46 +00:00
Kp a8f853aa7a Pass d_event arg by const& 2014-10-04 22:36:13 +00:00
Kp 8750b6a4ad Switch d_event subclasses to C++ inheritance 2014-10-04 18:05:26 +00:00
Kp 2434b20445 Pass g3_draw_bitmap pos by const & 2014-10-02 03:02:35 +00:00
Kp 5af79382a5 Pass vm_vec_rotate arg by & 2014-10-01 02:28:42 +00:00
Kp 321bbe37d8 Pass vm_vec_sub arguments by & 2014-09-28 21:11:45 +00:00
Kp cef8ab0cbd Propagate for variables in similar/arch/sdl/mouse.cpp 2014-09-26 02:42:13 +00:00
Kp f82835c7df Propagate for variables in similar/arch/sdl/key.cpp 2014-09-26 02:42:13 +00:00
Kp f6fc4d9797 Propagate for variables in similar/arch/sdl/gr.cpp 2014-09-26 02:42:13 +00:00
Kp 5ed9acb187 Propagate for variables in similar/arch/sdl/digi_mixer.cpp 2014-09-26 02:42:13 +00:00
Kp ba70c83575 Propagate for variables in similar/arch/sdl/digi_audio.cpp 2014-09-26 02:42:13 +00:00
Kp 47bc7d9937 Propagate for variables in similar/arch/sdl/digi.cpp 2014-09-26 02:42:13 +00:00
Kp 917ca43524 Propagate for variables in similar/arch/ogl/gr.cpp 2014-09-26 02:42:13 +00:00
Kp 703f60ac3f Fix -Wtype-limits warnings 2014-09-21 21:41:55 +00:00
Kp 5576a65dac Check length of g3 tmap inputs 2014-09-04 03:02:21 +00:00
Kp df3f2fe2fe Simplify ogl/sdl texture mapping 2014-09-02 22:13:15 +00:00
Kp 94550355a8 Use make_unique instead of bare new 2014-08-24 18:28:09 +00:00
Kp 8d835f8e34 Reduce inclusion of compiler-begin.h 2014-08-24 03:36:35 +00:00
Kp f0c927babd Fix !OGL build break from gr_fade_table array change 2014-08-20 02:15:23 +00:00
Kp cd9987968c Fix bogus memory leak warning in digi_mixer.cpp
u_mem runs too early.  Move the memory outside its view and rely on
Valgrind.
2014-08-20 01:28:12 +00:00
Kp 913a095be7 Remove unused return value of g3_draw_tmap 2014-08-16 17:35:44 +00:00
Kp 4acbb40ad7 Use enum for window event result 2014-08-07 02:47:48 +00:00
Kp 16d45909b4 Use unique_ptr for OGL texbuf 2014-08-05 02:33:10 +00:00
Kp 11c22409ad Use unique_ptr for circle_array_init_2 2014-08-05 02:32:55 +00:00
Kp be86e384b8 Use unique_ptr for circle_array_init 2014-08-05 02:32:35 +00:00
Kp 81cb86f2e3 Use unique_ptr for hmp_file 2014-08-05 02:29:43 +00:00
Kp 6abf37539e Remove unused OGL variable pixels 2014-07-30 03:13:34 +00:00
Kp bd1c6d8c5d Reduce header includes of physfsx.h 2014-07-22 23:48:23 +00:00
Kp b2f8088a75 Use find_if to traverse key_properties 2014-07-22 23:48:23 +00:00
Kp d3d457cf19 Pass array<> to gr_list_modes to preserve size information 2014-07-17 03:29:57 +00:00
Kp 9f685a0d0a List initialize unicode_frame_buffer 2014-07-16 03:14:04 +00:00
Kp 831ab8393d Use move to reduce copies in unibuffer_shift 2014-07-05 03:48:57 +00:00
Kp a48e3e421a List initialize Mouse 2014-07-04 03:56:40 +00:00
Kp f092095727 List initialize SDL_Event event 2014-07-04 03:56:40 +00:00
Kp 256e86b2b6 List initialize grd_curscreen 2014-07-04 03:56:40 +00:00
Matt Vandermeulen 28f307eb85 Fixes #5 - Byteswap header renamed to byteutil, plus sed magic
[Kp: switch to #pragma for byteutil.h]
2014-07-03 02:03:08 +00:00
Kp 6222b58bbc Move uvl_list into g3_draw_rod_tmap 2014-07-01 03:10:56 +00:00
Kp 3abc33d6cc Optimize gr_rle_decode 2014-06-30 23:56:51 +00:00
Kp f7ceca974b Add config.h inclusion for digi.cpp
Win32 builds fail without this.
2014-06-08 00:05:33 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp b9764fb45e Use array<> for Effects 2014-01-25 17:21:56 +00:00
Kp 8a4c553a8a Remove needless recomputation of Effects[] pointer 2014-01-25 17:21:56 +00:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +00: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 7fb4c6307f Add debug option -no-grab to prevent window grabbing 2013-12-22 20:56:55 +00:00
Kp e9693b5130 Clear SDL_Event before each poll 2013-12-22 20:02:42 +00:00
Kp b1c5307eb1 Use array for palette_array_t 2013-12-22 00:37:36 +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
Kp 1ec8057d74 Fix at-exit memory leak in digi_mixer 2013-12-20 04:41:46 +00:00
Kp e4b091dd38 Make ogl_pal a ubyte (*)[256*3] to improve checking 2013-12-20 03:19:40 +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 cb4fd7c1b4 Compact known file extension storage 2013-12-13 03:58:01 +00:00
zico a04aa340c5 Keep multi frame running during game idle events to decrease delay on packet forwarding 2013-12-09 16:28:34 +01:00
Kp 3b9b5ebfb0 Use RAII to manage function-local heap objects 2013-12-08 19:04:52 +00:00
Kp 60ecc60971 Move abspath onto read_m3u stack 2013-12-08 19:01:55 +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 34cd26a187 Remove hud_msg_buf 2013-12-05 00:11:52 +00:00
Kp d9c1f5425c Simplify jukebox filename setup 2013-12-05 00:10:59 +00:00
Kp e30f548d60 Invert sense of DbgAltTexMerge 2013-11-24 22:57:36 +00:00
Kp 8899120312 Remove SndDisableSdlMixer when mixer=0 2013-11-24 22:57:36 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 375fa1fa00 Rename digi_max_channels -> digi_mixer_max_channels
digi_audio.cpp has its own digi_max_channels
2013-10-26 03:50:28 +00:00
Kp b5414edcd0 Fix Win32 OpenGL build 2013-10-26 03:50:27 +00:00
Kp a6b1bd58a2 Use MALLOC consistently 2013-10-26 03:50:27 +00:00
Kp 5b0c4b10ac Use accessor for most get/set object->id accesses 2013-10-20 22:49:09 +00:00
Kp d21b7b7b6e Explicitly narrow GL floats for C++11 2013-10-09 01:54:12 +00:00
Kp c58c4e4d06 Move declarations to headers 2013-10-03 03:11:52 +00:00
Kp deb6fe9a91 Use MALLOC for mixdigi_convert_sound 2013-10-02 02:50:13 +00:00
Kp c000949e3a Move similar/arch/sdl/timer.c -> similar/arch/sdl/timer.cpp 2013-10-01 02:53:25 +00:00
Kp e6d6d92b1a Move similar/arch/sdl/mouse.c -> similar/arch/sdl/mouse.cpp 2013-10-01 02:53:25 +00:00
Kp 9c857c1fc8 Move similar/arch/sdl/key.c -> similar/arch/sdl/key.cpp 2013-10-01 02:53:25 +00:00
Kp 3ef32b16f5 Move similar/arch/sdl/init.c -> similar/arch/sdl/init.cpp 2013-10-01 02:53:25 +00:00
Kp bc7429c912 Move similar/arch/sdl/event.c -> similar/arch/sdl/event.cpp 2013-10-01 02:53:25 +00:00
Kp 37b37aa08b Move similar/arch/sdl/digi_audio.c -> similar/arch/sdl/digi_audio.cpp 2013-10-01 02:53:25 +00:00
Kp e2b7b802e3 Move similar/arch/sdl/digi.c -> similar/arch/sdl/digi.cpp 2013-10-01 02:53:23 +00:00
Kp fce2717e83 Move similar/arch/sdl/jukebox.c -> similar/arch/sdl/jukebox.cpp 2013-10-01 02:53:09 +00:00
Kp ace3238790 Move similar/arch/sdl/digi_mixer.c -> similar/arch/sdl/digi_mixer.cpp 2013-10-01 02:53:09 +00:00
Kp 64c7bc80f0 Move similar/arch/sdl/gr.c -> similar/arch/sdl/gr.cpp 2013-10-01 02:53:09 +00:00
Kp b7db46a43a Switch to std::min 2013-09-15 04:06:07 +00:00
Kp af52e78a50 Move similar/arch/ogl/ogl.c -> similar/arch/ogl/ogl.cpp 2013-08-24 17:10:35 +00:00
Kp d909692148 Allow compiler to unroll pow2ize 2013-08-24 16:44:23 +00:00