mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
client: Add gametype variable
`gametype` variable could be used for show menu for different embeded mod type. Remaster has all ctf/rogue/xatrix maps in baseq2 directory and menu could not detected by game variable anymore.
This commit is contained in:
parent
d907b8bb57
commit
a3d450ff64
6 changed files with 54 additions and 17 deletions
21
README.md
21
README.md
|
@ -31,16 +31,16 @@ Monsters:
|
|||
|
||||
Models support:
|
||||
|
||||
| Format | Original Game | Comments |
|
||||
| ------ | --------------- | ------------------------------------------------- |
|
||||
| mdl | Quake 1 | could be issues with textures |
|
||||
| md2 | Quake 2 | full support |
|
||||
| md2 | Anachronox | incorrect normals, does no suport tagged surfaces |
|
||||
| fm | Heretic 2 | show all meshes, |
|
||||
| dkm | Daikatana DKM1 | unchecked with game |
|
||||
| dkm | Daikatana DKM2 | unchecked with game, incorrect normals |
|
||||
| md3 | Quake 3 | show all meshes, no tags support, unchecked, slow |
|
||||
| md5 | Doom 3/Quake 4 | requires md2 for skins, show all meshes, slow |
|
||||
| Format | Original Game | Frame vertex | Comments |
|
||||
| ------ | --------------- | ------------ | ------------------------------------------------- |
|
||||
| mdl | Quake 1 | 8 bit | could be issues with textures |
|
||||
| md2 | Quake 2 | 8 bit | full support |
|
||||
| md2 | Anachronox | 8/10/16 bit | incorrect normals, does no suport tagged surfaces |
|
||||
| fm | Heretic 2 | 8 bit | show all meshes, |
|
||||
| dkm | Daikatana DKM1 | 8 bit | unchecked with game |
|
||||
| dkm | Daikatana DKM2 | 10 bit | unchecked with game, incorrect normals |
|
||||
| md3 | Quake 3 | 16 bit | show all meshes, no tags support, unchecked, slow |
|
||||
| md5 | Doom 3/Quake 4 | float | requires md2 for skins, show all meshes, slow |
|
||||
|
||||
All models support only single texture for all meshes and only up to 255 frames.
|
||||
|
||||
|
@ -80,6 +80,7 @@ Bonus goals:
|
|||
* Use separete texture hi-color buffer for ui in soft render,
|
||||
* Convert map surface flag by game type,
|
||||
* Cleanup function declarations in game save code,
|
||||
* Use 3 bytes vertex normal,
|
||||
* Support scalled textures for models and walls in soft render and fix
|
||||
lighting with remastered maps.
|
||||
|
||||
|
|
|
@ -247,6 +247,10 @@ Set `0` by default.
|
|||
spawned in maps (in fact, some official Ground Zero maps contain
|
||||
these entities). This cvar is set to 0 by default.
|
||||
|
||||
* **game**: current game value, mod name and directory.
|
||||
|
||||
* **gametype**: replace menu to different mod type without change mod name in game variable.
|
||||
|
||||
* **nextdemo**: Defines the next command to run after maps from the
|
||||
`nextserver` list. By default this is set to the empty string.
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ CL_AddPacketEntities(frame_t *frame)
|
|||
unsigned int effects, renderfx;
|
||||
|
||||
/* To distinguish baseq2, xatrix and rogue. */
|
||||
cvar_t *game = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
cvar_t *gametype = Cvar_Get("gametype", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
|
||||
/* bonus items rotate at a fixed rate */
|
||||
autorotate = anglemod(cl.time * 0.1f);
|
||||
|
@ -314,7 +314,7 @@ CL_AddPacketEntities(frame_t *frame)
|
|||
something special */
|
||||
if (renderfx & RF_SHELL_HALF_DAM)
|
||||
{
|
||||
if (strcmp(game->string, "rogue") == 0)
|
||||
if (strcmp(gametype->string, "rogue") == 0)
|
||||
{
|
||||
/* ditch the half damage shell if any of red, blue, or double are on */
|
||||
if (renderfx & (RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE))
|
||||
|
@ -326,7 +326,7 @@ CL_AddPacketEntities(frame_t *frame)
|
|||
|
||||
if (renderfx & RF_SHELL_DOUBLE)
|
||||
{
|
||||
if (strcmp(game->string, "rogue") == 0)
|
||||
if (strcmp(gametype->string, "rogue") == 0)
|
||||
{
|
||||
/* lose the yellow shell if we have a red, blue, or green shell */
|
||||
if (renderfx & (RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_GREEN))
|
||||
|
|
|
@ -889,6 +889,7 @@ CL_ParseServerData(void)
|
|||
(!*str && (fs_gamedirvar->string && !*fs_gamedirvar->string)))
|
||||
{
|
||||
Cvar_Set("game", str);
|
||||
Cvar_Set("gametype", str);
|
||||
}
|
||||
|
||||
/* parse player entity number */
|
||||
|
|
|
@ -90,10 +90,26 @@ int m_menudepth;
|
|||
static qboolean
|
||||
M_IsGame(const char *gamename)
|
||||
{
|
||||
cvar_t *game = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
cvar_t *game, *gametype;
|
||||
const char* current_game;
|
||||
|
||||
if (strcmp(game->string, gamename) == 0
|
||||
|| (strcmp(gamename, BASEDIRNAME) == 0 && strcmp(game->string, "") == 0))
|
||||
game = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
gametype = Cvar_Get("gametype", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
|
||||
current_game = gametype->string;
|
||||
|
||||
/* copy game to gametype */
|
||||
if (strcmp(game->string, gametype->string) && (
|
||||
!strcmp(game->string, "ctf") ||
|
||||
!strcmp(game->string, "rogue")
|
||||
))
|
||||
{
|
||||
Cvar_Set("gametype", game->string);
|
||||
current_game = game->string;
|
||||
}
|
||||
|
||||
if (strcmp(current_game, gamename) == 0
|
||||
|| (strcmp(gamename, BASEDIRNAME) == 0 && strcmp(current_game, "") == 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -3118,6 +3134,13 @@ ModsApplyActionFunc(void *unused)
|
|||
// called via command buffer so that any running server has time to shutdown
|
||||
Cbuf_AddText(va("game %s\n", modnames[s_mods_list.curvalue]));
|
||||
|
||||
/* replace game type only if game changed to ctf/rogue */
|
||||
if (!strcmp("ctf", modnames[s_mods_list.curvalue]) ||
|
||||
!strcmp("rogue", modnames[s_mods_list.curvalue]))
|
||||
{
|
||||
Cbuf_AddText(va("gametype %s\n", modnames[s_mods_list.curvalue]));
|
||||
}
|
||||
|
||||
// start the demo cycle in the new game directory
|
||||
menu_startdemoloop = true;
|
||||
|
||||
|
|
|
@ -335,12 +335,20 @@ Qcommon_Init(int argc, char **argv)
|
|||
|
||||
// remember the initial game name that might have been set on commandline
|
||||
{
|
||||
cvar_t* gameCvar = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
cvar_t* gameCvar, *gametypeCvar;
|
||||
const char* game = "";
|
||||
|
||||
gameCvar = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
gametypeCvar = Cvar_Get("gametype", "", CVAR_LATCH | CVAR_SERVERINFO);
|
||||
|
||||
if(gameCvar->string && gameCvar->string[0])
|
||||
{
|
||||
game = gameCvar->string;
|
||||
if (strcmp(gametypeCvar->string, gameCvar->string))
|
||||
{
|
||||
/* Set gametype if game is provided */
|
||||
Cvar_Set("gametype", gameCvar->string);
|
||||
}
|
||||
}
|
||||
|
||||
Q_strlcpy(userGivenGame, game, sizeof(userGivenGame));
|
||||
|
|
Loading…
Reference in a new issue