9front - general discussion about 9front
 help / color / mirror / Atom feed
* games/doom: fix switch textures swapping in ultimate doom
@ 2015-07-29 16:05 qux
  0 siblings, 0 replies; only message in thread
From: qux @ 2015-07-29 16:05 UTC (permalink / raw)
  To: 9front

games/doom: fix switch textures swapping in ultimate doom

gamemode is set according to the name of the main wad (cf. d_main.c), i.e.:
- doom1.wad: (shareware doom1, ep1 only) gamemode == shareware
- doom.wad: (registered doom1, ep1-3) gamemode == registered
- doomu.wad: (ultimate doom, ep1-4) gamemode == retail
- doom2.wad, plutonia.wad, tnt.wad: gamemode == commercial
most doom.wad's distributed online are, in fact, ultimate doom.
if your ultimate doom wad is correctly named doomu.wad, some switches in
episodes 2-4 won't swap their texture when toggled, because
p_switch.c:P_InitSwitchList() is only checking for registered doom1.

easy way to test: demo2 in either registered or ultimate doom: the player flips
a switch right at the beginning of the demo; if the main wad is called
doomu.wad, the switch won't change its texture.
% games/doom -playdemo demo2
if you rename the wad to doom.wad or alter d_main.c:IdentifyVersion, the switch
will swap its texture like it should.


diff -r aa2b4dca05f1 sys/src/games/doom/p_switch.c
--- a/sys/src/games/doom/p_switch.c	Wed Jul 29 14:51:00 2015 +0200
+++ b/sys/src/games/doom/p_switch.c	Wed Jul 29 17:32:41 2015 +0300
@@ -112,7 +112,7 @@
 	
     episode = 1;

-    if (gamemode == registered)
+    if (gamemode == registered || gamemode == retail)
 	episode = 2;
     else
 	if ( gamemode == commercial )


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-29 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 16:05 games/doom: fix switch textures swapping in ultimate doom qux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).