diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f31d4d8d6..c187c7d4e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -208,7 +208,6 @@ static inline void *G_ScpyTiccmd(ticcmd_t* dest, void* src, const size_t n) } - // Some software don't support largest packet // (original sersetup, not exactely, but the probability of sending a packet // of 512 bytes is like 0.1) diff --git a/src/d_main.c b/src/d_main.c index 3353651ad..ecb30f8c0 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -527,7 +527,7 @@ static void D_Display(void) else py = viewwindowy + 4; patch = W_CachePatchName("M_PAUSE", PU_CACHE); - V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, 0, patch); + V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, V_SNAPTOTOP, patch); } if (demo.rewinding) diff --git a/src/doomtype.h b/src/doomtype.h index dd7c26b5d..5a04f77ba 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -249,6 +249,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz); #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) // >= GCC 3.1 #define FUNCDEAD __attribute__ ((deprecated)) #define FUNCINLINE __attribute__((always_inline)) + #define PUREFUNC __attribute__((pure)) #define FUNCNONNULL __attribute__((nonnull)) #endif @@ -321,6 +322,9 @@ size_t strlcpy(char *dst, const char *src, size_t siz); #ifndef ATTRNOINLINE #define ATTRNOINLINE #endif +#ifndef PUREFUNC +#define PUREFUNC +#endif /* Miscellaneous types that don't fit anywhere else (Can this be changed?) */ diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h index 742fd82ae..a5b66a429 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -92,8 +92,6 @@ void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap); -void HWR_RenderDrawNodes(void); - // -------- // hw_shaders.c // -------- diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 815a7db66..7ee770704 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1065,8 +1065,6 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, float endrealtop, endrealbot, endtop, endbot; float endpegt, endpegb, endpegmul; float endheight = 0.0f, endbheight = 0.0f; - - float diff; fixed_t v1x = FloatToFixed(wallVerts[0].x); fixed_t v1y = FloatToFixed(wallVerts[0].z); @@ -1186,7 +1184,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, endbot = endtop; } - if (endbheight >= endtop && bheight >= top && !cv_splitwallfix.value || bheight >= top && cv_splitwallfix.value) + if ((endbheight >= endtop && bheight >= top && !cv_splitwallfix.value) || (bheight >= top && cv_splitwallfix.value)) continue; // Found a break @@ -1332,6 +1330,88 @@ void HWR_DrawSkyWall(FOutVector *wallVerts, FSurfaceInfo *Surf) // PF_Occlude is set in HWR_ProjectWall to draw into the depth buffer } +// Returns true if the midtexture is visible, and false if... it isn't... +static boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf) +{ + FUINT blendmode = PF_Masked; + + pSurf->PolyColor.s.alpha = 0xFF; + + if (!gr_curline->polyseg) + { + // set alpha for transparent walls + switch (gr_linedef->special) + { + case 900: + blendmode = HWR_TranstableToAlpha(tr_trans10, pSurf); + break; + case 901: + blendmode = HWR_TranstableToAlpha(tr_trans20, pSurf); + break; + case 902: + blendmode = HWR_TranstableToAlpha(tr_trans30, pSurf); + break; + case 903: + blendmode = HWR_TranstableToAlpha(tr_trans40, pSurf); + break; + case 904: + blendmode = HWR_TranstableToAlpha(tr_trans50, pSurf); + break; + case 905: + blendmode = HWR_TranstableToAlpha(tr_trans60, pSurf); + break; + case 906: + blendmode = HWR_TranstableToAlpha(tr_trans70, pSurf); + break; + case 907: + blendmode = HWR_TranstableToAlpha(tr_trans80, pSurf); + break; + case 908: + blendmode = HWR_TranstableToAlpha(tr_trans90, pSurf); + break; + // Translucent + case 102: + case 121: + case 123: + case 124: + case 125: + case 141: + case 142: + case 144: + case 145: + case 174: + case 175: + case 192: + case 195: + case 221: + case 253: + case 256: + blendmode = PF_Translucent; + break; + default: + blendmode = PF_Masked; + break; + } + } + else if (gr_curline->polyseg->translucency > 0) + { + // Polyobject translucency is shared between all of its lines + if (gr_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn + return false; + //Surf.PolyColor.s.alpha = 0x00; // This shouldn't draw anything regardless of blendmode + //blendmode = PF_Masked; + else + blendmode = HWR_TranstableToAlpha(gr_curline->polyseg->translucency, pSurf); + } + + if (blendmode != PF_Masked && pSurf->PolyColor.s.alpha == 0x00) + return false; + + pSurf->PolyFlags = blendmode; + + return true; +} + // // HWR_ProcessSeg // A portion or all of a wall segment will be drawn, from startfrac to endfrac, @@ -1350,9 +1430,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom fixed_t worldhighslope = 0, worldlowslope = 0; fixed_t v1x, v1y, v2x, v2y; - GLMapTexture_t *grTex = NULL; float cliplow = 0.0f, cliphigh = 0.0f; - INT32 gr_midtexture; fixed_t h, l; // 3D sides and 2s middle textures fixed_t hS, lS; @@ -1414,11 +1492,9 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom wallVerts[2].z = wallVerts[1].z = ve.y; // x offset the texture - { - fixed_t texturehpeg = gr_sidedef->textureoffset + gr_curline->offset; - cliplow = (float)texturehpeg; - cliphigh = (float)(texturehpeg + (gr_curline->flength*FRACUNIT)); - } + fixed_t texturehpeg = gr_sidedef->textureoffset + gr_curline->offset; + cliplow = (float)texturehpeg; + cliphigh = (float)(texturehpeg + (gr_curline->flength*FRACUNIT)); if (HWR_ShouldUsePaletteRendering()) { @@ -1435,13 +1511,15 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (gr_linedef->flags & ML_TFERLINE) noencore = true; - if (gr_frontsector) - Surf.PolyColor.s.alpha = 255; + Surf.PolyColor.s.alpha = 255; + + INT32 gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture); + GLMapTexture_t *grTex = NULL; + // two sided line if (gr_backsector) { INT32 gr_toptexture, gr_bottomtexture; - // two sided line SLOPEPARAMS(gr_backsector->c_slope, worldhigh, worldhighslope, gr_backsector->ceilingheight) SLOPEPARAMS(gr_backsector->f_slope, worldlow, worldlowslope, gr_backsector->floorheight) @@ -1660,8 +1738,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom else HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap); } - gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture); - if (gr_midtexture || gr_portal == GRPORTAL_STENCIL || gr_portal == GRPORTAL_DEPTH || gl_drawing_stencil) + + if ((gr_midtexture && HWR_BlendMidtextureSurface(&Surf)) || gr_portal == GRPORTAL_STENCIL || gr_portal == GRPORTAL_DEPTH || gl_drawing_stencil) { sector_t *front, *back; INT32 repeats; @@ -1880,72 +1958,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom } } - // set alpha for transparent walls (new boom and legacy linedef types) - FBITFIELD blendmode; - - switch (gr_linedef->special) - { - case 900: - blendmode = HWR_TranstableToAlpha(tr_trans10, &Surf); - break; - case 901: - blendmode = HWR_TranstableToAlpha(tr_trans20, &Surf); - break; - case 902: - blendmode = HWR_TranstableToAlpha(tr_trans30, &Surf); - break; - case 903: - blendmode = HWR_TranstableToAlpha(tr_trans40, &Surf); - break; - case 904: - blendmode = HWR_TranstableToAlpha(tr_trans50, &Surf); - break; - case 905: - blendmode = HWR_TranstableToAlpha(tr_trans60, &Surf); - break; - case 906: - blendmode = HWR_TranstableToAlpha(tr_trans70, &Surf); - break; - case 907: - blendmode = HWR_TranstableToAlpha(tr_trans80, &Surf); - break; - case 908: - blendmode = HWR_TranstableToAlpha(tr_trans90, &Surf); - break; - // Translucent - case 102: - case 121: - case 123: - case 124: - case 125: - case 141: - case 142: - case 144: - case 145: - case 174: - case 175: - case 192: - case 195: - case 221: - case 253: - case 256: - blendmode = PF_Translucent; - break; - default: - blendmode = PF_Masked; - break; - } - - if (gr_curline->polyseg && gr_curline->polyseg->translucency > 0) - { - if (gr_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn - { - Surf.PolyColor.s.alpha = 0x00; // This shouldn't draw anything regardless of blendmode - blendmode = PF_Masked; - } - else - blendmode = HWR_TranstableToAlpha(gr_curline->polyseg->translucency, &Surf); - } + // TODO: Actually use the surface's flags so that I don't have to do this + FUINT blendmode = Surf.PolyFlags; // Render midtextures on two-sided lines with a z-buffer offset. // This will cause the midtexture appear on top, if a FOF overlaps with it. @@ -1968,7 +1982,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom else { // Single sided line... Deal only with the middletexture (if one exists) - gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture); + if (gr_midtexture && gr_linedef->special != HORIZONSPECIAL) // Ignore horizon line for OGL { { @@ -2546,7 +2560,7 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector) // HWR_AddLine // Clips the given segment and adds any visible pieces to the line list. -void HWR_AddLine(seg_t *line) +static void HWR_AddLine(seg_t *line) { angle_t angle1, angle2; @@ -2606,7 +2620,7 @@ void HWR_AddLine(seg_t *line) checkforemptylines = true; gr_backsector = line->backsector; - + // do an extra culling check when rendering portals // check if any line vertex is on the viewable side of the portal target line // if not, the line can be culled. @@ -2668,6 +2682,7 @@ doaddline: else { gr_backsector = R_FakeFlat(gr_backsector, &tempsec, NULL, NULL, true); + if (CheckClip(gr_frontsector, gr_backsector)) { gld_clipper_SafeAddClipRange(angle2, angle1); @@ -2694,7 +2709,7 @@ doaddline: // // modified to use local variables -boolean HWR_CheckBBox(fixed_t *bspcoord) +static boolean HWR_CheckBBox(const fixed_t *bspcoord) { INT32 boxpos; fixed_t px1, py1, px2, py2; @@ -3119,7 +3134,7 @@ static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float v // : Add sprites of things in sector. // : Draw one or more line segments. // -----------------+ -void HWR_Subsector(size_t num) +static void HWR_Subsector(size_t num) { INT16 count; seg_t *line; @@ -3447,7 +3462,7 @@ skip_stuff_for_portals: // use returned value as multiplier for the added values from p_thrust thing // P_InterceptVector needs divlines which need dx and dy, dx=x2-x1 dy=y2-y1 -static boolean HWR_PortalCheckBBox(fixed_t *bspcoord) +static boolean HWR_PortalCheckBBox(const fixed_t *bspcoord) { vertex_t closest_point; if (!portalclipline) @@ -3492,44 +3507,37 @@ static boolean HWR_PortalCheckBBox(fixed_t *bspcoord) // traversing subtree recursively. // Just call with BSP root. -void HWR_RenderBSPNode(INT32 bspnum) +static void HWR_RenderBSPNode(INT32 bspnum) { - node_t *bsp = &nodes[bspnum]; - - // Decide which side the view point is on - INT32 side; - ps_numbspcalls.value.i++; - // Found a subsector? - if (bspnum & NF_SUBSECTOR) + while (!(bspnum & NF_SUBSECTOR)) // Found a subsector? { - // PORTAL CULLING - if (portalclipline) - { - sector_t *sect = subsectors[bspnum & ~NF_SUBSECTOR].sector; - if (portalcullsector) - { - if (sect != portalcullsector) - return; - portalcullsector = NULL; - } - } - if (bspnum != -1) - HWR_Subsector(bspnum&(~NF_SUBSECTOR)); - return; + const node_t *bsp = &nodes[bspnum]; + + // Decide which side the view point is on. + INT32 side = R_PointOnSide(viewx, viewy, bsp); + + // Recursively divide front space. + if (HWR_PortalCheckBBox(bsp->bbox[side])) + HWR_RenderBSPNode(bsp->children[side]); + + // Possibly divide back space + if (!(HWR_CheckBBox(bsp->bbox[side^1]) && HWR_PortalCheckBBox(bsp->bbox[side^1]))) + return; + + bspnum = bsp->children[side^1]; } - // Decide which side the view point is on. - side = R_PointOnSide(viewx, viewy, bsp); - - // Recursively divide front space. - if (HWR_PortalCheckBBox(bsp->bbox[side])) - HWR_RenderBSPNode(bsp->children[side]); - - // Possibly divide back space. - if (HWR_CheckBBox(bsp->bbox[side^1]) && HWR_PortalCheckBBox(bsp->bbox[side^1])) - HWR_RenderBSPNode(bsp->children[side^1]); + // PORTAL CULLING + if (portalclipline && portalcullsector) + { + if (portalcullsector != subsectors[bspnum & ~NF_SUBSECTOR].sector) + return; + portalcullsector = NULL; + } + // e6y: support for extended nodes + HWR_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR); } // ========================================================================== @@ -4594,7 +4602,7 @@ static int CompareDrawNodePlanes(const void *p1, const void *p2) // // HWR_RenderDrawNodes // Sorts and renders the list of drawnodes for the scene being rendered. -void HWR_RenderDrawNodes(void) +static void HWR_RenderDrawNodes(void) { INT32 i = 0, run_start = 0; @@ -5371,9 +5379,9 @@ void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) #endif // set top/bottom coords - vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset); + vis->ty = FIXED_TO_FLOAT(interp.z + spritecachedinfo[lumpoff].topoffset); - vis->gzt = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset); + vis->gzt = FIXED_TO_FLOAT(interp.z + spritecachedinfo[lumpoff].topoffset); vis->gz = vis->gzt - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height); vis->precip = true; diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index ab5d57159..3530c2915 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -136,13 +136,6 @@ void HWR_DrawSkyBackground(float fpov); void HWR_AddPolyObjectSegs(void); -// hw_main.c: BSP -void HWR_RenderBSPNode(INT32 bspnum); -void HWR_Subsector(size_t num); -void HWR_AddLine(seg_t *line); -boolean HWR_CheckBBox(fixed_t *bspcoord); -void HWR_RenderDrawNodes(void); - // hw_main.c: Sprites void HWR_AddSprites(sector_t *sec); void HWR_ProjectSprite(mobj_t *thing); diff --git a/src/k_kart.c b/src/k_kart.c index aa720bd88..40486cfd5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10037,11 +10037,11 @@ void K_drawKartHUD(void) int xoff = cv_dnft_xoffset.value; if (splitscreen > 1) - V_DrawCenteredString(BASEVIDWIDTH/4+xoff, LAPS_Y+1+yoff, K_calcSplitFlags(0), countstr); + V_DrawCenteredString(BASEVIDWIDTH/4+xoff, LAPS_Y+1+yoff, K_calcSplitFlags(V_SNAPTOBOTTOM), countstr); else { INT32 karlen = strlen(countstr)*6; // half of 12 - V_DrawKartString((BASEVIDWIDTH/2)-karlen+xoff, LAPS_Y+3+yoff, K_calcSplitFlags(0), countstr); + V_DrawKartString((BASEVIDWIDTH/2)-karlen+xoff, LAPS_Y+3+yoff, K_calcSplitFlags(V_SNAPTOBOTTOM), countstr); } } diff --git a/src/m_menu.c b/src/m_menu.c index baf9aef97..92cf7fb0c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1526,14 +1526,14 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Music Volume", &cv_digmusicvolume, 38}, -/* -- :nonnathisshit: +#ifndef NO_MIDI {IT_STRING|IT_CVAR, NULL, "MIDI", &cv_gamemidimusic, 50}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "MIDI Volume", &cv_midimusicvolume, 58}, -*/ +#endif //{IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50}, - +#ifdef NO_MIDI {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 50}, {IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 60}, @@ -1547,14 +1547,33 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_STRING|IT_CVAR, NULL, "Play Music While Unfocused", &cv_playmusicifunfocused, 125}, {IT_STRING|IT_CVAR, NULL, "Play SFX While Unfocused", &cv_playsoundifunfocused, 135}, {IT_STRING|IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 155} +#else + {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 60}, + {IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 70}, + + {IT_STRING|IT_CVAR, NULL, "Chat Notifications", &cv_chatnotifications, 85}, + {IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 95}, + {IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 105}, + + {IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 115}, + {IT_STRING|IT_CALL, NULL, "Music Test", M_MusicTest, 125}, + + {IT_STRING|IT_CVAR, NULL, "Play Music While Unfocused", &cv_playmusicifunfocused, 135}, + {IT_STRING|IT_CVAR, NULL, "Play SFX While Unfocused", &cv_playsoundifunfocused, 145}, + {IT_STRING|IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 165} +#endif }; static const char* OP_SoundTooltips[] = { "Turn Sound effects on or off.", - "Volume of sound effects.", - "Turn Sound effects on or off.", - "Volume of music.", + "Volume of Sound effects.", + "Turn Music on or off.", + "Volume of Music.", +#ifndef NO_MIDI + "Turn Midi Music on or off.", + "Volume of Midi Music.", +#endif "Reverse left and right channels of audio.", "Surround Sound.", "Chat notification sound.", @@ -1871,8 +1890,7 @@ static menuitem_t OP_AdvServerOptionsMenu[] = #ifndef NONET static const char* OP_AdvServerOptionsTooltips[] = -{ - +{ "Server used for master server.", "Attempts to resynchronise player to server.", "Maximum allowed delay.", @@ -4054,7 +4072,7 @@ void M_StartControlPanel(void) Dummymenuplayer_OnChange(); - if ((server || IsPlayerAdmin(consoleplayer))) + if (server || IsPlayerAdmin(consoleplayer)) { MPauseMenu[mpause_switchmap].status = IT_STRING | IT_CALL; MPauseMenu[mpause_addons].status = IT_STRING | IT_CALL; @@ -4820,7 +4838,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_ControlsDef) { - if (!(OP_ControlsTooltips[itemOn] == NULL)) + if (!(OP_ControlsTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_ControlsTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4830,7 +4848,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_MouseOptionsDef) { - if (!(OP_MouseTooltips[itemOn] == NULL)) + if (!(OP_MouseTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_MouseTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4840,7 +4858,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_VideoOptionsDef) { - if (!(OP_VideoTooltips[itemOn] == NULL)) + if (!(OP_VideoTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_VideoTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4850,7 +4868,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_SoundOptionsDef) { - if (!(OP_SoundTooltips[itemOn] == NULL)) + if (!(OP_SoundTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_SoundTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4860,7 +4878,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_SoundAdvancedDef) { - if (!(OP_SoundAdvancedTooltips[itemOn] == NULL)) + if (!(OP_SoundAdvancedTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_SoundAdvancedTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4870,7 +4888,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_ExpOptionsDef) { - if (!(OP_ExpTooltips[itemOn] == NULL)) + if (!(OP_ExpTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_ExpTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4880,7 +4898,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_ChatOptionsDef) { - if (!(OP_ChatOptionsTooltips[itemOn] == NULL)) + if (!(OP_ChatOptionsTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_ChatOptionsTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4892,7 +4910,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_GameOptionsDef) { - if (!(OP_GameTooltips[itemOn] == NULL)) + if (!(OP_GameTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_GameTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4903,7 +4921,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_ServerOptionsDef) { - if (!(OP_ServerOptionsTooltips[itemOn] == NULL)) + if (!(OP_ServerOptionsTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_ServerOptionsTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4914,7 +4932,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_AdvServerOptionsDef) { - if (!(OP_AdvServerOptionsTooltips[itemOn] == NULL)) + if (!(OP_AdvServerOptionsTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_AdvServerOptionsTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4927,7 +4945,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_PlayerDistortDef) { - if (!(OP_PlayerDistortTooltips[itemOn] == NULL)) + if (!(OP_PlayerDistortTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_PlayerDistortTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4940,7 +4958,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_SaturnCreditsDef) // C: { - if (!(OP_CreditTooltips[itemOn] == NULL)) + if (!(OP_CreditTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_CreditTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4950,7 +4968,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_BirdDef) { - if (!(OP_BirdTooltips[itemOn] == NULL)) + if (!(OP_BirdTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_BirdTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4960,7 +4978,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_TiltDef) { - if (!(OP_TiltTooltips[itemOn] == NULL)) + if (!(OP_TiltTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_TiltTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -4970,7 +4988,7 @@ static void M_DrawGenericMenu(void) if (currentMenu == &OP_AdvancedBirdDef) { - if (!(OP_AdvancedBirdTooltips[itemOn] == NULL)) + if (!(OP_AdvancedBirdTooltips[itemOn] == NULL)) { M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_AdvancedBirdTooltips[itemOn], 30, coolalphatimer); if (coolalphatimer > 0 && interpTimerHackAllow) @@ -7917,17 +7935,21 @@ static void M_DrawSkyRoom(void) (digital_disabled ? warningflags : highlightflags), (digital_disabled ? "OFF" : "ON")); - /*V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, +#ifndef NO_MIDI + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y+currentMenu->menuitems[5].alphaKey, (midi_disabled ? warningflags : highlightflags), - (midi_disabled ? "OFF" : "ON"));*/ + (midi_disabled ? "OFF" : "ON")); +#endif if (itemOn == 0) lengthstring = 8*(sound_disabled ? 3 : 2); else if (itemOn == 2) lengthstring = 8*(digital_disabled ? 3 : 2); - /*else if (itemOn == 5) - lengthstring = 8*(midi_disabled ? 3 : 2);*/ +#ifndef NO_MIDI + else if (itemOn == 5) + lengthstring = 8*(midi_disabled ? 3 : 2); +#endif } for (i = 0; i < currentMenu->numitems; ++i) @@ -9261,8 +9283,6 @@ void M_ModeAttackRetry(INT32 choice) G_CheckDemoStatus(); // Cancel recording if (modeattacking == ATTACKING_RECORD) M_ChooseTimeAttack(0); - /*else if (modeattacking == ATTACKING_NIGHTS) - M_ChooseNightsAttack(0);*/ } static void M_ModeAttackEndGame(INT32 choice) @@ -11623,6 +11643,8 @@ static void M_SetupMultiPlayer(INT32 choice) //change the y offsets of the menu depending on cvar settings SKINSELECTMENUEDIT + sortSkinGrid(); + MP_PlayerSetupDef.prevMenu = currentMenu; M_SetupNextMenu(&MP_PlayerSetupDef); } @@ -11660,6 +11682,8 @@ static void M_SetupMultiPlayer2(INT32 choice) //change the y offsets of the menu depending on cvar settings SKINSELECTMENUEDIT + sortSkinGrid(); + MP_PlayerSetupDef.prevMenu = currentMenu; M_SetupNextMenu(&MP_PlayerSetupDef); } @@ -11697,6 +11721,8 @@ static void M_SetupMultiPlayer3(INT32 choice) //change the y offsets of the menu depending on cvar settings SKINSELECTMENUEDIT + sortSkinGrid(); + MP_PlayerSetupDef.prevMenu = currentMenu; M_SetupNextMenu(&MP_PlayerSetupDef); } @@ -11733,6 +11759,8 @@ static void M_SetupMultiPlayer4(INT32 choice) //change the y offsets of the menu depending on cvar settings SKINSELECTMENUEDIT + + sortSkinGrid(); MP_PlayerSetupDef.prevMenu = currentMenu; M_SetupNextMenu(&MP_PlayerSetupDef); @@ -11758,6 +11786,7 @@ static boolean M_QuitMultiPlayerMenu(void) return true; } + // ================= // DATA OPTIONS MENU // ================= diff --git a/src/p_map.c b/src/p_map.c index 3372fe088..6051d5d1c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -248,26 +248,6 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) //pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these. P_ResetPlayer(object->player); - - /* // SRB2kart - Springs don't need to change player state in kart. - if (P_MobjFlip(object)*vertispeed > 0) - P_SetPlayerMobjState(object, S_PLAY_SPRING); - else if (P_MobjFlip(object)*vertispeed < 0) - P_SetPlayerMobjState(object, S_PLAY_FALL1); - else // horizontal spring - { - if (pflags & (PF_JUMPED|PF_SPINNING) && object->player->panim == PA_ROLL) - object->player->pflags = pflags; - else - P_SetPlayerMobjState(object, S_PLAY_RUN1); - } - - if (spring->info->painchance) - { - object->player->pflags |= PF_JUMPED; - P_SetPlayerMobjState(object, S_PLAY_ATK1); - } - */ } return true; } @@ -314,14 +294,6 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) if (flipval*object->momz > FixedMul(speed, spring->scale)) object->momz = flipval*FixedMul(speed, spring->scale); - /* // SRB2kart - don't need state change - if (p && !p->powers[pw_tailsfly]) // doesn't reset anim for Tails' flight - { - P_ResetPlayer(p); - if (p->panim != PA_FALL) - P_SetPlayerMobjState(object, S_PLAY_FALL1); - } - */ break; case MT_STEAM: // Steam if (zdist > FixedMul(16*FRACUNIT, spring->scale)) @@ -341,14 +313,6 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) else object->momz = flipval*FixedMul(speed, FixedSqrt(FixedMul(spring->scale, object->scale))); // scale the speed with both objects' scales, just like with springs! - /* // SRB2kart - don't need state change - if (p) - { - P_ResetPlayer(p); - if (p->panim != PA_FALL) - P_SetPlayerMobjState(object, S_PLAY_FALL1); - } - */ break; default: break; @@ -365,10 +329,6 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) return; if ((sonic->pflags & PF_CARRIED) && sonic->mo->tracer == tails->mo) return; - - //if (!tails->powers[pw_tailsfly] && !(tails->charability == CA_FLY && (tails->mo->state >= &states[S_PLAY_SPC1] && tails->mo->state <= &states[S_PLAY_SPC4]))) - // return; // SRB2kart - no changey statey - if (tails->bot == 1) return; @@ -407,13 +367,6 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) { // Why block opposing teams from tailsflying each other? // Sneaking into the hands of a flying tails player in Race might be a viable strategy, who knows. - /* - if (gametype == GT_RACE || gametype == GT_COMPETITION - || (netgame && (tails->spectator || sonic->spectator)) - || (G_TagGametype() && (!(tails->pflags & PF_TAGIT) != !(sonic->pflags & PF_TAGIT))) - || (gametype == GT_MATCH) - || (G_GametypeHasTeams() && tails->ctfteam != sonic->ctfteam)) - sonic->pflags &= ~PF_CARRIED; */ if (tails->spectator || sonic->spectator || G_RaceGametype()) // SRB2kart sonic->pflags &= ~PF_CARRIED; else @@ -487,35 +440,6 @@ static boolean PIT_CheckThing(mobj_t *thing) } #endif - // Metal Sonic destroys tiny baby objects. - /*if (tmthing->type == MT_METALSONIC_RACE - && (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE)) - { - if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) - return true; - blockdist = thing->radius + tmthing->radius; - if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) - return true; // didn't hit it - // see if it went over / under - if (tmthing->z > thing->z + thing->height) - return true; // overhead - if (tmthing->z + tmthing->height < thing->z) - return true; // underneath - if (thing->type == MT_SPIKE) - { - S_StartSound(tmthing, thing->info->deathsound); - for (thing = thing->subsector->sector->thinglist; thing; thing = thing->snext) - if (thing->type == MT_SPIKE && thing->health > 0 && thing->flags & MF_SOLID && P_AproxDistance(thing->x - tmthing->x, thing->y - tmthing->y) < FixedMul(56*FRACUNIT, thing->scale)) - P_KillMobj(thing, tmthing, tmthing); - } - else - { - thing->health = 0; - P_KillMobj(thing, tmthing, tmthing); - } - return true; - }*/ - if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING)) return true; @@ -1207,21 +1131,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if ((tmthing->type == MT_THROWNBOUNCE && tmthing->fuse > 8*TICRATE) && thing->flags & MF_SOLID) return true; - // Missiles ignore Brak's helper. - /*if (thing->type == MT_BLACKEGGMAN_HELPER) - return true; - - // Hurting Brak - if (tmthing->type == MT_BLACKEGGMAN_MISSILE - && thing->type == MT_BLACKEGGMAN && tmthing->target != thing) - { - // Not if Brak's already in pain - if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35])) - P_SetMobjState(thing, thing->info->painstate); - return false; - }*/ - - if (!(thing->flags & MF_SHOOTABLE)/* && !(thing->type == MT_EGGSHIELD)*/) + if (!(thing->flags & MF_SHOOTABLE)) { // didn't do any damage return !(thing->flags & MF_SOLID); @@ -1232,80 +1142,11 @@ static boolean PIT_CheckThing(mobj_t *thing) && thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target) return true; // Don't give rings to your carry player by accident. - /*if (thing->type == MT_EGGSHIELD) - { - fixed_t touchx, touchy; - angle_t angle; - - if (P_AproxDistance(tmthing->x-thing->x, tmthing->y-thing->y) > - P_AproxDistance((tmthing->x-tmthing->momx)-thing->x, (tmthing->y-tmthing->momy)-thing->y)) - { - touchx = tmthing->x + tmthing->momx; - touchy = tmthing->y + tmthing->momy; - } - else - { - touchx = tmthing->x; - touchy = tmthing->y; - } - - angle = R_PointToAngle2(thing->x, thing->y, touchx, touchy) - thing->angle; - - if (!(angle > ANGLE_90 && angle < ANGLE_270)) // hit front of shield, didn't destroy it - return false; - else // hit shield from behind, shield is destroyed! - { - P_KillMobj(thing, tmthing, tmthing); - return false; - } - }*/ - if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE) return true; // damage / explode if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) P_DamageMobj(thing, tmthing, tmthing, 1); - /*else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player - && (thing->player->pflags & PF_JUMPED) - && !thing->player->powers[pw_flashing] - && thing->tracer != tmthing - && tmthing->target != thing) - { - // Hop on the missile for a ride! - thing->player->pflags |= PF_ITEMHANG; - thing->player->pflags &= ~PF_JUMPED; - P_SetTarget(&thing->tracer, tmthing); - P_SetTarget(&tmthing->target, thing); // Set owner to the player - P_SetTarget(&tmthing->tracer, NULL); // Disable homing-ness - tmthing->momz = 0; - - thing->angle = tmthing->angle; - - if (!demo.playback || P_AnalogMove(thing->player)) - { - if (thing->player == &players[consoleplayer]) - localangle[0] = thing->angle; - else if (thing->player == &players[displayplayers[1]]) - localangle[1] = thing->angle; - else if (thing->player == &players[displayplayers[2]]) - localangle[2] = thing->angle; - else if (thing->player == &players[displayplayers[3]]) - localangle[3] = thing->angle; - } - - return true; - } - else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player && ((thing->player->pflags & PF_ITEMHANG) || (thing->player->pflags & PF_JUMPED))) - { - // Ignore - } - else if (tmthing->type == MT_BLACKEGGMAN_GOOPFIRE) - { - P_UnsetThingPosition(tmthing); - tmthing->x = thing->x; - tmthing->y = thing->y; - P_SetThingPosition(tmthing); - }*/ else P_DamageMobj(thing, tmthing, tmthing->target, 1); @@ -1374,29 +1215,6 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetTarget(&thing->target, tmthing); } - // Respawn rings and items - /*if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) - && (tmthing->player || thing->player)) - { - mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing; - player_t *pl = (droneobj == thing) ? tmthing->player : thing->player; - - // Must be in bonus time, and must be NiGHTS, must wait about a second - // must be flying in the SAME DIRECTION as the last time you came through. - // not (your direction) xor (stored direction) - // In other words, you can't u-turn and respawn rings near the drone. - if (pl->bonustime && (pl->pflags & PF_NIGHTSMODE) && (INT32)leveltime > droneobj->extravalue2 && ( - !(pl->flyangle > 90 && pl->flyangle < 270) - ^ (droneobj->extravalue1 > 90 && droneobj->extravalue1 < 270) - )) - { - // Reload all the fancy ring stuff! - P_ReloadRings(); - } - droneobj->extravalue1 = pl->flyangle; - droneobj->extravalue2 = (INT32)leveltime + TICRATE; - }*/ - // check for special pickup if (thing->flags & MF_SPECIAL && tmthing->player) { @@ -1469,71 +1287,10 @@ static boolean PIT_CheckThing(mobj_t *thing) P_DamageMobj(thing, tmthing, tmthing, 1); else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer]) P_DamageMobj(tmthing, thing, thing, 1); - - /*if (G_BattleGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam)) - { - if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super]) - && !thing->player->powers[pw_super]) - P_DamageMobj(thing, tmthing, tmthing, 1); - else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super]) - && !tmthing->player->powers[pw_super]) - P_DamageMobj(tmthing, thing, thing, 1); - } - - // If players are using touch tag, seekers damage hiders. - if (G_TagGametype() && cv_touchtag.value && - ((thing->player->pflags & PF_TAGIT) != (tmthing->player->pflags & PF_TAGIT))) - { - if ((tmthing->player->pflags & PF_TAGIT) && !(thing->player->pflags & PF_TAGIT)) - P_DamageMobj(thing, tmthing, tmthing, 1); - else if ((thing->player->pflags & PF_TAGIT) && !(tmthing->player->pflags & PF_TAGIT)) - P_DamageMobj(tmthing, thing, tmthing, 1); - }*/ } - // Force solid players in hide and seek to avoid corner stacking. - // Kart: No Tailspickup ever, players are always solid - /*if (cv_tailspickup.value && gametype != GT_HIDEANDSEEK) - { - if (tmthing->player && thing->player) - { - P_DoTailsCarry(thing->player, tmthing->player); - return true; - } - } - else if (thing->player) { - if (thing->player-players == consoleplayer && botingame) - //CV_SetValue(&cv_analog2, true); - thing->player->pflags &= ~PF_CARRIED; - }*/ - if (thing->player) { - // Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only - /*if (tmthing->eflags & MFE_VERTICALFLIP - && (tmthing->z + tmthing->height + tmthing->momz < thing->z - || tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height)) - ; - else if (!(tmthing->eflags & MFE_VERTICALFLIP) - && (tmthing->z + tmthing->momz > thing->z + thing->height - || tmthing->z + tmthing->momz <= thing->z)) - ; - else if (P_IsObjectOnGround(thing) - && !P_IsObjectOnGround(tmthing) // Don't crush if the monitor is on the ground... - && (tmthing->flags & MF_SOLID)) - { - if (tmthing->flags & (MF_MONITOR|MF_PUSHABLE)) - { - // Objects kill you if it falls from above. - if (thing != tmthing->target) - P_DamageMobj(thing, tmthing, tmthing->target, 10000); - - tmthing->momz = -tmthing->momz/2; // Bounce, just for fun! - // The tmthing->target allows the pusher of the object - // to get the point if he topples it on an opponent. - } - }*/ - if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM) P_DoFanAndGasJet(tmthing, thing); } @@ -1755,9 +1512,7 @@ static boolean PIT_CheckThing(mobj_t *thing) ; // Fix a few nasty spring-jumping bugs that happen sometimes. // Monitors are not treated as solid to players who are jumping, spinning or gliding, // unless it's a CTF team monitor and you're on the wrong team - /*else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) - && !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2))) - ;*/ + // z checking at last // Treat noclip things as non-solid! else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID diff --git a/src/p_maputl.c b/src/p_maputl.c index 8fcd8f271..9eb80f2fc 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -136,33 +136,21 @@ void P_ClosestPointOnLine3D(fixed_t x, fixed_t y, fixed_t z, line_t *line, verte // INT32 P_PointOnLineSide(fixed_t x, fixed_t y, line_t *line) { - const vertex_t *v1 = line->v1; fixed_t dx, dy, left, right; if (!line->dx) - { - if (x <= v1->x) - return (line->dy > 0); + return x <= line->v1->x ? line->dy > 0 : line->dy < 0; - return (line->dy < 0); - } if (!line->dy) - { - if (y <= v1->y) - return (line->dx < 0); + return y <= line->v1->y ? line->dx < 0 : line->dx > 0; - return (line->dx > 0); - } - - dx = (x - v1->x); - dy = (y - v1->y); + dx = (x - line->v1->x); + dy = (y - line->v1->y); left = FixedMul(line->dy>>FRACBITS, dx); right = FixedMul(dy, line->dx>>FRACBITS); - if (right < left) - return 0; // front side - return 1; // back side + return right < left ? 0 : 1; } // @@ -225,39 +213,25 @@ static INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, divline_t *line) fixed_t dx, dy, left, right; if (!line->dx) - { - if (x <= line->x) - return line->dy > 0; + return x <= line->x ? line->dy > 0 : line->dy < 0; - return line->dy < 0; - } if (!line->dy) - { - if (y <= line->y) - return line->dx < 0; - - return line->dx > 0; - } + return y <= line->y ? line->dx < 0 : line->dx > 0; dx = (x - line->x); dy = (y - line->y); // try to quickly decide by looking at sign bits if ((line->dy ^ line->dx ^ dx ^ dy) & 0x80000000) - { - if ((line->dy ^ dx) & 0x80000000) - return 1; // left is negative - return 0; - } + return ((line->dy ^ dx) & 0x80000000) ? 1 : 0; left = FixedMul(line->dy>>8, dx>>8); right = FixedMul(dy>>8, line->dx>>8); - if (right < left) - return 0; // front side - return 1; // back side + return right < left ? 0 : 1; } + // // P_MakeDivline // diff --git a/src/p_mobj.c b/src/p_mobj.c index 1bb709970..958559b5e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10465,16 +10465,8 @@ void P_SpawnPrecipitation(void) //for (j = 0; j < cv_precipdensity.value; ++j) -- density is 1 for kart always { - if (cv_lessprecip.value) - { - x = basex*1.5 + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3); - y = basey*1.5 + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3); - } - else - { - x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3); - y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3); - } + x = ((cv_lessprecip.value ? basex*1.5 : basex) + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3)); + y = ((cv_lessprecip.value ? basey*1.5 : basey) + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3)); precipsector = R_IsPointInSubsector(x, y); diff --git a/src/r_bsp.c b/src/r_bsp.c index 97cbca37c..83f530f2a 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1313,9 +1313,9 @@ void R_RenderBSPNode(INT32 bspnum) { node_t *bsp; INT32 side; - + ps_numbspcalls.value.i++; - + while (!(bspnum & NF_SUBSECTOR)) // Found a subsector? { bsp = &nodes[bspnum]; @@ -1326,7 +1326,6 @@ void R_RenderBSPNode(INT32 bspnum) R_RenderBSPNode(bsp->children[side]); // Possibly divide back space. - if (!R_CheckBBox(bsp->bbox[side^1])) return; @@ -1334,7 +1333,8 @@ void R_RenderBSPNode(INT32 bspnum) } // PORTAL CULLING - if (portalcullsector) { + if (portalcullsector) + { sector_t *sect = subsectors[bspnum & ~NF_SUBSECTOR].sector; if (sect != portalcullsector) return; diff --git a/src/r_main.c b/src/r_main.c index 8a975498d..fce4fd92e 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -331,7 +331,7 @@ static void FlipCam4_OnChange(void) // // killough 5/2/98: reformatted // -INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *restrict node) +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; @@ -350,7 +350,7 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *restrict node) } // killough 5/2/98: reformatted -INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line) +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; diff --git a/src/r_main.h b/src/r_main.h index 63c7c3ab5..c8c3f4e8c 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -65,8 +65,8 @@ extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ]; #define NUMCOLORMAPS 32 // Utility functions. -INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node); -INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line); +INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t *node); +INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line); angle_t R_PointToAngle(fixed_t x, fixed_t y); angle_t R_PointToAngle64(INT64 x, INT64 y); angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1); diff --git a/src/r_things.c b/src/r_things.c index f954e0cbf..c35b88d61 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -3191,93 +3191,92 @@ static int skinSortFunc(const void *a, const void *b) //tbh i have no clue what const UINT8 val_a = *((const UINT8 *)a); const UINT8 val_b = *((const UINT8 *)b); - //return (strcmp(in1->realname, in2->realname) < 0) || (strcmp(in1->realname, in2->realname) ==); switch (cv_skinselectgridsort.value) { - case SKINMENUSORT_REALNAME: - //CONS_Printf("Sorting by realname\n"); - // check name - if ((temp = strcmp(in1->realname, in2->realname))) - return temp; - // sort by internal name - return strcmp(in1->name, in2->name); - break; + case SKINMENUSORT_REALNAME: + //CONS_Printf("Sorting by realname\n"); + // check name + if ((temp = strcmp(in1->realname, in2->realname))) + return temp; + // sort by internal name + return strcmp(in1->name, in2->name); + break; - case SKINMENUSORT_NAME: - //CONS_Printf("Sorting by name\n"); - return strcmp(in1->name, in2->name); - break; + case SKINMENUSORT_NAME: + //CONS_Printf("Sorting by name\n"); + return strcmp(in1->name, in2->name); + break; - case SKINMENUSORT_SPEED: - //CONS_Printf("Sorting by speed\n"); - // check speed - if (in1->kartspeed < in2->kartspeed) - return -1; - else if (in2->kartspeed < in1->kartspeed) - return 1; - // then check weight - if (in1->kartweight < in2->kartweight) - return -1; - else if (in2->kartweight < in1->kartweight) - return 1; - // then check name - if ((temp = strcmp(in1->realname, in2->realname))) - return temp; - // sort by internal name - return strcmp(in1->name, in2->name); - break; + case SKINMENUSORT_SPEED: + //CONS_Printf("Sorting by speed\n"); + // check speed + if (in1->kartspeed < in2->kartspeed) + return -1; + else if (in2->kartspeed < in1->kartspeed) + return 1; + // then check weight + if (in1->kartweight < in2->kartweight) + return -1; + else if (in2->kartweight < in1->kartweight) + return 1; + // then check name + if ((temp = strcmp(in1->realname, in2->realname))) + return temp; + // sort by internal name + return strcmp(in1->name, in2->name); + break; - case SKINMENUSORT_WEIGHT: - //CONS_Printf("Sorting by weight\n"); - // check weight - if (in1->kartweight < in2->kartweight) - return -1; - else if (in2->kartweight < in1->kartweight) - return 1; - // then check speed - if (in1->kartspeed < in2->kartspeed) - return -1; - else if (in2->kartspeed < in1->kartspeed) - return 1; - // then check name - if ((temp = strcmp(in1->realname, in2->realname))) - return temp; - // sort by internal name - return strcmp(in1->name, in2->name); - break; + case SKINMENUSORT_WEIGHT: + //CONS_Printf("Sorting by weight\n"); + // check weight + if (in1->kartweight < in2->kartweight) + return -1; + else if (in2->kartweight < in1->kartweight) + return 1; + // then check speed + if (in1->kartspeed < in2->kartspeed) + return -1; + else if (in2->kartspeed < in1->kartspeed) + return 1; + // then check name + if ((temp = strcmp(in1->realname, in2->realname))) + return temp; + // sort by internal name + return strcmp(in1->name, in2->name); + break; - case SKINMENUSORT_PREFCOLOR: - //CONS_Printf("Sorting by prefcolor\n"); - // check prefcolor - if (in1->prefcolor < in2->prefcolor) - return -1; - else if (in2->prefcolor < in1->prefcolor) - return 1; - // then check name - if ((temp = strcmp(in1->realname, in2->realname))) - return temp; - // sort by internal name - return strcmp(in1->name, in2->name); - break; + case SKINMENUSORT_PREFCOLOR: + //CONS_Printf("Sorting by prefcolor\n"); + // check prefcolor + if (in1->prefcolor < in2->prefcolor) + return -1; + else if (in2->prefcolor < in1->prefcolor) + return 1; + // then check name + if ((temp = strcmp(in1->realname, in2->realname))) + return temp; + // sort by internal name + return strcmp(in1->name, in2->name); + break; - case SKINMENUSORT_ID: - //CONS_Printf("Sorting by id\n"); - //how do i do by ID????? - //wait why dont i just convert the inputs to UINT32s - //please tell me im allowed to define variables in here since its a block + case SKINMENUSORT_ID: + //CONS_Printf("Sorting by id\n"); + //how do i do by ID????? + //wait why dont i just convert the inputs to UINT32s + //please tell me im allowed to define variables in here since its a block - if (val_a == val_b) - return 0; - else if (val_a < val_b) - return -1; - else - return 1; + if (val_a == val_b) + return 0; + else if (val_a < val_b) + return -1; + else + return 1; - default: - return strcmp(in1->name, in2->name); - break; + default: + return strcmp(in1->name, in2->name); + break; } //im scared this somehow will sometimes end up here so im gonna add this here just to be safe return strcmp(in1->name, in2->name); @@ -3285,8 +3284,8 @@ static int skinSortFunc(const void *a, const void *b) //tbh i have no clue what void sortSkinGrid(void) { - CONS_Printf("Sorting skin list (%d)...\n", cv_skinselectgridsort.value); - qs22j(skinsorted, numskins, sizeof(UINT8), skinSortFunc); + //CONS_Printf("Sorting skin list (%d)...\n", cv_skinselectgridsort.value); + qs22j(skinsorted, numskins, sizeof(UINT8), skinSortFunc); } // @@ -3601,7 +3600,7 @@ next_token: numallskins++; } - sortSkinGrid(); + //sortSkinGrid(); return; } diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 2f8e84767..643957c5c 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -343,6 +343,9 @@ static void write_backtrace(bt_crash_reason_t reason) if (compdate && comptime && comprevision && compbranch) fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch); + if (gamestate == GS_LEVEL) + fprintf(out, "Game map: %s\n", G_BuildMapName(gamemap)); + fprintf(out, "Time of crash: %s\n", asctime(timeinfo)); fprintf(out, "Caused by: "); @@ -3791,10 +3794,10 @@ const char *I_ClipboardPaste(void) if (!SDL_HasClipboardText()) return NULL; + clipboard_contents = SDL_GetClipboardText(); - memcpy(clipboard_modified, clipboard_contents, 255); + strlcpy(clipboard_modified, clipboard_contents, 256); SDL_free(clipboard_contents); - clipboard_modified[255] = 0; while (*i) { diff --git a/src/st_stuff.c b/src/st_stuff.c index 1c31f1f1e..06ce08c5e 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -746,13 +746,13 @@ static void ST_drawLevelTitle(void) { dupcalc = (dupcalc - BASEVIDWIDTH)>>1; - V_DrawFill(sub - dupcalc, bary+9, ttlnumxpos+dupcalc + 1, 2, 31); - V_DrawDiag(sub + ttlnumxpos + 1, bary, 11, 31); - V_DrawFill(sub - dupcalc, bary, ttlnumxpos+dupcalc, 10, gtc); - V_DrawDiag(sub + ttlnumxpos, bary, 10, gtc); + V_DrawFill(sub - dupcalc, bary+9, ttlnumxpos+dupcalc + 1, 2, 31|V_SNAPTOBOTTOM); + V_DrawDiag(sub + ttlnumxpos + 1, bary, 11, 31|V_SNAPTOBOTTOM); + V_DrawFill(sub - dupcalc, bary, ttlnumxpos+dupcalc, 10, gtc|V_SNAPTOBOTTOM); + V_DrawDiag(sub + ttlnumxpos, bary, 10, gtc|V_SNAPTOBOTTOM); if (subttl[0]) - V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, subttl); + V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, subttl); //else //V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, va("%s Mode", gametype_cons_t[gametype].strvalue)); } @@ -761,15 +761,15 @@ static void ST_drawLevelTitle(void) lvlttlxpos += sub; zonexpos += sub; - V_DrawLevelTitle(lvlttlxpos, bary-18, 0, lvlttl); + V_DrawLevelTitle(lvlttlxpos, bary-18, V_SNAPTOBOTTOM, lvlttl); if (strlen(zonttl) > 0) - V_DrawLevelTitle(zonexpos, bary+6, 0, zonttl); + V_DrawLevelTitle(zonexpos, bary+6, V_SNAPTOBOTTOM, zonttl); else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) - V_DrawLevelTitle(zonexpos, bary+6, 0, M_GetText("Zone")); + V_DrawLevelTitle(zonexpos, bary+6, V_SNAPTOBOTTOM, M_GetText("Zone")); if (actnum[0]) - V_DrawLevelTitle(ttlnumxpos+12, bary+6, 0, actnum); + V_DrawLevelTitle(ttlnumxpos+12, bary+6, V_SNAPTOBOTTOM, actnum); } // Draw the status bar overlay, customisable: the user chooses which @@ -799,16 +799,16 @@ static void ST_overlayDrawer(void) strlcpy(name, player_names[stplyr-players], 13);*/ // Show name of player being displayed - V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-40, V_HUDTRANS, M_GetText("VIEWPOINT:")); - V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-32, V_HUDTRANS|V_ALLOWLOWERCASE, player_names[stplyr-players]); + V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-40, V_SNAPTOBOTTOM|V_HUDTRANS, M_GetText("VIEWPOINT:")); + V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-32, V_SNAPTOBOTTOM|V_HUDTRANS|V_ALLOWLOWERCASE, player_names[stplyr-players]); } } else if (!demo.title) { if (!splitscreen) { - V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("VIEWPOINT:")); - V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-32, V_HUDTRANSHALF|V_ALLOWLOWERCASE, player_names[stplyr-players]); + V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-40, V_SNAPTOBOTTOM|V_HUDTRANSHALF, M_GetText("VIEWPOINT:")); + V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-32, V_SNAPTOBOTTOM|V_HUDTRANSHALF|V_ALLOWLOWERCASE, player_names[stplyr-players]); } else if (splitscreen == 1) { diff --git a/src/y_inter.c b/src/y_inter.c index 62f585492..c2cb23438 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -340,14 +340,11 @@ void Y_AnimatedVoteScreenCheck(void) boolean stopSearching = false; if (luaVoteScreen) - { strncpy(tmpPrefix, luaVoteScreen, 4); - } else { - if(G_BattleGametype()) { + if(G_BattleGametype()) strcpy(tmpPrefix, "BTLS"); - } } strncpy(animPrefix, tmpPrefix, 4); @@ -360,20 +357,22 @@ void Y_AnimatedVoteScreenCheck(void) currentAnimFrame = 0; INT32 i = 1; - while(!stopSearching){ + while(!stopSearching) + { boolean normalLumpExists = W_LumpExists(va("%sC%d", tmpPrefix, i)); boolean wideLumpExists = W_LumpExists(va("%sW%d", tmpPrefix, i)); - if(normalLumpExists || wideLumpExists){ - if(normalLumpExists){ + if (normalLumpExists || wideLumpExists) + { + if (normalLumpExists) foundAnimVoteFrames++; - } - if(wideLumpExists){ + + if (wideLumpExists) foundAnimVoteWideFrames++; - } - } else { // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking - stopSearching = true; } + else // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking + stopSearching = true; + i++; } } @@ -536,22 +535,21 @@ void Y_IntermissionDrawer(void) { UINT8 *colormap = R_GetTranslationColormap(*data.match.character[i], *data.match.color[i], GTC_CACHE); // i fucking hate this i fucking hate this i hate this so much - if (!players[data.match.num[i]].skinlocal) { - if (!players[data.match.num[i]].localskin) - if (cv_highresportrait.value) - V_DrawSmallMappedPatch(x+16, y-4, 0, facewantprefix[*data.match.character[i]], colormap); - else - V_DrawMappedPatch(x+16, y-4, 0, facerankprefix[*data.match.character[i]], colormap); - else - if (cv_highresportrait.value) - V_DrawSmallMappedPatch(x+16, y-4, 0, facewantprefix[players[data.match.num[i]].localskin - 1], colormap); - else - V_DrawMappedPatch(x+16, y-4, 0, facerankprefix[players[data.match.num[i]].localskin - 1], colormap); - } else { + if (!players[data.match.num[i]].skinlocal) + { + int skinIndex = players[data.match.num[i]].localskin ? players[data.match.num[i]].localskin - 1 : *data.match.character[i]; + if (cv_highresportrait.value) - V_DrawSmallMappedPatch(x+16, y-4, 0, localfacewantprefix[players[data.match.num[i]].localskin - 1], colormap); + V_DrawSmallMappedPatch(x + 16, y - 4, 0, facewantprefix[skinIndex], colormap); else - V_DrawMappedPatch(x+16, y-4, 0, localfacerankprefix[players[data.match.num[i]].localskin - 1], colormap); + V_DrawMappedPatch(x + 16, y - 4, 0, facerankprefix[skinIndex], colormap); + } + else + { + if (cv_highresportrait.value) + V_DrawSmallMappedPatch(x + 16, y - 4, 0, localfacewantprefix[players[data.match.num[i]].localskin - 1], colormap); + else + V_DrawMappedPatch(x + 16, y - 4, 0, localfacerankprefix[players[data.match.num[i]].localskin - 1], colormap); } } @@ -995,34 +993,6 @@ static void Y_UnloadData(void) UNLOAD(widebgpatch); UNLOAD(bgtile); UNLOAD(interpic); - - /*switch (intertype) - { - case int_coop: - // unload the coop and single player patches - UNLOAD(data.coop.ttlnum); - UNLOAD(data.coop.bonuspatches[3]); - UNLOAD(data.coop.bonuspatches[2]); - UNLOAD(data.coop.bonuspatches[1]); - UNLOAD(data.coop.bonuspatches[0]); - UNLOAD(data.coop.ptotal); - break; - case int_spec: - // unload the special stage patches - //UNLOAD(data.spec.cemerald); - //UNLOAD(data.spec.nowsuper); - UNLOAD(data.spec.bonuspatch); - UNLOAD(data.spec.pscore); - UNLOAD(data.spec.pcontinues); - break; - case int_match: - case int_race: - default: - //without this default, - //int_none, int_tag, int_chaos, and int_classicrace - //are not handled - break; - }*/ } // SRB2Kart: Voting! @@ -1031,36 +1001,29 @@ static void Y_UnloadData(void) // // Draw animated patch based on frame counter on vote screen // -void Y_DrawAnimatedVoteScreenPatch(boolean widePatch){ +static inline void Y_DrawAnimatedVoteScreenPatch(boolean widePatch) +{ char tempAnimPrefix[7]; (widePatch) ? strcpy(tempAnimPrefix, animWidePrefix) : strcpy(tempAnimPrefix, animPrefix); INT32 tempFoundAnimVoteFrames = (widePatch) ? foundAnimVoteWideFrames : foundAnimVoteFrames; - INT32 flags = V_SNAPTOBOTTOM | V_SNAPTOTOP; // Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0 - if(widePatch) { - if(currentAnimFrame > foundAnimVoteWideFrames-1){ + if (widePatch) + { + if (currentAnimFrame > foundAnimVoteWideFrames-1) currentAnimFrame = 0; - } - } else { - if(currentAnimFrame > foundAnimVoteFrames-1){ + } + else + { + if (currentAnimFrame > foundAnimVoteFrames-1) currentAnimFrame = 0; - } } - /*patch_t *currPatch = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame+1), PU_CACHE); - V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(currPatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) - (vid.height / vid.dupy) - SHORT(currPatch->height), - V_SNAPTOTOP|V_SNAPTOLEFT, currPatch); - if(votetic % 3 == 0 && !paused){*/ - - { - patch_t *background = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame + 1), PU_CACHE); - V_DrawScaledPatch(160 - (background->width / 2), (200 - (background->height)), flags, background); - } - if (lastvotetic != votetic && lastvotetic % 2 == 0) { - currentAnimFrame = (currentAnimFrame+1 > tempFoundAnimVoteFrames-1) ? 0 : currentAnimFrame + 1; // jeez no fucking idea how to make this shit not go nuts with interpolation - } + patch_t *background = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame + 1), PU_CACHE); + V_DrawScaledPatch(160 - (background->width / 2), (200 - (background->height)), V_SNAPTOBOTTOM|V_SNAPTOTOP, background); + + if (lastvotetic != votetic && lastvotetic % 2 == 0) + currentAnimFrame = (currentAnimFrame + 1 > tempFoundAnimVoteFrames - 1) ? 0 : currentAnimFrame + 1; // jeez no fucking idea how to make this shit not go nuts with interpolation } // @@ -1083,42 +1046,30 @@ void Y_VoteDrawer(void) if (!voteclient.loaded) return; - { - static angle_t rubyfloattime = 0; - rubyheight = FINESINE(rubyfloattime>>ANGLETOFINESHIFT); - rubyfloattime += FixedMul(ANGLE_MAX/NEWTICRATE, renderdeltatics); - } + static angle_t rubyfloattime = 0; + rubyheight = FINESINE(rubyfloattime>>ANGLETOFINESHIFT); + rubyfloattime += FixedMul(ANGLE_MAX/NEWTICRATE, renderdeltatics); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - if (widebgpatch && vid.width / vid.dupx > 320) { - - if(foundAnimVoteWideFrames == 0){ + if (widebgpatch && vid.width / vid.dupx > 320) + { + if (foundAnimVoteWideFrames == 0) V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(widebgpatch->width)/2), (vid.height / vid.dupy) - SHORT(widebgpatch->height), V_SNAPTOTOP|V_SNAPTOLEFT, widebgpatch); - } else { - // patch_t *currPatch = W_CachePatchName(va("%s%d", animPrefix, currentAnimFrame+1), PU_CACHE); - // V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(currPatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) - // (vid.height / vid.dupy) - SHORT(currPatch->height), - // V_SNAPTOTOP|V_SNAPTOLEFT, currPatch); - // if(votetic % 4 == 0 && !paused){ - // currentAnimFrame = (currentAnimFrame+1 > foundAnimVoteFrames-1) ? 0 : currentAnimFrame + 1; - // } + else Y_DrawAnimatedVoteScreenPatch(true); - } - } else { - if(foundAnimVoteFrames == 0) { + } + else + { + if (foundAnimVoteFrames == 0) V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(bgpatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) (vid.height / vid.dupy) - SHORT(bgpatch->height), V_SNAPTOTOP|V_SNAPTOLEFT, bgpatch); - } else { + else Y_DrawAnimatedVoteScreenPatch(false); - } - - } - for (i = 0; i < 4; i++) // First, we need to figure out the height of this thing... {