Commit Graph

38 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 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
Nicolas Hake 715d3f34dd Remove obsolete declaration of C4Group_SetOriginal
This function hasn't existed for five years. It's time for the
declaration to go away.
2015-11-14 16:19:58 +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 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
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
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 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
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
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 5d1f210436 C4Group::FindNextEntry only writes in the result buffer finding a file (#618)
Before "Initialize some uninitialized variables", SCopy would do nothing
because the StdStrBug still contained the parameter, but with that patch,
it wrote the empty string into the result buffer.
2011-08-05 22:07:44 +02:00
Günther Brammer c4f16d42ce Initialize some uninitialized variables 2011-07-18 02:12:37 +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 5b808be269 Remove some unused variables
gcc 4.6 finds variables that are write-only.
2011-03-28 19:31:28 +02:00
Nicolas Hake b332e73ba3 C4Group: Fix FindNextEntry
The char* parametered FindNextEntry didn't pass the last found
filename to its implementation, so it always found the first file
matching the wildcard
2011-03-08 17:53:30 +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 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
Nicolas Hake 5dc0d3b4cb Reduce value truncation warnings 2010-04-20 18:20:24 +02:00
Carl-Philip Hänsch 01156cc04d C4Group: Ignore *~ backup files 2010-04-15 22:24:34 +02:00
Benjamin Herr 27287b981f Reformat everything according to style guidelines
as per http://forum.openclonk.org/topic_show.pl?tid=208
and http://wiki.openclonk.org/w/Style_Guidelines
via astyle
  --brackets=break
  --indent=tab=2
  --keep-one-line-statements
  --keep-one-line-blocks
  --indent-namespaces
  --convert-tabs
  --recursive
  --exclude=zlib
  --exclude=tinyxml
  src/\*.h src/*.cpp
2010-03-28 19:58:21 +02:00
Günther Brammer b4e37b070b Change all indentation with spaces to use tabs instead
This is a whitespace-only patch. Hopefully, it'll only affect rarely-changed
parts of the engine, since all regularly maintained pieces should already
use tabs.
2010-03-27 17:05:02 +01:00
Günther Brammer ff8d950e85 Remove C4ENGINE define
Most files using it weren't used by c4group-the-application anymore, and
the remaining stuff can be dealt with by using stubs or the same code in
both cases.
2010-02-17 22:59:46 +01:00
Armin Burgmeier a9f3f5e80c Fix size of C4GroupEntryCore
The BOOL->bool patch (ea7876ddd97d) changed the size of C4GroupEntryCore, thus
C4Groups could no longer be loaded correctly. This broke PlayerJoin for packed
player files.

The same patch seems to also cause other problems - normal Clonk movement
in the landscape is currently broken as well.
2009-08-24 23:53:12 -04:00
Günther Brammer 9a8b5dd739 Replace BOOL by bool, TRUE by true, FALSE by false 2009-08-15 20:50:32 +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