Commit graph

81 commits

Author SHA1 Message Date
Kp 1a7659897a Pass canvas to draw_model_picture 2017-02-19 19:33:44 +00:00
Kp b02e2e9a3a Use range_for in draw_polygon_model 2017-02-19 19:33:44 +00:00
Kp 39071d124d Pass canvas to draw_polygon_model 2017-02-19 19:33:43 +00:00
Kp 85da2c0013 Pass canvas to g3_draw_polygon_model 2017-02-11 21:42:40 +00:00
Kp 590a025a89 Pass canvas to g3_start_frame 2017-02-11 21:42:34 +00:00
Kp 22e364e030 Pass canvas to gr_clear_canvas 2017-01-01 00:45:45 +00:00
Kp b02375bfbd Rename WORDS_NEED_ALIGNMENT to DXX_WORDS_NEED_ALIGNMENT
Rename symbol WORDS_NEED_ALIGNMENT to DXX_WORDS_NEED_ALIGNMENT to show that it is a DXX
symbol, not one inherited from a library.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl WORDS_NEED_ALIGNMENT -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(WORDS_NEED_ALIGNMENT\)\>/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(WORDS_NEED_ALIGNMENT\))/#\1if \2DXX_\3/' -e 's/^\s*#ifndef \(WORDS_NEED_ALIGNMENT\)\>/#if !DXX_\1/'
2016-10-09 17:35:03 +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 ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp b35a893d9a Rewrite simple pointer casts from C style to reinterpret_cast<>
s/(\s*\(\w\+\s*\*\+\)\s*)\s*(/reinterpret_cast<\1>(/g
2016-07-03 00:54:15 +00:00
Kp f5aed82d83 Rewrite simple pointer casts from C style to reinterpret_cast<>
This pass only targets int16_t and uint16_t.

s/(\s*\(u\?int16_t\s*\*\+\)\s*)\s*(/reinterpret_cast<\1>(/g
2016-07-03 00:54:14 +00:00
Kp 3469ff8c34 Change (short*) to (int16_t*)
Uses of `(short*)` usually want exactly a 16-bit signed integer.  Most
platforms provide that as `short`, but that is not guaranteed.

s/(short \(*\+\)\s*)/(int16_t \1)/g
2016-06-27 04:11:13 +00:00
Kp a4967ffceb Move various robot data into namespaces 2016-06-25 23:21:36 +00:00
Kp a3e65f64ea Use range_for for polyobj_find_min_max 2016-06-25 23:21:36 +00:00
Kp 89ddc1b911 Add parentheses around casts of simple array subscripts
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.

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*-\s*[^>]\)\)/\1(\5\6\7\8)\9/g
2016-06-25 23:21:36 +00:00
Kp 231223895d Rewrite simple pointer casts from C style to reinterpret_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\*\)\s*)\s*(/reinterpret_cast<\1>(/g
2016-06-05 01:04:26 +00:00
Kp aeebffccc0 Rewrite cast of (ushort*) to standard type uint16_t
s/(\s*ushort\s*\*\s*)/(uint16_t *)/g
2016-06-05 01:04:25 +00:00
Kp 9d0c6f59a5 Remove always-zero piggy_page_flushed
Descent for DOS supported paging content on demand.  Rebirth has no
support for paging content out, but retained piggy_page_flushed
to track whether anything had been paged out.  Commit 3c20c24 ("Disable
piggy_bitmap_page_out_all") removed the last site that could set
piggy_bitmap_page_out_all to a non-zero value.  All remaining code
either tests it for non-zero or sets it to zero.

Remove the statements that set it to zero.
Remove assertions that the value is zero.
Remove conditional blocks that execute only when it is non-zero.
2016-05-22 17:49:30 +00:00
Kp 18a917a1d0 Fix -Wshadow warnings in read_model_file 2016-05-21 17:24:50 +00:00
Kp 7f721f98e2 Fix -Wshadow warnings in read_model_guns 2016-05-21 17:24:50 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +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 ed55763603 Remove unused symbols 2015-12-04 03:36:31 +00:00
Kp 8dd1f7c2cf Move texture_list_index into local scope 2015-10-09 02:46:09 +00:00
Kp c4a8432081 Remove WORDS_NEED_ALIGNMENT memcpy src cast to const uint8_t*
The cast provokes a warning on systems that require alignment, so remove
it.  memcpy takes const void* input, so the cast is unnecessary.

Reported-by: MattWatt <https://github.com/dxx-rebirth/dxx-rebirth/issues/119>
2015-09-13 21:02:19 +00:00
Kp e5683593ef Expand ZERO_VECTOR inline 2015-08-13 03:15:53 +00:00
Kp bc7c469ab2 Use array<> for more globals 2015-08-12 03:11:46 +00:00
Kp a2816617fe Pass reactor& to read_model_guns 2015-07-25 23:10:48 +00:00
Kp ce72014e2e Always parse WORDS_BIGENDIAN and !WORDS_BIGENDIAN 2015-06-13 22:42:21 +00:00
Kp df9ce26dfb Fix WORDS_NEED_ALIGNMENT build
Integer promotion changed short+short into an int, but INTEL_SHORT only
takes short or unsigned short.  Add a cast to force the result back to
short.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/56>
2015-04-04 17:23:47 +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 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp 66a70fd373 Prepare for global arrays to be array<> 2015-04-02 02:36:52 +00:00
Kp 2397bc9a02 Cache &Polygon_models[N_polygon_models] 2015-02-28 22:34:07 +00:00
Kp 68be3baeca Track highest_texture_num locally 2015-02-28 22:34:06 +00:00
Kp 2fa2e17a82 Make chunk.old_base const 2015-02-22 01:29:43 +00:00
Kp f29f5cc9b3 Fix WORDS_NEED_ALIGNMENT breaks 2015-02-22 01:29:43 +00:00
Kp 68e2168377 Use array<> for bitmap_index arrays 2015-02-14 22:48:30 +00:00
Kp 29236f8668 Use array<> for multi_player_textures 2015-02-14 22:48:29 +00:00
Kp d1f45f85b2 Wrap submodel angles 2015-02-14 22:48:28 +00:00
Kp 673a711461 Remove vm_angles_2_matrix return value 2015-02-05 03:03:51 +00:00
Kp 2daaacaa26 Move robot_points onto stack 2015-02-05 03:03:50 +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 68d705a85a Use bool conversion to test PHYSFS_File pointer 2015-01-17 18:31:42 +00:00
Kp 8b2c0235c6 Fix polyobj for WORDS_NEED_ALIGNMENT 2014-12-22 04:35:49 +00:00
Kp 47ea6955ee Add workaround for <gcc-4.9.1 reference binding bug
This could be gcc bug #61500.
2014-11-04 03:21:23 +00:00
Kp 8c29419ac8 Refactor polyobj_find_min_max 2014-11-02 03:43:17 +00:00