Commit graph

51 commits

Author SHA1 Message Date
James R
3a8a7f3cf5 Add thin timer font 2024-01-22 16:42:30 -08:00
James R
0e4222ae99 String drawing: add support for button character codes
- Bits 5 and 6 define the button state
  - 0xB0 - unpressed (neutral state)
  - 0xA0 - animating between pressed and unpressed
  - 0X90 - pressed down
- Bits 1 - 4 define the button type
  - 0x00 - up
  - 0x01 - down
  - 0x02 - right
  - 0x03 - left
  - 0x07 - R shoulder
  - 0x08 - L shoulder
  - 0x09 - start
  - 0x0A - A
  - 0x0B - B
  - 0x0C - C
  - 0x0D - X
  - 0x0E - Y
  - 0x0F - Z
- Button offsets and dimensions tweaked to my own taste
2024-01-16 05:19:36 -08:00
James R
0d07b83896 String drawing: fix width calculation not accounting for string dance character code 2024-01-16 05:12:12 -08:00
James R
a1e4479f5d String drawing: remove support for transparency character codes
- Frees up 5-7 bit range when 8th bit is set
2024-01-16 05:03:58 -08:00
James R
6d929b6be9 V_GetFontSpecification: bunch menu font 2023-12-29 17:03:54 -08:00
toaster
d0117bc222 Bottom-mounted Dialogue
Makes the drawer more complicated, but the benefit for most circumstances is significant.
In non-splitscreen contexts, pushes V_SLIDEIN|V_SNAPTOBOTTOM HUD elements upwards when the Dialogue is open.
2023-12-01 16:44:11 +00:00
James R.
7b3010c93d Fix many instances of splitscreen view number if there are duplicate displayplayers
- Avoid iterating displayplayers to find view number and
  prefer R_GetViewNumber.
- Iterate over all matching displayplayers if necessary,
  instead of stopping at the first match.
2023-10-03 21:28:33 -07:00
Eidolon
f62cf5fc83 Tracy Instrument I_FinishUpdate, software display 2023-09-18 16:18:38 -05:00
James R.
afeba341c0 Remove translucenthud cvar, let V_HUDTRANS fade in like V_SLIDEIN
- V_HUDTRANS does not fade if combined with V_SLIDEIN
  (since sliding elements are not supposed to fade).
- If not V_SPLITSCREEN, uses most opaque fade value among
  splitscreen players (since Tally will fade back out for
  specific players).
2023-09-11 18:30:40 -07:00
James R.
653db93022 V_AdjustXYWithSnap: refactor V_SLIDEIN, separate timer calculation, fix interpolation
- Move timer calculation to ST_CalculateFadeIn, cache in
  st_fadein
- Fix interpolation by using rendertimefrac instead of
  renderdeltatics
2023-09-11 18:22:29 -07:00
Sal
0675a4e527 Tally screen 2023-09-09 05:27:55 +00:00
Eidolon
78ccaf361b hwr2: upscale chosen resolution to desktop res 2023-09-01 15:30:04 -05:00
Eidolon
6f580606cd hwr2: Remove pass infrastructure
It's not worth trying to force the engine to conform to deferred
drawing.
2023-09-01 15:30:04 -05:00
James R
2e748636d7 Create V_CenteredTitleCardStringOffset
- V_TitleCardStringWidth no longer has the special case
  for punctuation, moved to this function instead.
- Handles both leading and trailing punctuation, and even
  spaces.

toaster-assisted, thank-you-toaster
2023-08-27 15:06:51 -07:00
James R
2328ceb4bc V_TitleCardStringWidth: don't count punctuation, in order to help centering
Punctuation, like ellipsis, normally offsets the centered
position of text. But this looks subjectively weird. By
not counting it, punctuation is basically allowed to
extend further off to the sides.

The difference looks like:

                   CENTER
                     ||
                     \/
                     ||
    OLD:    |   TOO LATE...    |
                     ||
    NEW:    |     TOO LATE...  |
                     ||
                     /\
                     ||
                   CENTER
2023-08-26 21:39:18 +01:00
James R
4f60d046ba V_DrawTitleCardString, V_TitleCardStringWidth: add 4P font support 2023-08-26 21:39:18 +01:00
James R
88cb0dda22 V_DrawFill: clip with cliprect 2023-08-25 17:24:13 -07:00
James R
6c0b042eed Refactor cvar definitions completely, move everything to cvars.cpp
- No need to call CV_RegisterVar
- Cvar definitions live in only one file, easier to locate
- Organized into sections -- netvars, cheats, etc.
- Use builder pattern to initialize cvars
- Still need to extern if you want to read the cvar value
2023-08-25 17:22:40 -07:00
Sally Coolatta
019546e846 Add server join splash
Just wanted to give literally any possibility of seeing the server contact as a client
2023-08-25 14:42:01 -04:00
toaster
e3d0662c7d Remove even a mention of the slur that once sat here 2023-07-19 21:23:27 +01:00
toaster
9b51c9c7fe V_GetHWConsBackColor: Fix for RR's console color list
Also, don't be such a weenie that you say slurs in your code comments
2023-07-18 19:52:14 +01:00
toaster
4b5612954f Scrunch up generic font by default
EXTREMELY popular, has positive effects across the entire game
Doesn't apply to console
2023-07-12 09:00:30 +01:00
toaster
e3ee8f9afa V_LevelNameHeight: Don't use strlen for possibly every iteration depending on optimisation level 2023-07-12 09:00:30 +01:00
toaster
9e4e996a5e V_ScaledWordWrap API changes
- The function is back to producing zone-allocated memory copies, like its precursor V_WordWrap
    - The author of this commit got rid of that dependency originally because it seemed like a fair part of the API, and meant static buffers could be used in certain circumstances, but it was necessary to revert for the following change.
- Newlines can now be inserted mid-word, treating the width provided as ironclad except in the case of single characters wider than the region.
    - This will be necessary for future work with the in-game chat.
    - Reserves 8 characters at first, then Z_Reallocs double that every time it runs out.
2023-07-12 09:00:30 +01:00
toaster
4675a9b059 Fix an issue where newlines could potentially double-up when faced with whitespace 2023-07-12 09:00:30 +01:00
toaster
c5dc430b50 V_6WIDTHSPACE no longer a pitfall for using V_DrawThinString
The bunched text behaviour is now the primary mode of operation for TINY_FONT.
2023-07-12 09:00:29 +01:00
toaster
445929fac9 Whitespace at the end of a line should NOT be counted when getting V_StringScaledWidth
Second guessed this change over lunch
2023-07-12 09:00:29 +01:00
toaster
277f7c51a3 V_ScaledWordWrap
Moves WordWrap to the font/V_GetFontSpecification system.

Much healthier long-term for our purposes, including the possibility of changing fonts for various contexts freely.
2023-07-12 09:00:29 +01:00
toaster
fb0fa9ac53 V_StringScaledWidth fixes
- Don't calculate a cy that's not actually needed
- Ignore colorcodes
- Update `right` when space characters are printed, too
2023-07-12 09:00:29 +01:00
toaster
fd4c1aeec3 fontspec_t, V_GetFontSpecification
Reduces quantity of copypasted code between V_StringWidthScaled and V_DrawStringScaled to far more manageable "this is an inner loop and cannot be abstracted" levels.

Guarantees consistency in handling across existing and future functions.
2023-07-12 09:00:29 +01:00
toaster
86784ae91a Add Menu Font (without using it anywhere)
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.

Adds the additional font. This requires a little cleanup before we can use it as the primary menu font, but worth at least putting this in the relevant places for later.
2023-07-12 09:00:29 +01:00
toaster
a536f884ce V_ALLOWLOWERCASE --> V_FORCEUPPERCASE
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.

Simple inversion on the face of things, but with a long tail of consequences, including 19 changed files.

Forced uppercase has been applied in a handful of locations where it was aesthetically imperative. Most menus will follow in another commit, so that that may be reverted if we change the default menu font.
2023-07-12 09:00:29 +01:00
toaster
4b97c171b5 Character-handling cleanup
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.

- V_CharacterValid
    - Makes checks for valid character drawing consistent and cleaner
    - If a case isn't being forced, characters that can have case applied but don't exist will attempt to draw their other case.
- V_DrawCharacterScaled
    - Saner core function that doesn't overload the character provided
    - Previous terrible is supported for now via backwards-compatible shim function
2023-07-12 09:00:28 +01:00
James R
d223019e15 OPPRF and PINGF font: use bunched character spacing
Intermission, Vote and ZVote affected.
2023-06-29 19:27:35 -07:00
toaster
15ff670a48 Reduce space width of Level Select high/low fonts - fancy fonts shouldn't be monospace 2023-06-27 17:32:03 +01:00
Eidolon
8d390c58d4 hwr2: Extract BlendMode enum from twodee
This enum is usable across multiple parts of hwr2 so it would be easier
to just keep it separate.
2023-05-19 18:54:19 -05:00
James R
4944b605d4 V_DrawStretchyFixedPatch: round bottom y value to nearest integer
Fixes 1px overshoot at some scales.
2023-04-26 07:35:54 -07:00
James R
520e2f796b Revert "V_DrawStretchyFixedPatch: multiply vertical scale in fixed-point"
This reverts commit 7d90e8f8f8.
2023-04-26 07:34:22 -07:00
James R
d7448bd597 V_StringScaledWidth: always return full width of bunched fonts 2023-04-23 08:25:50 -07:00
James R
7d90e8f8f8 V_DrawStretchyFixedPatch: multiply vertical scale in fixed-point
Fixes 1px overshoot at some scales.
2023-04-23 08:19:47 -07:00
James R
d9b406f4d0 Add TIMER_FONT, rename V_DrawKartString to V_DrawTimerString
Separates timer and FREE PLAY fonts.
2023-04-21 00:34:06 -07:00
Sally Coolatta
996ca9adad Z Voting 2023-04-20 15:55:38 -04:00
Sally Coolatta
b799862ccb Implement FG catchers
- Catcher comes down to grab your selection. (Needs per-player arrows, as discussed last night.)
- Catcher has more accurate rainbow cycle. Just looks a bit cleaner.
- Vote thumbnails now have outlines & dims, instead of transparency.
- Put voting roulette code into its own struct.
- Sped up voting roulette. (although it's not visible currently)
- Made modify vote stricter (kick hacked clients trying to do funky stuff)
- Added VOTE_TIME_WAIT_FOR_VOTE define. If enabled, voting timer will only start when any player gives a vote. Currently disable because it'd be exploitable without mid-game vote joining.
2023-04-10 02:10:01 -04:00
Eidolon
356e3317df hwr2: Do postimg in hardware
Depends on updated shaders
2023-04-02 19:46:21 -05:00
James R
eae2bc5c3c V_DrawStretchyFixedPatch: fix flipped patch offsets 2023-03-15 01:16:12 -07:00
Eidolon
df5f24e5c7 hwr2: separate Modulate and Alpha blending in 2d 2023-03-01 18:54:31 -06:00
Eidolon
42fa2cf286 hwr2: restore software CustomFadeScreen 2023-02-28 19:20:31 -06:00
Eidolon
158aaa6803 hwr2: fix DrawFill full screen special case 2023-02-26 18:47:42 -06:00
Eidolon
d855d96a10 hwr2: Add hardware 2D rendering 2023-02-26 18:47:42 -06:00
toaster
d2aed2d49e V_AdjustXYWithSnap: Support top/bottom slides if not V_SPLITSCREEN, V_SNAPTORIGHT, or V_SNAPTOLEFT, but do have V_SLIDEIN 2023-02-16 18:14:31 +00:00