Snowy #43

Merged
Indev450 merged 4 commits from snowy into Saturn 2023-08-29 09:33:57 +02:00
7 changed files with 324 additions and 34 deletions

No files matched your search

+17 -17
View File
@@ -153,25 +153,25 @@ consvar_t cons_backcolor = {"con_backcolor", "Black", CV_CALL|CV_SAVE, backcolor
static CV_PossibleValue_t menuhighlight_cons_t[] =
{
{0, "Game type"},
{V_YELLOWMAP, "Always yellow"},
{V_PURPLEMAP, "Always purple"},
{V_GREENMAP, "Always green"},
{V_BLUEMAP, "Always blue"},
{V_REDMAP, "Always red"},
{V_GRAYMAP, "Always gray"},
{V_ORANGEMAP, "Always orange"},
{V_SKYMAP, "Always sky-blue"},
{V_GOLDMAP, "Always gold"},
{V_LAVENDERMAP, "Always lavender"},
{V_TEAMAP, "Always tea-green"},
{V_STEELMAP, "Always steel-blue"},
{V_PINKMAP, "Always pink"},
{V_BROWNMAP, "Always brown"},
{V_PEACHMAP, "Always peach"},
{0, "Gametype Default"},
{V_YELLOWMAP, "Always Yellow"},
{V_PURPLEMAP, "Always Purple"},
{V_GREENMAP, "Always Green"},
{V_BLUEMAP, "Always Blue"},
{V_REDMAP, "Always Red"},
{V_GRAYMAP, "Always Gray"},
{V_ORANGEMAP, "Always Orange"},
{V_SKYMAP, "Always Sky-Blue"},
{V_GOLDMAP, "Always Gold"},
{V_LAVENDERMAP, "Always Lavender"},
{V_TEAMAP, "Always Tea-Green"},
{V_STEELMAP, "Always Steel-Blue"},
{V_PINKMAP, "Always Pink"},
{V_BROWNMAP, "Always Brown"},
{V_PEACHMAP, "Always Peach"},
{0, NULL}
};
consvar_t cons_menuhighlight = {"menuhighlight", "Game type", CV_SAVE, menuhighlight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cons_menuhighlight = {"menuhighlight", "Gametype Default", CV_SAVE, menuhighlight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static void CON_Print(char *msg);
+11
View File
@@ -469,6 +469,12 @@ consvar_t cv_showping = {"showping", "Always", CV_SAVE, showping_cons_t, NULL, 0
static CV_PossibleValue_t pingmeasurement_cons_t[] = {{0, "Frames"}, {1, "Milliseconds"}, {0, NULL}};
consvar_t cv_pingmeasurement = {"pingmeasurement", "Frames", CV_SAVE, pingmeasurement_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
//consvar_t cv_smallpos = {"smallpositionnumber", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_showminimapnames = {"showminimapnames", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_minihead = {"smallminimapplayers", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_showlapemblem = {"showlapemblem", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_showviewpointtext = {"showviewpointtext", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
@@ -773,6 +779,11 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_showping);
CV_RegisterVar(&cv_pingmeasurement);
//CV_RegisterVar(&cv_smallpos);
CV_RegisterVar(&cv_showminimapnames);
CV_RegisterVar(&cv_minihead);
CV_RegisterVar(&cv_showlapemblem);
CV_RegisterVar(&cv_showtrackaddon);
+4
View File
@@ -150,6 +150,10 @@ extern consvar_t cv_pingtimeout;
extern consvar_t cv_showping;
extern consvar_t cv_pingmeasurement;
//extern consvar_t cv_smallpos;
extern consvar_t cv_showminimapnames;
extern consvar_t cv_minihead;
extern consvar_t cv_showlapemblem;
extern consvar_t cv_showviewpointtext;
+15 -13
View File
@@ -8647,27 +8647,29 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
amxpos = amnumxpos + ((x + AutomapPic->width/2 - (facemmapprefix[skin]->width/2))<<FRACBITS);
amypos = amnumypos + ((y + AutomapPic->height/2 - (facemmapprefix[skin]->height/2))<<FRACBITS);
// do we want this? it feels unnecessary. easier to just modify the amnumxpos?
/*if (encoremode)
{
flags |= V_FLIP;
amxpos = -amnumxpos + ((x + AutomapPic->width/2 + (facemmapprefix[skin]->width/2))<<FRACBITS);
}*/
if (!mo->color) // 'default' color
V_DrawSciencePatch(amxpos, amypos, flags, facemmapprefix[skin], FRACUNIT);
else
{
UINT8 *colormap;
if (mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, mo->color, GTC_CACHE);
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap);
UINT8 *colormap = R_GetTranslationColormap((mo->colorized) ? TC_RAINBOW : skin, mo->color, GTC_CACHE);
if (cv_minihead.value == 1)
V_DrawFixedPatch(amxpos + (2 * FRACUNIT), amypos + (2 * FRACUNIT), FRACUNIT/2, flags, facemmapprefix[skin], colormap);
else if (cv_minihead.value == 0)
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap);
if (cv_showminimapnames.value && !(modeattacking || gamestate == GS_TIMEATTACK))
{
const char *player_name = va("%c%s", V_GetSkincolorChar(mo->color), player_names[mo->player - players]);
V_DrawCenteredSmallStringAtFixed(amxpos + (4 * FRACUNIT), amypos - (3 * FRACUNIT), V_ALLOWLOWERCASE|flags, player_name);
}
if (mo->player
&& ((G_RaceGametype() && mo->player->kartstuff[k_position] == spbplace)
|| (G_BattleGametype() && K_IsPlayerWanted(mo->player))))
{
if (cv_minihead.value == 1)
V_DrawFixedPatch(amxpos, amypos, FRACUNIT / 2, flags, kp_wantedreticle, NULL);
else if (cv_minihead.value == 0)
V_DrawFixedPatch(amxpos - (4<<FRACBITS), amypos - (4<<FRACBITS), FRACUNIT, flags, kp_wantedreticle, NULL);
}
}
+8 -4
View File
@@ -1695,16 +1695,20 @@ static menuitem_t OP_SaturnMenu[] =
{
{IT_HEADER, NULL, "Saturn Options", NULL, 0},
{IT_STRING | IT_CVAR, NULL, "Serverqueue waittime", &cv_connectawaittime, 20},
//{IT_STRING | IT_CVAR, NULL, "Addon Download Speed", &cv_downloadspeed, 55}, //no idea why you would wanna change it anyways
{IT_STRING | IT_CVAR, NULL, "Show Minimap Names", &cv_showminimapnames, 30},
{IT_STRING | IT_CVAR, NULL, "Skin Select Spinning Speed", &cv_skinselectspin, 50},
{IT_STRING | IT_CVAR, NULL, "Input Display outside of RA", &cv_showinput, 60},
{IT_STRING | IT_CVAR, NULL, "V2-ish Speedometer", &cv_newspeedometer, 70},
{IT_STRING | IT_CVAR, NULL, "Show Lap Emblem", &cv_showlapemblem, 80},
{IT_STRING | IT_CVAR, NULL, "No Midnight Channel Flicker", &cv_lessflicker, 90},
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 105},
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 120},
{IT_STRING | IT_CVAR, NULL, "Small Position Number", &cv_smallpos, 90},
{IT_STRING | IT_CVAR, NULL, "No Midnight Channel Flicker", &cv_lessflicker, 100},
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 115},
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 130},
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 135}, // uwu
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 145}, // uwu
};
enum
+263
View File
@@ -1770,6 +1770,12 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
}
}
void V_DrawCenteredSmallString(INT32 x, INT32 y, INT32 option, const char *string)
{
x -= V_SmallStringWidth(string, option)/2;
V_DrawSmallString(x, y, option, string);
}
void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string)
{
x -= V_SmallStringWidth(string, option);
@@ -1983,6 +1989,102 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
}
}
// Jaden: awesome!
void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
{
fixed_t cx = x, cy = y;
INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0;
const char *ch = string;
INT32 charflags = 0;
const UINT8 *colormap = NULL;
INT32 spacewidth = 2, charwidth = 0;
INT32 lowercase = (option & V_ALLOWLOWERCASE);
option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE...
if (option & V_NOSCALESTART)
{
dupx = vid.dupx;
dupy = vid.dupy;
scrwidth = vid.width;
}
else
{
dupx = dupy = 1;
scrwidth = vid.width/vid.dupx;
left = (scrwidth - BASEVIDWIDTH)/2;
scrwidth -= left;
}
if (option & V_NOSCALEPATCH)
scrwidth *= vid.dupx;
charflags = (option & V_CHARCOLORMASK);
switch (option & V_SPACINGMASK)
{
case V_MONOSPACE:
spacewidth = 4;
/* FALLTHRU */
case V_OLDSPACING:
charwidth = 4;
break;
case V_6WIDTHSPACE:
spacewidth = 3;
default:
break;
}
for (;;ch++)
{
if (!*ch)
break;
if (*ch & 0x80) //color parsing -x 2.16.09
{
// manually set flags override color codes
if (!(option & V_CHARCOLORMASK))
charflags = ((*ch & 0x7f) << V_CHARCOLORSHIFT) & V_CHARCOLORMASK;
continue;
}
if (*ch == '\n')
{
cx = x;
if (option & V_RETURN8)
cy += (4*dupy)<<FRACBITS;
else
cy += (6*dupy)<<FRACBITS;
continue;
}
c = *ch;
if (!lowercase)
c = toupper(c);
c -= HU_FONTSTART;
// character does not exist or is a space
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
{
cx += (spacewidth * dupx)<<FRACBITS;
continue;
}
if (charwidth)
{
w = charwidth * dupx;
center = w/2 - hu_font[c]->width*(dupx/4);
}
else
w = hu_font[c]->width * dupx / 2;
if ((cx>>FRACBITS) > scrwidth)
break;
if ((cx>>FRACBITS)+left + w < 0) //left boundary check
{
cx += w<<FRACBITS;
continue;
}
colormap = V_GetStringColormap(charflags);
V_DrawFixedPatch(cx + (center<<FRACBITS), cy, FRACUNIT/2, option, hu_font[c], colormap);
cx += w<<FRACBITS;
}
}
void V_DrawCenteredSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
{
x -= (V_SmallStringWidth(string, option) / 2)<<FRACBITS;
V_DrawSmallStringAtFixed(x, y, option, string);
}
// Draws a tallnum. Replaces two functions in y_inter and st_stuff
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num)
{
@@ -2369,6 +2471,167 @@ INT32 V_ThinStringWidth(const char *string, INT32 option)
return w;
}
char V_GetSkincolorChar(INT32 color)
{
char cstart = 0x80;
switch (color)
{
case SKINCOLOR_WHITE:
case SKINCOLOR_SILVER:
case SKINCOLOR_SLATE:
cstart = 0x80; // White
break;
case SKINCOLOR_GREY:
case SKINCOLOR_NICKEL:
case SKINCOLOR_BLACK:
case SKINCOLOR_SKUNK:
case SKINCOLOR_JET:
cstart = 0x86; // V_GRAYMAP
break;
case SKINCOLOR_SEPIA:
case SKINCOLOR_BEIGE:
case SKINCOLOR_WALNUT:
case SKINCOLOR_BROWN:
case SKINCOLOR_LEATHER:
case SKINCOLOR_RUST:
case SKINCOLOR_WRISTWATCH:
cstart = 0x8e; // V_BROWNMAP
break;
case SKINCOLOR_FAIRY:
case SKINCOLOR_SALMON:
case SKINCOLOR_PINK:
case SKINCOLOR_ROSE:
case SKINCOLOR_BRICK:
case SKINCOLOR_LEMONADE:
case SKINCOLOR_BUBBLEGUM:
case SKINCOLOR_LILAC:
cstart = 0x8d; // V_PINKMAP
break;
case SKINCOLOR_CINNAMON:
case SKINCOLOR_RUBY:
case SKINCOLOR_RASPBERRY:
case SKINCOLOR_CHERRY:
case SKINCOLOR_RED:
case SKINCOLOR_CRIMSON:
case SKINCOLOR_MAROON:
case SKINCOLOR_FLAME:
case SKINCOLOR_SCARLET:
case SKINCOLOR_KETCHUP:
cstart = 0x85; // V_REDMAP
break;
case SKINCOLOR_DAWN:
case SKINCOLOR_SUNSET:
case SKINCOLOR_CREAMSICLE:
case SKINCOLOR_ORANGE:
case SKINCOLOR_PUMPKIN:
case SKINCOLOR_ROSEWOOD:
case SKINCOLOR_BURGUNDY:
case SKINCOLOR_TANGERINE:
cstart = 0x87; // V_ORANGEMAP
break;
case SKINCOLOR_PEACH:
case SKINCOLOR_CARAMEL:
case SKINCOLOR_CREAM:
cstart = 0x8f; // V_PEACHMAP
break;
case SKINCOLOR_GOLD:
case SKINCOLOR_ROYAL:
case SKINCOLOR_BRONZE:
case SKINCOLOR_COPPER:
case SKINCOLOR_THUNDER:
cstart = 0x8a; // V_GOLDMAP
break;
case SKINCOLOR_POPCORN:
case SKINCOLOR_QUARRY:
case SKINCOLOR_YELLOW:
case SKINCOLOR_MUSTARD:
case SKINCOLOR_CROCODILE:
case SKINCOLOR_OLIVE:
cstart = 0x82; // V_YELLOWMAP
break;
case SKINCOLOR_ARTICHOKE:
case SKINCOLOR_VOMIT:
case SKINCOLOR_GARDEN:
case SKINCOLOR_TEA:
case SKINCOLOR_PISTACHIO:
cstart = 0x8b; // V_TEAMAP
break;
case SKINCOLOR_LIME:
case SKINCOLOR_HANDHELD:
case SKINCOLOR_MOSS:
case SKINCOLOR_CAMOUFLAGE:
case SKINCOLOR_ROBOHOOD:
case SKINCOLOR_MINT:
case SKINCOLOR_GREEN:
case SKINCOLOR_PINETREE:
case SKINCOLOR_EMERALD:
case SKINCOLOR_SWAMP:
case SKINCOLOR_DREAM:
case SKINCOLOR_PLAGUE:
case SKINCOLOR_ALGAE:
cstart = 0x83; // V_GREENMAP
break;
case SKINCOLOR_CARIBBEAN:
case SKINCOLOR_AZURE:
case SKINCOLOR_AQUA:
case SKINCOLOR_TEAL:
case SKINCOLOR_CYAN:
case SKINCOLOR_JAWZ:
case SKINCOLOR_CERULEAN:
case SKINCOLOR_NAVY:
case SKINCOLOR_SAPPHIRE:
cstart = 0x88; // V_SKYMAP
break;
case SKINCOLOR_PIGEON:
case SKINCOLOR_PLATINUM:
case SKINCOLOR_STEEL:
cstart = 0x8c; // V_STEELMAP
break;
case SKINCOLOR_PERIWINKLE:
case SKINCOLOR_BLUE:
case SKINCOLOR_BLUEBERRY:
case SKINCOLOR_NOVA:
cstart = 0x84; // V_BLUEMAP
break;
case SKINCOLOR_ULTRAVIOLET:
case SKINCOLOR_PURPLE:
case SKINCOLOR_FUCHSIA:
cstart = 0x81; // V_PURPLEMAP
break;
case SKINCOLOR_PASTEL:
case SKINCOLOR_MOONSLAM:
case SKINCOLOR_DUSK:
case SKINCOLOR_TOXIC:
case SKINCOLOR_MAUVE:
case SKINCOLOR_LAVENDER:
case SKINCOLOR_BYZANTIUM:
case SKINCOLOR_POMEGRANATE:
cstart = 0x89; // V_LAVENDERMAP
break;
default:
break;
}
return cstart;
}
boolean *heatshifter = NULL;
INT32 lastheight = 0;
INT32 heatindex[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
+6
View File
@@ -191,6 +191,7 @@ void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string
// draw a string using the hu_font, 0.5x scale
void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string);
void V_DrawCenteredSmallString(INT32 x, INT32 y, INT32 option, const char *string);
void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string);
// draw a string using the tny_font
@@ -200,6 +201,9 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st
void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
void V_DrawCenteredSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
// Draw tall nums, used for menu, HUD, intermission
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);
void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits);
@@ -225,6 +229,8 @@ INT32 V_SmallStringWidth(const char *string, INT32 option);
// Find string width from tny_font chars
INT32 V_ThinStringWidth(const char *string, INT32 option);
char V_GetSkincolorChar(INT32 color);
void V_DoPostProcessor(INT32 view, postimg_t type, INT32 param);
void V_DrawPatchFill(patch_t *pat);