Commit Graph

1506 Commits (2063d578c3c1c3e28c50497fd3297dc9f1103215)

Author SHA1 Message Date
Per Inge Mathisen 2063d578c3 Make sure hash table is re-initialized properly after closed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2052 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-10 21:23:43 +00:00
Per Inge Mathisen 2de32d08ba Silence a Valgrind warning by not free()ing a NULL pointer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2051 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-10 20:32:59 +00:00
Per Inge Mathisen e2879a2206 Fix crash on starting cam2 where objects are released but animations that refer
to them are not. Bug looks like it has always been there, but hidden by old memory
management code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2050 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-10 20:17:27 +00:00
Per Inge Mathisen 3cedbb58f5 Fix bug introduced in struct multiweapon code of r857, which crashes the first
level of cam2 because the non-nullness of an array pointer is checked instead of
the non-nullness of the first pointer in that array.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2048 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-09 19:58:27 +00:00
Giel van Schijndel e8e75c81a2 * Add dec130.h to the automake system
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2047 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-09 09:02:30 +00:00
Ari Johnson dad009776a Update to Xcode project file to include dec130.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2046 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-09 05:38:44 +00:00
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 e531fb31fc * Remove a futile check for error condition (psBuilding->psStructureType->numFuncs == 0) which can never occur unless errors occur while loading a stats file (and if they do, they should be detected by the code loading that file)
* Use calloc instead of malloc followed by memset(0) (calloc both allocates memory; and then sets all of it to zero)
 * Move a lot of duplicated malloc (calloc now) calls out of the switch statement; and in front of it
 * Use map_coord and world_coord instead of bitshifting with TILE_SHIFT
 * Declare and use variables in a more local scope
 * Take advantage of the fact that FUNCTIONALITY now is a struct by not casting anymore
Parts from patch by Freddie Witherden <evilguru> plus changes by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2044 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 20:45:01 +00:00
Giel van Schijndel b091d350e0 * Don't take guesses on what kind of struct is the largest; use a union instead so that the compiler can deal with that
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2043 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 20:04:39 +00:00
Per Inge Mathisen 868b3594c8 Fix crash in campaign when saving a game where a repair structure has been destroyed.
Bug introduced in first reference count commit (r1995).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2042 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 13:20:27 +00:00
Giel van Schijndel a437f1efe2 * Change default of setting "ReopenBuildMenu" to true since this was the behaviour of the original Warzone AFAIK, and as such is probably expected by most people
* Remove commented out line which was an exact duplication of a line just below it

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2041 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 11:01:24 +00:00
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