Commit graph

604 commits

Author SHA1 Message Date
Kp 8a30fc656b Factor out editor special segment drawing 2016-01-09 16:38:12 +00:00
Kp 96898bab0a Block direct changes to Highest_segment_index
Route updates through helper functions.
2016-01-09 16:38:12 +00:00
Kp 2ef83ad002 Remove redundant segptr computation 2016-01-03 20:21:35 +00:00
Kp 34df375032 Cache remove_trigger wall_num 2016-01-03 20:21:35 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +00:00
Kp d479819931 Use absolute_sibling to reduce global references for ptridx 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp a9b82e3f7f Make vlighting static 2015-12-04 03:36:31 +00:00
Kp ed55763603 Remove unused symbols 2015-12-04 03:36:31 +00:00
Kp 708dc0a7e1 Use vobjptr/vcobjptr for more Objects[] access 2015-12-03 03:26:49 +00:00
Kp db77622f0e Move array_size into valptridx_specialized_types 2015-11-26 02:56:55 +00:00
Kp 82d0c2ed96 Make some implicit uses of ptridx construction explicit 2015-11-19 03:23:34 +00:00
Kp 3ea0470aa7 Fix eobject to use an in-array object 2015-10-30 02:52:54 +00:00
Kp c1f8497b33 Simplify editor group print 2015-10-30 02:52:54 +00:00
Kp 8b61b9f0db Remove unused symbols 2015-10-24 03:13:11 +00:00
Kp 48af374924 Reduce direct use of Segments[] 2015-10-21 02:45:43 +00:00
Kp af2d8f7deb Factor out create_vert*_lists switch 2015-10-18 21:01:20 +00:00
Kp 1f63bfeee5 Reduce lifetime of returned get_seg_masks result 2015-10-18 21:01:19 +00:00
Kp faf698703e Make rotate_list result anonymous 2015-10-18 21:01:18 +00:00
Kp ffd6c113ae Move fwdwall.h -> fwd-wall.h for consistency 2015-10-09 02:46:10 +00:00
Kp 78de0ac119 Add fwd-event.h with forward declarations of event.h 2015-10-09 02:46:10 +00:00
Kp bca143d87d Only include ogl_init.h in OpenGL builds 2015-10-09 02:46:10 +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
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 1cdd4ac2ce Pass object & to [gs]et_*_id 2015-09-15 02:48:04 +00:00
Kp d3ca71c8d0 Inline get_num_reactor_models 2015-08-26 03:15:10 +00:00
Kp e5683593ef Expand ZERO_VECTOR inline 2015-08-13 03:15:53 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp bc7c469ab2 Use array<> for more globals 2015-08-12 03:11:46 +00:00
Kp c80d12319a Use unqualified begin/end
Most call sites use unqualified begin/end and rely on using declarations
to pick an appropriate implementation.  Fix the sites that explicitly
requested std::begin/std::end.
2015-08-03 03:11:25 +00:00
Kp 9a5654e002 Move similar/editor/autosave.cpp -> common/editor/autosave.cpp 2015-07-25 23:10:47 +00:00
Kp cf678a23ac Pass vcsegptridx/vcsegptr to find_point_seg 2015-07-18 21:01:55 +00:00
Kp a5476c5605 Use array<> for segsize_common propagated 2015-07-18 21:01:55 +00:00
Kp 8c2ba970d3 Use vsegptr for eobject.cpp 2015-07-18 21:01:55 +00:00
Kp 1db87a6e61 Return objnum_t from get_next_object 2015-07-14 02:42:11 +00:00
Kp fa8dcc9113 Explicitly delete basic_ptridx(pointer_type); require array
Require the array argument for basic_ptridx, which is supplied
automatically when the factory is used.
2015-07-13 01:09:37 +00:00
Kp fa805558f2 Use std::swap for ExchangeMarkandCurseg 2015-07-13 01:09:37 +00:00
Kp 1adb56f16b Make draw_mine_all static 2015-07-13 01:09:36 +00:00
Kp f4ab295af8 Pass vsegptridx from propagate_textures_common 2015-07-12 01:04:22 +00:00
Kp 827e7a4b99 Pass vsegptridx to ktmap pts_aux 2015-07-12 01:04:22 +00:00
Kp 2c326df217 Use valptr for kgame.cpp 2015-07-12 01:04:18 +00:00
Kp 04fc19c941 Use valptr for group.cpp 2015-07-12 01:04:18 +00:00
Kp 4f99478814 Use valptr for elight.cpp 2015-07-12 01:04:18 +00:00
Kp f7c89300e4 Use valptr for curves.cpp 2015-07-12 01:04:18 +00:00
Kp fdd2356eac Use segptridx for Cursegp, Markedsegp 2015-07-12 01:04:18 +00:00
Kp 1b6999ff4d Switch get_seg_masks from vcsegptridx_t to vcsegptr_t
The index component is not needed.
2015-07-12 01:04:17 +00:00
Kp 968cdbecf4 Add non-aborting UserError for user-caused fatal errors 2015-06-16 03:15:40 +00:00
Kp caf40e279e Enable tail-call from close_wall_window 2015-06-13 22:42:19 +00:00
Kp 7b7bfe14a5 Enable tail-call to redraw_current_object 2015-06-13 22:42:19 +00:00
Kp c1455cfea9 Use template for object page functions 2015-06-13 22:42:19 +00:00
Kp 420c2adee1 Simplify editor lighting 2015-06-13 22:42:19 +00:00
Kp fe3dae1508 Use valptr for texpage highest_valid 2015-06-13 22:42:19 +00:00
Kp b07704ef45 Use valptr for seguvs highest_valid 2015-06-13 22:42:19 +00:00
Kp 2154f8e442 Use valptr for segment highest_valid 2015-06-13 22:42:19 +00:00
Kp 438a1a4bee Use valptr for medwall highest_valid 2015-06-13 22:42:18 +00:00
Kp c3ba75cd22 Use valptr for meddraw highest_valid 2015-06-13 22:42:18 +00:00
Kp adcd8d7fa7 Use valptr for ksegsize highest_valid 2015-06-13 22:42:17 +00:00
Kp fc46612114 Use valptr for kbuild highest_valid 2015-06-13 22:42:17 +00:00
Kp 41b71fd214 Use valptr for group highest_valid 2015-06-13 22:42:17 +00:00
Kp 32f256311d Use valptr for eobject highest_valid 2015-06-13 22:42:16 +00:00
Kp 742971711f Use valptr for elight highest_valid 2015-06-13 22:42:16 +00:00
Kp 9125ae32cd Make objnum unsigned 2015-06-13 22:42:15 +00:00
Kp 53a7798d80 Simplify fix_sincos calls 2015-06-02 03:03:31 +00:00
Kp ea2c2df250 Update open-coded tests for segment_none 2015-05-28 03:08:39 +00:00
Kp 8e49c191ce Remove unused copy_side_except_vertex_ids 2015-05-17 20:37:59 +00:00
Kp f5b02ce6a0 Remove write-only ai_static D1 follow_path_start_seg 2015-05-09 17:39:01 +00:00
Kp 7dae02fbb4 Remove write-only ai_static D1 follow_path_end_seg 2015-05-09 17:39:00 +00:00
Kp 36ce989db6 Refactor get_next_segment 2015-05-09 17:38:58 +00:00
Kp f7eaf36ad3 Fix rotate_uv_point with -Wmissing-field-initializers
gcc-5 -Wmissing-field-initializers allows initialization by empty
braces, causing SConf not to pass -Wno-missing-field-initializers.
Change rotate_uv_point to return an explicitly 0 light to fix the
resulting warning.
2015-04-30 03:32:27 +00:00
Kp e883d7c872 Use enum class for AIB constants 2015-04-26 20:15:51 +00:00
Kp fd6ac87c25 Fix trigger_none checks 2015-04-26 20:15:50 +00:00
Kp 6e9638531a Mark get_previous_segment static 2015-04-22 02:44:31 +00:00
Kp 150e2d2686 Convert local arrays to array<> 2015-04-19 04:18:49 +00:00
Kp 7fd4ccb004 Simplify info_display_object_placement cache override 2015-04-19 04:18:49 +00:00
Kp 5ae5033fed Use enum for AIB constants 2015-04-02 02:36:57 +00:00
Kp 6b6eaef226 Include polyobj.h from robot.h
Swap the inclusion order since all robots are polyobjects, but not all
polyobjects are robots.
2015-04-02 02:36:57 +00:00
Kp b0ec49f8e5 Remove unused file+line from get_seg_masks 2015-04-02 02:36:56 +00:00
Kp 4e6d9b9901 Make xlate_previous const 2015-04-02 02:36:56 +00:00
Kp 1469e2e34c Simplify print_clock 2015-04-02 02:36:56 +00:00
Kp 36e1612ecb Make undo_status array<const char *> 2015-04-02 02:36:56 +00:00
Kp efcf7ce6cf Remove unnecessary strcpy in info.cpp 2015-04-02 02:36:55 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp 4871b17c8f Pass array<> to remap_side_uvs 2015-02-27 03:30:33 +00:00
Kp c3b09da175 Simplify assign_light_to_side 2015-02-27 03:30:33 +00:00
Kp 291fc95fb1 Refactor and optimize assign_uvs_to_side
Use ?: to pick Stretch_scale_* value.
Mark bogosity as unlikely.
Cache vector subtraction.
Defer constructing rotation matrix.
Move uvl assignment into reusable lambda.

This also fixes clang build.  btb reports that clang chokes on:
	extern T t;
	extern const T ct;
	[]() {
		if (a)
			return ct;
		return t;
	}
with
    error: return type 'vms_matrix' must match previous return type 'const vms_matrix' when lambda expression has unspecified explicit return type

Compiler failure report: d38dd0aeef (commitcomment-9909178)
2015-02-27 03:30:33 +00: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 8a64ea3b0e Use array<> for Vertex_active 2015-02-14 22:48:28 +00:00
Kp 315f1ce815 Use array<> for Side_to_verts 2015-02-14 22:48:27 +00:00
Kp 078d9513e0 Pass end-of-list for ignore_obj_list 2015-02-05 03:03:51 +00:00
Kp 673a711461 Remove vm_angles_2_matrix return value 2015-02-05 03:03:51 +00:00
Kp 7a4a6ed1d4 Return uvl from compute_uv_side_center 2015-02-05 03:03:50 +00:00
Kp 1dafd71427 Return uvl from rotate_uv_point
Returned l is now 0 instead of undefined.
2015-02-05 03:03:50 +00:00
Kp 799ebb61a0 Use range_for in texture.cpp 2015-02-05 03:03:50 +00:00
Kp c21536ebb3 Return array<> from create_2d_rotation_matrix 2015-02-05 03:03:50 +00:00
Kp 8f5e6df9a5 Use array<> for Side_to_verts 2015-02-05 03:03:50 +00: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 d38dd0aeef Simplify assign_uvs_to_side error paths 2015-02-03 00:37:07 +00:00
Kp cd1d3f52fb Remove string copying in info_display_segsize 2015-01-29 04:27:35 +00:00
Kp 71ec47b32e Refactor ui_pad_activate 2015-01-29 04:27:35 +00:00
Kp c8b5fe5552 Pass find_vector_intersection arg by & 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 fccb6814f8 Pass gr_create_sub_canvas arg by & 2015-01-17 18:31:40 +00:00
Kp c731558a94 Pass gr_init_sub_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 6ccf6ae96b Use range_for in segment.cpp 2015-01-12 00:26:02 +00:00
Kp ff493fcfce Inline vm_vec_make 2015-01-12 00:26:02 +00:00
Kp fbac119095 Propagate use of objptridx_t 2014-12-23 04:20:27 +00:00
Kp 702ea40ade Move segment declarations to fwdsegment.h 2014-12-22 04:35:49 +00:00
Kp 2d8f8b5d4a Reduce inclusion of wall.h 2014-12-22 04:35:49 +00:00
Kp 3864bff448 Write current_tmap_list carefully 2014-12-20 04:36:11 +00:00
Kp b68a403e41 Use partial_range to load textures 2014-12-20 04:36:11 +00:00
Kp 0bf2a6eb80 Return unique_ptr from ui_add_gadget_button 2014-12-20 04:36:10 +00:00
Kp 3b4fbd0bd5 Return unique_ptr from ui_add_gadget_radio 2014-12-20 04:36:10 +00:00
Kp b16e8ecbec Return unique_ptr from ui_add_gadget_checkbox 2014-12-20 04:36:09 +00:00
Kp 413a316154 Return unique_ptr from ui_add_gadget_inputbox 2014-12-20 04:36:09 +00:00
Kp 89b1ff8795 Return unique_ptr from ui_add_gadget_userbox 2014-12-20 04:36:09 +00:00
Kp 8d487b4883 Return unique_ptr from ui_add_gadget_icon 2014-12-20 04:36:09 +00:00
Kp bcfd6a77f0 Use unique_ptr for object_dialog 2014-12-20 04:36:09 +00:00
Kp cf5e5620aa Deduce input box text length 2014-12-20 04:36:09 +00:00
Kp 6735a94f3b Use unique_ptr for wall_dialog 2014-12-20 04:36:09 +00:00
Kp 63ee79d988 Use unique_ptr for robot_dialog 2014-12-20 04:36:08 +00:00
Kp 7e4e8f3501 Use unique_ptr for centers_dialog 2014-12-20 04:36:08 +00:00
Kp f0c8482b8b Use unique_ptr for trigger_dialog 2014-12-20 04:36:08 +00:00
Kp 9ffd958d3d Create window_rendered_data locally 2014-12-18 04:12:38 +00:00
Kp 601290e674 Return vertex_array_list_t from create_all_vertex_lists 2014-12-14 05:23:00 +00:00
Kp adbff232c5 Split seg/obj vars of find_seg_side_face 2014-12-13 17:47:01 +00:00
Kp 7c98dea8be Pass render_frame arg by & 2014-12-13 04:11:21 +00:00
Kp 78cdb70959 Use partial_range on Triggers 2014-12-08 04:19:26 +00:00
Kp 355df375a0 Pass gr_bitmap arg as & 2014-12-02 03:35:01 +00:00
Kp d79287e368 Use partial_range for delete_curve 2014-11-30 22:09:23 +00:00
Kp 9aa539c062 Return texmerge_get_cached_bitmap result by & 2014-11-30 22:09:19 +00:00
Kp b4acc5b858 Pass gr_ubitmap arg by & 2014-11-30 22:09:19 +00:00
Kp 968f7ddc97 Pass gr_gpixel arg by & 2014-11-30 22:09:18 +00:00
Kp 5aaf847c41 Fix various -Wnarrowing errors 2014-11-26 03:39:21 +00:00
Kp f206b3b127 Reduce inclusion of object.h 2014-11-23 04:36:58 +00:00
Kp 2c349136cc Avoid slicing into segnum_t local 2014-11-20 03:00:36 +00:00
Kp e56fe128e0 Remove DosShell 2014-11-19 04:19:43 +00:00
Kp c72ec87296 Redirect g3_end_frame->ogl_end_frame 2014-11-16 19:14:51 +00:00
Kp 855b249555 Make g3s_point const only in OGL 2014-11-16 19:14:51 +00:00
Kp c2d308807c Make various g3s_point * const 2014-11-15 03:10:06 +00:00
Kp baa39fe8f7 Add g3_rotate_point that returns result 2014-11-13 03:41:29 +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 1bb1c0ad33 Fix build break for objptr->objptridx conversions 2014-11-11 04:12:10 +00:00
Kp df6b4bd783 Add vm_vec_rotate that returns result 2014-11-04 01:31:22 +00:00
Kp 3a24b20e15 Add vm_vector_2_matrix that returns result 2014-11-04 01:27:55 +00:00
Kp 9026e225db Add vm_vec_ang_2_matrix that returns result 2014-11-04 01:27:46 +00:00
Kp 141a7602d0 Add vm_angles_2_matrix that returns result 2014-11-04 01:24:08 +00:00
Kp fd9a9a5166 Pass rotate_segment_new arg by & 2014-11-04 01:23:01 +00:00
Kp c97f1136fa Pass AttachSegmentNewAng arg by & 2014-11-04 01:20:07 +00:00
Kp 553ab8d56c Pass med_move_group arg by & 2014-11-04 01:14:36 +00:00
Kp f321621d77 Pass med_copy_group arg by & 2014-11-04 01:13:52 +00:00
Kp 5d1df2484e Add med_create_group_rotation_matrix that returns result 2014-11-04 01:13:08 +00:00
Kp fddb15310b Pass med_create_group_rotation_matrix arg by & 2014-11-04 01:10:52 +00:00
Kp fb4de8e2a8 Pass med_attach_segment_rotated vms_matrix by & 2014-11-02 03:45:01 +00:00
Kp f5717c7db7 Pass med_rotate_segment vms_matrix by & 2014-11-02 03:44:31 +00:00
Kp 40eb2e6b01 Add vm_vec_scale_add that returns result 2014-11-02 03:43:57 +00:00
Kp b32f5e5df3 Add vm_vec_copy_scale that returns result 2014-11-02 03:43:47 +00:00
Kp 697bdcf078 Add vm_vec_normal that returns result 2014-11-01 03:17:48 +00:00
Kp 0202a4b054 Pass scale_vert vector by & 2014-11-01 03:14:14 +00:00
Kp 7e3c7a413a Pass obj_create_copy vector by const & 2014-11-01 03:06:04 +00:00
Kp 6d61198130 Pass compute_segment_center vector by & 2014-10-30 03:32:51 +00:00
Kp 8a89eff0bb Pass compute_center_point_on_side vector by & 2014-10-30 03:32:27 +00:00
Kp 7b402cf613 Pass vnear vector by & 2014-10-30 03:19:11 +00:00
Kp a09fcd7753 Add vm_vec_add that returns result 2014-10-30 03:11:06 +00:00
Kp 5bb9c88979 Add vm_vec_sub that returns result 2014-10-29 03:24:31 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp af318b9eb2 Pass PHYSFSX_writeVector vector by const & 2014-10-26 22:08:58 +00:00
Kp f0d4c50fcc Pass create_curve arg by & 2014-10-26 22:08:58 +00:00
Kp ae6502f86b Pass set_matrix_based_on_side arg by & 2014-10-26 22:01:18 +00:00
Kp fc5b50c433 Pass med_create_new_segment arg by & 2014-10-26 22:01:13 +00:00
Kp 09835590f3 Pass g3_set_view_matrix arg by & 2014-10-26 22:01:00 +00:00
Kp 68309dfef0 Pass extract_*_vector_from_segment arg by & 2014-10-26 21:37:06 +00:00
Kp 258d6b4a04 Pass place_object vms_vector arg by & 2014-10-26 21:36:10 +00:00
Kp 2a5265493e Pass obj_create position vms_vector by & 2014-10-26 21:35:16 +00:00
Kp a79bb365f9 Pass get_seg_masks arg by & 2014-10-26 21:28:38 +00:00
Kp 359fcb3ce7 Remove unused set_chase_matrix 2014-10-25 16:40:00 +00:00
Kp a32547af16 Pass position-related vms_vector arg by & 2014-10-22 02:46:03 +00:00
Kp 019b572c0e Remove #define Segment2s Segments 2014-10-21 03:15:12 +00:00
Kp 4c4eff5a6d Fix Win32 build breaks caused by wrong sized std::size_t 2014-10-19 21:04:16 +00:00
Kp e7e23eb92e Make unused_window_userdata_t const 2014-10-16 02:30:29 +00:00
Kp 7f648c0f5f Wrap segment iteration idiom 2014-10-12 23:10:05 +00:00
Kp fb641b3250 Wrap object iteration idiom 2014-10-12 23:05:46 +00:00
Kp d72fcfeef1 Remove unnecessary UI_GADGET* casts 2014-10-04 22:36:13 +00:00
Kp a8f853aa7a Pass d_event arg by const& 2014-10-04 22:36:13 +00:00
Kp 93b2129a71 Combine EVENT_UI_DIALOG_DRAW blocks 2014-10-04 17:53:03 +00:00
Kp 2a63700d95 Use magic type for wall magic constants 2014-10-04 17:31:13 +00:00
Kp 6971dfbf4a Use symbolic *_none constants for -1 2014-10-04 17:31:13 +00:00
Kp 02fd23f6af Pass player_is_visible_from_object arg by const & 2014-10-02 03:02:37 +00:00
Kp 649704a37c Pass med_create_segment arg as & 2014-10-02 03:02:37 +00:00
Kp 51470e5b4a Pass sort_seg_list arg as & 2014-10-02 03:02:37 +00:00
Kp ca3a4524a2 Pass med_extract_*_vector_from_segment_side arg as & 2014-10-02 03:02:37 +00:00
Kp bee7a203d8 Pass med_rotate_group arg as const & 2014-10-02 03:02:37 +00:00
Kp c705265ccc Pass move_object_to_vector arg as const & 2014-10-02 03:02:37 +00:00
Kp ad562e14a4 Remove unused curve_dir 2014-10-02 03:02:36 +00:00
Kp 07be2e3951 Pass curve_dist p0 by & 2014-10-02 03:02:36 +00:00
Kp 8aa9f071e6 Pass med_point_2_vec v by & 2014-10-02 03:02:36 +00:00
Kp d0dd976fdb Pass g3_point_2_vec v by & 2014-10-02 03:02:36 +00:00