Commit graph

49 commits

Author SHA1 Message Date
Kp 71bde6f35f Use range_for for properties_read_cmp 2015-10-09 02:46:09 +00:00
Kp 3905f1a668 Enable -Wcast-qual 2015-06-13 22:42:21 +00:00
Kp cf87ebe54d Remove write-only grs_bitmap::bm_handle 2015-05-09 17:38:59 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp 8ad180c0a2 Use array<> for Reactors 2015-02-28 19:36:01 +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 68e2168377 Use array<> for bitmap_index arrays 2015-02-14 22:48:30 +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 46252fae4d Optimize compute_average_rgb
Reduce variable reloads.  Reduce memory footprint.  Add support for
memory poison detection.
2015-01-29 04:27:36 +00:00
Kp f31e9f76e0 Remove textures.h #include "piggy.h" 2015-01-29 04:27:35 +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 fa73ca8a17 Pass gr_remap_bitmap_good arg by & 2015-01-25 05:32:45 +00:00
Kp 31450e4843 Pass iff_read_bitmap arg by & 2015-01-25 05:32:44 +00:00
Kp a6884e77db Unpack robot_info 2015-01-23 03:55:04 +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 da6632a917 Use array<> for Robot_joints 2014-12-18 04:12:38 +00:00
Kp e54c2c79df Use array<> for Sounds 2014-12-14 05:22:59 +00:00
Kp 241b3140fd Use range_for in light rendering 2014-12-05 04:11:37 +00:00
Kp 5eddc2c197 Make bitmap bm_data const where easy 2014-12-02 03:24:38 +00:00
Kp 9baeb31162 Pass rle_end arg by & 2014-11-13 03:41:38 +00:00
Kp 44084ff261 Pass PHYSFSX_readVector vector by & 2014-10-26 22:08:58 +00:00
Kp 0d0297553e Simplify bm_free_extra_models 2014-09-28 21:55:59 +00:00
Kp 382afad2b8 Refactor weapon_info_read_n
Fix potential for initializing .children to wrong value with old data
files.  Currently, this cannot be hit because no caller uses the right
combination of arguments to cause it.

Rely on partial_range to report invalid custom files.
2014-09-27 21:21:58 +00:00
Kp afd995aa22 Centralize N_D2_* constants in bm.h 2014-09-27 15:42:45 +00:00
Kp 703f60ac3f Fix -Wtype-limits warnings 2014-09-21 21:41:55 +00:00
Kp 0ae2345cf4 Remove unnecessary throw
On error, partial_range will throw.
2014-08-09 21:22:25 +00:00
Kp 9e619f73d5 Inline polymodel_read_n 2014-07-26 04:18:06 +00:00
Kp ebb1b70350 Fix polymodel writing on x64
Packed writing a structure containing a pointer, but reading it as an
int, is wrong on x64.
2014-07-26 04:01:35 +00:00
Kp 6020c9c013 Use d_fname for DOS filenames 2014-07-25 02:54:31 +00:00
Kp 2ddc37d804 Write tmap_info carefully 2014-07-25 02:54:31 +00:00
Kp 3a35179e50 List initialize avg_color_rgb 2014-07-19 03:09:58 +00:00
Kp 50e4c92390 Remove write-only variable count in compute_average_rgb 2014-07-16 03:21:04 +00:00
Kp 3abc33d6cc Optimize gr_rle_decode 2014-06-30 23:56:51 +00:00
Kp 3c6f787e15 Use array<> for Polygon_models 2014-06-20 02:59:53 +00:00
Kp 7b33018cb5 Use array<> for Textures 2014-06-20 02:59:53 +00:00
Kp 3200823a8b Use array<> for TmapInfo 2014-06-20 02:59:53 +00:00
Kp d510438fd4 Use array<> for WallAnims 2014-06-15 03:35:21 +00:00
Kp 7c62bf98ef Use array<> for Powerup_info 2014-06-14 01:15: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 917ef39258 Use array<> for Vclip 2014-01-23 03:48:25 +00:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +00:00
Kp 5b5c8a3c6a Remove write-only variable TmapList 2013-12-22 01:16:16 +00:00
Kp b1c5307eb1 Use array for palette_array_t 2013-12-22 00:37:36 +00:00
Kp a3d66a3b37 Add typedef palette_array_t for palette data 2013-12-22 00:05:13 +00:00
Kp 3b9b5ebfb0 Use RAII to manage function-local heap objects 2013-12-08 19:04:52 +00:00
Kp 75c229c6bf Normalize con_printf newline usage 2013-12-07 21:13:37 +00:00
Kp 2d01f3a649 Optimize references to player ship 2013-12-01 22:53:25 +00:00
Kp 9db2badadb Move similar/main/bm.c -> similar/main/bm.cpp 2013-12-01 22:52:54 +00:00
Renamed from similar/main/bm.c (Browse further)