Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quake Enhanced, Scourge of Armagon - missing texture #56

Open
mooreye opened this issue Apr 5, 2023 · 14 comments
Open

Quake Enhanced, Scourge of Armagon - missing texture #56

mooreye opened this issue Apr 5, 2023 · 14 comments

Comments

@mooreye
Copy link

mooreye commented Apr 5, 2023

When playing Quake Enhanced, Scourge of Armagon, map hip2m4 the end gate of the level has checkered/missing texture, as seen on the screenshot. My hipnotic's pak0.pak md5sum is a9e2a6e544da7f506f6b65b0661e89a9, I use GOG purchase of Quake Enhanced.

https://imgur.com/1376s0r

@sezero
Copy link
Owner

sezero commented Apr 6, 2023

Reproduced with quake enhanced update3, hipnotic pak0.pak is 79,928,584
bytes with md5sum 4dd6bf448c9c3c2615b47e2e20bedb43

Possibly a missing texture - haven't investigated. How does ironwail or
vkquake work? (CC: @andrei-drexler, @Novum)

@sezero
Copy link
Owner

sezero commented Apr 6, 2023

Same thing happens in vkquake for me

@Novum
Copy link

Novum commented Apr 7, 2023

And I assume this does not happen in the Kex Quake?

@mooreye
Copy link
Author

mooreye commented Apr 8, 2023

And I assume this does not happen in the Kex Quake?

No, it doesn't seem to happen, although it uses different texture than the retro SoA did:
https://youtu.be/VS6OwwXFIc4?t=409

@Novum
Copy link

Novum commented Apr 9, 2023

I'm getting a warning "Mod_LoadTexInfo: 12 textures missing from BSP file". Does not happen with the original hipnotic (non rerelease).

After debugging for like 5 minutes I have no idea how this works in Kex Quake: The texture lump just has invalid (-1) dataofs entries.

@mooreye
Copy link
Author

mooreye commented Jun 20, 2023

Can anything be done to fix this with an extra pak1.pak or so?

@andrey-budko
Copy link
Contributor

They probably use textures[0] for missed textures.

--- a/Quake/gl_model.c
+++ b/Quake/gl_model.c
@@ -1052,10 +1052,9 @@ static void Mod_LoadTexinfo (lump_t *l)
 		if (miptex >= loadmodel->numtextures-1 || !loadmodel->textures[miptex])
 		{
 			if (out->flags & TEX_SPECIAL)
-				out->texture = loadmodel->textures[loadmodel->numtextures-1];
+				out->texture = loadmodel->textures[0];
 			else
-				out->texture = loadmodel->textures[loadmodel->numtextures-2];
-			out->flags |= TEX_MISSING;
+				out->texture = loadmodel->textures[0];
 			missing++;
 		}
 		else
rerelease

image

patched quakespasm

image

@sezero
Copy link
Owner

sezero commented Aug 21, 2023

Huh.. Thanks @andrey-budko. Now, if we had a fool-proof way of detecting rerelease content..

@sezero
Copy link
Owner

sezero commented Aug 21, 2023

@Novum, @temx, @ericwa, @andrei-drexler: What do you think of this?

@andrey-budko
Copy link
Contributor

I think we can ask @svkaiser

@sezero
Copy link
Owner

sezero commented Aug 22, 2023

FWIW, I can make a 'detection' (cough..) of remastered content like below.
Combined with @andrey-budko suggestion, it would be like:

index c80450f..24781c3 100644
--- a/Quake/common.c
+++ b/Quake/common.c
@@ -39,6 +39,7 @@ cvar_t	cmdline = {"cmdline","",CVAR_ROM/*|CVAR_SERVERINFO*/}; /* sending cmdline
 static qboolean		com_modified;	// set true if using non-id files
 
 qboolean		fitzmode;
+qboolean		remastered = false;
 
 static void COM_Path_f (void);
 
@@ -2135,6 +2136,13 @@ _add_path:
 			search->next = com_searchpaths;
 			com_searchpaths = search;
 		}
+		if (i == 0 && path_id == 1) {
+			if (COM_FileExists("progs/b_g_key_00_00.lmp", NULL) &&
+			    file_from_pak && com_filesize == 4104) {
+				remastered = true; /* 2021 re-release content */
+				Con_Printf ("Playing remastered version.\n");
+			}
+		}
 		if (qspak) {
 			search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
 			search->path_id = path_id;
diff --git a/Quake/gl_model.c b/Quake/gl_model.c
index 46a83a9..0a9729c 100644
--- a/Quake/gl_model.c
+++ b/Quake/gl_model.c
@@ -1051,6 +1051,9 @@ static void Mod_LoadTexinfo (lump_t *l)
 		//johnfitz -- rewrote this section
 		if (miptex >= loadmodel->numtextures-1 || !loadmodel->textures[miptex])
 		{
+			if (remastered)
+				out->texture = loadmodel->textures[0];
+			else
 			if (out->flags & TEX_SPECIAL)
 				out->texture = loadmodel->textures[loadmodel->numtextures-1];
 			else
diff --git a/Quake/common.h b/Quake/common.h
index 05ff9d3..7694215 100644
--- a/Quake/common.h
+++ b/Quake/common.h
@@ -397,6 +397,7 @@ long FS_filelength (fshandle_t *fh);
 
 
 extern struct cvar_s	registered;
+extern qboolean		remastered;
 extern qboolean		standard_quake, rogue, hipnotic;
 extern qboolean		fitzmode;
 	/* if true, run in fitzquake mode disabling custom quakespasm hacks */

@andrey-budko
Copy link
Contributor

andrey-budko commented Aug 22, 2023

no lightmap with TEX_MISSING flag

a

@sezero
Copy link
Owner

sezero commented Aug 22, 2023

no lightmap with TEX_MISSING flag

Well, I wasn't expecting any solutions to this thing at all to begin with.

I'm still not sure that your patch whether your patch can cause any
serious side effects either. Ie.: no lightmap would be the least of
issues with replacement textures, no?

@andrey-budko
Copy link
Contributor

Just in case you didn't notice. I'm not sure about my patch too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants