Commit Graph

4434 Commits (b464ee82a5257092ff979daa03111c6b3b76ca4a)

Author SHA1 Message Date
Giel van Schijndel b464ee82a5 Don't generate SQL code (that's SQL statements for table definitions as well as SQLite loading code) for fields of type C-only-field
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5520 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 20:36:45 +00:00
Giel van Schijndel 9eb61150c0 Add a new datatype to the mini database schema meta language: `struct`
* Allows "linking" in the database to other struct instances
 * Will be represented as a pointer to the target struct in the C datastructures
 * Will be represented as an integer ID in tables


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5519 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 19:48:39 +00:00
Giel van Schijndel caa467d9ee * Improve error message generated on type mismatch by code generator c_sqliteload
* Fix a syntax error in code generator sql_tabledef and add and initialize the used variables to produce an error message


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5518 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 19:17:08 +00:00
Per Inge Mathisen 58792b6df1 Fix erronous error reporting
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5517 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 16:21:00 +00:00
Per Inge Mathisen e2064a4927 Add error check in NETsendGAMESTRUCT - dump warning to log if fails.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5516 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 11:50:18 +00:00
Per Inge Mathisen a2ca8dedaf Improve logging in NETbcast. Change parameter type of NETBroadcastPlayerInfo so
that it takes unsigned like all its users.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5515 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 11:20:47 +00:00
Per Inge Mathisen 117fa9e961 Cosmetic improvements to netplay debug log calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5514 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 11:02:55 +00:00
Giel van Schijndel 2e5fab25f8 Attach line numbers to the AST of field declarations, and use it when reporting field-related errors
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5513 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 22:14:09 +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 65dee90e74 Accept all of ([US]D?WORD|[US]BYTE) as "transition" types in the mini database schema meta language
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5511 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 21:53:10 +00:00
Giel van Schijndel e33f083aaf Give errors when encountering unmatched struct-level and enum-level directives
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5510 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 21:48:34 +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
Giel van Schijndel dd90404594 Don't include stats-db2.tpl.struct.h, which is used when generating stats-db2.h, in the Doxygen docs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5508 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 18:27:00 +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
Giel van Schijndel 7f75a8f3c7 Add a new %nomacro directive to prevent macro definition of a struct and its children if the parent of that struct has a %macro directive
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5505 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 16:41:59 +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 05bf9bdcd8 Declare UDWORDs as UDWORD in the C code (doh!) not as unsigned int...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5502 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 15:33:48 +00:00
Giel van Schijndel d8d2ad0dd6 Add a transition type "UDWORD" to the mini database schema meta language
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5501 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 15:30:32 +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 975ecbbb95 Add copies of strings declared with the "string" type in the struct definitions; thus have the structs take ownership of these strings (they're allocated with strdup)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5499 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 14:48:39 +00:00
Giel van Schijndel 8ce0412a28 * Add new %macro, %macroprefix and %macrosuffix directives to the mini database schema meta language
* Generate macro definitions similar to our current "inheritance-like" structure as created by macros when the above %macro directive is used


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5498 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 14:02:17 +00:00
Giel van Schijndel b16526e0a9 Move the code for generating the forward declaration of the SQLite loading function to a separate function of its own: printLoadFunc
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5497 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 13:30:25 +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 4452048964 Don't use a default value for %valprefix when either %valprefix or %valsuffix has been specified
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5495 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 13:06:02 +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 fbeca90347 Modify the 'forward declaration name' of COMPONENT_TYPE for EditWorld to still match that of Warzone itself, which got changed in r5485
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5492 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 11:48:18 +00:00
Giel van Schijndel 51370fcdbd Add a new enum-level directive: %valsuffix which (similar to %valprefix) adds a suffix to al enum's values
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5491 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 11:17:08 +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 dc0aa99fac Allow empty value prefixes as well (using the %valprefix directive)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5486 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:23:19 +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
Giel van Schijndel b1d12b5a1a * Add a new enum-level qualifier: %valprefix; this changes the default prefix (which is just the enum's name with '_' appended) prefixed to all enum values
* Add a new enum that uses this: COMPONENT_TYPE


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5484 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 21:24:39 +00:00
Giel van Schijndel 87ad15af6a * Add a new struct-level directive: %suffix
- This directive adds a suffix to the names of structs (in the generated C code) and the subclasses that inherit from that struct
 * Use %suffix instead of %prefix in test_code.tpl


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5483 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 21:11:24 +00:00
Giel van Schijndel 2a11247d7e Add a new enum-level directive: %max "param":
* This will add an enumerator to the end of the generated C enum code with "param" as its name (prefixed by the enum's name of course)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5482 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 21:02:58 +00:00
Giel van Schijndel eb7bd7be49 Update test_code.tpl as well to match r5480's change in syntax
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5481 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:52:57 +00:00
Giel van Schijndel 118a83f42a Slight change in syntax to not require (and disallow) a semi-colon after struct-level directives that open a new scope (terminated with "end\;"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5480 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:52:09 +00:00
Giel van Schijndel c7f60d7e7d #include "lib/sqlite3/sqlite3.h" in generated SQLite loading code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5479 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:44:14 +00:00
Giel van Schijndel 82a2aea03f c_structdef_cg.pm: Fix an error where we forgot to use the \{"name"\} member of the hash thus resulting in bad code being generated
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5478 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:43:26 +00:00
Dennis Schridde c2f5375cb2 Remove crossbuild hacks, which probably not worked like that on Windows anyway.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5477 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:17:13 +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 77bc79ab88 Remove the TARGET option (I shouldn't have added it back) and select the windows-specific link line for the win32 makefiles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5475 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 19:52:33 +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 6fcbc73c2c Merge the DATA build option (for the win32 makefile build system) into INSTALLER as the data packages are only required when building an installer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5473 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 17:51:31 +00:00
Giel van Schijndel a81de28500 Add the TARGET option to the win32 makefile system's config template
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5472 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 17:36:37 +00:00
Giel van Schijndel d914e3cccd Don't use the `mingw32-` prefix in the win32 makefiles, as MinGW's default distribution doesn't provide all executables with `mingw32-` prefix, but it does provide all of them without the prefix
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5471 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 17:26:11 +00:00