Commit Graph

251 Commits (master)

Author SHA1 Message Date
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 c1e113f1f9 c4group: Remove useless version history
A list of versions and dates isn't helping anyone, especially not if
no actual changelog is available.
2015-02-13 17:21:49 +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 a92c22a7b3 Merge various build system fixes and cleanups 2015-01-25 18:50:29 +01:00
Günther Brammer d9e3d9db3d Require filenames to be in unicode, remove iconv usage
Every modern operating system and Clonk uses UTF-8, and windows uses UTF-16
and has its own conversion code.
2015-01-03 20:41:03 +01:00
Sven Eberhardt 49f991c819 Move shader logging into separate file and log only in editor mode (#1209) 2015-01-03 17:53:59 +01:00
Armin Burgmeier 1e77de1044 Merge branch 'lights'
Conflicts:
	src/c4group/C4Components.h
2015-01-03 16:00:20 +01:00
Mark 305637b246 Loading skeletons separately (#1180)
Animations are now part of the skeleton, and skeletons are loaded before meshes. They are stored in a map in StdMeshSkeletonLoader. This is only the first part of changes for #1180.
2014-12-20 23:11:33 +01:00
Tobias Zwick 4981182cf8 Merge remote-tracking branch '_origin/master' into lights
Conflicts:
	src/c4group/C4Components.h
2014-12-15 21:16:40 +01:00
Armin Burgmeier e0bfc3211c Fix definition packing order (#1189)
To match the changed loading order from previous commit
2014-12-15 09:07:50 -05:00
Tobias Zwick d59b1e5e5b reduce version numbering from x.y.z (x does never changes) to y.z 2014-12-12 21:57:52 +01:00
Armin Burgmeier dd16b2d588 Set useful name for in-memory CStdFiles
This fixes a valgrind warning when creating a savegame, since in that case
the file name is filled with uninitialized junk. It is not used at other
places, since it is an in-memory file, and therefore was probably harmless.

Now we give a useful name to in-memory files based on the address of the
StdBuf object, which might actually be useful when debugging.
2014-12-06 15:42:42 -05:00
Armin Burgmeier 137abb89df Implement normal maps for sprite graphics 2014-11-07 15:29:09 -05:00
Armin Burgmeier a03ec84374 Fix extraction of language names for language options (#1127)
At least in some implementations, std::regex does not treat $ and ^ as the
beginning or end of a line but as the beginning or end of the whole string.
2014-10-06 13:03:32 -04:00
Sven Eberhardt e740938bbb Fix .ocu updates and allow direct download of installer for future updates. 2014-10-05 14:32:23 +02:00
Sven Eberhardt 05631742c8 Allow definition of achievements in parent (.ocf) folders.
Note that regular scenario parameters cannot be defined in folders because that would complicate savegames, records, etc.
2014-10-03 12:17:12 +02:00
Sven Eberhardt abab7be591 Added scenario achievements displayed as small symbols beside the scenario name in the startup selection screen.
They can be used e.g. to show that you have finished a scenario on different difficulty levels.
2014-09-24 23:08:40 +02:00
Sven Eberhardt 378bda5546 Added custom scenario parameters (SCENPAR_*).
Can currently only be set in network games in the lobby. In the future, maybe we can find a place somewhere in the scenario selection dialogue.
2014-09-23 23:02:52 +02: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 5c7e5446ba Move <regex> inclusion to C4Include
Since multiple source files may want to use regular expressions, move
the header inclusion before setting up heap debugging.
2014-03-25 18:28:02 +01:00
Sven Eberhardt 57463b61c4 Rework SolidMasks to be defined in a separate SolidMask.png graphics file instead of the main definition graphics. 2014-01-08 01:55:33 +01:00
Sven Eberhardt 5094cc5c1b Reworked "Save as scenario" option in editor to write a script file instead of Game.txt. 2013-12-27 17:10:09 +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
Nicolas Hake f0550c45b4 GetResStr: Match lines nongreedily (#993)
With greedy matching enabled, . (dot) would also match newlines.
2013-11-08 01:11:16 +01:00
Nicolas Hake 8d8f0396b6 Move system string table to C4LangStringTable
libc4script requires the system string table, but doesn't require the
full-fledged C4Language. Move the table to C4LangStringTable to reduce
dependencies.
2013-10-29 21:36:38 +01:00
Nicolas Hake 4ebf67754c Move C4ComponentHost::LoadEx to C4Language
To make C4ComponentHost more reusable, move C4Language dependencies out
of the class.
LoadEx isn't really suited to reside in C4Language, but it's better to
have it there, since all C4Language consumers also use C4ComponentHost;
the reverse isn't true.
2013-10-29 21:32:21 +01:00
Nicolas Hake 924e0538fc Fallback to Boost.Regex if <regex> is broken
A large number of g++ versions ship a <regex> that declares all of the
required functions, but don't actually implement them, making using them
result in a linker error.

Fallback to Boost.Regex if the host C++11 <regex> implementation is
broken; the interface is the same anyway, only differing in the
containing namespace.

Unfortunately, Boost.Regex is not a header-only library, but this is not
a big deal because all major Linux distributions ship it, and Visual
Studio implements <regex> since 2010 (the oldest version we still
support).
2013-10-29 16:59:38 +01:00
Nicolas Hake e753bf8168 Replace ResTable with a proper dictionary
ResTable (the main system string table) was a home-grown hashmap that
did not cope with collisions at all. Since we already have a proper
dictionary in C4LangStringTable, use that instead.
2013-10-19 19:28:54 +02:00
Sven Eberhardt 3019a8e66e Fix file SHA1 calculation.
sha1::digest_type is a reference, so cast the BYTE and not the pointer. SHA1 calculation of file contents is required for league.
2013-09-26 23:52:23 +02: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
Tobias Zwick 003e29f223 enable loading Title.jpg for scenario (folders) 2013-05-25 20:48:14 +02:00
Nicolas Hake 459fce0758 Replace std::auto_ptr with std::unique_ptr
std::auto_ptr has awkward copy semantics and is deprecated in C++11.
2013-03-26 15:43:01 +01:00
Sven Eberhardt 57e63a5275 Added support for scripted maps (Map.c) and documentation. 2013-03-19 00:36:06 +01:00
Nicolas Hake e91d4a4278 Update more various references to clonk.exe 2013-02-03 20:54:34 +01:00
Armin Burgmeier e7be3dc32d Remove some additionally introduced includes and forward declarations
they are no longer needed, the code compiles just fine without.
2013-01-14 02:25:11 +01: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
Nicolas Hake a619b4b6ed c4group: Fix incorrect swprintf usage 2013-01-11 23:41:58 +01:00
Tobias Zwick d0a6bb099f fix #792: wouldn't load Overlay.*.png 2013-01-08 23:52:45 +01:00
Günther Brammer 41c88ba863 Use _snwprintf instead of swprintf
Apparently the C standard committee and Microsoft couldn't agree on how
swprintf should work.
We previously tried to work around the resulting breakage, but I just got
the following compilation error. It's really better to avoid that function
entirely. Since we only used it in windows-specific code, the
windows-specific _snwprintf is a nicely compiler-independent replacement.

src/platform/PlatformAbstraction.h: In function ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’:
src/platform/PlatformAbstraction.h:243:12: error: redefinition of ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/swprintf.inl:30:5: error: ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’ previously defined here
2012-12-31 22:03:12 +01:00
Günther Brammer 6a6190564f Remove some forward declarations that are already in C4Prototypes.h 2012-12-31 22:03:12 +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
Nicolas Hake 5a803c6110 Win32: Add dummy fourth FILE/PRODUCTINFO resource component
The FILEVERSION and PRODUCTVERSION components of VERSIONINFO blocks are 32 bit
integers, specified as four 8-bit integers. Apparently MinGW's windres chokes
on the definition if not all values are given.
2012-10-21 12:40:22 +02:00
Armin Burgmeier b4aafdd874 Remove build number aka C4XVER4 2012-10-18 23:54:50 +02:00
Armin Burgmeier 9c1496178b Load Graphics*.mesh files for use with SetGraphics (#480) 2012-10-14 14:37:45 +02:00
Sven Eberhardt 878f8f9927 C4Group: .orig and .svn added to ignore list 2012-10-13 17:18:25 +02:00
Tobias Zwick b5d0af513a remove splash video and option for it 2012-10-02 23:02:52 +02:00
Günther Brammer 1a29f8625d Reorder engine source file organization a bit
This mostly consists of flattening the hierarchy, splitting the
graphics stuff out of platform, and a few smaller cleanups.
2012-04-27 19:04:43 +02:00
Günther Brammer 40de33ca3c win32: Make sdl-mainloop option work
As it doesn't have the editor, this is only useful for compiling
more of our code on more platforms.
2012-03-23 22:53:56 +01: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 2092baaa18 Fix possible double close when attempting to open uncompressed files 2012-02-05 20:00:47 +01:00
Armin Burgmeier f50ebf6441 Update C4Group packing order
This speeds up loading of packed files significantly. It's not optimal,
though, because the order in which textures are loaded by the engine
is not known by c4group (it depends on their occurence in the Scene.material
file). This could be fixed by specifying custom packing orders for every
object we have. But then again maybe switching to a different format which
allows for random access might be more worth it.
2012-02-04 22:08:38 +01:00
Armin Burgmeier 8e5b9262df Fix a possible file leak in CStdFile::Open
This happened if open() worked but c4_gzdopen failed. This bug prevented
Objects.ocd being packed because of "Too many files open."
2012-02-04 21:28:17 +01:00
Martin Plicht a62486044e C4Reloc: Each path is associated with a path type, specifying whether a path is a preferred installation location 2011-10-16 16:07:13 +02:00
Armin Burgmeier a1370c2954 Rename our custom gz* functions to avoid conflicts with zlib.dll
This fixes the build with native mingw for me.
2012-01-28 17:02:37 +01:00
Nicolas Hake 74620be240 Backed out changeset: c3fc1ee1ec8c 2011-11-10 02:17:00 +01:00
Peter Wortmann d5c075ade8 Yet another variant on how to find data files
This time, the relocation code checks for a "System.c4g" in either
the executable path or a "data" folder directly below. CMake makes
sure that this points somewhere sensible for normal builds.

TODO:
* Check whether this actually works under Unixes. Can "ln -sf"
  delete important stuff? Is there a safe alternative?
* Further unify with the Mac Os solution. Other platforms might
  auto-pack for release builds too, for example - and it might
  be a good idea to have a proper data subdirectory in Mac bundles
  as well.
2011-11-09 00:45:07 +00:00
Günther Brammer cb3ae45c2f c4group -t: remove destination before packing group 2011-11-02 21:33:38 +01:00
Günther Brammer ccbf4d1d45 Consolidate duplicated simple Log functions
The various small utilities do not use the engine Log implementation but
one that simply prints to stdout. Instead of duplicating that one, link a
common one into the utilities.
2011-11-02 21:36:39 +01:00
Günther Brammer b4fd8fcd15 linux: Add O_CLOEXEC to various open calls
This should prevent some file descriptor leakage from forks that
some libraries we use do.
2012-03-05 01:33:02 +01:00
Günther Brammer 3b9dd7b487 win32: Remove some cruft from the c4group resource.rc 2012-02-14 22:49:26 +01:00
Günther Brammer dfea0914a9 Merge the functions pointer branch 2012-03-09 17:42:48 +01:00
Sven Eberhardt bdd053e2dc Fix compilation with zlib 1.2.6
Include zlib.h instead of just copying the definition for gzFile
2012-02-21 17:12:00 +01:00
Günther Brammer cd46cf9914 C4SimpleLog defaults to on 2012-02-17 00:25:20 +01:00
Günther Brammer b911630578 Replace OpenSSL SHA1 implementation with one copied from boost/uuid
Although the code already uses boost, boost/uuid hides the sha1
implementation in a deeply nested namespace, which is just too bizarre to
use. Also the name of that namespace suggests that it is just an
implementation detail that could go away without notice.
2011-01-10 21:30:40 +01:00
Günther Brammer 3c41310fa3 Remove C4ConfigShareware to reduce OpenSSL dependency 2011-11-02 00:07:29 +01:00
Günther Brammer 5f2f995852 Unify the #include blocks a little bit
One line for C4Include.h, one for the .h corresponding to the .cpp, one
empty line, the other C4* includes, another empty line, external headers.
2011-11-01 23:17:41 +01:00
Günther Brammer fa1cab4896 Clean up some obsolete Config.General.ExePath usages 2011-10-10 23:28:01 +02:00
Sven Eberhardt 452f34ffd9 Debug: Add thread checking for CStdFile 2011-10-09 20:11:18 +02: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
David Dormagen a886a18180 replaced remaining TRUE and FALSE (both are invalid now) 2009-09-05 19:22:54 +02: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 a28a6621da shuffle the #includes around a bit
This reduces the dependencies from src/lib to the rest of the code a bit.
2009-08-12 22:03:50 +02:00
Günther Brammer b46f4696e9 Split C4Rect out to its own source file
Because much more depends on C4Rect than only C4Shape, and C4Shape uses
lots of other stuff.

Also move some other files which depend on C4Group to src/c4group, because
I'm editing the build files anyway.
2009-08-14 01:46: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
Nicolas Hake 8d8b087808 Return NULL instead of ((T*)false) from more functions 2011-09-28 19:42:56 +02:00
Günther Brammer bfee2c5b81 Version 5.1.91 (5.2 Beta) 2011-09-27 01:15:00 +02:00
Günther Brammer e61c0f1393 Remove some obsolete files from Graphics.ocg 2011-09-23 01:40:28 +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
Günther Brammer 2f201b5f21 Use printf instead of sprintf+puts 2011-08-15 01:35:32 +02:00
Tobias Zwick 532cea1abe removed Cursor graphics in different sizes 2011-08-18 19:06:49 +02:00
Nicolas Hake 0f4e6e8ccd win32: Use wide variants of CRT file access APIs 2011-08-11 15:46:06 +02:00
Nicolas Hake b2e83c3cb2 Replace raw CRT file access API calls with StdFile equivalents 2011-08-11 15:45:27 +02:00
Nicolas Hake 5f923b0b98 win32: Generate wide strings for OutputDebugString 2011-08-11 15:42:00 +02:00
Günther Brammer 4d1238beb4 win32: Use Unicode APIs for File manipulation 2011-04-02 18:45:44 +02:00
Günther Brammer 3c557d34a4 win32: Use open+gzdopen instead of gzopen
In preparation for a utf-8 wrapper around open.
2011-06-19 17:38:27 +02:00