Commit graph

244 commits

Author SHA1 Message Date
Kp e8d82d7d85 Pass valptridx factories to static functions 2017-07-26 03:15:59 +00:00
Kp 599ac9dee0 Always qualify valptridx type/factory
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const.  Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:

	im#PREFIX -> allow-invalid+mutable
	ic#PREFIX -> allow-invalid+const
	vm#PREFIX -> require-valid+mutable
	vc#PREFIX -> require-valid+const

Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual.  All other changes are generated by:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'

for the 'm' prefix and:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'

for the 'i' prefix.
2017-06-10 03:31:02 +00:00
Kp 4e1156a996 Use canvas in OGL g3_draw_sphere 2017-03-11 19:56:24 +00:00
Kp 72ce5d7e66 Pass canvas to draw_all_edges 2017-03-11 19:56:23 +00:00
Kp 014734834c Switch gr_printf calls to local canvas 2017-03-11 19:56:22 +00:00
Kp a19286437a Pass canvas to show_mousefs_indicator 2017-03-11 19:56:22 +00:00
Kp 74d4833591 Factor out automap common assignments 2017-03-10 01:22:34 +00:00
Kp d8dc2ed985 Cache intermediate results in automap_build_edge_list 2017-03-10 01:22:33 +00:00
Kp 858807e2a5 Use range_for in automap 2017-03-10 01:22:33 +00:00
Kp adefaf0fba Simplify automap_find_edge result 2017-03-10 01:22:33 +00:00
Kp 08e4a6e620 Use stdint constants for some INT*_MAX
clang becomes confused trying to determine which vm_distance_squared
constructor to use for a literal input of 0x7fffffffffffffff, even
though the size of the input requires it to be `long` and only one
constructor can take a `long`.  Switch from an explicit
0x7fffffffffffffff to the symbolic constant INT64_MAX, which has the
same value, but a platform-appropriate suffix to force the compiler to
pick the right type.

For general clarity, switch some other instances of integer maximum
literals to symbolic constants of the same value.

This commit has no effect on the generated code (except for changes to
line numbers).

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/pull/324>
Fixes: 17208cca79 ("Disallow int for vm_distance_squared")
2017-02-22 03:05:43 +00:00
Kp cdb193c053 Use unsigned for sides/verts in more places 2017-02-19 19:33:38 +00:00
Kp 0f00cf51b0 Make segment vertices unsigned 2017-02-19 19:33:37 +00:00
Kp aadf18e694 Cache canvas in draw_automap 2017-02-11 21:42:46 +00:00
Kp 5f855437ed Pass canvas to name_frame 2017-02-11 21:42:45 +00:00
Kp a23f33a34d Pass canvas to draw_player 2017-02-11 21:42:44 +00:00
Kp 9ad724f32f Pass canvas to DrawMarkers 2017-02-11 21:42:44 +00:00
Kp 24c4a030a1 Pass canvas to DrawMarkerNumber 2017-02-11 21:42:44 +00:00
Kp ed9fe62d85 Expand GHEIGHT
As a macro, it always refers to the global grd_curcanv.  This interferes
with converting canvas handling to be an argument.  Expand GHEIGHT so
that uses of grd_curcanv can be changed individually.
2017-02-11 21:42:42 +00:00
Kp 03c43b1d7f Expand GWIDTH
As a macro, it always refers to the global grd_curcanv.  This interferes
with converting canvas handling to be an argument.  Expand GWIDTH so
that uses of grd_curcanv can be changed individually.
2017-02-11 21:42:42 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +00:00
Kp 590a025a89 Pass canvas to g3_start_frame 2017-02-11 21:42:34 +00:00
Kp 80e7ade6a1 Pass canvas to g3_draw_sphere 2017-02-11 21:42:33 +00:00
Kp 513e7ceceb Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp 0dcae721d9 Make canvas an explicit argument to gr_printf
Previously, a macro implied *grd_curcanv as the canvas.  Pass the canvas
explicitly so that callers can choose the canvas to use.
2017-02-11 21:42:32 +00:00
Kp 8c706a88bd Initialize grs_main_bitmap at construction 2017-01-28 18:12:20 +00:00
Kp 5da784dbed Pass canvas to gr_{,u}string 2017-01-08 22:32:00 +00:00
Kp 1ef6b9d5bc Pass font to gr_get_string_size 2017-01-08 22:31:59 +00:00
Kp 0480ba8030 Pass canvas to gr_string(int,int,const char*,int,int) 2017-01-08 22:31:59 +00:00
Kp 22e364e030 Pass canvas to gr_clear_canvas 2017-01-01 00:45:45 +00:00
Kp 1b57e9a5ff Pass canvas to show_fullscr 2017-01-01 00:45:43 +00:00
Kp 87be333d29 Fold automap pause_game setup 2016-12-10 17:51:11 +00:00
Kp 4497812674 Use enum for object type 2016-11-20 23:12:00 +00:00
Kp 3081e69536 Pass grs_main_bitmap to gr_init_bitmap_alloc 2016-10-29 23:16:15 +00:00
Kp 98839d1af6 Pass player position to automap_apply_input 2016-10-28 03:39:41 +00:00
Kp 01f2932824 Pass grs_canvas &to window_create 2016-10-15 00:53:20 +00:00
Kp 94202ff782 Fold D1 draw_automap calls to gr_string 2016-10-15 00:53:15 +00:00
Chris Taylor 60ac1eaad3 Replace delete dcx::window kludge with a better solution
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
2016-10-04 14:05:44 +08:00
kreatordxx b87fcad332 Merge pull request #230 from dxx-rebirth/allow_window_subclasses_2
Allow window subclasses
2016-10-03 10:36:26 +08:00
Chris Taylor 87617e8ac9 Allow dcx::window struct to be subclassed - step 3
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
2016-10-02 17:49:19 +08:00
Kp 815a26f32d Expand and cache various uses of get_local_plrobj() 2016-10-02 00:34:48 +00:00
Kp 95988a343c Pass player object to recompute_automap_segment_visibility 2016-10-02 00:34:48 +00:00
Kp 0d5d191671 Pass player object to DropMarker 2016-10-02 00:34:48 +00:00
Kp ce65735c04 Expand get_local_player_flags
It was a convenient transition macro, but its presence was always
intended to be temporary.  Expand it to ease the conversion of usage
sites that already have access to local player data through a local
variable.
2016-10-02 00:34:40 +00:00
Kp 437d1717d8 Combine automap add_one_edge flags 2016-09-30 01:49:57 +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 7a13d3f228 Include dxxsconf.h explicitly and earlier 2016-09-24 18:06:10 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR 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 -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp 53deef077a Prefer make_unique over raw new 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 5963ff747b Use fallthrough for abandoning marker input 2016-07-15 03:43:04 +00:00
Kp 3fe581c84a Cache reference to local player object 2016-07-03 00:54:16 +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 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 7e3ea961c1 Pass object_base &to draw_player 2016-05-21 17:24:51 +00:00
Kp 6ce7cd4ec5 Fix -Wshadow warnings in draw_player 2016-05-21 17:24:51 +00:00
Kp ebc9d55b90 Fix -Wshadow warnings in draw_automap 2016-05-21 17:24:51 +00:00
Kp 97f38bf01d Fix -Wshadow warnings in draw_all_edges 2016-05-21 17:24:51 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 2016-02-12 04:02:28 +00:00
Kp 8066361076 Pass color to draw_player 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 8c24eaa721 Pass color to g3_draw_line 2016-02-12 04:02:28 +00:00
Kp 228bbe999a Unify draw_automap key color lookup 2016-02-12 04:02:28 +00:00
Kp 553b313099 Use vwallptr 2016-02-12 04:02:28 +00:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp 74dfa29d31 Convert most Trigger references to valptridx 2016-02-06 22:12:54 +00:00
Kp ba7e64bec5 Cache obj->size in draw_player 2016-01-17 05:19:10 +00:00
Kp a3ae630829 Remove default argument for basic_ptridx(index) 2016-01-09 16:38:14 +00:00
Kp e3e77f8724 Remove sprintf from automap.cpp 2016-01-03 20:21:36 +00:00
Kp 23bb4c5826 Move SysNoNiceFPS to CArg 2015-12-24 04:01:26 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +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 32051298ae Use inline namespace dcx/dsx for more symbols 2015-12-13 18:00:48 +00:00
Kp 01c0280e82 Optimize marker map drawing 2015-12-03 03:26:49 +00:00
Kp 708dc0a7e1 Use vobjptr/vcobjptr for more Objects[] access 2015-12-03 03:26:49 +00:00
Kp 64dee5d52a Move SysMaxFPS to CGameArg
Both games support SysMaxFPS.  Move it to the common structure.
2015-11-24 04:05:35 +00:00
Kp 17b8b64980 Use macro get_local_player_flags for player's flags 2015-10-30 02:52:56 +00:00
Kp faf698703e Make rotate_list result anonymous 2015-10-18 21:01:18 +00:00
Kp 271c465a7c Use <algorithm> for adjust_segment_limit 2015-10-03 17:17:49 +00:00
Kp d4df692d30 Use range_for in draw_all_edges 2015-10-03 17:17:49 +00:00
Kp a6d6eceea3 Reduce indirection in automap drawingListBright 2015-10-03 17:17:48 +00:00
Kp 50f672ba34 Reuse computed string length 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 71ffbdf719 Replace fill(0) with ={} 2015-09-29 02:41:22 +00:00
Kp 2f927c68f9 Improve support for using exact_type with valptridx 2015-09-15 02:48:04 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp bda7fef3a0 Use get_local_player to compute reference to local player 2015-07-25 23:10:46 +00:00
Kp f38e80c053 Use get_local_plrobj to compute reference to object of local player 2015-07-25 23:10:45 +00:00
Kp bbcdf9f7d2 Fix LTO -Wodr for GameCfg 2015-07-18 03:49:47 +00:00
Kp 4c5ce566ef Use valptr for automap highest_valid 2015-06-13 22:42:16 +00:00
Kp 6792c1bc4b Enable -Wunused-parameter 2015-04-26 20:15:56 +00:00
Kp fd6ac87c25 Fix trigger_none checks 2015-04-26 20:15:50 +00:00
Kp d4080c2505 Pass vcobjptr_t to draw_player 2015-04-22 02:44:30 +00:00
Kp 4d6d7fbbc7 Simplify automap door coloring 2015-04-22 02:44:30 +00:00
Kp c338862ad6 Reduce gauges.h includes 2015-04-19 04:18:51 +00:00
Kp 150e2d2686 Convert local arrays to array<> 2015-04-19 04:18:49 +00:00
Kp 72a01bf56c Add indirection for player color lookup 2015-03-09 03:33:07 +00:00