Commit Graph

8577 Commits (7232b97fc855a786fa2871f23d24a6fe19ae120b)

Author SHA1 Message Date
Freddie Witherden 5362cf2217 Fix compilation under GCC 4.5.
Previously, _WZ_ASSERT_ARRAY_EXPR_FUNCTION would return NULL
((void *) 0) for a function with a declared return type of char.
2010-12-30 20:45:35 +00:00
Cyp ffe096fea4 Make zoom rate when scrolling framerate-independent. 2010-12-30 00:58:55 +01:00
Cyp 5c4b81fa63 Make C++ WZ_ASSERT_STATIC_STRING a compile-time check without using typeid, make C++ WZ_ASSERT_ARRAY_EXPR work. 2010-12-30 00:58:55 +01:00
Freddie Witherden fca489ce42 Iniparser rewrite as per ticket #2012.
This code completely replaces the old iniparser with a new,
cleaner API.  All existing uses of the old code have been ported.

The Xcode and MSVC projects will require updating.
2010-12-29 21:17:12 +00:00
Per Inge Mathisen 7d1e719e13 Remove hard-coded limit for number of polygons in models. This limit is now only relevant for delivery point, oil resource and wall models. 2010-12-29 12:46:10 +01:00
Per Inge Mathisen b72332ba42 Simplify shadow rendering for objects by removing unused/useless hacks for droid transport. 2010-12-29 12:44:18 +01:00
Per Inge Mathisen 086a0fd4bc Add new PIE flag 0x00001000 that specifies that the PIE model should not be stretched to fit to terrain. 2010-12-29 10:57:38 +01:00
Per Inge Mathisen 4eed3bef79 Remove the now obsolete distinction between configurable FPS rates for MP and campaign. Up the maximum FPS to 500 from 200.
To change the max fps rate now change only the "framerate" line. Patch reviewed by Cyp.
2010-12-29 00:24:45 +01:00
Per Inge Mathisen 06ab993d26 Remove some dead code 2010-12-29 00:07:53 +01:00
Per Inge Mathisen aafe14fbc2 Add separate shader for models rendered for buttons to remove lighting effects from those.
Add support for per-pixel lighting. Patch reviewed by SafetyOff.
2010-12-28 23:35:57 +01:00
Per Inge Mathisen af59954767 Do not spend value resources shading the backsides of polygons or setting irrelevant GL states. 2010-12-27 16:53:13 +01:00
Per Inge Mathisen f5ea79ed3c Enable OpenGL lighting controlled through the vertex shader. Added two new script functions setSunPosition an setSunIntensity.
Added a new PIE file directive MATERIALS that sets material properties for a mesh level. Original patch reviewed by SafetyOff.
2010-12-26 22:12:53 +01:00
Freddie Witherden 72e5404db4 Improve formatting of cmdSelectSubDroids. 2010-12-26 16:29:53 +00:00
Cyp e8b8abf4cb Fix typo in last commit.
Places structures more gently, structures should no longer form craters in the ground when being placed down.
2010-12-26 16:17:03 +01:00
Cyp 2ee63abdc6 Remove strange asymmetric check in structure height calculation, remove float and add syncDebug for defense height.
Also, fix minor inconsistencies in structure map coverage calculations, which probably didn't change anything, since structures should always be aligned, anyway.
2010-12-26 15:51:26 +01:00
buginator e2c7c49a21 Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Apply patch — kill some more warnings, and fix a few issues that Buginator found.
2010-12-24 20:02:10 -05:00
buginator e8d5913372 Apply patch — kill some more warnings, and fix a few issues that Buginator found. 2010-12-25 00:38:06 +01:00
buginator aee2b97fce Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Try to make production interface behave less confusing.
  Simplify production run code.
  Italian translation update by Alpha93.
  Turkish translation update by Ayhan Görgülü.
2010-12-24 01:00:58 -05:00
Cyp 9597a8f2f1 Try to make production interface behave less confusing.
Changelog: Production interface with looping production now shows how much will be built each loop iteration.
2010-12-24 01:17:38 +01:00
Cyp e6cd8d8d64 Simplify production run code.
And fix production runs not being cleared when a structure is removed.
2010-12-24 01:17:38 +01:00
cybersphinx 3e9c0ef263 Italian translation update by Alpha93.
Closes #2408.
2010-12-23 23:03:08 +01:00
cybersphinx 365dfe80d9 Turkish translation update by Ayhan Görgülü.
Closes #2418.
2010-12-23 23:02:17 +01:00
buginator c43e15a14b Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Kill idiotic "'BOOL' : forcing value to bool 'true' or 'false' (performance warning)." warning.
2010-12-23 15:53:36 -05:00
Cyp 6a6b23e13b Kill idiotic "'BOOL' : forcing value to bool 'true' or 'false' (performance warning)." warning.
The compiler probably wasted more cpu cycles printing the warning than the conversion ever would.

Refs ticket:2431.
2010-12-23 21:38:18 +01:00
buginator e1eb1a1889 Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Fixes ticket:2430 without breaking the cross compile.
2010-12-23 13:38:53 -05:00
Cyp 16a1582aa5 Fixes ticket:2430 without breaking the cross compile.
Error   27      error C2664: 'BOOL (HANDLE,DWORD,PVOID,DWORD,PDWORD)' :
cannot convert parameter 1 from 'DWORD' to 'HANDLE'

Since it cannot convert (HANDLE)hProcess to a HANDLE, the obvious solution is to add a cast: (HANDLE)(HANDLE)hProcess.

Error   26      error C2664: 'BOOL (HANDLE,DWORD,PVOID,DWORD,PDWORD)' :
cannot convert parameter 2 from 'void *' to 'DWORD'
../../../../lib/exceptionhandler/exchndl.cpp: In function ‘BOOL IntelStackWalk(DWORD, void*, void*, _tagSTACKFRAME*, CONTEXT*, BOOL (*)(void*, const void*, void*, DWORD, DWORD*), void* (*)(void*, DWORD), DWORD (*)(void*, DWORD), DWORD (*)(void*, void*,
_tagADDRESS*))’:
../../../../lib/exceptionhandler/exchndl.cpp:599: error: invalid conversion from ‘long unsigned int’ to ‘const void*’

Since it needs a void *, no, I mean a DWORD, no, I mean a void *, the obvious solution is to add a cast: ...id *)(DWORD)(void *)(DWORD)(void *)StackFrame->AddrFrame.Offset
2010-12-23 13:06:13 +01:00
buginator 012029622d Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Try to fix the cross compile.
  Fix releaseBranch script to handle netplay.cpp instead of netplay.c.
  Simplify targetting projectiles.
  Fix WZ_DECL_CONST -> WZ_DECL_PURE on src/vector.h.
  Clean up some weird invalid PROJECTILE * -> BASE_OBJECT * casts.
  Make structures rectangular instead of circular for the purposes of projectile collision detection.
  Remove SPACETIME C wrapper around Spacetime.
  Remove redundant memset()s in loadGame.
  Use default constructors instead of memset for W_INIT (widget init) derivatives.
  Fix game saving/loading.
  Reset constructor upgrade between games.
  Remove ORDER_LIST_MAX and the corresponding 10 order limit to droid order queues.
  Use --debug=memory to see sizeof(...) for the various object types.
2010-12-22 22:47:40 -05:00
Cyp 76690bbc4b Try to fix the cross compile. 2010-12-23 03:14:32 +01:00
Cyp 0f3974c3d3 Fix releaseBranch script to handle netplay.cpp instead of netplay.c. 2010-12-23 02:40:49 +01:00
Cyp 3d7939e525 Simplify targetting projectiles.
Also, made projectile misses be in random directions instead of picking one of 8 directions.
2010-12-23 01:42:18 +01:00
Cyp c7e9e05d30 Fix WZ_DECL_CONST -> WZ_DECL_PURE on src/vector.h.
Think not allowed to use WZ_DECL_CONST on functions that take references to parameters. The compiler should be able to optimise inline functions properly even without any WZ_DECL_BLAH, anyway.
2010-12-23 01:42:18 +01:00
Cyp c875c639b7 Clean up some weird invalid PROJECTILE * -> BASE_OBJECT * casts.
And make some functions take SIMPLE_OBJECT * instead of void *.
2010-12-23 01:42:18 +01:00
Cyp 85c08b05f9 Make structures rectangular instead of circular for the purposes of projectile collision detection.
Lasers hitting cyborg factories look less weird now.

Changelog: Structures are now rectangular for projectile collision detection, not round.
2010-12-23 01:40:30 +01:00
Cyp 93f4c3060b Remove SPACETIME C wrapper around Spacetime. 2010-12-22 21:56:52 +01:00
Cyp e1f3cdc7e7 Remove redundant memset()s in loadGame.
The same variables were memset()ted in loadStructureStats() and statsInitVars().
2010-12-22 21:08:16 +01:00
Cyp 76430c583f Use default constructors instead of memset for W_INIT (widget init) derivatives.
Accidentally fixed 5 memsets of W_FORMINIT, which were incorrectly using sizeof(W_BUTINIT). (The sizeof() was smaller than the object, so it didn't overflow, at least.)

And removed an ugly memset of a DROID.
2010-12-22 17:26:39 +01:00
Cyp a2665e12f7 Fix game saving/loading.
Broke in 49c0f1cd8b. D'oh, was reversing random uninitialised pointers instead of reversing linked lists.
2010-12-22 16:26:07 +01:00
Cyp 7cb68dcfe7 Reset constructor upgrade between games.
Fixes desynch due to building at different speeds. Fixes ticket:2362.

Changelog: Fix construction speed upgrades being preserved even between games.
2010-12-22 11:15:45 +01:00
Cyp 4dd5e0dd91 Remove ORDER_LIST_MAX and the corresponding 10 order limit to droid order queues.
sizeof(DROID) -= 296; (On 64-bit platforms.)

Fixes a probable issue when dead droids are removed from order lists.

Changelog: Allow queueing of arbitrarily many orders instead of just 10.
2010-12-22 02:58:38 +01:00
Cyp e7772e0b16 Use --debug=memory to see sizeof(...) for the various object types. 2010-12-22 02:50:21 +01:00
buginator 29e7585d9f Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Fix building with gcc 4.5.1.
  Add (unsigned) cast in mixed-enum switch, to prevent compiler errors.
2010-12-21 19:25:14 -05:00
Cyp 7c9b7acae1 Fix building with gcc 4.5.1.
Added unsigned casts to suppress compiler warnings due to enum abuse.
2010-12-22 00:58:59 +01:00
Cyp 9f160d95c0 Add (unsigned) cast in mixed-enum switch, to prevent compiler errors.
(Not sure which compiler version it was.)
2010-12-22 00:44:52 +01:00
buginator 7fbf88885e Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Simplify normalsOnTile in src/lighting.cpp.
  Make Vectors fun to use. Instead of Vector2f_Sub(Vector2f_Mul(myVector, myScalar), myOtherVector), write myVector*myScalar + MyOtherVector.
  Fix GLee.cpp → GLee.c in Linux and Windows build scripts.
  Normalise the warnings for the mac builds.
2010-12-21 18:43:21 -05:00
Cyp 3df719fc70 Simplify normalsOnTile in src/lighting.cpp.
Can probably be simplified further.

Original function was somewhat bloated.

Reviewed by coppercore.
2010-12-21 23:37:57 +01:00
Cyp 309398dd1d Make Vectors fun to use. Instead of Vector2f_Sub(Vector2f_Mul(myVector, myScalar), myOtherVector), write myVector*myScalar + MyOtherVector.
Reviewed by Safety0ff.
2010-12-21 22:35:37 +01:00
Cyp 0a064c2470 Fix GLee.cpp → GLee.c in Linux and Windows build scripts.
And LPTCSTR → LPCTSTR in some Windows file, apparently LPTCSTR wasn't similar enough for it to compile, closes ticket:2428.
2010-12-21 22:13:25 +01:00
dak180 0c898fb097 Normalise the warnings for the mac builds. 2010-12-21 15:03:06 -05:00
buginator 238cbaad90 Merge branch 'master' of github.com:Warzone2100/warzone2100
* 'master' of github.com:Warzone2100/warzone2100:
  Change Glee back to c; eliminates warnings in the mac build.
  Make OBJECT_POSITION inheritance explicit.
  Remove extern "C" {} from most places, due to longer being needed.
  Try to fix cross-compile errors.
  Fix strict-aliasing warnings reported by dak180.
  Don't fail to build when building from tarballs.
2010-12-21 12:58:40 -05:00
dak180 22285a7528 Change Glee back to c; eliminates warnings in the mac build. 2010-12-21 12:30:41 -05:00