• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得windowscocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

This is a fork of Zandronum for Mac Os (M1 and Intel)


Commit MetaInfo

Revisionaa63bfb48d843a1371a2cd8ca8c2b84bd589ed21 (tree)
Time2006-07-20 14:13:39
AuthorRandy Heit <rheit@zdoo...>
CommiterRandy Heit

Log Message

- Added some simple translucency map analysis for BOOM maps to more

intelligently pick the value to use for TranslucentLine's second argument.

- Added a queryiwad_key cvar to control which key can force the IWAD selection

to appear. It can be either "shift" or "control". Any other value will
disable its functionality.

- Fixed: A_SkullPop() and A_FreezeDeathChunks() did not transfer the player's

inventory to the new dismembered head "player".

SVN r268 (trunk)

Change Summary

Incremental Difference

diff -r aa9391c63915 -r aa63bfb48d84 docs/rh-log.txt
--- a/docs/rh-log.txt Wed Jul 19 16:00:44 2006 +0000
+++ b/docs/rh-log.txt Thu Jul 20 05:13:39 2006 +0000
@@ -1,3 +1,12 @@
1+July 19, 2006
2+- Added some simple translucency map analysis for BOOM maps to more
3+ intelligently pick the value to use for TranslucentLine's second argument.
4+- Added a queryiwad_key cvar to control which key can force the IWAD selection
5+ to appear. It can be either "shift" or "control". Any other value will
6+ disable its functionality.
7+- Fixed: A_SkullPop() and A_FreezeDeathChunks() did not transfer the player's
8+ inventory to the new dismembered head "player".
9+
110 July 18, 2006
211 - Fixed: C_midPrint() needs a NULL status bar check.
312
diff -r aa9391c63915 -r aa63bfb48d84 src/g_heretic/a_hereticplayer.cpp
--- a/src/g_heretic/a_hereticplayer.cpp Wed Jul 19 16:00:44 2006 +0000
+++ b/src/g_heretic/a_hereticplayer.cpp Thu Jul 20 05:13:39 2006 +0000
@@ -212,6 +212,7 @@
212212 // Attach player mobj to bloody skull
213213 player = actor->player;
214214 actor->player = NULL;
215+ mo->ObtainInventory (actor);
215216 mo->player = player;
216217 mo->health = actor->health;
217218 mo->angle = actor->angle;
diff -r aa9391c63915 -r aa63bfb48d84 src/g_shared/a_action.cpp
--- a/src/g_shared/a_action.cpp Wed Jul 19 16:00:44 2006 +0000
+++ b/src/g_shared/a_action.cpp Thu Jul 20 05:13:39 2006 +0000
@@ -284,6 +284,7 @@
284284 head->momy = pr_freeze.Random2 () << (FRACBITS-7);
285285 head->player = actor->player;
286286 actor->player = NULL;
287+ head->ObtainInventory (actor);
287288 head->health = actor->health;
288289 head->angle = actor->angle;
289290 head->player->mo = head;
diff -r aa9391c63915 -r aa63bfb48d84 src/p_setup.cpp
--- a/src/p_setup.cpp Wed Jul 19 16:00:44 2006 +0000
+++ b/src/p_setup.cpp Thu Jul 20 05:13:39 2006 +0000
@@ -120,6 +120,7 @@
120120 struct
121121 {
122122 short tag, special;
123+ short alpha;
123124 DWORD map;
124125 } a;
125126
@@ -1715,12 +1716,18 @@
17151716 switch (ld->special)
17161717 { // killough 4/11/98: handle special types
17171718 int j;
1719+ int alpha;
17181720
17191721 case TranslucentLine: // killough 4/11/98: translucent 2s textures
17201722 // [RH] Second arg controls how opaque it is.
1723+ alpha = sidetemp[ld->sidenum[0]].a.alpha;
1724+ if (alpha < 0)
1725+ {
1726+ alpha = ld->args[1];
1727+ }
17211728 if (!ld->args[0])
17221729 {
1723- ld->alpha = (byte)ld->args[1];
1730+ ld->alpha = (BYTE)alpha;
17241731 if (ld->args[2] == 1)
17251732 {
17261733 sides[ld->sidenum[0]].Flags |= WALLF_ADDTRANS;
@@ -1736,7 +1743,7 @@
17361743 {
17371744 if (lines[j].id == ld->args[0])
17381745 {
1739- lines[j].alpha = (byte)ld->args[1];
1746+ lines[j].alpha = (BYTE)alpha;
17401747 if (lines[j].args[2] == 1)
17411748 {
17421749 sides[lines[j].sidenum[0]].Flags |= WALLF_ADDTRANS;
@@ -1930,6 +1937,7 @@
19301937 for (i = 0; i < count; i++)
19311938 {
19321939 sidetemp[i].a.special = sidetemp[i].a.tag = 0;
1940+ sidetemp[i].a.alpha = -1;
19331941 sidetemp[i].a.map = NO_SIDE;
19341942 }
19351943 if (count < numsides)
@@ -2075,6 +2083,28 @@
20752083 sidetemp = NULL;
20762084 }
20772085
2086+int P_DetermineTranslucency (int lumpnum)
2087+{
2088+ FWadLump tranmap = Wads.OpenLumpNum (lumpnum);
2089+ BYTE index;
2090+ PalEntry newcolor;
2091+
2092+ tranmap.Seek (GPalette.BlackIndex * 256 + GPalette.WhiteIndex, SEEK_SET);
2093+ tranmap.Read (&index, 1);
2094+
2095+ newcolor = GPalette.BaseColors[GPalette.Remap[index]];
2096+
2097+ if (developer)
2098+ {
2099+ char lumpname[9];
2100+ lumpname[8] = 0;
2101+ Wads.GetLumpName (lumpname, lumpnum);
2102+ Printf ("%s appears to be translucency %d (%d%%)\n", lumpname, newcolor.r,
2103+ newcolor.r*100/255);
2104+ }
2105+ return newcolor.r;
2106+}
2107+
20782108 // killough 4/4/98: delay using texture names until
20792109 // after linedefs are loaded, to allow overloading.
20802110 // killough 5/3/98: reformatted, cleaned up
@@ -2171,8 +2201,37 @@
21712201 }
21722202 break;
21732203
2174-/*
2175- case TranslucentLine: // killough 4/11/98: apply translucency to 2s normal texture
2204+ case TranslucentLine: // killough 4/11/98: apply translucency to 2s normal texture
2205+ if (!map->HasBehavior)
2206+ {
2207+ int lumpnum;
2208+
2209+ if (strnicmp ("TRANMAP", msd->midtexture, 8) == 0)
2210+ {
2211+ // The translator set the alpha argument already; no reason to do it again.
2212+ sd->midtexture = 0;
2213+ }
2214+ else if ((lumpnum = Wads.CheckNumForName (msd->midtexture)) > 0 &&
2215+ Wads.LumpLength (lumpnum) == 65536)
2216+ {
2217+ sidetemp[i].a.alpha = P_DetermineTranslucency (lumpnum);
2218+ sd->midtexture = 0;
2219+ }
2220+ else
2221+ {
2222+ strncpy (name, msd->midtexture, 8);
2223+ sd->midtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
2224+ }
2225+
2226+ strncpy (name, msd->toptexture, 8);
2227+ sd->toptexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
2228+
2229+ strncpy (name, msd->bottomtexture, 8);
2230+ sd->bottomtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
2231+ break;
2232+ }
2233+ // Fallthrough for Hexen maps is intentional
2234+#if 0
21762235 sd->midtexture = strncasecmp("TRANMAP", msd->midtexture, 8) ?
21772236 (sd->special = W_CheckNumForName(msd->midtexture)) < 0 ||
21782237 W_LumpLength(sd->special) != 65536 ?
@@ -2180,8 +2239,8 @@
21802239 (sd->special++, 0) : (sd->special=0);
21812240 sd->toptexture = R_TextureNumForName(msd->toptexture);
21822241 sd->bottomtexture = R_TextureNumForName(msd->bottomtexture);
2183- break;
2184-*/
2242+#endif
2243+
21852244 default: // normal cases
21862245 strncpy (name, msd->midtexture, 8);
21872246 sd->midtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
diff -r aa9391c63915 -r aa63bfb48d84 src/v_palette.cpp
--- a/src/v_palette.cpp Wed Jul 19 16:00:44 2006 +0000
+++ b/src/v_palette.cpp Thu Jul 20 05:13:39 2006 +0000
@@ -148,6 +148,12 @@
148148 BaseColors[i] = PalEntry (colors[0], colors[1], colors[2]);
149149 Remap[i] = i;
150150 }
151+
152+ // Find white and black from the original palette so that they can be
153+ // used to make an educated guess of the translucency % for a BOOM
154+ // translucency map.
155+ WhiteIndex = BestColor ((DWORD *)BaseColors, 255, 255, 255);
156+ BlackIndex = BestColor ((DWORD *)BaseColors, 0, 0, 0);
151157 }
152158
153159 // In ZDoom's new texture system, color 0 is used as the transparent color.
diff -r aa9391c63915 -r aa63bfb48d84 src/v_palette.h
--- a/src/v_palette.h Wed Jul 19 16:00:44 2006 +0000
+++ b/src/v_palette.h Thu Jul 20 05:13:39 2006 +0000
@@ -54,10 +54,12 @@
5454
5555 void MakeGoodRemap ();
5656
57- //PalEntry Colors[256]; // gamma corrected palette
5857 PalEntry BaseColors[256]; // non-gamma corrected palette
5958 BYTE Remap[256]; // remap original palette indices to in-game indices
6059
60+ BYTE WhiteIndex; // white in original palette index
61+ BYTE BlackIndex; // black in original palette index
62+
6163 // Given an array of colors, fills in remap with values to remap the
6264 // passed array of colors to this palette.
6365 void MakeRemap (const DWORD *colors, BYTE *remap, const BYTE *useful, int numcolors) const;
diff -r aa9391c63915 -r aa63bfb48d84 src/win32/i_system.cpp
--- a/src/win32/i_system.cpp Wed Jul 19 16:00:44 2006 +0000
+++ b/src/win32/i_system.cpp Thu Jul 20 05:13:39 2006 +0000
@@ -616,6 +616,7 @@
616616 }
617617
618618 EXTERN_CVAR (Bool, queryiwad);
619+CVAR (String, queryiwad_key, "shift", CVAR_GLOBALCONFIG|CVAR_ARCHIVE);
619620 static WadStuff *WadList;
620621 static int NumWads;
621622 static int DefaultWad;
@@ -698,7 +699,21 @@
698699
699700 int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
700701 {
701- if (showwin || GetAsyncKeyState(VK_SHIFT))
702+ int vkey;
703+
704+ if (stricmp (queryiwad_key, "shift") == 0)
705+ {
706+ vkey = VK_SHIFT;
707+ }
708+ else if (stricmp (queryiwad_key, "control") == 0 || stricmp (queryiwad_key, "ctrl") == 0)
709+ {
710+ vkey = VK_CONTROL;
711+ }
712+ else
713+ {
714+ vkey = 0;
715+ }
716+ if (showwin || (vkey != 0 && GetAsyncKeyState(vkey)))
702717 {
703718 WadList = wads;
704719 NumWads = numwads;