Commit Graph

60 Commits (eabca223f5e7c237f5d3bb88183d38a41cb9bced)

Author SHA1 Message Date
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Nicolas Hake 8fc57b69c3 Don't ZeroMem non-POD types
Using memset to initialize non-POD types doesn't work. Or rather, it may
work right now, but will fail when somebody adds a member that relies on
its constructor doing something (like for example any STL container).
Either way it's undefined behavior and needs to go. Furthermore, using
it to reinitialize an object also prevents any dtors from doing their
work when needed.

A new helper function InplaceReconstruct will take an object of nothrow-
default-constructible type, and call the dtor to properly clean up
before placement-new reconstructing the object in the same location.
This is still bad design, but unfortunately removing the Default/Clear
functions from every object currently using them is a herculean task.
2015-11-14 16:43:19 +01:00
Nicolas Hake 1bc2d41368 C4Group: Remove unused time offset
Four years ago, we made c4group stop caring about time. Now it doesn't
need to carry a completely unused offset value around anymore.
2015-11-14 16:19:58 +01:00
Peter Wortmann f0030e33e0 Warning fixes
Actually pretty sure a few of them were bugs. Hopefully no new
ones were introduced here.
2015-10-03 15:32:39 +01:00
Sven Eberhardt 80fe1aa658 Avoid some C4Group rewinds in scenario list and player loading. 2015-09-10 22:32:51 -04:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
Nicolas Hake 09ad403d06 C4Group: Stop checking operator new return value
new throws std::bad_alloc on failure. It never returns NULL, so checking
for that is useless.
2015-02-13 19:46:11 +01:00
Nicolas Hake 48626ce7ae C4Group: Change int Status members to enums 2015-02-13 18:49:23 +01:00
Nicolas Hake 340e0e3f64 Remove unused C4Group::GetStatus 2015-02-13 18:37:20 +01:00
Nicolas Hake 413e66ff97 Move C4Group::PrintInternals out of C4Group
C4Group::PrintInternals is only used in the c4group command line tool.
Move the code there.
2015-02-13 18:25:21 +01:00
Nicolas Hake 73862d8fcb Move C4Group::View out of C4Group
C4Group::View is only used in the c4group command line tool, so the
right place for that code is inside the tool. Added two public constant
accessors to return the header data and entries.
2015-02-13 17:19:37 +01:00
Nicolas Hake 81f9ee1c85 Reset C4Group search after Add() to invalidate stale directory cache
Adding a file to an on-disk unpacked C4Group file needs to reset the
directory cache so C4Group doesn't return old state later.
2015-02-08 22:28:33 +01:00
Nicolas Hake 06d86f7666 Split a return into multiple statements to make it less unreadable
IOCCC is that way ------->
2015-02-08 22:28:32 +01:00
Sven Eberhardt df97b485f9 Fix group loading order for definitions, sounds and graphics (#1253).
Graphics are now pre-loaded and may then be accessed in random order. Reduces Objects.ocd load time from 20 seconds to 1 second for me.

Some ordering is still broken (e.g. material.ocg and player files).
2015-02-07 14:01:15 +01:00
Günther Brammer 5bcedb5bbf Remove some redundant #includes 2015-01-25 18:53:48 +01:00
Günther Brammer 8780a69b51 Improve the messages for path problems
C4Group::Open would sometimes overwrite more specific error messages or
not mention the problematic path. DirectoryIterator::Read also now mentions
more detail. Two superfluous messages were removed to make space.
2014-06-09 04:17:17 +02:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Sven Eberhardt 12bce5ba4f Fix loading from child groups when the mother needs to re-set its file pointer.
Fixes a bug with loading the shader file from scenario local Graphics.ocg on network clients. I think I also heard a few more sounds after the fix, so maybe they used random access into child groups too.
2013-07-04 23:18:52 +02:00
Armin Burgmeier 257db99165 Merge remote-tracking branch 'new/master' into mape
Conflicts:
	CMakeLists.txt
	src/graphics/C4Draw.h
2013-01-14 01:38:03 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer f13df38ec1 update: Log an error message when extracting the update program fails 2012-11-19 22:45:19 +01:00
Sven Eberhardt 99992b6f47 Fix sync loss and missing landscape or objects when joining two consecutive games without restarting the engine inbetween
Caused by an outdated cache of the DirectoryIterator in the main scenario group
2012-11-17 19:44:04 +01:00
Sven Eberhardt 878f8f9927 C4Group: .orig and .svn added to ignore list 2012-10-13 17:18:25 +02:00
Armin Burgmeier 81e04899dc Merge default into mape 2012-02-12 19:41:48 +01:00
Günther Brammer 286a32f47d Remove C4GroupEntryCore::(Has)CRC, calculate the CRC on demand
The CRC was basically only used to decide which files to include in update
groups, but calculated for every group and then stored in the file on disc.
And for some unknown reason, updates themself didn't produce the right
numbers in the file.

This means that c4groups with this change cannot reproduce groups written
by older c4groups and vice versa, but this isn't necessary for updates, and
reading is compatible both ways.

Except for the ways that C4Update fails to remove the CRCs.
2012-02-08 00:12:44 +01:00
Armin Burgmeier 5e2361af9d C4Group::GetFullName: Don't return an empty string for the root directory ("/") 2009-09-26 21:52:09 -04:00
Armin Burgmeier 5c6a9b2347 Avoid double slashes in pathnames returned by C4Group 2009-09-22 22:07:19 -04:00
Günther Brammer 9a8b5dd739 Replace BOOL by bool, TRUE by true, FALSE by false 2009-08-15 20:50:32 +02:00
Martin Plicht 08479b6cfd Put Mac-specific stuff into MacUtility namespace 2009-08-12 14:13:16 +02:00
Günther Brammer 572d00c32e Move all source files
This might make stuff easier to find.
2009-08-10 17:59:18 +02:00
Günther Brammer dfc799aa27 Rename C4Group_GetFileCRC/SHA1 to GetFileCRC/SHA1
These functions aren't used for files in groups and
consequently broken for them. Remove the dead code.
2011-09-15 20:16:00 +02:00
Günther Brammer d20a3803d0 Make C4Group::PrintInternals available in Release c4groups, too 2011-09-13 00:14:16 +02:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Günther Brammer c43611bf37 win32: Remove a now unused #define stat _stat 2011-08-15 01:35:52 +02:00
Nicolas Hake b2e83c3cb2 Replace raw CRT file access API calls with StdFile equivalents 2011-08-11 15:45:27 +02:00
Günther Brammer 505b616404 Remove obsolete CStdFile::Load/Save 2011-06-19 16:35:06 +02:00
Peter Wortmann c84458f451 Fixed parameter naming for AccessNextEntry 2011-05-22 23:02:10 +01:00
Nicolas Hake a6429bad54 c4group: Remove timestamps from groups, use checksums only 2011-05-01 13:37:36 +02:00
Günther Brammer 4f62dac0bc Rewrite C4Group::View a bit for clarity 2011-03-30 21:13:47 +02:00
Günther Brammer 5b808be269 Remove some unused variables
gcc 4.6 finds variables that are write-only.
2011-03-28 19:31:28 +02:00
Armin Burgmeier 6e025ee4ec Remove C4Group sort order for files no longer used in OC 2011-03-12 13:55:01 +01:00
Günther Brammer e80a39dd09 Remove some dead code 2011-03-09 23:30:23 +01:00
Günther Brammer 01e9dce9ce Store C4ComponentHost filenames in StdCopyStrBufs 2011-03-05 02:45:27 +01:00
Günther Brammer 8ff6ae847c C4Group::LoadEntry takes pointer instead of non-const reference 2011-03-05 02:44:26 +01:00
Günther Brammer 374d8e743b C4Group: Error message for Open failing due to filename on the ignorelist 2011-03-04 03:49:39 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Günther Brammer 47594765cb c4group: Remove unused -a, -m, -e, -d, -r, -o commands
The new release scripts use -p instead. This doesn't make c4group a lot
simpler, but every bit helps.
2010-12-05 19:04:40 +01:00
Günther Brammer ccf84f5dbe c4group: Remove Maker information.
It is useless without the shareware registration providing a name.
2010-12-05 18:57:06 +01:00