Commit graph

24 commits

Author SHA1 Message Date
Kp 1101b02f84 Use std::span for PlayMovie argument subtitles 2022-10-02 19:51:35 +00:00
Kp ad7057be87 Add hack for case mismatch in Vertigo robot movies
PhysFS 3 is case-sensitive for movie filename lookup.  The consequence
of this was first reported in [1].  In [2], @icculus stated this was a
bug in PhysFS 3 that would be fixed in PhysFS 3.0.2.  However, [3] and
[4] assert that the fix was never included.  The existence of [5] seems
to support this.  The original problem was reported in 2019.  As of
2022, user @AlumiuN, running PhysFS 3.0.2, is affected.  Therefore, this
commit adds code to detect the relevant robot movies and adjust the case
in the Rebirth code.

[1]: https://github.com/dxx-rebirth/dxx-rebirth/issues/379
[2]: https://github.com/dxx-rebirth/dxx-rebirth/issues/379#issuecomment-389400528
[3]: https://github.com/dxx-rebirth/dxx-rebirth/issues/379#issuecomment-462083489
[4]: https://github.com/dxx-rebirth/dxx-rebirth/issues/379#issuecomment-477790175
[5]: https://github.com/dxx-rebirth/dxx-rebirth/issues/644
2022-09-24 17:47:52 +00:00
Kp 9fa97573c4 Move RoboFile to briefing scope 2022-09-24 17:47:52 +00:00
Kp 51219d3607 Use enum class for PlayMovie flag must_have 2022-07-23 20:58:10 +00:00
Kp e973dc0c4c Move small briefing members earlier in the structure 2021-09-19 10:53:48 +00:00
Kp c26fd86450 Keep builtin movies loaded until the end of main
Commit d0d7545ec1 ("Unload robot movies on exit") intended to shorten
the lifetime of the loaded data, but failed to save the unique_ptr, so
the lifetime was shortened more than intended.  Save the unique_ptr so
that the movies remain loaded.

Also, add a [[nodiscard]] annotation so that the compiler can warn if
this mistake is repeated.

Reported-by: Q3BFG10K <https://github.com/dxx-rebirth/dxx-rebirth/issues/599>
Fixes: d0d7545ec1 ("Unload robot movies on exit")
2021-07-25 23:00:56 +00:00
Kp d0d7545ec1 Unload robot movies on exit 2021-06-28 03:37:49 +00:00
Kp a682d2bacb Simplify movie_play_status
Callers only ever test for whether the movie was skipped, and never
distinguish between a movie that ran to completion versus a movie that
the user interrupted.  Combine these two statuses into one value, and
eliminate the logic in RunMovie that picked which of the two to return.
2021-01-17 22:23:23 +00:00
Kp 6f7b0b4743 Use enum class for PlayMovie result 2021-01-17 22:23:23 +00:00
Kp 62b58e9890 Move OGL to dxxsconf.h; rename to DXX_USE_OGL
Rename symbol OGL to DXX_USE_OGL to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -lzw OGL -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGL/\1 DXX_USE_OGL/' -e 's/\(\s*#\s*if\)ndef OGL/\1 !DXX_USE_OGL/' -e 's/\(\s*#\s*if !\?\)defined(OGL)/\1DXX_USE_OGL/'
2016-09-24 18:06:11 +00:00
Kp 0ece005dfa Use screen_mode for screen resolution 2015-05-14 02:23:13 +00:00
Kp fca381727c Add wrappers for screen width/height 2015-03-22 18:49:21 +00:00
Kp 73b0a016a8 Fix loading robots-?.mvl
Rework movie loading to fix loading built-in robot movies.  The previous
code always ignored loading the last entry in the movie array, which was
blank until 18f6919b33.  The last entry
was unused after d38a3d1362, so it was
removed, which caused the code to skip the robots entry.

Commit d38a3d1362 broke unloading add-on
movies by removing the strcpy which saved their name.  Add code to save
the name to extra_robot_movie_mission and call it when switching
missions.

Reported by btb: https://github.com/dxx-rebirth/dxx-rebirth/pull/17
2014-12-06 17:56:56 +00:00
Kp fb1704780b Move pMovie into local data structures 2014-10-29 03:01:18 +00:00
Kp fea751bc62 Use std::string for mission path 2014-08-24 17:45:30 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 9de54cfa74 Switch to C++ linkage
import fileinput
guard = 0
cxxguard = '#ifdef __cplusplus\n'
for line in fileinput.input(inplace=True):
	if line == cxxguard:
		guard = 1
		continue
	if guard:
		if line == 'extern "C" {\n':
			guard = 2
			continue
		if line == '}\n':
			guard = 0
			continue
		if guard == 2:
			assert(line == '#endif\n')
			guard = 0
			print cxxguard,
			continue
	print line,
2013-12-06 03:35:32 +00:00
Kp bbb9214e0e Invert sense of hires/lowres options 2013-11-24 22:57:36 +00:00
Kp 4469ff36c0 Manage movie subtitles automatically 2013-11-09 17:45:21 +00:00
Kp 18f6919b33 Mark movie data const 2013-11-02 04:28:10 +00:00
Kp 06c83c9393 Move similar/main/gamecntl.c -> similar/main/gamecntl.cpp 2013-10-05 21:35:58 +00:00
Kp c58c4e4d06 Move declarations to headers 2013-10-03 03:11:52 +00:00
Kp aa9127e3c1 Enable -Wwrite-strings 2013-09-15 21:34:03 +00:00
Kp 7cda97cc74 Move d2x-rebirth source into subdirectory d2x-rebirth 2013-02-19 00:34:46 +00:00
Renamed from main/movie.h (Browse further)