Merge branch 'Saturn-Next' into Saturn-Testing

This commit is contained in:
Alug committed 2025-07-15 18:57:23 +02:00
commit bb9118ee32
26 files changed
+800 -805

No files matched your search

+1 -1
View File
@@ -2031,7 +2031,7 @@ static void CL_ReloadReceivedSavegame(void)
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
{
camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y);
camera[i].subsector = R_PointInSubsectorFast(camera[i].x, camera[i].y);
}
cl_redownloadinggamestate = false;
+13 -13
View File
@@ -446,19 +446,19 @@ extern UINT16 spacetimetics;
extern UINT16 extralifetics;
// SRB2kart
extern tic_t introtime;
extern tic_t starttime;
extern tic_t raceexittime;
extern tic_t battleexittime;
extern INT32 hyudorotime;
extern INT32 stealtime;
extern INT32 sneakertime;
extern INT32 itemtime;
extern INT32 comebacktime;
extern INT32 bumptime;
extern INT32 wipeoutslowtime;
extern INT32 wantedreduce;
extern INT32 wantedfrequency;
extern const tic_t introtime;
extern const tic_t starttime;
extern const tic_t raceexittime;
extern const tic_t battleexittime;
extern const INT32 hyudorotime;
extern const INT32 stealtime;
extern const INT32 sneakertime;
extern const INT32 itemtime;
extern const INT32 comebacktime;
extern const INT32 bumptime;
extern const INT32 wipeoutslowtime;
extern const INT32 wantedreduce;
extern const INT32 wantedfrequency;
extern UINT8 introtoplay;
extern UINT8 creditscutscene;
+13 -13
View File
@@ -196,19 +196,19 @@ UINT16 spacetimetics = 11*TICRATE + (TICRATE/2);
UINT16 extralifetics = 4*TICRATE;
// SRB2kart
tic_t introtime = 108+5; // plus 5 for white fade
tic_t starttime = 6*TICRATE + (3*TICRATE/4);
tic_t raceexittime = 5*TICRATE + (2*TICRATE/3);
tic_t battleexittime = 8*TICRATE;
INT32 hyudorotime = 7*TICRATE;
INT32 stealtime = TICRATE/2;
INT32 sneakertime = TICRATE + (TICRATE/3);
INT32 itemtime = 8*TICRATE;
INT32 comebacktime = 10*TICRATE;
INT32 bumptime = 6;
INT32 wipeoutslowtime = 20;
INT32 wantedreduce = 5*TICRATE;
INT32 wantedfrequency = 10*TICRATE;
const tic_t introtime = 108+5; // plus 5 for white fade
const tic_t starttime = 6*TICRATE + (3*TICRATE/4);
const tic_t raceexittime = 5*TICRATE + (2*TICRATE/3);
const tic_t battleexittime = 8*TICRATE;
const INT32 hyudorotime = 7*TICRATE;
const INT32 stealtime = TICRATE/2;
const INT32 sneakertime = TICRATE + (TICRATE/3);
const INT32 itemtime = 8*TICRATE;
const INT32 comebacktime = 10*TICRATE;
const INT32 bumptime = 6;
const INT32 wipeoutslowtime = 20;
const INT32 wantedreduce = 5*TICRATE;
const INT32 wantedfrequency = 10*TICRATE;
INT32 gameovertics = 15*TICRATE;
+47 -44
View File
@@ -3316,7 +3316,7 @@ static gl_vissprite_t *HWR_NewVisSprite(void)
// Finds a floor through which light does not pass.
static fixed_t HWR_OpaqueFloorAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
{
const sector_t *sec = R_PointInSubsector(x, y)->sector;
const sector_t *sec = R_PointInSubsectorFast(x, y)->sector;
fixed_t floorz = sec->floorheight;
if (sec->ffloors)
@@ -3734,6 +3734,9 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
}
if (cv_playerfade.value && spr->mobj->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
if (HWR_UseShader())
{
shader = SHADER_SPRITE;
@@ -4020,6 +4023,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
}
if (cv_playerfade.value && spr->mobj->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
if (HWR_UseShader())
{
shader = SHADER_SPRITE;
@@ -4452,6 +4458,15 @@ static void HWR_RenderDrawNodes(void)
// --------------------------------------------------------------------------
// Draw all vissprites
// --------------------------------------------------------------------------
namespace
{
enum class DrawSpritesType
{
kSprites,
kModels,
};
template <DrawSpritesType Type>
static void HWR_DrawSprites(void)
{
UINT32 i;
@@ -4466,56 +4481,44 @@ static void HWR_DrawSprites(void)
continue;
}
HWR_DrawSprite(spr);
}
}
static void HWR_DrawModels(void)
{
UINT32 i;
for (i = 0; i < gl_visspritecount; i++)
{
gl_vissprite_t *spr = gl_vsprorder[i];
if (spr->precip)
if constexpr (Type == DrawSpritesType::kModels)
{
HWR_DrawPrecipitationSprite(spr);
continue;
}
if (!spr->mobj)
continue;
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{
md2_t *md2;
if (spr->mobj->localskin)
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{
if (spr->mobj->skinlocal)
md2 = &md2_localplayermodels[(skin_t *)spr->mobj->localskin - localskins];
md2_t *md2;
if (spr->mobj->localskin)
{
if (spr->mobj->skinlocal)
md2 = &md2_localplayermodels[(skin_t *)spr->mobj->localskin - localskins];
else
md2 = &md2_playermodels [(skin_t *)spr->mobj->localskin - skins];
}
else
md2 = &md2_playermodels [(skin_t *)spr->mobj->localskin - skins];
md2 = &md2_playermodels[(skin_t *)spr->mobj->skin - skins];
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
if (((md2->notfound || md2->scale < 0.0f) && ((!cv_glfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
}
else
md2 = &md2_playermodels[(skin_t *)spr->mobj->skin - skins];
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
if (((md2->notfound || md2->scale < 0.0f) && ((!cv_glfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
{
if (md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
}
}
else
if constexpr (Type == DrawSpritesType::kSprites)
{
if (md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
HWR_DrawSprite(spr);
}
}
}
}
// --------------------------------------------------------------------------
// HWR_AddSprites
@@ -5565,10 +5568,10 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_
HWR_SortVisSprites();
PS_STOP_TIMING(ps_hw_spritesorttime);
PS_START_TIMING(ps_hw_spritedrawtime);
if (LIKELY(!cv_glmdls.value))
HWR_DrawSprites();
if (UNLIKELY(cv_glmdls.value))
HWR_DrawSprites<DrawSpritesType::kModels>();
else
HWR_DrawModels();
HWR_DrawSprites<DrawSpritesType::kSprites>();
PS_STOP_TIMING(ps_hw_spritedrawtime);
ps_numdrawnodes.value.i = 0;
+6 -1
View File
@@ -1227,6 +1227,9 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
}
if (cv_playerfade.value && spr->mobj->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
// dont forget to enabled the depth test because we can't do this like
// before: polygons models are not sorted
@@ -1241,7 +1244,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
else
{
md2s = md2_playermodels;
skinnum = (skin_t *)spr->mobj->localskin - skins;
skinnum = (skin_t *)spr->mobj->localskin - skins;
}
}
else
@@ -1266,6 +1269,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
if (md2->error)
return; // we already failed loading this before :(
if (!md2->model)
{
CONS_Debug(DBG_RENDER, "Loading model... (%s, %s)", sprnames[spr->mobj->sprite], md2->filename);
@@ -1284,6 +1288,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
return;
}
}
//Hurdler: arf, I don't like that implementation at all... too much crappy
gpatch = md2->glpatch;
if (gpatch)
+1 -1
View File
@@ -132,7 +132,7 @@ void HWR_PortalFrame(gl_portal_t* portal)
{
portalclipline = NULL;
portalcullsector = NULL;
viewsector = R_PointInSubsector(viewx, viewy)->sector;
viewsector = R_PointInSubsectorFast(viewx, viewy)->sector;
}
}
+1 -1
View File
@@ -4628,7 +4628,7 @@ static void K_CalculateBananaSlope(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z
//sec = R_PointInSubsector(x, y)->sector;
if (mobj->x != x || mobj->y != y || mobj->subsector == NULL)
sec = R_PointInSubsector(x, y)->sector;
sec = R_PointInSubsectorFast(x, y)->sector;
else
sec = mobj->subsector->sector;
+174 -115
View File
@@ -107,7 +107,7 @@
#define SMALLLINEHEIGHT 8
#define SLIDER_RANGE 10
#define SLIDER_WIDTH (8*SLIDER_RANGE+6)
#define SERVERS_PER_PAGE 11
#define SERVERS_PER_PAGE 10
#define MAXSTAT 9 //Max number a stat can have
typedef enum
@@ -183,6 +183,8 @@ static char joystickInfo[8][29];
static UINT32 serverlistpage;
static UINT32 oldserverlistpage;
static float serverlistslidex;
static INT32 serverlistsearched[MAXSERVERLIST] = {0};
static UINT32 serverlistsearchedcount = 0;
#endif
//static saveinfo_t savegameinfo[MAXSAVEGAMES]; // Extra info about the save games.
@@ -211,6 +213,8 @@ static void M_StopMessage(INT32 choice);
#ifndef NONET
static void M_HandleServerPage(INT32 choice);
static void M_HandleServerSearch(INT32 choice);
static void M_SearchServerList(void);
#endif
// Prototyping is fun, innit?
@@ -1110,11 +1114,11 @@ static menuitem_t MP_PlayerSetupMenu[] =
#ifndef NONET
static menuitem_t MP_ConnectMenu[] =
{
{IT_STRING | IT_CVAR, NULL, "Sort By", &cv_serversort, 4},
{IT_STRING | IT_KEYHANDLER, NULL, "Page", M_HandleServerPage, 12},
{IT_STRING | IT_CALL, NULL, "Refresh", M_Refresh, 20},
{IT_STRING | IT_KEYHANDLER, NULL, "", M_HandleServerSearch,0},
{IT_STRING | IT_CVAR, NULL, "Sort By", &cv_serversort, 16},
{IT_STRING | IT_KEYHANDLER, NULL, "Page", M_HandleServerPage, 24},
{IT_STRING | IT_CALL, NULL, "Refresh", M_Refresh, 32},
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 36},
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 48},
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 60},
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 72},
@@ -1129,6 +1133,7 @@ static menuitem_t MP_ConnectMenu[] =
enum
{
mp_connect_search,
mp_connect_sort,
mp_connect_page,
mp_connect_refresh,
@@ -1522,6 +1527,7 @@ enum
//op_exp_dirlight,
op_exp_skybox,
op_exp_accuratefps,
op_exp_votescrn,
#ifdef HWRENDER
op_exp_glscrtx,
#ifdef USE_FBO_OGL
@@ -2736,7 +2742,7 @@ menu_t MISC_AddonsDef =
50, 28,
0,
NULL,
{NULL}
NULL
};
menu_t MISC_ReplayHutDef =
@@ -2749,7 +2755,7 @@ menu_t MISC_ReplayHutDef =
30, 80,
0,
M_QuitReplayHut,
{NULL}
NULL
};
menu_t MISC_ReplayOptionsDef =
@@ -2762,7 +2768,7 @@ menu_t MISC_ReplayOptionsDef =
27, 40,
0,
NULL,
{NULL}
NULL
};
menu_t MISC_ReplayStartDef =
@@ -2775,7 +2781,7 @@ menu_t MISC_ReplayStartDef =
30, 90,
0,
NULL,
{NULL}
NULL
};
menu_t PlaybackMenuDef = {
@@ -2788,12 +2794,12 @@ menu_t PlaybackMenuDef = {
BASEVIDWIDTH/2 - 88, 2,
0,
NULL,
{NULL}
NULL
};
menu_t MAPauseDef = PAUSEMENUSTYLE(MAPauseMenu, 40, 72);
menu_t SPauseDef = PAUSEMENUSTYLE(SPauseMenu, 40, 72);
menu_t MPauseDef = PAUSEMENUSTYLE(MPauseMenu, 40, 72);
menu_t SPauseDef = PAUSEMENUSTYLE(SPauseMenu, 40, 72);
menu_t MPauseDef = PAUSEMENUSTYLE(MPauseMenu, 40, 72);
#ifdef HAVE_DISCORDRPC
menu_t MISC_DiscordRequestsDef = {
@@ -2805,16 +2811,16 @@ menu_t MISC_DiscordRequestsDef = {
0, 0,
0,
NULL,
{NULL}
NULL
};
#endif
// Misc Main Menu
menu_t MISC_ScrambleTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ScrambleTeamMenu, &MPauseDef, 27, 40);
menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseDef, 27, 40);
menu_t MISC_ChangeSpectateDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeSpectateMenu, &MPauseDef, 27, 40);
menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef);
menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
menu_t MISC_ScrambleTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ScrambleTeamMenu, &MPauseDef, 27, 40, NULL);
menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseDef, 27, 40, NULL);
menu_t MISC_ChangeSpectateDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeSpectateMenu, &MPauseDef, 27, 40, NULL);
menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef);
menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
//
// M_GetGametypeColor
@@ -2901,7 +2907,7 @@ menu_t SR_PandoraDef =
60, 40,
0,
M_ExitPandorasBox,
{NULL}
NULL
};
menu_t SR_MainDef = CENTERMENUSTYLE(NULL, SR_MainMenu, &MainDef, 72);
@@ -2917,7 +2923,7 @@ menu_t SR_UnlockChecklistDef =
280, 185,
0,
NULL,
{NULL}
NULL
};
menu_t SR_MusicTestDef =
@@ -2930,7 +2936,7 @@ menu_t SR_MusicTestDef =
60, 150,
0,
NULL,
{NULL}
NULL
};
menu_t SR_EmblemHintDef =
@@ -2943,7 +2949,7 @@ menu_t SR_EmblemHintDef =
60, 150,
0,
NULL,
{NULL}
NULL
};
// Single Player
@@ -2959,7 +2965,7 @@ menu_t SP_LevelStatsDef =
280, 185,
0,
NULL,
{NULL}
NULL
};
static menu_t SP_TimeAttackDef =
@@ -2972,7 +2978,7 @@ static menu_t SP_TimeAttackDef =
34, 40,
0,
M_QuitTimeAttackMenu,
{NULL}
NULL
};
static menu_t SP_ReplayDef =
{
@@ -2984,7 +2990,7 @@ static menu_t SP_ReplayDef =
34, 40,
0,
NULL,
{NULL}
NULL
};
static menu_t SP_GuestReplayDef =
{
@@ -2996,7 +3002,7 @@ static menu_t SP_GuestReplayDef =
34, 40,
0,
NULL,
{NULL}
NULL
};
static menu_t SP_GhostDef =
{
@@ -3008,7 +3014,7 @@ static menu_t SP_GhostDef =
34, 40,
0,
NULL,
{NULL}
NULL
};
// Multiplayer
@@ -3026,7 +3032,7 @@ menu_t MP_MainDef =
#else
NULL,
#endif
{NULL}
NULL
};
menu_t MP_OfflineServerDef = MAPICONMENUSTYLE("M_MULTI", MP_OfflineServerMenu, &MP_MainDef);
@@ -3044,7 +3050,7 @@ menu_t MP_ConnectDef =
27,24,
0,
M_CancelConnect,
{NULL}
NULL
};
#endif
menu_t MP_PlayerSetupDef =
@@ -3057,7 +3063,7 @@ menu_t MP_PlayerSetupDef =
36, 14,
0,
M_QuitMultiPlayerMenu,
{NULL}
NULL
};
// Options
@@ -3071,18 +3077,18 @@ menu_t OP_MainDef =
60, 25,
0,
NULL,
{NULL}
NULL
};
menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30);
menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30, OP_ControlsTooltips);
//WTF
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_ControlsDef, 60, 30);
menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef);
menu_t OP_Joystick1Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 30, 36);
menu_t OP_Joystick2Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 30, 36);
menu_t OP_Joystick3Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 30, 36);
menu_t OP_Joystick4Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 30, 36);
menu_t OP_JoystickSetDef =
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_ControlsDef, 60, 30, OP_MouseTooltips);
menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef);
menu_t OP_Joystick1Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 30, 36, NULL);
menu_t OP_Joystick2Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 30, 36, NULL);
menu_t OP_Joystick3Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 30, 36, NULL);
menu_t OP_Joystick4Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 30, 36, NULL);
menu_t OP_JoystickSetDef =
{
"M_CONTRO",
sizeof (OP_JoystickSetMenu)/sizeof (menuitem_t),
@@ -3092,7 +3098,7 @@ menu_t OP_JoystickSetDef =
50, 40,
0,
NULL,
{NULL}
NULL
};
menu_t OP_VideoOptionsDef =
@@ -3105,7 +3111,7 @@ menu_t OP_VideoOptionsDef =
30, 15,
0,
NULL,
{NULL}
OP_VideoTooltips
};
menu_t OP_VideoModeDef =
@@ -3118,7 +3124,7 @@ menu_t OP_VideoModeDef =
48, 26,
0,
NULL,
{NULL}
NULL
};
menu_t OP_ColorOptionsDef =
@@ -3131,7 +3137,7 @@ menu_t OP_ColorOptionsDef =
30, 30,
0,
NULL,
{NULL}
NULL
};
menu_t OP_SoundOptionsDef =
@@ -3144,7 +3150,7 @@ menu_t OP_SoundOptionsDef =
30, 20,
0,
NULL,
{NULL}
OP_SoundTooltips
};
@@ -3158,25 +3164,25 @@ menu_t OP_HUDOptionsDef =
30, 20,
0,
NULL,
{NULL}
NULL
};
menu_t OP_CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_CamOptionsMenu, &OP_MainDef, 30, 30);
menu_t OP_Player1CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player1CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
menu_t OP_Player2CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player2CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
menu_t OP_Player3CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player3CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
menu_t OP_Player4CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player4CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
menu_t OP_CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_CamOptionsMenu, &OP_MainDef, 30, 30, OP_CamOptionsTooltips);
menu_t OP_Player1CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player1CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
menu_t OP_Player2CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player2CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
menu_t OP_Player3CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player3CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
menu_t OP_Player4CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player4CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
menu_t OP_ChatOptionsDef = DEFAULTMENUSTYLE("M_HUD", OP_ChatOptionsMenu, &OP_HUDOptionsDef, 30, 30);
menu_t OP_ChatOptionsDef = DEFAULTMENUSTYLE("M_HUD", OP_ChatOptionsMenu, &OP_HUDOptionsDef, 30, 30, OP_ChatOptionsTooltips);
menu_t OP_SoundAdvancedDef = DEFAULTSCROLLSTYLE("M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30);
menu_t OP_SoundAdvancedDef = DEFAULTSCROLLSTYLE("M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30, OP_SoundAdvancedTooltips);
menu_t OP_FocusOptionsDef = DEFAULTMENUSTYLE(NULL, OP_FocusOptionsMenu, &OP_MainDef, 17, 30);
menu_t OP_FocusOptionsDef = DEFAULTMENUSTYLE(NULL, OP_FocusOptionsMenu, &OP_MainDef, 17, 30, OP_FocusOptionsTooltips);
menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 20);
menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 24, 20);
menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 20, OP_GameTooltips);
menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 24, 20, OP_ServerOptionsTooltips);
#ifndef NONET
menu_t OP_AdvServerOptionsDef = DEFAULTSCROLLSTYLE("M_SERVER", OP_AdvServerOptionsMenu, &OP_ServerOptionsDef, 24, 30);
menu_t OP_AdvServerOptionsDef = DEFAULTSCROLLSTYLE("M_SERVER", OP_AdvServerOptionsMenu, &OP_ServerOptionsDef, 24, 30, OP_AdvServerOptionsTooltips);
#endif
//menu_t OP_NetgameOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_NetgameOptionsMenu, &OP_ServerOptionsDef, 30, 30);
@@ -3192,38 +3198,38 @@ menu_t OP_MonitorToggleDef =
47, 30,
0,
NULL,
{NULL}
NULL
};
#ifdef HWRENDER
menu_t OP_OpenGLOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30);
menu_t OP_OpenGLOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30, OP_OpenGLTooltips);
#endif
menu_t OP_ExpOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_ExpOptionsMenu, &OP_VideoOptionsDef, 30, 25);
menu_t OP_ExpOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_ExpOptionsMenu, &OP_VideoOptionsDef, 30, 25, OP_ExpTooltips);
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30);
menu_t OP_ScreenshotOptionsDef = DEFAULTSCROLLSTYLE("M_SCSHOT", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30);
menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30);
menu_t OP_ProtocolDef = DEFAULTMENUSTYLE(NULL, OP_ProtocolMenu, &OP_DataOptionsDef, 30, 30);
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30, NULL);
menu_t OP_ScreenshotOptionsDef = DEFAULTSCROLLSTYLE("M_SCSHOT", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30, NULL);
menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30, NULL);
menu_t OP_ProtocolDef = DEFAULTMENUSTYLE(NULL, OP_ProtocolMenu, &OP_DataOptionsDef, 30, 30, NULL);
#ifdef HAVE_DISCORDRPC
menu_t OP_DiscordOptionsDef = DEFAULTMENUSTYLE(NULL, OP_DiscordOptionsMenu, &OP_DataOptionsDef, 30, 30);
menu_t OP_DiscordOptionsDef = DEFAULTMENUSTYLE(NULL, OP_DiscordOptionsMenu, &OP_DataOptionsDef, 30, 30, NULL);
#endif
menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 30, 30);
menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 30, 30, NULL);
menu_t OP_SaturnDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnMenu, &OP_MainDef, 30, 30);
menu_t OP_PlayerDistortDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_PlayerDistortMenu, &OP_SaturnDef, 30, 30);
menu_t OP_HudOffsetDef = DEFAULTSCROLLSTYLE(NULL, OP_HudOffsetMenu, &OP_SaturnHudDef, 30, 30);
menu_t OP_SaturnHudDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnHudMenu, &OP_SaturnDef, 30, 30);
menu_t OP_SaturnDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnMenu, &OP_MainDef, 30, 30, OP_SaturnTooltips);
menu_t OP_SaturnCreditsDef = DEFAULTMENUSTYLE(NULL, OP_SaturnCreditsMenu, &OP_SaturnDef, 30, 0, NULL); // OP_CreditTooltips no space :c
menu_t OP_SaturnCreditsDef = DEFAULTMENUSTYLE(NULL, OP_SaturnCreditsMenu, &OP_SaturnDef, 30, 0);
menu_t OP_SaturnHudDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnHudMenu, &OP_SaturnDef, 30, 30, OP_SaturnHudTooltips);
menu_t OP_PlayerDistortDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_PlayerDistortMenu, &OP_SaturnDef, 30, 30, OP_PlayerDistortTooltips);
menu_t OP_HudOffsetDef = DEFAULTSCROLLSTYLE(NULL, OP_HudOffsetMenu, &OP_SaturnHudDef, 30, 30, NULL);
menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30);
menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30, OP_BirdTooltips);
menu_t OP_NametagDef = DEFAULTMENUSTYLE(NULL, OP_NametagMenu, &OP_SaturnHudDef, 30, 40);
menu_t OP_DriftGaugeDef = DEFAULTMENUSTYLE(NULL, OP_DriftGaugeMenu, &OP_SaturnHudDef, 30, 40);
menu_t OP_NametagDef = DEFAULTMENUSTYLE(NULL, OP_NametagMenu, &OP_SaturnHudDef, 30, 40, OP_NametagTooltips);
menu_t OP_DriftGaugeDef = DEFAULTMENUSTYLE(NULL, OP_DriftGaugeMenu, &OP_SaturnHudDef, 30, 40, OP_DriftGaugeTooltips);
menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60);
menu_t OP_AdvancedBirdDef = DEFAULTMENUSTYLE(NULL, OP_AdvancedBirdMenu, &OP_BirdDef, 30, 60);
menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60, OP_TiltTooltips);
menu_t OP_AdvancedBirdDef = DEFAULTMENUSTYLE(NULL, OP_AdvancedBirdMenu, &OP_BirdDef, 30, 60, OP_AdvancedBirdTooltips);
INT16 ccvarposition = 0;
@@ -3240,7 +3246,7 @@ static void M_CustomCvarMenu(INT32 choice)
/*menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLMENUSTYLE(
MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ADDONS),
"M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 30, 30);*/
menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLSTYLE("M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 10, 30);
menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLSTYLE("M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 10, 30, NULL);
menu_t OP_ForkedBirdDef = {
NULL,
@@ -3251,10 +3257,10 @@ menu_t OP_ForkedBirdDef = {
30, 6,
0,
NULL,
{NULL}
NULL
};
menu_t OP_LocalSkinDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_ForkedBirdDef, 30, 60);
menu_t OP_LocalSkinDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_ForkedBirdDef, 30, 60, NULL);
// ==========================================================================
@@ -4875,6 +4881,9 @@ void M_Init(void)
//todo put this somewhere better...
CV_RegisterVar(&cv_allcaps);
memset(menu_text_input_buf, 0, sizeof menu_text_input_buf);
M_TextInputInit(&menuinput, menu_text_input_buf, sizeof menu_text_input_buf);
}
void M_InitCharacterTables(void)
@@ -5191,6 +5200,16 @@ static void M_DrawSplitText(INT32 x, INT32 y, INT32 option, const char* str, INT
free(clines);
}
static void M_DoToolTips(menu_t* menu)
{
if (!menu->tooltips || itemOn == -1 || !menu->tooltips[itemOn])
return;
M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, menu->tooltips[itemOn], coolalphatimer);
if ((coolalphatimer > 0) && interpTimerHackAllow)
coolalphatimer--;
}
static void M_DrawGenericMenu(void)
{
@@ -5337,23 +5356,7 @@ static void M_DrawGenericMenu(void)
// dumb hack
// tooltips
// replaced with macro so it doesent look as terrible anymore lol
DoToolTips(OP_ControlsDef, OP_ControlsTooltips);
DoToolTips(OP_MouseOptionsDef, OP_MouseTooltips);
DoToolTips(OP_VideoOptionsDef, OP_VideoTooltips);
DoToolTips(OP_SoundOptionsDef, OP_SoundTooltips);
DoToolTips(OP_FocusOptionsDef, OP_FocusOptionsTooltips);
DoToolTips(OP_ChatOptionsDef, OP_ChatOptionsTooltips);
DoToolTips(OP_GameOptionsDef, OP_GameTooltips);
DoToolTips(OP_ServerOptionsDef, OP_ServerOptionsTooltips);
//DoToolTips(OP_SaturnCreditsDef, OP_CreditTooltips); // C:
DoToolTips(OP_BirdDef, OP_BirdTooltips);
DoToolTips(OP_TiltDef, OP_TiltTooltips);
DoToolTips(OP_AdvancedBirdDef, OP_AdvancedBirdTooltips);
DoToolTips(OP_NametagDef, OP_NametagTooltips);
DoToolTips(OP_DriftGaugeDef, OP_DriftGaugeTooltips);
DoToolTips(OP_CamOptionsDef, OP_CamOptionsTooltips);
DoToolTips(OP_Player1CamOptionsDef || currentMenu == &OP_Player2CamOptionsDef || currentMenu == &OP_Player3CamOptionsDef || currentMenu == &OP_Player4CamOptionsDef, OP_PlayerCamOptionsTooltips); // god this one is still terrible lmao
M_DoToolTips(currentMenu);
}
static void M_DrawGenericBackgroundMenu(void)
@@ -5484,16 +5487,7 @@ static void M_DrawGenericScrollMenu(void)
// dumb hack
// tooltips
// same macro here
DoToolTips(OP_ExpOptionsDef, OP_ExpTooltips);
#ifdef HWRENDER
DoToolTips(OP_OpenGLOptionsDef, OP_OpenGLTooltips);
#endif
DoToolTips(OP_SaturnDef, OP_SaturnTooltips);
DoToolTips(OP_SaturnHudDef, OP_SaturnHudTooltips);
DoToolTips(OP_AdvServerOptionsDef, OP_AdvServerOptionsTooltips);
DoToolTips(OP_SoundAdvancedDef, OP_SoundAdvancedTooltips);
DoToolTips(OP_PlayerDistortDef, OP_PlayerDistortTooltips);
M_DoToolTips(currentMenu);
}
static void M_DrawPauseMenu(void)
@@ -5808,7 +5802,7 @@ menu_t MessageDef =
0, 0, // x, y (TO HACK)
0, // lastOn, flags (TO HACK)
NULL,
{0},
NULL,
};
@@ -9632,7 +9626,7 @@ Fetch_servers_thread (int *id)
}
#endif/*MASTERSERVER*/
#define SERVERHEADERHEIGHT 36
#define SERVERHEADERHEIGHT 48
#define SERVERLINEHEIGHT 12
#define S_LINEY(n) currentMenu->y + SERVERHEADERHEIGHT + (n * SERVERLINEHEIGHT)
@@ -9640,6 +9634,57 @@ Fetch_servers_thread (int *id)
#ifndef NONET
static UINT32 localservercount;
static void M_SearchServerList(void)
{
char servername[MAXSERVERNAME+1] = {0};
serverlistsearchedcount = 0;
for (UINT32 i = 0; i < serverlistcount; ++i)
{
StripColors(servername, serverlist[i].info.servername, MAXSERVERNAME);
if (menuinput.length == 0 || strcasestr(servername, menuinput.buffer) != NULL)
serverlistsearched[serverlistsearchedcount++] = i;
}
if (menuinput.length > 0)
serverlistpage = 0;
}
static void M_HandleServerSearch(INT32 choice)
{
boolean exitmenu = false; // exit to previous menu
switch (choice)
{
case KEY_DOWNARROW:
M_NextOpt();
S_StartSound(NULL, sfx_menu1);
break;
case KEY_UPARROW:
M_PrevOpt();
S_StartSound(NULL, sfx_menu1);
break;
case KEY_ESCAPE:
exitmenu = true;
break;
default:
if (M_TextInputHandle(&menuinput, choice))
{
S_StartSound(NULL, sfx_menu1);
M_SearchServerList();
}
break;
}
if (exitmenu)
{
if (currentMenu->prevMenu)
M_SetupNextMenu(currentMenu->prevMenu);
else
M_ClearMenus(true);
}
}
static void M_HandleServerPage(INT32 choice)
{
boolean exitmenu = false; // exit to previous menu
@@ -9662,7 +9707,7 @@ static void M_HandleServerPage(INT32 choice)
case KEY_ENTER:
case KEY_RIGHTARROW:
S_StartSound(NULL, sfx_menu1);
if ((serverlistpage + 1) * SERVERS_PER_PAGE < serverlistcount)
if ((serverlistpage + 1) * SERVERS_PER_PAGE < serverlistsearchedcount)
{
oldserverlistpage = serverlistpage++;
serverlistslidex = BASEVIDWIDTH;
@@ -9693,7 +9738,7 @@ static void M_Connect(INT32 choice)
{
// do not call menuexitfunc
M_ClearMenus(false);
COM_BufAddText(va("connect node %d\n", serverlist[choice-FIRSTSERVERLINE + serverlistpage * SERVERS_PER_PAGE].node));
COM_BufAddText(va("connect node %d\n", serverlist[serverlistsearched[choice-FIRSTSERVERLINE + serverlistpage * SERVERS_PER_PAGE]].node));
}
static void M_Refresh(INT32 choice)
@@ -9751,11 +9796,11 @@ static void M_DrawServerCountAndHorizontalBar(void)
radius = V_StringWidth(text, 0) / 2;
V_DrawCenteredString(center, currentMenu->y+28, 0, text);
V_DrawCenteredString(center, currentMenu->y+40, 0, text);
// Horizontal line!
V_DrawFill(1, currentMenu->y+32, center - radius - 2, 1, 0);
V_DrawFill(center + radius + 2, currentMenu->y+32, BASEVIDWIDTH - 1, 1, 0);
V_DrawFill(1, currentMenu->y+44, center - radius - 2, 1, 0);
V_DrawFill(center + radius + 2, currentMenu->y+44, BASEVIDWIDTH - 1, 1, 0);
}
#endif
@@ -9765,9 +9810,9 @@ static void M_DrawServerLines(INT32 x, INT32 page)
const char *gt = "Unknown";
const char *spd = "";
for (i = 0; i < min(serverlistcount - page * SERVERS_PER_PAGE, SERVERS_PER_PAGE); i++)
for (i = 0; i < min(serverlistsearchedcount - page * SERVERS_PER_PAGE, SERVERS_PER_PAGE); i++)
{
INT32 slindex = i + page * SERVERS_PER_PAGE;
INT32 slindex = serverlistsearched[i + page * SERVERS_PER_PAGE];
UINT32 globalflags = ((serverlist[slindex].info.numberofplayer >= serverlist[slindex].info.maxplayer) ? V_TRANSLUCENT : 0)
|((itemOn == FIRSTSERVERLINE+i) ? highlightflags : 0)|V_ALLOWLOWERCASE;
@@ -9806,7 +9851,7 @@ static void M_DrawServerLines(INT32 x, INT32 page)
static void M_DrawConnectMenu(void)
{
UINT16 i;
INT32 numPages = (serverlistcount+(SERVERS_PER_PAGE-1))/SERVERS_PER_PAGE;
INT32 numPages = (serverlistsearchedcount+(SERVERS_PER_PAGE-1))/SERVERS_PER_PAGE;
INT32 mservflags = V_ALLOWLOWERCASE;
for (i = FIRSTSERVERLINE; i < min(localservercount, SERVERS_PER_PAGE)+FIRSTSERVERLINE; i++)
@@ -9856,6 +9901,16 @@ static void M_DrawConnectMenu(void)
M_DrawServerLines(currentMenu->x, serverlistpage);
}
V_DrawFill(currentMenu->x, currentMenu->y, MAXSTRINGLENGTH*8+6, 8+6, 239);
const INT32 xoff = 3, yoff = 3;
if (itemOn != 0)
V_DrawString(currentMenu->x+xoff, currentMenu->y+yoff, V_ALLOWLOWERCASE, menuinput.buffer);
else
M_DrawTextInput(currentMenu->x+xoff, currentMenu->y+yoff, &menuinput, 0);
localservercount = serverlistcount;
M_DrawGenericMenu();
@@ -9935,6 +9990,7 @@ void M_SortServerList(void)
qs22j(serverlist, serverlistcount, sizeof(serverelem_t), ServerListEntryComparator_gametype);
break;
}
M_SearchServerList();
#endif
}
@@ -9993,6 +10049,9 @@ static void M_ConnectMenu(INT32 choice)
CL_UpdateServerList();
// Reset
M_TextInputSetString(&menuinput, "");
M_SetupNextMenu(&MP_ConnectDef);
itemOn = 0;
+17 -28
View File
@@ -212,14 +212,14 @@ extern menuitem_t PlayerMenu[MAXSKINS];
typedef struct menu_s
{
const char *menutitlepic;
INT16 numitems; // # of menu items
struct menu_s *prevMenu; // previous menu
menuitem_t *menuitems; // menu items
void (*drawroutine)(void); // draw routine
INT16 x, y; // x, y of menu
INT16 lastOn; // last item user was on in menu
boolean (*quitroutine)(void); // called before quit a menu return true if we can
const char* tooltips[MAXTOOLTIPS]; // tooltips! give me that info bitch
INT16 numitems; // # of menu items
struct menu_s *prevMenu; // previous menu
menuitem_t *menuitems; // menu items
void (*drawroutine)(void); // draw routine
INT16 x, y; // x, y of menu
INT16 lastOn; // last item user was on in menu
boolean (*quitroutine)(void); // called before quit a menu return true if we can
const char* *tooltips; // tooltips! give me that info bitch
} menu_t;
void M_SetupNextMenu(menu_t *menudef);
@@ -335,7 +335,7 @@ void M_PopupMasterServerConnectError(void);
void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name);
// These defines make it a little easier to make menus
#define DEFAULTMENUSTYLE(header, source, prev, x, y)\
#define DEFAULTMENUSTYLE(header, source, prev, x, y, tooltip)\
{\
header,\
sizeof(source)/sizeof(menuitem_t),\
@@ -345,10 +345,10 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
x, y,\
0,\
NULL,\
{NULL}\
tooltip\
}
#define DEFAULTSCROLLSTYLE(header, source, prev, x, y)\
#define DEFAULTSCROLLSTYLE(header, source, prev, x, y, tooltip)\
{\
header,\
sizeof(source)/sizeof(menuitem_t),\
@@ -358,7 +358,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
x, y,\
0,\
NULL,\
{NULL}\
tooltip\
}
@@ -372,7 +372,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
x, y,\
0,\
NULL,\
{NULL}\
NULL\
}
#define CENTERMENUSTYLE(header, source, prev, y)\
@@ -385,7 +385,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
BASEVIDWIDTH/2, y,\
0,\
NULL,\
{NULL}\
NULL\
}
#define MAPICONMENUSTYLE(header, source, prev)\
@@ -398,7 +398,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
24,40,\
0,\
NULL,\
{NULL}\
NULL\
}
#define CONTROLMENUSTYLE(source, prev)\
@@ -411,7 +411,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
26, 40,\
0,\
NULL,\
{NULL}\
NULL\
}
#define IMAGEDEF(source)\
@@ -424,18 +424,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
0, 0,\
0,\
NULL,\
{NULL}\
}
#define DoToolTips(menu, tooltip)\
if (currentMenu == &menu)\
{\
if (!(tooltip[itemOn] == NULL))\
{\
M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, tooltip[itemOn], coolalphatimer);\
if (coolalphatimer > 0 && interpTimerHackAllow)\
coolalphatimer--;\
}\
NULL\
}
#ifdef __cplusplus
+15
View File
@@ -1828,6 +1828,21 @@ void CopyCaretColors(char *p, const char *s, int n)
strncpy(p, s, n);
}
void StripColors(char *dst, char *src, size_t n)
{
size_t j = 0;
for (size_t i = 0; j < n && src[i] != 0; ++i)
{
char c = src[i];
if ((c & 0x80) == 0)
dst[j++] = c;
}
dst[j] = 0;
}
/** Token parser for TEXTURES, ANIMDEFS, and potentially other lumps later down the line.
* Was originally R_GetTexturesToken when I was coding up the TEXTURES parser, until I realized I needed it for ANIMDEFS too.
* Parses up to the next whitespace character or comma. When finding the start of the next token, whitespace is skipped.
+3
View File
@@ -87,6 +87,9 @@ INT32 axtoi(const char *hexStg);
void CopyCaretColors(char *p, const char *s, int n);
// Remove color codes from string
void StripColors(char *dst, char *src, size_t n);
const char *GetRevisionString(void);
// Vector/matrix math
+2 -2
View File
@@ -1995,7 +1995,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
tmbbox[BOXLEFT] = x - thiscam->radius;
if (thiscam->x != x || thiscam->y != y || thiscam->subsector == NULL)
newsubsec = R_PointInSubsector(x, y);
newsubsec = R_PointInSubsectorFast(x, y);
else
newsubsec = thiscam->subsector;
@@ -2181,7 +2181,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
return false;
if (thiscam->x != x || thiscam->y != y || thiscam->subsector == NULL)
s = R_PointInSubsector(x, y);
s = R_PointInSubsectorFast(x, y);
else
s = thiscam->subsector;
+1 -1
View File
@@ -908,7 +908,7 @@ void P_SetUnderlayPosition(mobj_t *thing)
void P_SetPrecipitationThingPosition(precipmobj_t *thing)
{
thing->subsector = R_PointInSubsector(thing->x, thing->y);
thing->subsector = R_PointInSubsectorFast(thing->x, thing->y);
// NOTE: this works because bnext/bprev are at the same
// offsets in precipmobj_t and mobj_t
+4 -4
View File
@@ -755,7 +755,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix
testy += y;
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector))
if (R_PointInSubsectorFast(testx, testy)->sector == (boundsec ? boundsec : sector))
return P_GetSlopeZAt(slope, testx, testy);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
@@ -835,7 +835,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
testy += y;
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector))
if (R_PointInSubsectorFast(testx, testy)->sector == (boundsec ? boundsec : sector))
return P_GetSlopeZAt(slope, testx, testy);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
@@ -3289,7 +3289,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
}
}
thiscam->subsector = R_PointInSubsector(thiscam->x, thiscam->y);
thiscam->subsector = R_PointInSubsectorFast(thiscam->x, thiscam->y);
thiscam->floorz = tmfloorz;
thiscam->ceilingz = tmceilingz;
@@ -10371,7 +10371,7 @@ void P_PrecipitationEffects(void)
for (y = yl; y <= yh; y += RADIUSSTEP)
for (x = xl; x <= xh; x += RADIUSSTEP)
{
if (R_PointInSubsector((fixed_t)x, (fixed_t)y)->sector->ceilingpic != skyflatnum) // Found the outdoors!
if (R_PointInSubsectorFast((fixed_t)x, (fixed_t)y)->sector->ceilingpic != skyflatnum) // Found the outdoors!
continue;
newdist = S_CalculateSoundDistance(players[displayplayers[0]].mo->x, players[displayplayers[0]].mo->y, 0, (fixed_t)x, (fixed_t)y, 0);
+2 -2
View File
@@ -2511,7 +2511,6 @@ static void P_SetupCamera(UINT8 pnum, camera_t *cam)
cam->y = players[pnum].mo->y;
cam->z = players[pnum].mo->z;
cam->angle = players[pnum].mo->angle;
cam->subsector = R_PointInSubsector(cam->x, cam->y); // make sure camera has a subsector set -- Monster Iestyn (12/11/18)
}
else
{
@@ -2536,9 +2535,10 @@ static void P_SetupCamera(UINT8 pnum, camera_t *cam)
cam->y = thing->y;
cam->z = thing->z;
cam->angle = FixedAngle((fixed_t)thing->angle << FRACBITS);
cam->subsector = R_PointInSubsector(cam->x, cam->y); // make sure camera has a subsector set -- Monster Iestyn (12/11/18)
}
cam->subsector = R_PointInSubsectorFast(cam->x, cam->y); // make sure camera has a subsector set -- Monster Iestyn (12/11/18)
cam->chase = false; // tell camera to reset its position next tic
}
+1 -1
View File
@@ -2022,7 +2022,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
camera[i].y += y;
camera[i].z += z;
camera[i].reset = true;
camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y);
camera[i].subsector = R_PointInSubsectorFast(camera[i].x, camera[i].y);
R_RelativeTeleportViewInterpolation(i, x, y, z, 0);
break;
}
+3 -3
View File
@@ -3406,7 +3406,7 @@ static void P_DemoCameraMovement(camera_t *cam, UINT8 num)
}
// update subsector to avoid crashes;
cam->subsector = R_PointInSubsector(cam->x, cam->y);
cam->subsector = R_PointInSubsectorFast(cam->x, cam->y);
}
void P_ResetCamera(player_t *player, camera_t *thiscam)
@@ -3450,7 +3450,7 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
thiscam->relativex = 0;
thiscam->subsector = R_PointInSubsector(thiscam->x,thiscam->y);
thiscam->subsector = R_PointInSubsectorFast(thiscam->x,thiscam->y);
thiscam->radius = 20*FRACUNIT;
thiscam->height = 16*FRACUNIT;
@@ -3686,7 +3686,7 @@ static void P_MoveCameraToSpawn(UINT8 playernum)
thiscam->angle = player->mo->angle;
thiscam->aiming = 0;
thiscam->subsector = R_PointInSubsector(thiscam->x,thiscam->y);
thiscam->subsector = R_PointInSubsectorFast(thiscam->x,thiscam->y);
thiscam->reset_aiming = true;
+3 -3
View File
@@ -196,10 +196,10 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
mobj_t *pviewmobj = viewplayer->mo;
INT32 heightsec;
boolean underwater;
UINT8 i = R_GetViewNumber();
camera_t *thiscam = &camera[R_GetViewNumber()];
if (viewplayer == &players[displayplayers[i]] && camera[i].chase)
heightsec = camera->subsector->sector->heightsec;
if (thiscam->chase)
heightsec = thiscam->subsector->sector->heightsec;
else if (viewmobj)
heightsec = pviewmobj->subsector->sector->heightsec;
else
+1 -1
View File
@@ -232,7 +232,7 @@ void R_InterpolateView(fixed_t frac, boolean forceinvalid)
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
viewplayer = newview->player;
viewsector = R_PointInSubsector(viewx, viewy)->sector;
viewsector = R_PointInSubsectorFast(viewx, viewy)->sector;
R_SetupFreelook();
}
+44 -17
View File
@@ -141,10 +141,10 @@ static CV_PossibleValue_t drawdist_precip_cons_t[] = {
#endif
static CV_PossibleValue_t maxinterpdist_cons_t[] = {
/*{256, "256"},*/ {512, "512"}, {768, "768"},
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
/*{256, "256"},*/ {512, "512"}, {768, "768"},
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
static CV_PossibleValue_t fov_cons_t[] = {{MINFOV*FRACUNIT, "MIN"}, {MAXFOV*FRACUNIT, "MAX"}, {0, NULL}};
@@ -170,14 +170,14 @@ consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnO
consvar_t cv_precachetextures = {"precachetextures", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS] = {
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
{"chasecam2", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
{"chasecam3", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
{"chasecam4", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
};
consvar_t cv_flipcam[MAXSPLITSCREENPLAYERS] = {
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}
@@ -195,6 +195,7 @@ consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE|CV_CALL|CV_NO
consvar_t cv_lessprecip = {"lessweathereffects", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_mobjscaleprecip = {"scaleprecipmobjscale", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_maxinterpdist = {"maxinterpdist", "Infinite", CV_SAVE, maxinterpdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playerfade = {"playerfade", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_ripplewater = {"waterripples", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// Okay, whoever said homremoval causes a performance hit should be shot.
@@ -211,6 +212,7 @@ consvar_t cv_randomdirlight = {"randomdirectionallight", "Off", CV_SAVE|CV_CALL
consvar_t cv_showhud = {"showhud", "Yes", CV_CALL, CV_YesNo, R_SetViewSize, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_translucenthud = {"translucenthud", "10", CV_SAVE, translucenthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_uncappedhud = {"uncappedhud", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_soniccd = {"soniccd", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_allowmlook = {"allowmlook", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -400,7 +402,8 @@ angle_t R_PlayerSliptideAngle(player_t *player)
sprframe = &sprdef->spriteframes[rot];
// No sprite frame? I guess it is possible
if (!sprframe) return 0;
if (!sprframe)
return 0;
if (sprframe->rotate != SRF_SINGLE || (mo->frame & FF_PAPERSPRITE))
ang = R_PointToAngle(mo->x, mo->y) - mo->angle;
@@ -460,6 +463,7 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe
return false;
cullplane = cullheight->frontsector->floorheight;
if (cullheight->flags & ML_NOCLIMB) // Group culling
{
if (!viewcullheight)
@@ -579,8 +583,6 @@ static void R_InitTextureMapping(void)
doubleclipangle = clipangle*2;
}
//
// R_InitLightTables
// Only inits the zlight table,
@@ -1047,6 +1049,33 @@ void R_Init(void)
framecount = 0;
}
//
// R_IsPointInSubsector, same as above but returns 0 if not in subsector
//
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
{
node_t *node;
INT32 side, i;
size_t nodenum;
subsector_t *ret;
nodenum = numnodes - 1;
while (!(nodenum & NF_SUBSECTOR))
{
node = &nodes[nodenum];
side = R_PointOnSide(x, y, node);
nodenum = node->children[side];
}
ret = &subsectors[nodenum & ~NF_SUBSECTOR];
for (i = 0; i < ret->numlines; i++)
if (P_PointOnLineSide(x, y, segs[ret->firstline + i].linedef) != segs[ret->firstline + i].side)
return 0;
return ret;
}
//
// R_SetupFrame
//
@@ -1066,7 +1095,7 @@ static void R_SetupCommonFrame(player_t * player, sector_t * sector)
if (sector != NULL)
newview->sector = sector;
else
newview->sector = R_PointInSubsector(newview->x, newview->y)->sector;
newview->sector = R_PointInSubsectorFast(newview->x, newview->y)->sector;
R_InterpolateView(rendertimefrac_unpaused, false);
}
@@ -1167,7 +1196,7 @@ void R_SkyboxFrame(int s)
{
player_t *player = &players[displayplayers[s]];
camera_t *thiscam = &camera[s];
subsector_t * subsector = NULL;
subsector_t *subsector = NULL;
mapheader_t *mh = mapheaderinfo[gamemap-1];
R_SetViewContext(static_cast<viewcontext_e>(VIEWCONTEXT_SKY1 + s));
@@ -1306,7 +1335,7 @@ static void R_PortalFrame(portal_t *portal)
{
portalclipline = NULL;
portalcullsector = NULL;
viewsector = R_PointInSubsector(viewx, viewy)->sector;
viewsector = R_PointInSubsectorFast(viewx, viewy)->sector;
}
}
@@ -1522,11 +1551,6 @@ void R_RegisterEngineStuff(void)
CV_RegisterVar(&cv_fovchange);
CV_RegisterVar(&cv_fov);
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
{
CV_RegisterVar(&cv_chasecam[i]);
}
CV_RegisterVar(&cv_shadow);
CV_RegisterVar(&cv_shadowoffs);
CV_RegisterVar(&cv_skybox);
@@ -1536,6 +1560,8 @@ void R_RegisterEngineStuff(void)
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
{
CV_RegisterVar(&cv_chasecam[i]);
CV_RegisterVar(&cv_cam_dist[i]);
CV_RegisterVar(&cv_cam_still[i]);
CV_RegisterVar(&cv_cam_height[i]);
@@ -1569,6 +1595,7 @@ void R_RegisterEngineStuff(void)
CV_RegisterVar(&cv_randomdirlight);
CV_RegisterVar(&cv_maxinterpdist);
CV_RegisterVar(&cv_playerfade);
CV_RegisterVar(&cv_ripplewater);
+16 -38
View File
@@ -88,7 +88,7 @@ extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];
//
// killough 5/2/98: reformatted
//
FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t * restrict node)
FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t* restrict node)
{
if (!node->dx)
return x <= node->x ? node->dy > 0 : node->dy < 0;
@@ -117,10 +117,10 @@ FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSideFast(fixed_t x, fixed_t
FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line)
{
fixed_t lx = line->v1->x;
fixed_t ly = line->v1->y;
fixed_t ldx = line->v2->x - lx;
fixed_t ldy = line->v2->y - ly;
fixed_t lx = line->v1->x;
fixed_t ly = line->v1->y;
fixed_t ldx = line->v2->x - lx;
fixed_t ldy = line->v2->y - ly;
// use cross product to determine side quickly
INT64 v = ((INT64)y - ly) * ldx - ((INT64)x - lx) * ldy;
@@ -137,42 +137,19 @@ fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
//
// R_PointInSubsector
//
FUNCINLINE static ATTRINLINE subsector_t *R_PointInSubsector(fixed_t x, fixed_t y)
{
size_t nodenum = numnodes-1;
while (!(nodenum & NF_SUBSECTOR))
nodenum = nodes[nodenum].children[R_PointOnSide(x, y, nodes+nodenum)];
return &subsectors[nodenum & ~NF_SUBSECTOR];
#define R_POINTINSUBSECTOR(FUNCNAME, SIDEFUNC)\
FUNCINLINE static ATTRINLINE subsector_t *FUNCNAME(fixed_t x, fixed_t y)\
{\
size_t nodenum = numnodes-1;\
while (!(nodenum & NF_SUBSECTOR))\
nodenum = nodes[nodenum].children[SIDEFUNC(x, y, nodes+nodenum)];\
return &subsectors[nodenum & ~NF_SUBSECTOR];\
}
//
// R_IsPointInSubsector, same as above but returns 0 if not in subsector
//
FUNCINLINE static ATTRINLINE subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
{
node_t *node;
INT32 side, i;
size_t nodenum;
subsector_t *ret;
R_POINTINSUBSECTOR(R_PointInSubsector, R_PointOnSide)
R_POINTINSUBSECTOR(R_PointInSubsectorFast, R_PointOnSideFast)
nodenum = numnodes - 1;
while (!(nodenum & NF_SUBSECTOR))
{
node = &nodes[nodenum];
side = R_PointOnSide(x, y, node);
nodenum = node->children[side];
}
ret = &subsectors[nodenum & ~NF_SUBSECTOR];
for (i = 0; i < ret->numlines; i++)
if (P_PointOnLineSide(x, y, segs[ret->firstline + i].linedef) != segs[ret->firstline + i].side)
return 0;
return ret;
}
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y);
#define R_PointToDist(x, y) R_PointToDist2(viewx, viewy, x, y)
#define R_PointToDist2(px2, py2, px1, py1) FixedHypot((px1) - (px2), (py1) - (py2))
@@ -218,6 +195,7 @@ extern consvar_t cv_fov, cv_fovchange;
extern consvar_t cv_skybox;
extern consvar_t cv_tailspickup;
extern consvar_t cv_maxinterpdist;
extern consvar_t cv_playerfade;
extern consvar_t cv_ripplewater;
extern consvar_t cv_randomdirlight;
+36
View File
@@ -737,6 +737,13 @@ static void R_DrawFlippedMaskedColumn(drawcolumndata_t* dc, column_t *column)
dc->texturemid = basetexturemid;
}
// Based off of R_GetLinedefTransTable
transnum_t R_GetThingTransTable(fixed_t alpha, transnum_t transmap)
{
return static_cast<transnum_t>((20*(FRACUNIT - ((alpha * (10 - transmap))/10) - 1) + FRACUNIT) >> (FRACBITS+1));
}
//
// R_DrawVisSprite
// mfloorclip and mceilingclip should also be set.
@@ -1596,6 +1603,9 @@ static void R_ProjectSprite(mobj_t *thing)
else
trans = 0;
if (cv_playerfade.value && oldthing->player)
trans = static_cast<INT32>(R_GetThingTransTable(R_DoPlayerFade(oldthing), static_cast<transnum_t>(trans)));
//SoM: 3/17/2000: Disregard sprites that are out of view..
if (vflip)
{
@@ -2931,6 +2941,32 @@ boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist)
return true;
}
fixed_t R_DoPlayerFade(mobj_t *thing)
{
fixed_t fadealpha = FRACUNIT;
static constexpr tic_t countdownstarttime = (15 * TICRATE) / 4; // starttime - (3*TICRATE)
if (thing->player == viewplayer || viewplayer->exiting || camera[R_GetViewNumber()].freecam || leveltime < countdownstarttime)
return fadealpha;
const INT32 playerdist = (FixedMul((thing->x - viewx), viewcos) + FixedMul((thing->y - viewy), viewsin)) >> FRACBITS;
const INT32 viewplayerdist = (FixedMul((viewplayer->mo->x - viewx), viewcos) + FixedMul((viewplayer->mo->y - viewy), viewsin)) >> FRACBITS;
if (playerdist < viewplayerdist)
{
if (playerdist < viewplayerdist / 2) // stronger fade when very close
{
fadealpha = (playerdist * FRACUNIT) / (viewplayerdist / 2) / 3;
}
else
{
fadealpha = (playerdist * FRACUNIT) / viewplayerdist;
}
}
return fadealpha;
}
boolean R_CheckInterpDist(mobj_t *thing)
{
if (!cv_maxinterpdist.value)
+3
View File
@@ -87,9 +87,12 @@ typedef struct
void R_DrawMasked(maskcount_t* masks, INT32 nummasks);
transnum_t R_GetThingTransTable(fixed_t alpha, transnum_t transmap);
boolean R_ThingVisible(mobj_t *thing);
boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist);
boolean R_CheckInterpDist(mobj_t *thing);
fixed_t R_DoPlayerFade(mobj_t *thing);
boolean R_ThingIsFullBright(mobj_t *thing);
boolean R_ThingIsSemiBright(mobj_t *thing);
+2 -2
View File
@@ -957,7 +957,7 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
INT64 x, y, yl, yh, xl, xh;
fixed_t newdist;
if (R_PointInSubsector(listensource.x, listensource.y)->sector->ceilingpic == skyflatnum)
if (R_PointInSubsectorFast(listensource.x, listensource.y)->sector->ceilingpic == skyflatnum)
approx_dist = 0;
else
{
@@ -970,7 +970,7 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
for (y = yl; y <= yh; y += FRACUNIT*64)
for (x = xl; x <= xh; x += FRACUNIT*64)
{
if (R_PointInSubsector(x, y)->sector->ceilingpic == skyflatnum)
if (R_PointInSubsectorFast(x, y)->sector->ceilingpic == skyflatnum)
{
// Found the outdoors!
newdist = S_CalculateSoundDistance(listensource.x, listensource.y, 0, x, y, 0);
+391 -512
View File
File diff suppressed because it is too large. Load diff
-2
View File
@@ -1,5 +1,3 @@
#include <winuser.h>
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"