Sven Eberhardt
81ba07cc48
reproduce lights assertion in C4Application constructor
2015-02-17 21:03:50 +01:00
Sven Eberhardt
33b49e21aa
Implement loading of serialized light sections.
2015-02-17 21:02:37 +01:00
Sven Eberhardt
68eb45732e
Log all relevant data for reproduction on tri.fanRY > tri.fanLY assertion.
...
Just compiling the logged light section and calling CalculateTriangles on it should be used to reproduce the assertion.
2015-02-17 01:31:10 +01:00
Nicolas Hake
9bfd232ab5
Test whether GLDEBUGPROCARB's userParam is const or not
...
Depending on how current your headers are, the userParam parameter to
GLDEBUGPROCARB may be const, or it may not. The ARB has added the const
qualifier at some point after publishing the specs. Hooray for breaking
API changes.
2015-02-16 21:21:31 +01:00
Nicolas Hake
feb9513666
GL: Use GLAPIENTRY instead of APIENTRY
...
They're the same on Windows, but Linux doesn't have APIENTRY at all.
2015-02-16 18:48:35 +01:00
Nicolas Hake
4db690b0c6
Add copyright header to files that were missing it
2015-02-16 18:40:52 +01:00
Nicolas Hake
04df02c9df
Win: Don't write a text crash dump if the log is already closed
...
Assertion failures or crashes during process shutdown must not write to
the log file if it is already closed, or the debugging CRT will raise
another assertion.
2015-02-16 18:14:29 +01:00
Nicolas Hake
c809ab4ae3
gl: Use glDeleteTextures instead of glDeleteObject to delete textures
...
glDeleteObject doesn't delete textures, it deletes shader objects.
2015-02-16 18:07:03 +01:00
Nicolas Hake
50a81a8dc7
gl: Don't call glDeleteObjectARB on null objects
...
glDeleteObjectARB will flag GL_INVALID_PARAMETER when it's called with a
null parameter. Avoid this so the error list doesn't get tainted.
2015-02-16 17:45:17 +01:00
Nicolas Hake
cac94659d0
wGL: Allow OpenGL debugging
...
This introduces a new command line parameter "--debug-opengl", which
will create special debug OpenGL contexts and attach a callback that the
driver will invoke when it detects a problem. The callback will then
write the error message to the logfile, and break into the debugger if
one is attached.
Currently only works on Windows.
2015-02-16 17:45:10 +01:00
Nicolas Hake
00a24846cc
GL: cast gluErrorString rv to const char* before handing to StdStrBuf
2015-02-16 17:44:20 +01:00
Nicolas Hake
eed1c43b8a
GL: Correctly encode error strings
...
gluErrorString returns latin-1 encoded strings. Our code expects to
receive UTF-8 encoded strings everywhere, so make sure that the strings
are converted before passing them on.
2015-02-16 15:39:05 +01:00
Nicolas Hake
a70433b6a7
Skip drawing line objects with less than two vertices ( #1263 )
...
A line object must have at least two points to plot a line through. At
any vertex count less than that, we were accessing invalid memory by
dereferencing the first element of an empty vector (VtxNum==1), or
issuing an OOB read from the vertex data (VtxNum==0).
2015-02-15 14:23:44 +01:00
Sven Eberhardt
a7ecc86dc4
Hide normal maps from landscape drawing texture list in editor. ( #1255 )
2015-02-14 23:45:16 +01:00
Nicolas Hake
2b332f5a74
Adapt mape to C4Group changes
2015-02-13 20:22:41 +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
ff263e5433
Fix potential buffer overflow in ssprintf
...
If vsnprintf fails for other reasons than too small a buffer, it returns
a negative value. Comparing that with a size_t value promotes the
negative value to unsigned, which makes for a very large result, almost
guaranteed to be larger than the buffer size.
2015-02-12 23:55:38 +01:00
Nicolas Hake
95641b5fb0
Add a dummy declaration to ssprintf
...
G++ doesn't allow attributes on function definitions for reasons. Add a
declaration immediately before the definition so it works.
2015-02-12 23:14:16 +01:00
Nicolas Hake
e21a5bdd44
Rename BoundBy to Clamp
...
"BoundBy" sounds like a predicate. "Clamp" is a common function name for
the operation in graphics processing, so it should be familiar to users.
2015-02-12 23:05:55 +01:00
Nicolas Hake
35e7ca509b
Replace NoPointer struct with template parameter deduction
...
We're trying to ensure that no caller passes a char* to ssprintf, but a
char array instead. This is way easier done by using template parameter
deduction than a specialized class template.
2015-02-12 22:25:36 +01:00
Nicolas Hake
ea354218bb
Remove unused private field StdMeshMaterialShader::Type
...
We'll keep the parameter just in case we'll ever need the info.
2015-02-11 20:48:18 +01:00
Nicolas Hake
2d1e4caabc
Remove a superfluous endianness test
...
We're not supporting BE systems, and even when we did, I'm not sure this
test could ever have done something.
2015-02-11 20:41:35 +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
Nicolas Hake
1a1cecadd4
Update license texts
...
Some files, most notably ObjC and test cases, hadn't been updated to use
the new license header. Fix this.
2015-02-08 15:05:11 +01:00
Sven Eberhardt
cd3b969fc4
Silence a few warnings in render and SolidMask code.
2015-02-08 12:37:00 +01:00
Sven Eberhardt
4e65dccb1f
Fix memory leak on CID_Animation_BaseInfo mesh chunk type.
...
Detected by a -Wunused warning.
2015-02-08 12:35:45 +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
Sven Eberhardt
91fdb82720
Remove dupliocate sound loading.
2015-02-07 14:01:15 +01:00
Sven Eberhardt
c94814f374
Fix signed/unsigned comparison warning.
2015-02-07 14:01:14 +01:00
Nicolas Hake
e2a8f6d303
Reorder some declarations and initializations to avoid order mismatch
...
While none of the mismatches were having a side-effect, this silences a
number of -Wreorder warnings which were drowning out potentially
important diagnostics.
2015-02-04 22:12:42 +01:00
Martin Plicht
2ca9a77cc4
mac: Do #include guessing dance until compile success
2015-02-04 21:52:04 +01:00
Sven Eberhardt
a237caa467
Save config to disk at round end ( #1260 )
...
This should ensure that MissionAccess gained in this round is always saved even if a crash happens during scenario shutdown or in a following round.
2015-02-03 22:49:55 +01:00
Sven Eberhardt
c714e5e3b2
Fix full map screenshots ( #1220 ).
...
Fixed upperboard, borders when screenshotting while at the side of the map and issues when multiple viewports were open.
2015-02-03 01:00:16 +01:00
Sven Eberhardt
7b8ffd79a4
Make Lava/DuroLava emit ambient light as a material property. ( #1205 )
2015-01-28 22:35:14 +01:00
Sven Eberhardt
e717dd0dab
Fix MSVC build.
2015-01-26 18:46:41 +01:00
Günther Brammer
4f9bc068ad
Merge #include cleanup and SDL-mainloop fix
2015-01-25 20:47:50 +01:00
Günther Brammer
36ce941e4d
cmake: Restore SDL-Mainloop build
2015-01-25 19:05:06 +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
Sven Eberhardt
b00ff573cd
Fix leaked light and some possible dead pointers on game end and section switch.
2015-01-25 18:39:34 +01:00
Sven Eberhardt
1c4444d5fc
Fix memory leaks on definitions without or with invalid bitmap graphics.
2015-01-25 18:24:27 +01:00
Sven Eberhardt
8f866cceee
Fix assertion on landscape changes outside landscape rectangle ( #1232 )
2015-01-25 18:23:43 +01:00
Sven Eberhardt
089b4794a8
Fix a few warnings in Win64 build.
2015-01-25 16:43:51 +01:00
Sven Eberhardt
e1a09298d4
Fix a few harmless warnings.
2015-01-25 16:16:06 +01:00