Commit Graph

2095 Commits (34e4246bd4936ffc04bd1975670093e1c9aefd37)

Author SHA1 Message Date
Giel van Schijndel e8e664f85a * Get rid of function strresGetIDString who's only purpose is to determine whether the given ID string has a string resource associated with it, and if so return a string that's equal (according to strcmp) to the passed in ID string
* Replace the only use of strresGetIDString with a call to function strresGetStringByID, which will also return NULL on failure to find the given ID string

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5663 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 21:12:43 +00:00
Giel van Schijndel a0e779ceb8 * Add a new function strresGetStringByID which combines the functionality of strresGetIDNum and strresGetString
* Get rid of function strresGetIDNum with its inconvenient API and use strresGetStringByID instead

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5661 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 20:10:16 +00:00
Giel van Schijndel 12e5120e69 Replace the linked list of arrays of string pointers (premature) optimisation with just a linked list of strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5660 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:57:09 +00:00
Giel van Schijndel 032b630b22 * Make the ppTextMsg string arrays of VIEWDATA and SEQ_DISPLAY hold there strings as const references
* Don't use strdup() to assign the strings to ppTextMsg's message array
 * Make seq_AddTextForVideo const correct

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5659 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:42:45 +00:00
Giel van Schijndel 47d02a31da * Change strresGetString to return its string as const (to prevent potential double-free problems)
* Instead use strdup() where a non-const reference to these strings is used
  * NOTE: This may introduce memory leaks, but I'd rather have memory leaks than double-frees, of which I'm frankly surprised that they don't occur ''much'' more often
 * Change FindDroidTemplate to take its parameter as const
 * Don't multi-purpose the parameters of FindDroidTemplate as local variables
 * Store string variables in getName as const
 * scrvGetString:
  * Directly return the string it retrieved and use NULL to indicate failure
  * Return the string as `const'

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5658 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:18:07 +00:00
Giel van Schijndel 8101f3bf5b * Change strresGetIDString to return its ID string const
* Change allocateName to do as the name suggests and actually ''allocate'' a string!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5656 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:08 +00:00
Giel van Schijndel e3a7f0cab8 Return the retrieved string from strresGetIDString and allocateName and use NULL to indicate failure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5655 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:03 +00:00
Freddie Witherden d9baa8d8b7 Break out of the droid sync loop early if there are no more droids to sync.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5653 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 14:11:14 +00:00
Giel van Schijndel 39d34b1880 Compiler warns about an uninitialized variable, `distanceExtensionFactor`, being used.
So initialize this variable with an "uninitialized marker" and assert that it doesn't occur in the places where this variable is used.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5651 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 13:59:07 +00:00
Freddie Witherden 6a94667dba Remove some dead #ifdef'ed code (#ifdef ARROWS).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5650 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 10:13:22 +00:00
Giel van Schijndel cf374ee5e1 * Move the definitions of the datatypes used by the string resource system from strres.h to strres.c
* Add a forward declaration for STR_RES to strres.h (so that we can still declare pointers to this type)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5645 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:36:23 +00:00
Giel van Schijndel d430c4b44d * Initialize global psStringRes to NULL
* Return the STR_RES* pointer from strresCreate and use NULL to indicate failure
 * Use size_t to store memory sizes in instead of UDWORD

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5644 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:33:10 +00:00
Giel van Schijndel 7125ab811c Access OpenGL headers on Mac OSX through OpenGL/<header> instead of opengl/<header> (lower case)
This fixes a compile error reported by <ruud> on IRC

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5641 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 20:23:24 +00:00
Giel van Schijndel 38f5b64c91 Add a new command line option: --flush-debug-stderr which causes the debug output to be flushed when used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5636 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:49:36 +00:00
Giel van Schijndel 7d42778f80 Don't #define DEBUG_GROUP0 in places where it cannot possibly be used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5629 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:52:33 +00:00
Giel van Schijndel d71055a5e0 * Replace uses of strcpy, strcat and sprintf with sstrcpy, sstrcat and ssprintf where possible
* Merge a translation string into it's printf formatting string (i.e. make the format string the translated string)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5621 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:55 +00:00
Giel van Schijndel a76577d94e Add some more informative debug messages to the ASSERTs of CHECK_OBJECT
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5582 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 01:23:16 +00:00
Per Inge Mathisen 3fb1c3e234 Add debug log calls to repair structure code to help debug
repair structure problems.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5569 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 15:47:33 +00:00
Per Inge Mathisen eb3ac2e356 Fix bug #11911: two patrol buttons. Patrol now has a new icon, drawn by
elio. Circle now has correct tooltip and uses old patrol icon. Some
spelling issues also fixed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5565 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 12:06:26 +00:00
Per Inge Mathisen d98f300696 Show all buildings in radar window. This makes the building under attack
colour change feature work correctly, too.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5563 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 11:13:36 +00:00
Giel van Schijndel cb1db1ff61 #include stats-db2.h in stats-db.h, as the former is intended to eventually replace the latter
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5537 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 21:30:15 +00:00
Giel van Schijndel ec4784973e Add the used command line to crash dump reports
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5536 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 21:26:09 +00:00
Giel van Schijndel 7749b59280 Don't remove stats-db2.h when using "make clean"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5534 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 19:36:58 +00:00
Giel van Schijndel 5526f2c61a * Move type OBJECT_POSITION (and macro POSITION_OBJ to declare it) from structuredef.h to the new file positiondef.h
* Update build systems: autotools, raw win32 makefiles, Code::Blocks project and MSVC project
 * Rename _droid and _base_object forward declaration types to DROID and BASE_OBJECT respectively
 * Add two forward declarations for BASE_OBJECT and DROID to scriptfuncs.h so that it can declare pointers to these types
 * src/messagedef.h depends on lib/ivis_common/ivisdef.h and src/positiondef.h so #include those
 * Don't #include stuff from src/ in lib/script/chat_processing.h
 * Remove all unnecessary #inlucdes from src/ from lib/script/chat_lexer.l

NOTE: Build systems not mentioned above might need updating.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5531 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 18:15:03 +00:00
Giel van Schijndel 77f6e2e90c Print the dpid on NET_LEAVE messages as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5529 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 17:36:29 +00:00
Per Inge Mathisen 96f1ad47af Make CHECK_DROID() call a new function checkDroid() to make it more obvious
which check fails. You can still see in which file and line it failed, as before.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5526 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 11:54:41 +00:00
Giel van Schijndel 13c4c559c5 * Move the definition of struct BRAIN_STATS from statsdef.h to stats-db2.tpl
* Make it possible to declare "references" to struct WEAPON by adding a %fetchRowById code block


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5525 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 21:45:42 +00:00
Giel van Schijndel 1a17b936c9 Move the definition of struct WEAPON_STATS from statsdef.h to stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5512 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 22:03:38 +00:00
Giel van Schijndel 859be18724 Move the definitions of structs SENSOR_STATS, ECM_STATS, REPAIR_STATS and CONSTRUCT_STATS from statsdef.h into a single definition in stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5509 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 19:40:49 +00:00
Per Inge Mathisen ef7a4044e9 Fix bug that made droids seemingly explode randomly during the game. The cause
was that they would pursue the enemy on another person's computer, but not on
yours. Now your droids only decide to pursue on your computer, and sends updates
to other people about such decisions over the network. WARNING: Increases network
usage by unknown amount. Network sync rates could be lowered.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5507 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 17:57:25 +00:00
Giel van Schijndel 52255c0ee0 Move the definition of struct PROPULSION_STATS from statsdef.h into a single definition in stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5506 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 17:53:41 +00:00
Per Inge Mathisen 6114b01fee Sanity check that structure production by droids have a target in unitUpdateBuild().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5504 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 16:30:06 +00:00
Giel van Schijndel 14a6655690 * Rename macro COMPONENT_STATS and struct COMP_BASE_STATS to STATS_COMPONENT and COMPONENT_STATS respectively
* Move the definition of macro STATS_COMPONENT and the struct COMPONENT_STATS (which was created using the contents of the macro) from statsdef.h into a single definition in stats-db2.tpl


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5503 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 15:37:46 +00:00
Giel van Schijndel 8ea7e2c54c Move the definition of macro STATS_BASE and the struct BASE_STATS (which was created using the contents of the macro) from statsdef.h into a single definition in stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5500 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 14:52:45 +00:00
Giel van Schijndel 44e01c2274 Move enums HIT_SIDE, PROP_SIDE and SENSOR_TYPE from statsdef.h to stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5496 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 13:07:37 +00:00
Giel van Schijndel 72d3aac053 * Get rid of enumerators INVALID_MOVEMENT and INVALID_WEAPON_EFFECT from enums MOVEMENT_MODEL and WEAPON_EFFECT respectively
* Modify getMovementModel's and getWeaponEffect's API so that we don't need to depend on enums MOVEMENT_MODEL and WEAPON_EFFECT containing an "invalid" enumerator
 * Move enums MOVEMENT_MODEL and WEAPON_EFFECT from statsdef.h to stats-db2.tpl


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5494 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 12:56:22 +00:00
Giel van Schijndel 2f7cb15a81 The *real* meaning of HCI
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5493 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 12:41:42 +00:00
Giel van Schijndel 3ca7c41f58 Don't add %valprefix to %max
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5490 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 11:13:01 +00:00
Per Inge Mathisen 9e57d0b4ce Cosmetic improvement
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5489 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 09:42:00 +00:00
Giel van Schijndel 2ae0d61f00 * Get rid of enumerator INVALID_SUBCLASS from WEAPON_SUBCLASS
* Modify getWeaponSubClass's API so that we don't need to depend on enum WEAPON_SUBCLASS containing an "invalid" enumerator
 * Move enums WEAPON_CLASS and WEAPON_SUBCLASS from statsdef.h to stats-db2.tpl
 * Rename NUM_WEAPON_CLASS and NUM_WEAPON_SUBCLASS to WC_NUM_WEAPON_CLASSES and WSC_NUM_WEAPON_SUBCLASSES respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5488 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:50:23 +00:00
Giel van Schijndel 136c2b245e Move enums FIREONMOVE and TRAVEL_MEDIUM from statsdef.h to stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5487 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:27:41 +00:00
Giel van Schijndel 4b850382ab Add a new template file to automatically generate enum definitions (currently in statsdef.h) from. This template will eventually be used by the SQLite code generator to generate S
QLite stats-loading code from.
 * Move 4 enums from statsdef.h to stats-db2.tpl: COMPONENT_TYPE, LOC, BODY_SIZE and PROPULSION_TYPE
 * #include stats-db2.h (generated from stats-db2.tpl) in statsdef.h

NOTE: The automatically generated file (stats-db2.h) is included in the repository so that no changes in the buildsystems are required. The autotools build system is updated to be able to update stats-db2.h if required.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5485 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:02:48 +00:00
Dennis Schridde 022315eef0 Hardcode top_srcdir to make building from non-topdir possible, dont depend on the touch command, fix LDFLAGS to not depend on the removed TARGET variable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5476 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:10:16 +00:00
Giel van Schijndel 66bfab9dcf Prefix all propulsion types (from enum PROPULSION_TYPE) with `PROPULSION_TYPE_` to qualify these names more fully
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5474 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 17:59:35 +00:00
Giel van Schijndel 26a9168ca9 Add a new configuration option "music_enabled" which can be used to disable the ingame music with
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5468 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 16:05:19 +00:00
Giel van Schijndel f6853ed368 * Get rid of enumerator INVALID_PROP_TYPE from PROPULSION_TYPE
* Modify getPropulsionType's API so that we don't need to depend on enum PROPULSION_TYPE containing an "invalid" enumerator

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5466 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 15:47:21 +00:00
Giel van Schijndel b3c43881a8 Don't #include "stats-db2.h" as it doesn't exist (is a testing file in my working copy)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5462 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 21:02:13 +00:00
Giel van Schijndel af9a1c2a18 Declare propulsionType as PROPULSION_TYPE (enum) instead of UBYTE in PROPULSION_STATS (struct)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5461 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 21:00:09 +00:00
Giel van Schijndel 2d6958306e Fix a compile error; forgot to declare variable "dummyVal" in r5454
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5459 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 20:43:24 +00:00
Per Inge Mathisen 1f831ebd3d Add beginnings of self-test to openal and general audio subsystems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5456 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:07:42 +00:00
Giel van Schijndel 47e7107aea Remove `systemPoints` from the code as it's never used.
It's loaded in from the stats files but unused throughout the rest of the code.

Read into a temporary dummy variable when loading stats.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5455 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:07:20 +00:00
Giel van Schijndel 0d997d617f Remove `hitPoints` from the code as it's never used.
It's loaded in from the stats files and copied all over a dozen places, but never actually __used__.

NOTE: This __shouldn't__ break savegames, I've checked it quite thoroughly, but game.c is evil & large enough that the chance exists I made a mistake in this department.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5454 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:02:19 +00:00
Giel van Schijndel c6c5c981e6 Remove all TECH_LEVEL related cruft from the code as it's read from the stats files but unused throughout the rest of the code.
Read into a temporary dummy variable when loading stats.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5453 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 18:28:37 +00:00
Per Inge Mathisen ba1df9e976 Fix bug #11979: Distorted terrain tiles after savegame r5399, caused by r5399.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5429 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 19:20:00 +00:00
Dennis Schridde f77542e2f8 Move config dir on Windows back to My Documents
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5427 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 17:46:45 +00:00
Per Inge Mathisen 9bc09663f0 Prettify debug output from rebuildSearchPath
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5421 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 13:01:09 +00:00
Freddie Witherden dd86c02f97 Make it possible to translate Video Options
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5412 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 15:36:55 +00:00
Giel van Schijndel c135ae175f * ASSERT that VTOL weapon droids have more than zero weapons
* Allow non-weapon VTOL droids to be passed into vtolHappy (e.g. sensor, construction, etc.): this should fix bug #11865

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5411 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 13:11:27 +00:00
Giel van Schijndel 01108419db Did I say vtolHappy was somewhat error prone?
* Fix a bug in r5409 where I accidentily reversed the weapon-reloaded logic
 * Merge two nested if-statements


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5410 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:58:18 +00:00
Giel van Schijndel 81c8aa657c Further cleanup/refactor vtolHappy:
* Trash the bool-array (previously bitmask) code
 * Simply return false as soon as we've determined a VTOL isn't "happy" (i.e. marked as fully armed and healed)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5409 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:51:57 +00:00
Giel van Schijndel 316eae3a37 Improve readability/maintainability of function vtolHappy by using an array of bools instead of abusing a bitmask
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5408 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:47:04 +00:00
Giel van Schijndel 336656a0a8 Fix a bug introduced in r5406:
* VTOLs didn't ever become "happy" again (i.e. where marked as fully armed and healed)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5407 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:44:00 +00:00
Giel van Schijndel 9c501e4641 vtolHappy: move the body-health check outside of the weapon check
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5406 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:31:06 +00:00
Giel van Schijndel 7db47c827e vtolHappy (what IDIOT wrote this btw??): only construct a bitmask once to increase readability/maintainability
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5405 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:21:26 +00:00
Giel van Schijndel e8c9f8a0ec Rename function vtolDroid to isVtolDroid:
* This name more clearly describes what it does: determine whether the given droid has VTOL propulsion

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5404 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 10:15:00 +00:00
Giel van Schijndel 1a5277de1d Proper constness: make vtolDroid and vtolHappy take their DROID* parameter as const
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5403 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 09:38:55 +00:00
Dennis Schridde 302a557478 Rename "raw" Makefiles to "win32" Makefiles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5402 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:29:04 +00:00
Dennis Schridde ec5aeaf3c7 Make "SCRIPT" release function just indirectly point to scriptFreeCode, so the function types are strictly compatible.
Clean scriptFreeCode's formating and remove unnecessary checks for ptr!=NULL before freeing.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5400 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:02:46 +00:00
Dennis Schridde 547ec7d49e TILE_NOTBLOCKING -> BITS_NOTBLOCKING, and store it in tileInfoBits instead of texture
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5399 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 13:57:03 +00:00
Giel van Schijndel 409bafbdf5 Turn the assert()s in the CHECK_STRUCTURE macro into ASSERTs so that we can see *which* assert failed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5395 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 11:28:01 +00:00
Giel van Schijndel 693c8292ff Provide a more useful error message than "Weirdy action on keymap processing".
Instead print the enum-number which we used to switch on.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5356 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 14:57:18 +00:00
Dennis Schridde 45b8413abf Improve readability of renderFeature by returning early, adding some comments, etc
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5350 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-30 17:07:41 +00:00
Dennis Schridde 45f23a4926 Merge commit 'HEAD@{3}'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5347 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 22:32:44 +00:00
Per Inge Mathisen aed2a94cd0 Move two vars into more local scope, and improve two asserts, then add a
fallback fix for non-debug builds. This to improve tracing of bug #11908:
crash - some assertion failed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5345 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 19:44:23 +00:00
Per Inge Mathisen 5ea6c60eee Do not initialize music sound system when --nosound option given.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5343 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 15:32:06 +00:00
Per Inge Mathisen a8dc963d37 Backport from path branch: Fix sMove->DestinationX|Y to use world coordinates, as they should be.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5342 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 15:25:58 +00:00
Dennis Schridde 050ec39c11 Use the (also new in this commit) relative variants of the directories almost everywhere.
Exception is when generating the .wz files, where we need the path to the build directory and building a reverse relative path to $(srcdir) will be messy.
Also silence submake.mk a great deal.
Bug #11883 should be fixed now for the most part.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5325 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 23:41:52 +00:00
Dennis Schridde fd2bfb0e0f Prepare for another fix for parts of bug #11883: Issues with the improved raw Makefiles
- Rename Makefile.raw to lowercase


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5321 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 22:48:45 +00:00
Dennis Schridde 73b35ab8d6 Rename top_srcdir/top_builddir to abs_top_srcdir/abs_top_builddir, to make this more obvious.
Their use is currently flawed, since it will not work in directories with spaces in them... (


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5319 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 20:19:54 +00:00
Giel van Schijndel 21a883121a * Add an ASSERT to trap a corner case which I don't think ever occurs.
The info from this ASSERT is needed for a proper (and fully educated) fix of bug #11865. Thus please attach a backtrace to bug #11865 when this ASSERT gets triggered, and if possible add which VTOL type you ordered to or from a rearming pad at the time.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5314 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 21:16:23 +00:00
Giel van Schijndel 276e201c01 * Get rid of "delayed return" in vtolHappy; just return false as soon as we've determined a VTOL isn't happy
* Use return (val == expected); instead of if (val == expected) return true; else return false;


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5313 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 21:15:58 +00:00
Per Inge Mathisen 826208f675 Backport nearest fix from pathfinding branch.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5310 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 18:00:37 +00:00
Dennis Schridde 9bd8b24921 Boost raw Makefiles
- Use PACKAGE, PACKAGE_VERSION, remove VERSION
- Allow out-of-source-dir builds (mkdir build && cd build && make -f ../Makefile.raw)
- Move config.mk from $(top_srcdir)/makerules/config.mk to $(top_builddir)/config.mk
   When keeping current behaviour (srcdir=builddir), this means: Move it from makerules into the main directory


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5308 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 13:54:47 +00:00
Dennis Schridde b16387ada8 Minor cleanup to minimise patch #686
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5298 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-22 17:39:11 +00:00
Dennis Schridde 9fffb2817a 0 -> '\0' to check the emptyness of a char[]
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5297 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-22 17:39:00 +00:00
Giel van Schijndel 76192b6534 * Make the level parser state enum a typedef (LEVELPARSER_STATE)
* When lev_error() gets called do __not__ ASSERT, use debug(LOG_ERROR, ... instead as the return value of false will be used as an indicator of failure anyway (no need to abort as it will cause the --selftest to always fail)
 * Accept empty input files for the .lev parser


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5285 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 17:32:03 +00:00
Per Inge Mathisen a1c47bccf8 patch #1075: Simplify playlist code. Thanks to Giel for patch review.
The playlist file is no a simple list of files to play during the game.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5281 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 15:40:56 +00:00
Dennis Schridde 4f77bdc8e6 Fix: warning: 'static' is not at beginning of declaration
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5280 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-20 14:04:10 +00:00
Dennis Schridde 7534eb48ac Add hack-note on usage of Vector3uw
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5278 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-20 08:51:50 +00:00
Dennis Schridde d3ad12ff6f Cleanup visibleObject & Co, and use new data ptr to transfer data to callback.
Still has a little global hole in it to transfer wall-locations out of the callback without cluttering the helper struct or the visibleObject() API.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5272 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-18 22:23:47 +00:00
Dennis Schridde bd65c4255f Fix bug #11828: Raycast visibility now too far
Was using squared distances and pseudo-3d vectors in some inappropriate places


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5271 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-18 22:23:06 +00:00
Dennis Schridde 496d6592b5 Style cleanups, fix typos, make follow-up bugfix patch smaller
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5270 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-18 22:22:26 +00:00
Dennis Schridde bdf986c0e5 Seperate and reorder functions for easier rebasing of Per's threaded pathfinding
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5268 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-18 20:44:48 +00:00
Per Inge Mathisen 0655255ceb patch #969: Rewritten minimap code. This changes the radar window, so that
you now always see the entire map on the radar. You can also change the size
of the radar window using the scroll wheel when cursor is over it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5266 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-18 18:35:25 +00:00
Per Inge Mathisen 6a595d9f85 Correct signedness of dot product in lighting calculation. Fixes lighting
bug on Intel Macs. Error introduced in commit r3592. Lesson: Don't use unsigned
if you do not absolutely need to.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5254 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-16 15:09:08 +00:00
Dennis Schridde 61f2e0ef21 Fix MSVC/noC99 compile errors and a potential segfault in visibleObject()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5253 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-14 11:22:37 +00:00
Giel van Schijndel 66b56d1c87 Use a pun on the whole Shakespear quote (original is: "By the pricking of my thumbs, something wicked this way comes."): "By the picking of these code-bombs, something wicked this way comes."
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5251 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-13 12:22:41 +00:00
Dennis Schridde d24d632e62 Simplify raycasting by making it vector based (3D vectors instead of 2D values to make it future proof to my next attack)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5250 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-12 20:11:50 +00:00
Dennis Schridde 3e8fa065b8 Minor cleanup and dont use globals for callbacks in raycast.c anymore
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5249 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-12 20:11:42 +00:00
Dennis Schridde 74d6424fdc Remove unnecessary inclusion of raycast.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5248 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-12 20:11:36 +00:00