Commit Graph

48 Commits (2063d578c3c1c3e28c50497fd3297dc9f1103215)

Author SHA1 Message Date
Giel van Schijndel bd9977cf3d * Move some variables into a more local scope
* Make use of the fact that FUNCTIONALITY is a union and work some casts away
 * Turn some bitshifting with TILE_SHIFT into map_coord and world_coord function calls
 * Merge some duplicated code in function resetFactoryNumFlag

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2045 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 22:47:13 +00:00
Giel van Schijndel 2c98295eab * Change usage of DROID->numKills to hold the percentage of dealt damage (to other units) instead
* This means that in order to get the actual amount of kills by this droid you need to divide this field by 100
 * All *Damage functions will now return a negative number if the amount of dealt damage was enough to destroy the target object (instead of TRUE)

Patch #745 (Adds Support For Partial Kills) by Freddie Witherden <evilguru>
Some minor changes by me (expansion of comments)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1937 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-23 12:48:03 +00:00
Giel van Schijndel 13f89d6f7b * Wrap a console print string in the _() gettext macro
* Remove a useless duplicated & commented out line


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1935 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-23 11:54:48 +00:00
Per Inge Mathisen 5aa373e5b2 Misc cleanup forward ported from reference counting work. Adds new checking
macro CHECK_STRUCTURE().


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1912 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-21 17:43:50 +00:00
Dennis Schridde 1f723e656c More cleanup...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1876 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 15:46:12 +00:00
Giel van Schijndel dea07b08a1 * split function dealWithLMB (which was around 350 lines) up into several smaller functions (still not pretty, but easier to read)
Behaviour should be unchanged


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1872 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-17 21:02:57 +00:00
Dennis Schridde e40c830278 Remove more unused code. This includes iV_GetMouseFrame, which returned an undefined value before. scriptextern.c might want to be adapted.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1865 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:56:36 +00:00
Giel van Schijndel 66746c4078 * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
* Fix a syntax error (missing brace)
 * Code cleanup: put curly braces on their own line
 * remove a copy&pasted switch statement, and merged it into the switch directly above (all case labels and break statements where _exactly_ the same, only the statements executed where different)
 * Use #if 0;#endif for commenting out code instead of /*;*/
 * move some vars in the most local scope where they're used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1860 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:59:04 +00:00
Per Inge Mathisen 5c23008ee0 Remove the unused 2D map editing code. We are never going there... Notice
that files are removed, so rerun your build systems!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1859 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:49:55 +00:00
Giel van Schijndel ed73e62898 Leave the memory management up to the memory management functions!
That is:
 * Don't use a custom memory heap implementation anymore
 * Remove all usages of HEAP code and replace it with malloc/free

NOTE: MacOSX projectfile probably requires an update

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1820 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 11:46:00 +00:00
Per Inge Mathisen 6eecf830ba Fix two issues with LasSat: You can no longer drag-build it (this would cause
an assert), and you can now build it and other multi-tile defense structures
over walls (plural) without asserting (or crashing) the game. I am sure there
are other issues left. Man, was that feature rushed! ;-)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1779 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 18:03:26 +00:00
Dennis Schridde eca9d2bab6 Simplify code, mX -> mouseXPos (like in input.c)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1771 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 02:06:46 +00:00
Giel van Schijndel 2d85204f13 Cleanup:
* remove commented out functions (which where only used by commented out code if they where used at all, removed that code as well)
 * movement stuff:
  - moveShuffleInit (// Initialize a droid for a shuffle move)
  - moveCalcVector (// Calculate the normalised vector between a droid and a point)
 * waypoint stuff:
  - orderAddWayPoint (// Append a new waypoint to a droid's list)
  - orderSelectedWaypoint (// Add a new waypoint to selected droid set)
  - SendSingleDroidWaypoint (// Occasionally need to send non selected waypoints ??)
  - recvDroidWayPoint (// recv)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1738 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 09:50:45 +00:00
Dennis Schridde 03e7785ada Remove unused function.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1618 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 16:10:20 +00:00
Dennis Schridde f347fa4fa8 Config option: debugmode (aka --cheat)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1602 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-09 05:31:51 +00:00
Dennis Schridde 1587bc93c1 - Formating and removal of unused lines
- Removed a 20ms delay from the mainloop
- Added ASSERT_STATIC macro to check assumptions on compiletime


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1582 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-02 15:50:30 +00:00
Stefan Huehner 9eda7db8a1 Code-Cleanup: remove a lot of type,function,variable
declarations/definitions which are not used anywhere.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1421 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 17:01:53 +00:00
Per Inge Mathisen c232641119 Copy strings back into the C code, and make them translatable by gettext.
Thanks to Huehner for writing the script that transformed calls to strres
back into C strings.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1325 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-01 20:15:46 +00:00
Giel van Schijndel d659136496 * move audio_id.[ch] to lib/sound (because the soundlib depends on it, and libraries shouldn't depend on the main source, i.e. src/)
* further remove audio_GetIDFromStr from src/aud.c and rename audioID_GetIDFromStr (from audio_id.c) to audio_GetIDFromStr
  * also changed calling method of audio_GetIDFromStr, now it returns its retrieved value (ID index number) rather than writing it in a pointer given as parameter

PS MSVC project might be broken, I don't have it so can't check nor fix it

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1288 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-27 18:59:03 +00:00
Dennis Schridde ca3b5909c8 Fix indention and some minor cleanup...
Fixing type-punned pointers is difficult, especially with that HEAP_ALLOC function...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1252 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 19:31:15 +00:00
Dennis Schridde 2a74242eb3 - Replaced various vectors with Vector3i and Vector3f (idea by Watermelon)
- Vector3i from lib/ivis also used in lib/audio, maybe want to move it to some more generic place?
- Replace iPoint with Vector2i
- Remove additional integer type declarations from pietypes.h
- Rename all iSprite to iTexture
- Various warning fixes: Unsigned/signed comparisons, uninitialized variables, declared but not defined symbols
- Replace DEBUG_BLOCK with DEBUG_MALLOC (it was virtually the same)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1245 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 16:20:16 +00:00
Per Inge Mathisen d3cadd9e4a Start making the code conform to -Wextra
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1146 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 16:46:48 +00:00
Roman C f4c4c48dd2 Patch by Gerard Krol:
replaces AND/OR macros with &&/||

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1089 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-10 16:39:39 +00:00
Giel van Schijndel 4def8b89ba Fix some compiler warnings:
* remove some unused functions

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1049 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-29 22:17:40 +00:00
Per Inge Mathisen 3d6771a521 Unify the several different definitions of pi in the codebase. Now we use the
C macro M_PI (if available, or we will define it on our own in fractions.h).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1033 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-24 19:42:20 +00:00
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Dennis Schridde f1ad4d83c9 - Expand DISP_HEIGTH/DISP_WIDTH
- Remove an unused function


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@964 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-07 19:29:26 +00:00
Dennis Schridde 8df2091640 Cleanup, fix warnings created by missing braces in intialization of the oaInfo struct.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@947 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-31 19:51:43 +00:00
Roman C 4ce5cd91ed Patch by Watermelon:
Multi-Targeting support:
1. Every weapon will try to choose its 'ideal' (this weapon's best
target) target first, if fails choose primary (weapon_slot 0) target.
2. If primary target is not valid for auxiliary (2nd,3rd etc), auxiliary
turret will try to acquire other targets (use primary weapon mortar to
engage remote target while having mg/cannon to engage close-quarter
enemies).
3.Adds DROID_OACTION_INFO struct (contains DROID_MAXWEAPS pointers to
BASE_OBJECT(target)) to handle multiple target info in order
functions.
4.A few weapon-related functions now return boolean values again instead of bitfields.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@945 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-31 15:18:01 +00:00
Dennis Schridde 3ceab2a84f Patch by Christian Ohm:
044 - Use int for gamma to avoid float imprecision


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@866 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 12:12:34 +00:00
Dennis Schridde 35ac675a7c Patch by Christian Ohm:
012 - mouseAtXXX cleanup


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@864 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 11:48:30 +00:00
Dennis Schridde 141a421d04 Patches by Christian Ohm:
002 - PSX removal part 2
019 - Remove PSX conditionals
020 - Remove IsPSX variable
021 - Remove unused parameter PSXSeqNumber from seq_AddSeqToList and seq_AddTextForVideo


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@861 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 11:20:44 +00:00
Dennis Schridde a715b54c9e Patch by Gerard Krol: sensorcrash.patch: fixes a crash when repairing a not damaged command center, corrects the mouse cursor
FIXME why is psDroid->asWeaps[0].nStat set to 0xCD instead of being initialized properly?


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@830 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-11 21:29:27 +00:00
Dennis Schridde 67056c8d24 - Droped a lot of (nearly) unused types from lib/framework/types.h
- Remove lots of unused functions (Windows/DDraw related)
- Now store the used bitdepth in the config and thus make it configurable without having to modify the sourcecode


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@808 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-04 01:11:26 +00:00
Dennis Schridde 3261a09baf BIG cleanup of headers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@749 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 17:24:55 +00:00
Stefan Huehner ae8467e580 Make more functions static.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@737 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-20 15:18:37 +00:00
Dennis Schridde 0ebbf5f1db Patch by Stefan Huehner: "code cleanup: static 2"
Mark some more function as static.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@711 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-14 13:15:40 +00:00
Dennis Schridde fc4ce66939 Patch "code cleanup: void 2" by Stefan Huehner
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@705 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 12:58:32 +00:00
Roman C d10c3bb0bd Ctrl+MouseWheel makes game speed up or slow down,
Using mouse wheel over radar makes radar zoom in/out, 
Added ability to put beacons using the radar, 
Tweaked beacon placement coordinates.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@664 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-30 17:02:58 +00:00
Dennis Schridde 76b6d70f6d Remove any occurences of GetTickCount() (a Windows function) with SDL_GetTicks() which was used on non MSVC anyway.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@656 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-27 19:09:35 +00:00
Dennis Schridde 0e288f45e7 - Replace all ASSERT(( )) with ASSERT( )
- Simplify definition of ASSERT(). Now is the same for GCC and MSVC.
  This may not work on versions older than MSVC 2005. If you experience this, please report it!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@613 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-23 12:58:48 +00:00
Dennis Schridde 62ae49b0ce Replaced all occurences of DBMB, DBPRINTF and DBERROR with their former define.
( DBPRINTF(("Message")); becomes debug( LOG_NEVER, "Message" ); )



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@608 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-22 14:28:49 +00:00
Per Inge Mathisen 8adf85a21b Remove obsolete file lib/ivis_opengl/vid.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@556 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-11 22:08:48 +00:00
Roman C 0afa375e12 -testing commit: made a softer mouse wheel zoom in/out
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@543 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-06 11:49:39 +00:00
Dennis Schridde 27fadd14cf - converted the sources in src/ to use full path includes instead of just the filename.
- marked places where lib/ivis_*implementation* (eg opengl) is needed, because of incomplete lib/ivis_common.

Should improve the understanding of interfaces and code organization.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@431 4a71c877-e1ca-e34f-864e-861f7616d084
2006-05-27 16:37:17 +00:00
Dennis Schridde b84d79a576 - Drastically simplyfied mouse-handling.
Patch by Cybersphinx

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@414 4a71c877-e1ca-e34f-864e-861f7616d084
2006-04-08 16:13:48 +00:00
Rodolphe Suescun aa3c7b4ff7 Added shadows as an option.
Alt-S (can be modified) to toggle.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@401 4a71c877-e1ca-e34f-864e-861f7616d084
2006-02-28 14:04:59 +00:00
No Author 5ba7ddac6b Create final repository structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@362 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-28 17:47:08 +00:00