Commit Graph

4527 Commits (da3c28efa2f85181d4fa39fe595015d312972b42)

Author SHA1 Message Date
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 bb9e24cf3f Reduce "raw" Makefiles to "win32" Makefiles by removing logic from configure.mk
Command variables stay, but DIRSEP variable got removed

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5401 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:28:50 +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
Elio Gubser 3695f6258b minor change of the power bar gradient
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5394 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 09:14:36 +00:00
Elio Gubser 147d658ade completed intfac1.svg
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5393 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 08:57:49 +00:00
Elio Gubser 7372b84341 Working on intfac2.svg, colours aren't correct in this version
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5392 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 08:42:19 +00:00
Giel van Schijndel a4e8c96977 Move the code to spawn GDB, and arrange for a communication pipe, to a separate function: execGdb
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5391 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:33 +00:00
Giel van Schijndel 619e1e1943 * Deal with a failure of exeve() by writing a debug message indicating that it failed and terminating the child of our fork()
* Flush the write end of the pipe after writing all GDB commands into it
 * Process the return data (both return value and the contents of the output integer) from waitpid()

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5390 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:25 +00:00
Giel van Schijndel 2d6615a30a Refactor function gdbExtendedBacktrace:
* return as soon as an error condition is detected, thus preventing the need for deep nested if-branches.
 * Add some additional comments
 * Return true or false, false indicating an error, true indicating success

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5389 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:17 +00:00
Giel van Schijndel 6953f0fd6d Move the code that provides GDB backtraces in a function of its own to refactor it later (i.e. get rid of the deep if-branch nesting)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5388 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:07 +00:00
Giel van Schijndel aadfec4677 Document the gdb commands; what they do and why they're there
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5387 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:41:00 +00:00
Giel van Schijndel 38eea0b640 The syscall open() returns -1 on an error *not* 0, as 0 is a *valid* file descriptor:
* Thus check for a return value of -1, not 0

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5386 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:40:52 +00:00
Giel van Schijndel f8e5f8ddb8 * Don't duplicate code just because there's a single platform (Mac OSX) on which it isn't used
* Instead compile that code on all platforms except for the given one (Mac OSX)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5385 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:40:43 +00:00
Giel van Schijndel 43bdd9575d Factor out the code to retrieve absolute program paths and move it into a separate function of its own: fetchProgramPath
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5384 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 22:40:20 +00:00
Giel van Schijndel c07a24b90a Add some basic syntax/semantics checking to the parser of the database schema meta language.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5383 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 13:53:09 +00:00
Freddie Witherden 84be0c975d Use eventMisc for FOCUS and BLUR events.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5382 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 13:09:23 +00:00
Giel van Schijndel 191a130f86 Add a new field qualifier to the meta database schema language:
* "optional" which specfies that the given field is optional and can thus be NULL.
 * Only allow this keyword for the string and IMD_model types

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5381 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 12:51:09 +00:00
Giel van Schijndel af1b99b30d Line out the field names correctly with the rest of the struct definitions
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5380 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 12:51:06 +00:00
Giel van Schijndel abad9943c6 In the %field hash store the field-qualifiers as an array instead of storing only a single qualifier.
This will allow for adding multiple qualifiers to the same field later on.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5379 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 12:50:58 +00:00
Dennis Schridde 0994ae8bba Use correct switch to disable translations in raw Makefiles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5378 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 07:34:08 +00:00
Dennis Schridde 16aa7b516c Use platform commands to move, not posix ones...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5377 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 05:58:00 +00:00
Giel van Schijndel f31772dda3 Add IMD_model as a dedicated type to the mini-meta database schema language
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5376 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 23:21:45 +00:00
Giel van Schijndel 0c28d0493f Fix a syntax error introduced in r5374
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5375 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 22:14:41 +00:00
Giel van Schijndel 6e853b04d1 Don't print directly from the code generators, instead append to an output string for printing at a later time.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5374 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 21:51:23 +00:00
Giel van Schijndel bf5230b419 Don't fetch the primary key, as we probably don't need it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5373 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 20:07:58 +00:00
Giel van Schijndel 00ffe3f55d Generate multi-line SELECT statements instead of single-line ones
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5372 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 20:03:38 +00:00
Giel van Schijndel 0cf5917686 Don't create an unnecessary temporary
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5371 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 20:03:27 +00:00
Giel van Schijndel 8a0dcfa4ac Add Makefile to produce test-output from test-input for DB mini language code generators
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5370 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:23:38 +00:00
Giel van Schijndel 14d3ccca36 Remove commented out & useless code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5369 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:57 +00:00
Giel van Schijndel a1cb6521fc "die" on a parsing error, don't just print "Unmatched line"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5368 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:46 +00:00
Giel van Schijndel c6647ae996 Move duplicated looping out of the code generators
Move the duplicated effort of looping over all structs and enums out of the code generators and into the code that invokes the code generator. Thus instead of invoking the code generator once to generate code for all structs and enums, we now invoke it once for every struct and enum.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5367 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:36 +00:00
Giel van Schijndel 6d7cbe3576 Code generators don't need to know how many code to generate anymore
A slight modification to the code generators removes their need for needing to know how many elements (enums or structs) it needs to generate code.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5366 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:25 +00:00
Giel van Schijndel f5055899db Add a code generator for SQL SELECT statements
Add a new code generator for the database mini-meta-language. It creates SQL SELECT statements that use INNER JOINs to join all fields across the inheritance hierarchy in a single result row.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5365 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:05:43 +00:00
Giel van Schijndel fc1f447adf Only auto-increment the ID for the base class
Don't add an AUTOINCREMENT clause to the PRIMARY KEY, ID column if it we're not working on the abstract base class.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5364 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:04:10 +00:00
Giel van Schijndel 0814e56caa Add file headers and leaders to generated files
Give the code generators the opportunity to print something at the start and the end of the file. E.g. header guards for C files, and some notice about the file being automatically generated for all types.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5363 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:04:00 +00:00
Giel van Schijndel 309517fc95 Rename test_code to test_code.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5362 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:56:34 +00:00
Giel van Schijndel cc3f64a21a Rewrite SQL table generator for new parser architecture
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5361 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:55:26 +00:00
Giel van Schijndel 505446f69a Don't process the "set" field type as a field qualifier. Instead rename and modify preProcessQualifiers and postProcessQualifiers to preProcessField and postProcessField respectively. These functions now parse the field's types as well as the field's qualifiers.
In addition we now also parse the "unique" keyword in set and enum lines and thus process it there as well.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5360 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:55:17 +00:00
Giel van Schijndel 3df34aeaa7 Rewrite the code generator and parser for the database metalanguage to perform less (or no) parsing in the code generators.
Instead we now have a two phase process:
 * First parse and build an abstract syntax tree (AST)
 * Secondly loop over the generated AST to produce useable code for the target language.

NOTE: Currently only the C struct definition generator is rewritten to this new architecture.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5359 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:55:06 +00:00
Giel van Schijndel 9db4235480 Add a code generator for my database meta-language
This code generator is still in a prototyping phase. It'll probably get rewritten entirely.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5358 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:45:32 +00:00