Commit Graph

237 Commits (61962fe70abd22a665446cc09fcef163bf0e3862)

Author SHA1 Message Date
Lukas Werling d84c9b174f Add warning for non-UTF-8 files 2016-12-13 22:40:51 +01:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Nicolas Hake 8f47edc1e3 Fix destruction order of system string table vs. editor
Depending on the mood of the linker, the editor may have been
constructed before and destroyed after the system-wide string table
because they weren't defined in the same file. Destruction of the editor
tries to load some strings, which would then access the already
destroyed string table and thus crash.
2016-10-16 18:40:51 +02:00
Sven Eberhardt 9d715387f2 Qt editor: Store and restore window layout (docked dialogues, etc.) 2016-08-08 23:57:24 -04:00
Sven Eberhardt 5db45c0f47 Merge branch 'master' into qteditor 2016-08-06 21:45:19 -04:00
Nicolas Hake 0cbb476daf Remove re namespace alias
This alias is a legacy from when we were using Boost.Regexp to
workaround a broken implementation in GCC's libstdc++ earlier than 4.9.
2016-07-25 18:39:44 +02:00
Sven Eberhardt a7aa89f168 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c
	src/platform/C4WindowSDL.cpp
	src/script/C4AulParse.cpp
	src/script/C4Effect.cpp
2016-06-20 22:27:03 -04:00
Nicolas Hake e490428f29 Win32: Drastically improve load times with unpacked planet/
C4Group::SearchNextEntry would waste lots of cycles looking up file
attributes that were never inspected afterwards. Since all we want is
the file size, and we already get that for free from FindFirstFile and
FindNextFile, store it with the directory iterator instead of querying
it at every iteration.

This reduces load times on my machine by almost half, tested across
several different scenarios.
2016-06-19 17:08:50 +02:00
Sven Eberhardt b70882d7fa Editor: Object scaling+rotation 2016-06-17 00:07:49 -04:00
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
Günther Brammer a19e7f6ced Use #elif defined() to check for config.h macros instead of plain #elif
This way, the code works with a config.h that does not define those macros.
2016-01-23 23:05:16 +01:00
Sven Eberhardt 3f7bd627de Fix int type in group info display format. 2016-01-09 00:19:39 -04:00
Nicolas Hake 9b34bf2634 Remove arbitrary inline forward declarations of StdBuf (and derivatives) 2015-12-29 21:42:46 +01:00
Nicolas Hake c0befc6ba0 Remove C4RTF
The only use of C4RTF in its final moments was parsing out plain text
from RTF files anyway, so why even go to all the trouble instead of just
storing plain text in the beginning?
2015-12-29 17:51:43 +01:00
Nicolas Hake 500229c302 C4Extra: Make ownership of ExtraGroups more explicit 2015-12-29 13:56:06 +01:00
Nicolas Hake d0cd244077 C4Extra: Merge ctor/Default, dtor/Clear 2015-12-29 02:59:02 +01:00
Sven Eberhardt 171080cbd5 Play frontend music by tag. 2015-12-12 12:08:45 -05:00
Sven Eberhardt 96082569bd Allow sounds in subfolders and create namespaces for them (#1185) 2015-12-06 23:44:41 -05: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
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 fe05fb5b1a Fix loading of shape textures from packed groups (#1421). 2015-10-15 20:29:56 -04:00
Sven Eberhardt 47e422f452 Rework and document texture shapes.
* Renamed from material shapes to textures shapes
* No per-texture, so the same material can use different shapes with different textures
* Load a shape image instead of text file with vector components
* Allow texture sizes that are not multiple of the map zoom
* Add minimum overlap parameter to draw shapes only when the given overlap is reached.
2015-10-09 00:16:24 -04: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 1f46a9004c Fix some erroneous file orders causing group rewinds. 2015-09-22 23:47:06 -04:00
Sven Eberhardt 80fe1aa658 Avoid some C4Group rewinds in scenario list and player loading. 2015-09-10 22:32:51 -04:00
Sven Eberhardt 283277ac82 Do not pre-load file contents from unpacked music folders ($1378).
Removes several seconds from startup time and ~150MB memory usage. Note that tags are still loaded so all file headers do have to be accessed.
2015-09-06 00:02:17 -04:00
Sven Eberhardt 5ec9999d4c Fix crash on global or scenario script reload.
The string table of System.ocg scripts (except the global System.ocg) pointed to nowhere after the initial load phase, but is still required for reload. Added a ref counting option to keep these string tables alive.
2015-08-20 13:15:11 -04:00
Armin Burgmeier 006cf68874 Some refactoring, and restore support for Map.bmp
The new behaviour that allows 255 mat-tex combinations (once we increased
C4M_MaxTexCount...) is enabled with MapFg.bmp, and then MapBg.bmp can be
used to draw IFT or other fancy things.
2015-08-04 21:21:23 -04:00
Armin Burgmeier eb98e73b76 Introduce background map
The background landscape is generated from the background map.
2015-08-04 21:21:23 -04:00
Armin Burgmeier 54666aeb2d Introduce background landscape
The background landscape is a 8-bit landscape which stores the material
that a particular pixel will be replaced with when it is cleared, e.g.
by digging or blasting.

This is just the groundwork for this and does not offer much advantage
over the IFT flag that was used previously for that purpose. However,
additional features such as keeping the background material/texture
fixed when loam bridges are built, PXS are incorporated into the landscape
or the massmover is moving things around can be added.

See http://bugs.openclonk.org/view.php?id=1338 for more details.
2015-08-04 21:20:06 -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
Sven Eberhardt 90cca08d63 Add /todo message board command.
Adds text to local TODO.txt file. Useful for taking notes quickly e.g. when testing new scenarios in a network game.

TODO filenames are configurable. Default file is TODO.txt in the scenario file (if it's unpacked) and TODO.txt on the current path if access to the first location failed.
2015-03-05 16:04:07 +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 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