Commit graph

460 commits

Author SHA1 Message Date
Kp c58d9c72a8 Propagate for variables in d2x-rebirth/main/escort.cpp 2014-09-26 02:42:16 +00:00
Kp 9eda412dff Use symbolic constant wall_none 2014-09-21 23:05:14 +00:00
Kp 703f60ac3f Fix -Wtype-limits warnings 2014-09-21 21:41:55 +00:00
Kp 039bf2f0b7 Fix crash on failure to create afterburner blob
Fix crash on failure to recreate thief.
2014-09-13 22:01:17 +00:00
Kp e8f4b20d1d Use special type for PHYSFSX_fgets 2014-09-07 20:07:20 +00:00
Kp a02f78a171 Move saving window pointer into helper 2014-09-07 19:04:07 +00:00
Kp fea751bc62 Use std::string for mission path 2014-08-24 17:45:30 +00:00
Kp b95759aecc Propagate use of objptridx 2014-08-23 23:53:56 +00:00
Kp 54da3b386b Copy bmread strings to local storage 2014-08-23 17:06:44 +00:00
Kp 66cb80c343 Propagate use of objptridx 2014-08-17 20:31:18 +00:00
Kp 414cf3b29b Remove useless buddy rediscovery loop
Assume Buddy_objnum will be set right.
2014-08-14 02:03:27 +00:00
Kp bf8d29b348 Remove useless buddy bot checks
These are only hit after the condition is assumed true.
2014-08-13 22:17:38 +00:00
Kp d6b81d2fe3 Deduce create_bfs_list max_segs 2014-08-13 03:19:13 +00:00
Kp 125d9257be Use special type names for segment/object numbers 2014-08-13 02:57:12 +00:00
Kp 4acbb40ad7 Use enum for window event result 2014-08-07 02:47:48 +00:00
Kp 0f7e561775 Add helper to iterate over objects in segment 2014-07-30 03:06:40 +00:00
Kp 13b233b7d7 Fix Windows build 2014-07-26 22:53:41 +00:00
Kp 51fdeea84b Use unique_ptr for model_data 2014-07-26 04:01:35 +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 bd1c6d8c5d Reduce header includes of physfsx.h 2014-07-22 23:48:23 +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 c4b31f875f Use array<> for MarkerMessage 2014-06-22 18:53:42 +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 bd35eb7469 Use array<> for wclip arrays 2014-06-14 23:13:38 +00:00
Kp 93ec327a10 Write powerup_type_info structures carefully 2014-06-14 23:13:37 +00:00
Kp 7c62bf98ef Use array<> for Powerup_info 2014-06-14 01:15:33 +00:00
Kp e326567cdf Skip useless sin computation 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 07f0555099 Switch missed sites to vclip_write/eclip_write 2014-02-05 02:37:39 +00:00
Kp 6ba95cb83b Use objptridx_t for detect_escort_goal_accomplished 2014-01-25 18:06:54 +00: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 917ef39258 Use array<> for Vclip 2014-01-23 03:48:25 +00:00
Kp a2427f58b5 Use special type to reduce pointer/index conversions 2014-01-12 19:32:12 +00:00
Kp 85b95efc70 Fix ugly hack of using -4 for fuelcen reached 2014-01-11 22:24:55 +00:00
Kp ae88d2ed8b Split out guidebot fuelcen search to separate function 2014-01-11 22:23:37 +00:00
Kp 21c9aa6c16 Remove unused ESCORT_GOAL_EXIT2 2014-01-11 22:20:48 +00:00
Kp 1ec7ea4e8f Remove goto logic in detect_escort_goal_accomplished 2014-01-11 22:19:19 +00:00
Kp 729f9c7d90 Check escort goal directly, rather than using goal_seg hack 2014-01-11 22:17:13 +00:00
Kp 9a5d0f6f09 Use symbolic values for segment/object first/none 2014-01-06 04:17:55 +00:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +00:00
Kp cf5343db18 Move ai_local into ai_static
Eliminates a global and some pointer math.
2013-12-29 03:59:21 +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 6e722eb789 Remove more unnecessary sprintf calls in do_escort_menu 2013-12-28 22:10:25 +00:00
Kp ba63c18d9b Remove unnecessary sprintf in do_escort_menu 2013-12-28 22:10:24 +00:00
Kp 38b2dbe639 Move object* -> objnum conversion into init_ai_object 2013-12-28 22:10:24 +00:00
Kp 44f1814b45 Store boss gate/teleport segments in countarray objects 2013-12-22 20:02:42 +00:00
Kp 0d7705cb05 Use visited_segment_bitarray_t for escort create_bfs_list 2013-12-22 05:29:49 +00:00
Kp 4fb6990b6c Make Stolen_items[] a C++ array 2013-12-22 01:53:26 +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 11f7bc51ee Use unsigned count of frames in a vclip 2013-12-22 00:05:13 +00:00
Kp 150281ac28 Use thief_message_str instead of thief_message where possible 2013-12-17 04:03:34 +00:00
Kp 21de8bc8f6 Use buddy_message_str instead of buddy_message where possible 2013-12-17 04:03:34 +00:00
Kp 92e8cb7a31 Add type checking to newmenu subfunction userdata 2013-12-15 21:54:38 +00:00
Kp cea46651fc Check type of window handler function 2013-12-15 18:51:26 +00:00
Kp 49f80d5886 Move movie control structure onto RunMovie stack 2013-12-08 19:01:53 +00:00
Kp 3e42f8c382 Move temporary bitmap descriptor onto bm_load_sub stack 2013-12-08 18:25:42 +00:00
Kp 75c229c6bf Normalize con_printf newline usage 2013-12-07 21:13:37 +00:00
Kp d3dadc66e8 Handle ESCORT_GOAL_UNSPECIFIED in say_escort_goal 2013-12-07 19:32:44 +00:00
Kp f1ddfd448a Simplify search for guide bot in escort menu 2013-12-07 19:32:29 +00:00
Kp bb2dafa7be Simplify search for guide bot in mine 2013-12-07 19:31:06 +00:00
Kp 72b6421877 Simplify Buddy_objnum calculation 2013-12-07 19:29:22 +00:00
Kp 8342558e1f Remove unused and broken escort energy center check
detect_escort_goal_accomplished is passed -4 for energy center and an
object index otherwise.  Using the index to search segments is wrong.
Using a side number to search other segments is also wrong.  Delete the
whole check, since it is broken and useless.
2013-12-07 19:25:23 +00:00
Kp a2cec5d71f Switch PHYSFSX_fgets to auto-sized variant where possible 2013-12-07 18:39:19 +00:00
Kp 9de54cfa74 Switch to C++ linkage
import fileinput
guard = 0
cxxguard = '#ifdef __cplusplus\n'
for line in fileinput.input(inplace=True):
	if line == cxxguard:
		guard = 1
		continue
	if guard:
		if line == 'extern "C" {\n':
			guard = 2
			continue
		if line == '}\n':
			guard = 0
			continue
		if guard == 2:
			assert(line == '#endif\n')
			guard = 0
			print cxxguard,
			continue
	print line,
2013-12-06 03:35:32 +00:00
Kp fcf216474b Move */main/collide.c -> similar/main/collide.c 2013-12-06 03:27:30 +00:00
Kp ef4db00e97 Restructure collide.c for merging 2013-12-02 00:22:11 +00:00
Kp 18aea17f9e Move */main/fireball.c -> similar/main/fireball.c 2013-12-02 00:21:31 +00:00
Kp 148dd00eeb Restructure fireball.c for merging 2013-12-02 00:12:36 +00:00
Kp 2ac98f7269 Move */main/gamemine.c -> similar/main/gamemine.c 2013-12-01 23:55:29 +00:00
Kp 38832fd1af Restructure gamemine.c for merge 2013-12-01 23:52:27 +00:00
Kp 1b59de804b Move d2x-rebirth/main/bmread.c -> d2x-rebirth/main/bmread.cpp 2013-12-01 23:24:33 +00:00
Kp c258115b30 Move */main/bm.c -> similar/main/bm.c 2013-12-01 22:51:44 +00:00
Kp 48effa8a6b Make Escort_goal_text [][] from *[] 2013-11-28 02:09:45 +00:00
Kp c0ffadae44 Make Thief_wait_times const 2013-11-28 00:27:43 +00:00
Kp e31f7141b2 Remove obsolete uvl processing
Descent refuses to load mines with version less than 16, so fixing up
uvl values in mines less than 15 is never used.
2013-11-24 23:50:44 +00:00
Kp cb7968159a Move editor texture data into load_mine_data 2013-11-24 23:50:43 +00:00
Kp 0b34e37a5e Restructure bmread.c for merging 2013-11-24 23:50:43 +00:00
Kp 4411532b6a Restructure bm.c for merging 2013-11-24 23:50:43 +00:00
Kp ca4f9e8b30 Fix array overstep in check_effect_blowup
If a robot fires a weapon, and then the robot dies, and then the robot
object is replaced with some object with a high id number, and then the
weapon hits, then check_effect_blowup used the id of the replaced object
as though it were a robot id.  This causes an overstep or understep of
Robot_info.  Tighten the check by requiring that the parent object have
the same signature at impact time as it did when the weapon was fired.
This can misclassify a weapon fired by a now-deceased guidebot as a
non-guidebot weapon, but there is not enough information saved to handle
this case, and guidebot deaths are rare.
2013-11-24 23:12:00 +00:00
Kp bbb9214e0e Invert sense of hires/lowres options 2013-11-24 22:57:36 +00:00
Kp aa05263b29 Move */main/gameseq.c -> similar/main/gameseq.c 2013-11-24 22:47:19 +00:00
Kp c90ade08fe Restructure gameseq.c for merging 2013-11-24 22:44:25 +00:00
Kp 47a4bb1ff1 Move */main/ai.c -> similar/main/ai.c 2013-11-23 22:47:45 +00:00
Kp 6be79cadce Unify ai_follow_path 2013-11-23 22:41:01 +00:00
Kp a56edce84a Cache result of indexing Robot_info 2013-11-23 18:53:13 +00:00
Kp 93b0f5396f Use helpers to test next_fire state 2013-11-18 04:51:33 +00:00
Kp 7a9db6716a Make ready_to_fire static 2013-11-18 04:51:33 +00:00
Kp f4cbfca8e2 Use helper to test for thief flag 2013-11-18 04:51:33 +00:00
Kp dc72fb5932 Use player_awareness_type_t for create_awareness_event 2013-11-18 04:51:33 +00:00
Kp c3d328ea5c Use helper to test for guidebot flag 2013-11-16 23:24:12 +00:00
Kp 1312369c94 Restructure ai.c for merging 2013-11-16 23:20:30 +00:00
Kp 5ff051cf4e Move */main/fuelcen.c -> similar/main/fuelcen.c 2013-11-10 22:56:12 +00:00
Kp 7c1945345c Restructure fuelcen.c for merging 2013-11-10 19:30:14 +00:00
Kp 4ef3937d35 Move */main/piggy.c -> similar/main/piggy.c 2013-11-10 19:08:12 +00:00
Kp e2a2cc579a Remove unused piggy_dump_all 2013-11-10 19:08:12 +00:00
Kp e04dc4e29e Move d2x-rebirth/main/escort.c -> d2x-rebirth/main/escort.cpp 2013-11-09 18:07:28 +00:00
Kp a7eadf58f4 Move d2x-rebirth/main/gamepal.c -> d2x-rebirth/main/gamepal.cpp 2013-11-09 18:07:28 +00:00
Kp 2be7f31d29 Move d2x-rebirth/main/segment.c -> d2x-rebirth/main/segment.cpp 2013-11-09 18:07:28 +00:00
Kp ea2022bb01 Move */main/endlevel.c -> similar/main/endlevel.c 2013-11-09 17:46:41 +00:00
Kp 1c754aa55e Restructure endlevel.c for merging 2013-11-09 17:45:21 +00:00
Kp 4469ff36c0 Manage movie subtitles automatically 2013-11-09 17:45:21 +00:00
Kp ea327d8394 Move d2x-rebirth/main/movie.c -> d2x-rebirth/main/movie.cpp 2013-11-09 17:45:21 +00:00
Kp cede90c2fb Restructure piggy.c for merging 2013-11-09 17:45:21 +00:00
Kp ed8484f096 Remove unnecessary packing on vms_vector 2013-11-08 03:14:43 +00:00
Kp 0a4c1ec7bf Quick out search for boss segments 2013-11-03 23:39:08 +00:00
Kp 2cd3760469 Simplify create_buddy_bot 2013-11-03 23:39:03 +00:00
Kp 5991940f8f Fix bug that object #1 can go faster than robot's top speed 2013-11-03 23:39:02 +00:00
Kp 18f6919b33 Mark movie data const 2013-11-02 04:28:10 +00:00
Kp 58958e091b Only give primaries that exist 2013-11-02 04:24:14 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 53f082f6f7 Send boss teleport index, not boss teleport segment 2013-11-01 23:18:05 +00:00
Kp 00ed0c17ff Mark reset_all_robot_centers as used for debuggers 2013-10-29 03:24:42 +00:00
Kp 68e936b809 Disable Parallax AI path debug printing 2013-10-29 03:24:41 +00:00
Kp a6b1bd58a2 Use MALLOC consistently 2013-10-26 03:50:27 +00:00
Kp 3693743d41 Move similar/main/mission.c -> similar/main/mission.cpp 2013-10-20 22:49:12 +00:00
Kp 5b0c4b10ac Use accessor for most get/set object->id accesses 2013-10-20 22:49:09 +00:00
Kp 22f24ef783 Simplify guidebot marker name printing 2013-10-08 02:02:26 +00:00
Kp 740a190835 Move */main/playsave.c -> similar/main/playsave.c 2013-10-06 17:56:37 +00:00
Kp 7dd7d6704b Make write_player_file void 2013-10-06 17:56:37 +00:00
Kp 761d0661ea Remove obsolete control_type_dos,control_type_win
This causes the field mapped to control_type_win to always set to 0 on
save.  However, the value was never used during execution.
2013-10-06 17:56:37 +00:00
Kp a2fc216cf6 Restructure playsave.c for merging 2013-10-06 17:56:37 +00:00
Kp f92e234054 Move */main/dumpmine.c -> similar/main/dumpmine.c 2013-10-06 16:58:49 +00:00
Kp fa1b1a1217 Restructure dumpmine.c for merging 2013-10-06 16:20:00 +00:00
Kp e73205faac Use enum for player awareness types 2013-10-05 21:35:58 +00:00
Kp 06c83c9393 Move similar/main/gamecntl.c -> similar/main/gamecntl.cpp 2013-10-05 21:35:58 +00:00
Kp b4107e6526 Remove duplicate declarations 2013-10-03 03:11:52 +00:00
Kp 13b2562ab3 Remove unnecessary bmread.h 2013-10-03 03:11:52 +00:00
Kp c58c4e4d06 Move declarations to headers 2013-10-03 03:11:52 +00:00
Kp f9899a9f20 Mark various functions static 2013-10-03 03:11:51 +00:00
Kp 1b4169b0d0 Move */main/powerup.c -> similar/main/powerup.c 2013-10-02 02:51:25 +00:00
Kp 3118fff45e Compute Boss_invulnerable_dot as needed 2013-09-28 23:51:51 +00:00
Kp 1ff627f85e Move multi_send_got_flag declaration to header 2013-09-21 23:34:05 +00:00
Kp cbe52ce1c7 Move d2x-rebirth/main/escort.h -> common/main/escort.h 2013-09-21 23:31:51 +00:00
Kp bca4a99f3e Move */main/laser.c -> similar/main/laser.c 2013-09-21 23:19:38 +00:00
Kp 9e3fb796e1 Use helper for comparing to proximity bomb index 2013-09-21 23:19:38 +00:00
Kp 7aef24071c Simplify weapon sufficiency logic 2013-09-21 23:19:38 +00:00
Kp 8df7e8c6b4 Restructure laser.c to simplify merge 2013-09-21 23:19:31 +00:00
Kp f4b21088a0 Track vulcan ammo explicitly 2013-09-20 23:12:54 +00:00
Kp 6e1d9f1f0c Add helper to test for weapons that use vulcan ammo 2013-09-20 23:12:51 +00:00
Kp d447d02a1d Move */main/newdemo.c -> similar/main/newdemo.c 2013-09-15 21:34:08 +00:00
Kp aa9127e3c1 Enable -Wwrite-strings 2013-09-15 21:34:03 +00:00
Kp eb9b126ab1 Reorder newdemo.c to simplify merging 2013-09-15 21:03:58 +00:00