Commit Graph

1745 Commits (3e14c0fb3d889fbc4afba44a32d04d8ecd32a7fd)

Author SHA1 Message Date
Giel van Schijndel d1e8dd2c5a * Cast psObj->psDest to DROID, after determining (psObj->psDest->type == DROID) (This should prevent a compiler warning about incompatible pointer types)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2040 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-07 15:28:27 +00:00
Giel van Schijndel f17bcede91 Huge piece of cleanup:
* Make droidDamage and objectDamage accept a parameter `DROID_HIT_SIDE impactSide` instead of `int angle` since it only needs to know the impactSide (which can be extracted from the angle)
 * Make some function calls better readable by splitting them decently out across lines (not just random line breaks)
 * Merge some recursive if-statements (i.e. make if (a) { if (b){} } become if (a && b) instead)
 * Move duplicated code into a function of its own (getHitSide)
 * Merge a large portion of duplicated code (parts that dealt with direct and indirect weapons were almost exactly the same)
 * Remove futile collision check based on checking whether targets where in the same tile as the projectile on impact (some more advanced collision detection was/is being performed anyhow)

Parts from patch #760 by Freddie Witherden <evilguru> plus some minor changes by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2039 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-07 15:18:54 +00:00
Giel van Schijndel a12e3630e2 * Split an #ifdef EDIT_OPTIONS section to make sure sButInit's member variables are properly set
Patch by DrZimmerman

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2038 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-07 14:38:32 +00:00
Giel van Schijndel 7b0625d4a7 * Change the adpcm decoder to use a more object oriented approach (rather than global vars which would make decoding multiple streams impossible)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2037 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-07 14:23:48 +00:00
Giel van Schijndel fcf6f02015 * Use an int16_t instead of a short, since this code quite obviously depends on these variables to have an exact size of 16 bits
* Put curly braces on a line of their own
 * Use INT16_MAX and INT16_MIN instead of magic numbers
 * Make some global vars statically linked and const (since they're constants for the adpcm audio codec only)
 * Make some functions in rpl_reader statically linked (they're only used in that file)
 * Add include file dec130.h instead of forward declaring functions in source files

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2036 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-07 13:58:15 +00:00
Giel van Schijndel d531d0a809 Huge piece of cleanup:
* Merge two large sequential if statements where the tested conditions where exactly the same
 * Remove some commented out code
 * Move some code duplicated in the true and false (else) parts of an if-statement out of those code blocks in front of the if-statement
 * Don't use multiple recursive if-branches, instead store some results in variables (EFFECT_TYPE facing, iIMDShape *imd)
 * Use a switch statement to switch on a BASE_OBJECT's type rather than a sequence of if/if-else statements
 * Merge some recursive if-statements (i.e. make if (a) { if (b){} } become if (a && b) instead)
 * Make some function calls better readable by splitting them decently out across lines (not just random line breaks)
 * Add some whitespace for increased readability
Parts from patch #756 by Freddie Witherden <evilguru> plus some changes by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2035 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-06 21:47:23 +00:00
Giel van Schijndel bd7d6ae12e * Rename some variables to more descriptive names
* Fix merged indentation of 4 spaces and tabs (even on the same line!!) by using tabs instead
 * Make some function calls better readable by splitting them decently out across lines (not just random line breaks)
Parts from patch #756 by Freddie Witherden <evilguru> plus some changes by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2034 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-06 20:29:43 +00:00
Giel van Schijndel d593fd7c17 * Verify a target isn't dead before using it
Patch by Watermelon

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2031 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-06 19:17:44 +00:00
Giel van Schijndel ed62f3da96 * Use 'unsigned int' instead of a fixed-with type to store the width, height and depth of an image
* Change an assert(FALSE) into a more descriptively styled: !"text string"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2030 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-06 13:47:39 +00:00
Giel van Schijndel b9f58a0e0b * Convert back-slashes in paths to forward-slashes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2028 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-06 11:32:56 +00:00
Giel van Schijndel 37d7adb0e2 * Add some assertions on unhandled/invalid BASE_OBJECT.type values to aid in debugging
* Add some whitespace to increase readability (empty lines between different case labels in switch statements, and use more consistent indentation in switch statements)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2027 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-05 12:57:24 +00:00
Giel van Schijndel 8947c63baf * Ignore another set of MSVC files
* Remove rather useless file d3dwrap.h
 * Remove DLLEXPORT stuff

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2026 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-04 18:53:52 +00:00
Giel van Schijndel 0a8c53b8a8 * Rename class CFileParser to fileParser (I don't want no freakin MFC naming conventions: prefixing all class-names with a captital 'C')
* Don't use pointers to fileParser for functions where references are lots more appropriate
 * Mark some functions private instead of public (they're only used by class CHeightMap's implementation)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2025 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-04 18:31:36 +00:00
Per Inge Mathisen 073a4793c5 Add died checks to projectile visibility function. Patch by Watermelon.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2024 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-04 18:29:02 +00:00
Per Inge Mathisen bc7dabc521 Fix off-by-one check in CHECK_DROID and CHECK_STRUCTURE macros. Patch by Watermelon.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2023 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-04 18:26:31 +00:00
Giel van Schijndel eb898d0293 * Fix forward declaration of OpenEditorFile
* Remove useless, and (luckily) unused default constructor from CFileParser
 * Move initialisation of m_Flags to initialization list of constructor
 * Don't use (void) as argument list of destructor (this is bad style in C, but especially so in C++, since C++ implies an empty argument list if you give one)
 * Don't check whether new didn't return NULL, since we're using the throwing variant of new anyway
 * Use istream.read instead of istream.readsome since the former will refill the buffer if necessary (which *is* necessary to be able to read something the first time)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2022 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-04 18:11:02 +00:00
Giel van Schijndel f0d6c4d6b6 * Remove yet some more unused/unreferenced variables to reduce warning spam
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2021 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 20:51:41 +00:00
Giel van Schijndel d4d550f700 * Remove some unused variables
* Use C++'s std::ifstream instead of stdio from C at some locations
 * remove unused constructors from CFileParser (FILE* Stream, short Flags), (char* Buffer, long BufferSize, short Flags) and member function Create(char* FileName, short Flags)
 * remove some duplicated code from fileparse.cpp

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2020 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 20:44:51 +00:00
Per Inge Mathisen 0c6b83c3ec Fix crash that happens when transport is unloading units that have
invalid target references. This is an ugly fix for some very ugly code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2019 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 20:44:31 +00:00
Per Inge Mathisen 56579f0b7d Remove excessive CHECK_DROID call in release droid function.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2018 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 20:41:19 +00:00
Per Inge Mathisen cbada4698b Remove two excessive logging calls
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2017 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 20:39:34 +00:00
Giel van Schijndel 28152bd17f * Add GPL header
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2016 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 14:42:34 +00:00
Giel van Schijndel bae4d98dfa * Remove empty file gatewaymapdefs.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2015 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 14:38:37 +00:00
Giel van Schijndel 4b642cbdb7 * Rename wrongly named file model.hpp to model.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 14:30:48 +00:00
Giel van Schijndel 8192e5788e * Ignore yet another MSVC file
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2013 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 14:18:00 +00:00
Giel van Schijndel cd5ada2263 * Use a tab-stop location to line stuff properly out
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2012 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 13:27:24 +00:00
Giel van Schijndel f0c12b8ae2 * rename some files to lowercase filenames
* convert M$ Word documents into OpenDocument text documents (OpenOffice.org handles this perfectly) (lets use open standards instead of property formats!)
 * remove WEDIT.DOC which seems to have been a duplicate of MANUAL.DOC or the otherway around, which doesn't matter really

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2011 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 13:24:14 +00:00
Giel van Schijndel 49b672aad7 * Remove a whole bunch of other MSVC files which apparently are not necessary
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2010 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 12:02:24 +00:00
Giel van Schijndel a1b1ac1f16 * Add tools/editworld/src/Debug to the ignore list since apparently this is MSVC's output directory
* Remove EditWorld.plg since this looks like a compilation report which we don't need in our repository (add it to the ignore list as well)
 * Another MSVC compilation output file to ignore list: EditWorld.ncb

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2009 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 11:59:52 +00:00
Giel van Schijndel 24e16176b8 * Allow larger display bitdepths than 16bit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2008 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 11:54:35 +00:00
Giel van Schijndel 10a0d4be6e * Set mime-types and svn:eol-style on EditWorld's files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2007 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 11:48:40 +00:00
Giel van Schijndel 6f1064ad0e * Set bugtraq:url and bugtraq:logregex properties on some directories
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2006 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 11:26:14 +00:00
Giel van Schijndel 345b1d6106 * Revive EditWorld from the dead
* Give it a nicely oriented directory structure
 * Rename all files in src/ (I hope I didn't miss any) to lowercase (except for MSVC project files)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2005 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 11:06:42 +00:00
Per Inge Mathisen 3a77772598 Fix assert when saving while transport is leaving the map
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2004 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-02 22:36:58 +00:00
Per Inge Mathisen 51d982100e Fix crash and assert when transport is leaving map in campaign
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2003 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-02 20:37:01 +00:00
Per Inge Mathisen 289b0479f0 Fix crashes in game loading code introduced by reference counting framework
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2002 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-02 20:09:25 +00:00
Dennis Schridde 14fb2c9d3d Fix bug#9430
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2001 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-02 16:23:53 +00:00
Giel van Schijndel 12c3d78559 * Add "-Werror-implicit-function-declaration" to Code::Blocks project compile options
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2000 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-02 11:03:41 +00:00
Per Inge Mathisen 4fa38ab9b6 Missed two cases of pointer references to objects being set in src/ai.c. Fixed!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1999 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 20:40:40 +00:00
Per Inge Mathisen 976c75191a Cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1998 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 15:26:53 +00:00
Per Inge Mathisen e06f29f87c Remove scrvGetBaseObj
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1997 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 14:51:28 +00:00
Per Inge Mathisen 49b1666441 Remove scrvLinkValues
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1996 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 14:30:19 +00:00
Per Inge Mathisen cd8cf1090b Implement the bulk API changes required for reference counting. Also fix some
missing checks for dead targets. Patch by me and Watermelon.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1995 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 12:27:25 +00:00
Per Inge Mathisen 64c9ca9ecd Optimize non-enabled calls to debug() by moving the if test before we do a function call.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1994 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 11:54:09 +00:00
Dennis Schridde bfb3775e83 Import ChangeLog for 2.0.7. Later versions will be added when they are released.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1993 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 01:20:03 +00:00
Dennis Schridde 714bcc5924 displayBuffer -> fileLoadBuffer, original patch by vs2k5. displayBuffer was abused to load nearly everything.
Reuse FILE_LOAD_BUFFER_SIZE macro, which was abandoned before. (That's also why fileLoadBuffer is now defined in src/init.c, even though the place is probably inappropriate.)
Make fileLoadBuffer static instead of malloced.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1992 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 00:28:49 +00:00
Dennis Schridde ae1bbe9894 Fix for wrong type by vs2k5.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1991 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-30 23:42:27 +00:00
Dennis Schridde c86c5aaa94 pie_export.py version 0.2, by kage:
as requested, it now provides a gui for setting the pie version -- you do this indirectly by setting the floating point precision (precision of 0 will create a "PIE 2", while anything else will create a "PIE 5"). note that only points will be given any extra precision at the moment, since i'm not sure how you want to handle texture coords. precision defaults to 0 (old pie format) since, afaik, pie 5 support in the engine is still lacking.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1989 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-29 17:09:03 +00:00
Per Inge Mathisen a4bf9eea4e Remove unused network code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1987 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-27 18:40:41 +00:00
Giel van Schijndel d55bd507c6 * Remove unused parameter char* DisplayBuffer from function pie_UploadDisplayBuffer (maybe we might as well remove this function altogether ?)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1986 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-27 12:30:29 +00:00