Skip to content

Commit 456e4e9

Browse files
committed
update submodules
1 parent 353b5e3 commit 456e4e9

14 files changed

+1073
-499
lines changed

3rd/lovr-api

Submodule lovr-api updated 473 files

meta/3rd/lovr/library/callback.lua

+4-10
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
---
1010
---
1111
---### NOTE:
12-
---Disabling the headset module can improve startup time a lot if you aren't intending to use `lovr.headset`.
12+
---Disabling unused modules can improve startup time.
1313
---
14-
---You can set `t.window` to nil to avoid creating the window. You can do it yourself later by using `lovr.graphics.createWindow`.
14+
---`t.window` can be set to nil to avoid creating the window.
1515
---
16-
---If the `lovr.graphics` module is disabled or the window isn't created, attempting to use any functionality requiring graphics may cause a crash.
16+
---The window can later be opened manually using `lovr.system.openWindow`.
1717
---
1818
---Enabling the `t.graphics.debug` flag will add additional error checks and will send messages from the GPU driver to the `lovr.log` callback.
1919
---
@@ -118,13 +118,7 @@ lovr.log = nil
118118
---
119119
---It can be overridden for custom mirroring behavior.
120120
---
121-
---For example, you could render a single eye instead of a stereo view, apply postprocessing effects, add 2D UI, or render the scene from an entirely different viewpoint for a third person camera.
122-
---
123-
---
124-
---### NOTE:
125-
---When this callback is called, the camera is located at `(0, 0, 0)` and is looking down the negative-z axis.
126-
---
127-
---Note that the usual graphics state applies while `lovr.mirror` is invoked, so you may need to reset graphics state at the end of `lovr.draw` to get the result you want.
121+
---For example, a stereo view could be drawn instead of a single eye or a 2D HUD could be rendered.
128122
---
129123
---@type fun()
130124
lovr.mirror = nil

meta/3rd/lovr/library/lovr/audio.lua

+18-6
Original file line numberDiff line numberDiff line change
@@ -689,17 +689,29 @@ function Source:tell(unit) end
689689
---Concrete.
690690
---
691691
---| "concrete"
692-
692+
---
693+
---Glass.
694+
---
693695
---| "glass"
694-
696+
---
697+
---Gravel.
698+
---
695699
---| "gravel"
696-
700+
---
701+
---Metal.
702+
---
697703
---| "metal"
698-
704+
---
705+
---Plaster.
706+
---
699707
---| "plaster"
700-
708+
---
709+
---Rock.
710+
---
701711
---| "rock"
702-
712+
---
713+
---Wood.
714+
---
703715
---| "wood"
704716

705717
---

meta/3rd/lovr/library/lovr/data.lua

+108-14
Original file line numberDiff line numberDiff line change
@@ -767,14 +767,14 @@ function ModelData:getWidth() end
767767
local Rasterizer = {}
768768

769769
---
770-
---Returns the advance metric of the font, in pixels.
770+
---Returns the advance metric for a glyph, in pixels.
771771
---
772-
---The advance is how many pixels the font advances horizontally after each glyph is rendered.
772+
---The advance is the horizontal distance to advance the cursor after rendering the glyph.
773773
---
774-
---This does not include kerning.
775-
---
776-
---@return number advance # The advance of the font, in pixels.
777-
function Rasterizer:getAdvance() end
774+
---@overload fun(self: lovr.Rasterizer, codepoint: number):number
775+
---@param character string # A character.
776+
---@return number advance # The advance of the glyph, in pixels.
777+
function Rasterizer:getAdvance(character) end
778778

779779
---
780780
---Returns the ascent metric of the font, in pixels.
@@ -784,6 +784,39 @@ function Rasterizer:getAdvance() end
784784
---@return number ascent # The ascent of the font, in pixels.
785785
function Rasterizer:getAscent() end
786786

787+
---
788+
---Returns the bearing metric for a glyph, in pixels.
789+
---
790+
---The bearing is the horizontal distance from the cursor to the edge of the glyph.
791+
---
792+
---@overload fun(self: lovr.Rasterizer, codepoint: number):number
793+
---@param character string # A character.
794+
---@return number bearing # The bearing of the glyph, in pixels.
795+
function Rasterizer:getBearing(character) end
796+
797+
---
798+
---Returns the bounding box of a glyph, or the bounding box surrounding all glyphs.
799+
---
800+
---Note that font coordinates use a cartesian "y up" coordinate system.
801+
---
802+
---@overload fun(self: lovr.Rasterizer, codepoint: number):number, number, number, number
803+
---@overload fun(self: lovr.Rasterizer):number, number, number, number
804+
---@param character string # A character.
805+
---@return number x1 # The left edge of the bounding box, in pixels.
806+
---@return number y1 # The bottom edge of the bounding box, in pixels.
807+
---@return number x2 # The right edge of the bounding box, in pixels.
808+
---@return number y2 # The top edge of the bounding box, in pixels.
809+
function Rasterizer:getBoundingBox(character) end
810+
811+
---
812+
---Returns the bezier curve control points defining the shape of a glyph.
813+
---
814+
---@overload fun(self: lovr.Rasterizer, codepoint: number, three: boolean):table
815+
---@param character string # A character.
816+
---@param three boolean # Whether the control points should be 3D or 2D.
817+
---@return table curves # A table of curves. Each curve is a table of numbers representing the control points (2 for a line, 3 for a quadratic curve, etc.).
818+
function Rasterizer:getCurves(character, three) end
819+
787820
---
788821
---Returns the descent metric of the font, in pixels.
789822
---
@@ -792,33 +825,88 @@ function Rasterizer:getAscent() end
792825
---@return number descent # The descent of the font, in pixels.
793826
function Rasterizer:getDescent() end
794827

828+
---
829+
---Returns the dimensions of a glyph, or the dimensions of any glyph.
830+
---
831+
---@overload fun(self: lovr.Rasterizer, codepoint: number):number, number
832+
---@overload fun(self: lovr.Rasterizer):number, number
833+
---@param character string # A character.
834+
---@return number width # The width, in pixels.
835+
---@return number height # The height, in pixels.
836+
function Rasterizer:getDimensions(character) end
837+
838+
---
839+
---Returns the size of the font, in pixels.
840+
---
841+
---This is the size the rasterizer was created with, and defines the size of images it rasterizes.
842+
---
843+
---@return number size # The font size, in pixels.
844+
function Rasterizer:getFontSize() end
845+
795846
---
796847
---Returns the number of glyphs stored in the font file.
797848
---
798849
---@return number count # The number of glyphs stored in the font file.
799850
function Rasterizer:getGlyphCount() end
800851

801852
---
802-
---Returns the height metric of the font, in pixels.
853+
---Returns the height of a glyph, or the maximum height of any glyph.
854+
---
855+
---@overload fun(self: lovr.Rasterizer, codepoint: number):number
856+
---@overload fun(self: lovr.Rasterizer):number
857+
---@param character string # A character.
858+
---@return number height # The height, in pixels.
859+
function Rasterizer:getHeight(character) end
860+
861+
---
862+
---Returns the kerning between 2 glyphs, in pixels.
863+
---
864+
---Kerning is a slight horizontal adjustment between 2 glyphs to improve the visual appearance.
803865
---
804-
---@return number height # The height of the font, in pixels.
805-
function Rasterizer:getHeight() end
866+
---It will often be negative.
867+
---
868+
---@overload fun(self: lovr.Rasterizer, firstCodepoint: number, second: string):number
869+
---@overload fun(self: lovr.Rasterizer, first: string, secondCodepoint: number):number
870+
---@overload fun(self: lovr.Rasterizer, firstCodepoint: number, secondCodepoint: number):number
871+
---@param first string # The first character.
872+
---@param second string # The second character.
873+
---@return number keming # The kerning between the two glyphs.
874+
function Rasterizer:getKerning(first, second) end
806875

807876
---
808-
---Returns the line height metric of the font, in pixels.
877+
---Returns the leading metric of the font, in pixels.
878+
---
879+
---This is the full amount of space between lines.
809880
---
810-
---This is how far apart lines are.
881+
---@return number leading # The font leading, in pixels.
882+
function Rasterizer:getLeading() end
883+
884+
---
885+
---Returns the width of a glyph, or the maximum width of any glyph.
811886
---
812-
---@return number height # The line height of the font, in pixels.
813-
function Rasterizer:getLineHeight() end
887+
---@overload fun(self: lovr.Rasterizer, codepoint: number):number
888+
---@overload fun(self: lovr.Rasterizer):number
889+
---@param character string # A character.
890+
---@return number width # The width, in pixels.
891+
function Rasterizer:getWidth(character) end
814892

815893
---
816-
---Check if the Rasterizer can rasterize a set of glyphs.
894+
---Returns whether the Rasterizer can rasterize a set of glyphs.
817895
---
818896
---@vararg any # Strings (sets of characters) or numbers (character codes) to check for.
819897
---@return boolean hasGlyphs # true if the Rasterizer can rasterize all of the supplied characters, false otherwise.
820898
function Rasterizer:hasGlyphs(...) end
821899

900+
---
901+
---Returns an `Image` containing a rasterized glyph.
902+
---
903+
---@overload fun(self: lovr.Rasterizer, codepoint: number, spread?: number, padding?: number):lovr.Image
904+
---@param character string # A character.
905+
---@param spread? number # The width of the distance field, for signed distance field rasterization.
906+
---@param padding? number # The number of pixels of padding to add at the edges of the image.
907+
---@return lovr.Image image # The glyph image. It will be in the `rgba32f` format.
908+
function Rasterizer:newImage(character, spread, padding) end
909+
822910
---
823911
---A Sound stores the data for a sound.
824912
---
@@ -1325,6 +1413,12 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end
13251413
---
13261414
---| "d32f"
13271415
---
1416+
---One 32-bit floating point depth channel and one 8-bit stencil channel.
1417+
---
1418+
---5 bytes per pixel.
1419+
---
1420+
---| "d32fs8"
1421+
---
13281422
---3 channels.
13291423
---
13301424
---8 bytes per 4x4 block, or 0.5 bytes per pixel.

meta/3rd/lovr/library/lovr/event.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function lovr.event.pump() end
4848
---Only nil, booleans, numbers, strings, and LÖVR objects are supported types for event data.
4949
---
5050
---@param name string # The name of the event.
51-
function lovr.event.push(name) end
51+
---@vararg any # The arguments for the event. Currently, up to 4 are supported.
52+
function lovr.event.push(name, ...) end
5253

5354
---
5455
---Pushes an event to quit.

0 commit comments

Comments
 (0)