From 27831f72652f07a10b50c7c4e395d3a3113d32a6 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 21 Jun 2021 19:13:33 +0000 Subject: [PATCH] Fix some misc issues that noone else is likely to notice. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5911 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- build_wip.sh | 2 +- engine/client/renderer.c | 6 ------ engine/client/spritegn.h | 2 ++ engine/common/fs_stdio.c | 2 +- engine/gl/gl_alias.c | 11 ++++++++--- engine/gl/gl_model.c | 11 ++++++++++- fte.m4 | 30 +++++++++++++++--------------- 7 files changed, 37 insertions(+), 27 deletions(-) diff --git a/build_wip.sh b/build_wip.sh index 43eb267a..2c0df9ed 100755 --- a/build_wip.sh +++ b/build_wip.sh @@ -202,7 +202,7 @@ function build_fteqcc { echo "--- Engine builds ---" #the -fno-finite-math-only is to avoid a glibc dependancy if [ "$BUILD_LINUXx86" != "n" ]; then - NATIVE_PLUGINS="$PLUGINS_LINUXx86" build "Linux 32-bit" linux_x86 FTE_TARGET=linux_x86 CPUOPTIMIZATIONS=-fno-finite-math-only $TARGETS_LINUX + NATIVE_PLUGINS="$PLUGINS_LINUXx86" build "Linux 32-bit" linux_x86 FTE_TARGET=linux32 CPUOPTIMIZATIONS=-fno-finite-math-only $TARGETS_LINUX fi if [ "$BUILD_LINUXx64" != "n" ]; then NATIVE_PLUGINS="$PLUGINS_LINUXx64" build "Linux 64-bit" linux_amd64 FTE_TARGET=linux64 CPUOPTIMIZATIONS=-fno-finite-math-only $TARGETS_LINUX diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 6b894bd7..851c36f4 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -231,9 +231,6 @@ cvar_t r_menutint = CVARF ("r_menutint", "0.68 0.4 0.13", cvar_t r_netgraph = CVARD ("r_netgraph", "0", "Displays a graph of packet latency. A value of 2 will give additional info about what sort of data is being received from the server."); extern cvar_t r_lerpmuzzlehack; extern cvar_t mod_h2holey_bugged, mod_halftexel, mod_nomipmap; -#ifdef SPRMODELS -cvar_t r_sprite_backfacing = CVARD ("r_sprite_backfacing", "0", "Make oriented sprites face backwards relative to their orientation, for compat with q1."); -#endif cvar_t r_nolerp = CVARF ("r_nolerp", "0", CVAR_ARCHIVE); cvar_t r_noframegrouplerp = CVARF ("r_noframegrouplerp", "0", CVAR_ARCHIVE); cvar_t r_nolightdir = CVARF ("r_nolightdir", "0", CVAR_ARCHIVE); @@ -590,9 +587,6 @@ void GLRenderer_Init(void) Cvar_Register (&mod_h2holey_bugged, GLRENDEREROPTIONS); Cvar_Register (&mod_halftexel, GLRENDEREROPTIONS); Cvar_Register (&mod_nomipmap, GLRENDEREROPTIONS); -#endif -#ifdef SPRMODELS - Cvar_Register (&r_sprite_backfacing, GLRENDEREROPTIONS); #endif Cvar_Register (&r_lerpmuzzlehack, GLRENDEREROPTIONS); Cvar_Register (&r_noframegrouplerp, GLRENDEREROPTIONS); diff --git a/engine/client/spritegn.h b/engine/client/spritegn.h index 92e0b3db..11357d7b 100644 --- a/engine/client/spritegn.h +++ b/engine/client/spritegn.h @@ -91,6 +91,8 @@ typedef struct { #define SPRDP_LABEL_SCALE 6 #define SPRDP_OVERHEAD 7 +#define SPR_ORIENTED_BACKFACE 8 //SPR_ORIENTED except facing along its normal... + #define SPRHL_OPAQUE 0 #define SPRHL_ADDITIVE 1 #define SPRHL_INDEXALPHA 2 diff --git a/engine/common/fs_stdio.c b/engine/common/fs_stdio.c index 4affdd6c..d21f9cc0 100644 --- a/engine/common/fs_stdio.c +++ b/engine/common/fs_stdio.c @@ -2,7 +2,7 @@ #include "fs.h" #include "errno.h" -#if !defined(NACL) && !defined(FTE_TARGET_WEB) && !defined(_WIN32) +#if !defined(NACL) && !defined(FTE_TARGET_WEB) && (!defined(_WIN32) || defined(FTE_SDL)) #ifdef WEBSVONLY #define Z_Free free diff --git a/engine/gl/gl_alias.c b/engine/gl/gl_alias.c index 2756773e..8da8b126 100644 --- a/engine/gl/gl_alias.c +++ b/engine/gl/gl_alias.c @@ -40,7 +40,6 @@ typedef struct extern cvar_t gl_part_flame, r_fullbrightSkins, r_fb_models, ruleset_allow_fbmodels; extern cvar_t r_noaliasshadows; extern cvar_t r_lodscale, r_lodbias; -extern cvar_t r_sprite_backfacing; extern cvar_t gl_ati_truform; extern cvar_t r_vertexdlights; @@ -2663,8 +2662,14 @@ static void R_Sprite_GenerateTrisoup(entity_t *e, int bemode) Matrix3_Multiply(e->axis, r_refdef.playerview->vw_axis, spraxis); else memcpy(spraxis, e->axis, sizeof(spraxis)); - if (!r_sprite_backfacing.ival) - VectorNegate(spraxis[1], spraxis[1]); + break; + case SPR_ORIENTED_BACKFACE: + // bullet marks on walls, invisible to anyone in the direction that its facing... + if ((e->flags & RF_WEAPONMODEL) && r_refdef.playerview->viewentity > 0) + Matrix3_Multiply(e->axis, r_refdef.playerview->vw_axis, spraxis); + else + memcpy(spraxis, e->axis, sizeof(spraxis)); + VectorNegate(spraxis[1], spraxis[1]); break; case SPR_FACING_UPRIGHT: diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index e4671d32..12157689 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -39,6 +39,9 @@ cvar_t mod_warnmodels = CVARD("mod_warnmodels", "1", "Warn if any models fa cvar_t mod_litsprites_force = CVARD("mod_litsprites_force", "0", "If set to 1, sprites will be lit according to world lighting (including rtlights), like Tenebrae. Ideally use EF_ADDITIVE or EF_FULLBRIGHT to make emissive sprites instead."); cvar_t mod_loadmappackages = CVARD ("mod_loadmappackages", "1", "Load additional content embedded within bsp files."); cvar_t temp_lit2support = CVARD("temp_mod_lit2support", "0", "Set to 1 to enable lit2 support. This cvar will be removed once the format is finalised."); +#ifdef SPRMODELS +cvar_t r_sprite_backfacing = CVARD ("r_sprite_backfacing", "0", "Make oriented sprites face backwards relative to their orientation, for compat with q1."); +#endif #ifdef SERVERONLY cvar_t gl_overbright, gl_specular, gl_load24bit, r_replacemodels, gl_miptexLevel, r_fb_bmodels; //all of these can/should default to 0 cvar_t r_noframegrouplerp = CVARF ("r_noframegrouplerp", "0", CVAR_ARCHIVE); @@ -634,6 +637,9 @@ void Mod_Init (qboolean initial) Cmd_AddCommandD("mod_showent", Mod_ShowEnt_f, "Allows you to quickly search through a map's entities."); Cmd_AddCommand("version_modelformats", Mod_PrintFormats_f); +#ifdef SPRMODELS + Cvar_Register (&r_sprite_backfacing, NULL); +#endif #ifndef SERVERONLY Cmd_AddCommandD("mod_findcubemaps", Mod_FindCubemaps_f, "Scans the entities of a map to find reflection env_cubemap sites and determines the nearest one to each surface."); Cmd_AddCommandD("mod_realign", Mod_Realign_f, "Reads the named bsp and writes it back out with only alignment changes."); @@ -5883,10 +5889,13 @@ qboolean QDECL Mod_LoadSpriteModel (model_t *mod, void *buffer, size_t fsize) mod->meshinfo = psprite; switch(sptype) { + case SPR_ORIENTED: + if (r_sprite_backfacing.ival) + sptype = SPR_ORIENTED_BACKFACE; + break; case SPR_VP_PARALLEL_UPRIGHT: case SPR_FACING_UPRIGHT: case SPR_VP_PARALLEL: - case SPR_ORIENTED: case SPR_VP_PARALLEL_ORIENTED: // case SPRDP_LABEL: // case SPRDP_LABEL_SCALE: diff --git a/fte.m4 b/fte.m4 index 01f150de..1452eba3 100644 --- a/fte.m4 +++ b/fte.m4 @@ -35,7 +35,7 @@ define(`LINENGINE2',`{ }')dnl define(`LINENGINE',`LINENGINE2($1,$2,CAT($2_lin64.zip))')dnl define(`HIDE',)dnl -define(`GAME',`ifelse(FTE_GAME,$1,$2 +define(`GAME',`ifelse(FTE_GAME,`$1',`$2' ,)')dnl define(`TEST',`ifelse(FTE_TEST,`1',` test "1" ',` test "0" @@ -101,7 +101,7 @@ define(`LINPLUG',`{ URL(linux_amd64/fteplug_$1_amd64.so) }')dnl GAME(quake, -{ +`{ package "fteplug_ezhud" WINPLUG(ezhud) LINPLUG(ezhud) @@ -109,9 +109,9 @@ GAME(quake, replace "ezhud" desc "Some lame alternative configurable hud." TEST()dnl -})dnl +}')dnl GAME(quake, -{ +`{ package "fteplug_qi" WINPLUG(qi) LINPLUG(qi) @@ -121,10 +121,10 @@ GAME(quake, author "Spike" website "https://www.quaddicted.com/reviews/" desc "Provides a way to quickly list+install+load numerous different maps and mods. Some better than others." - desc "If you're a single-player fan then these will keep you going for quite some time." + desc "If youre a single-player fan then these will keep you going for quite some time." desc "The database used is from quaddicted.com." TEST()dnl -})dnl +}')dnl { package "fteplug_irc" WINPLUG(irc) @@ -205,7 +205,7 @@ TEST()dnl } ')dnl GAME(quake2, -{ +`{ package "q2game_baseq2" { arch "win_x86" @@ -229,9 +229,9 @@ GAME(quake2, website "https://github.com/yquake2/yquake2" desc "Quake2 Gamecode (from yamagiq2). Required for single player or servers." TEST()dnl -})dnl +}')dnl GAME(quake, -{ +`{ package "fte_csaddon" category "Plugins" title "Ingame Map Editor" @@ -239,14 +239,14 @@ GAME(quake, gamedir "fte" FILE(csaddon.dat) URL(csaddon/csaddon.dat) - desc "This is Spike's map editing user interface. It is only active while running singleplayer (or sv_cheats is enabled)." + desc "This is Spikes map editing user interface. It is only active while running singleplayer (or sv_cheats is enabled)." desc "To activate, set the ca_show cvar to 1 (suggestion: ^abind c toggle ca_show^a)." - license "GPLv2, source on fte's svn" + license "GPLv2, source on the fte svn" author "Spike" TEST()dnl -})dnl +}')dnl GAME(quake, -{ +`{ package "fte_menusys" category "AfterQuake" title "Replacement Menus" @@ -255,8 +255,8 @@ GAME(quake, FILE(menu.dat) URL(csaddon/menu.dat) desc "This provides a more modern mouse-first menu system." - license "GPLv2, source on fte's svn" + license "GPLv2, source on the fte svn" author "Spike" TEST()dnl -})dnl +}')dnl