From 038808434a8f823226a5c85b7ceac1844e9afc2f Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Sun, 19 May 2024 19:05:56 +0800 Subject: [PATCH] Some minor change and cleanup. --- README.md | 2 +- modules/audio/Audio.lua | 15 ---- modules/graphics/types/Image.lua | 18 ++--- modules/graphics/types/Mesh.lua | 55 ++------------ modules/math/Math.lua | 126 ------------------------------- modules/thread/types/Thread.lua | 12 +-- 6 files changed, 19 insertions(+), 209 deletions(-) diff --git a/README.md b/README.md index 0625ec1b..341c9024 100644 --- a/README.md +++ b/README.md @@ -204,7 +204,7 @@ print(s) ```lua return { - version = '11.4', + version = '11.5', modules = { { name = 'modulename', diff --git a/modules/audio/Audio.lua b/modules/audio/Audio.lua index ae099ddb..2895d3ee 100644 --- a/modules/audio/Audio.lua +++ b/modules/audio/Audio.lua @@ -182,21 +182,6 @@ return { }, }, }, - { - name = 'getSourceCount', - description = 'Gets the current number of simultaneously playing sources.', - variants = { - { - returns = { - { - type = 'number', - name = 'numSources', - description = 'The current number of simultaneously playing sources.', - }, - }, - }, - }, - }, { name = 'getVelocity', description = 'Returns the velocity of the listener.', diff --git a/modules/graphics/types/Image.lua b/modules/graphics/types/Image.lua index 60e7cc05..3b1e762b 100644 --- a/modules/graphics/types/Image.lua +++ b/modules/graphics/types/Image.lua @@ -16,30 +16,30 @@ return { }, functions = { { - name = 'getFlags', - description = 'Gets the flags used when the image was created.', + name = 'isCompressed', + description = 'Gets whether the Image was created from CompressedData.\n\nCompressed images take up less space in VRAM, and drawing a compressed image will generally be more efficient than drawing one created from raw pixel data.', variants = { { returns = { { - type = 'table', - name = 'flags', - description = 'A table with ImageFlag keys.', + type = 'boolean', + name = 'compressed', + description = 'Whether the Image is stored as a compressed texture on the GPU.', }, }, }, }, }, { - name = 'isCompressed', - description = 'Gets whether the Image was created from CompressedData.\n\nCompressed images take up less space in VRAM, and drawing a compressed image will generally be more efficient than drawing one created from raw pixel data.', + name = 'isFormatLinear', + description = 'Gets whether the Image was created with the linear (non-gamma corrected) flag set to true.\n\nThis method always returns false when gamma-correct rendering is not enabled.', variants = { { returns = { { type = 'boolean', - name = 'compressed', - description = 'Whether the Image is stored as a compressed texture on the GPU.', + name = 'linear', + description = 'Whether the Image\'s internal pixel format is linear (not gamma corrected), when gamma-correct rendering is enabled.', }, }, }, diff --git a/modules/graphics/types/Mesh.lua b/modules/graphics/types/Mesh.lua index 01370347..d03b497d 100644 --- a/modules/graphics/types/Mesh.lua +++ b/modules/graphics/types/Mesh.lua @@ -11,53 +11,6 @@ return { 'Object', }, functions = { - { - name = 'attachAttribute', - description = 'Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.', - variants = { - { - arguments = { - { - type = 'string', - name = 'name', - description = 'The name of the vertex attribute to attach.', - }, - { - type = 'Mesh', - name = 'mesh', - description = 'The Mesh to get the vertex attribute from.', - }, - }, - }, - { - description = 'If a Mesh wasn\'t created with a custom vertex format, it will have 3 vertex attributes named VertexPosition, VertexTexCoord, and VertexColor.\n\nCustom named attributes can be accessed in a vertex shader by declaring them as attribute vec4 MyCustomAttributeName; at the top-level of the vertex shader code. The name must match what was specified in the Mesh\'s vertex format and in the name argument of Mesh:attachAttribute.', - arguments = { - { - type = 'string', - name = 'name', - description = 'The name of the vertex attribute to attach.', - }, - { - type = 'Mesh', - name = 'mesh', - description = 'The Mesh to get the vertex attribute from.', - }, - { - type = 'VertexAttributeStep', - name = 'step', - description = 'Whether the attribute will be per-vertex or per-instance when the mesh is drawn.', - default = '\'pervertex\'', - }, - { - type = 'string', - name = 'attachname', - description = 'The name of the attribute to use in shader code. Defaults to the name of the attribute in the given mesh. Can be used to use a different name for this attribute when rendering.', - default = 'name', - }, - }, - }, - }, - }, { name = 'attachAttribute', description = 'Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.', @@ -127,6 +80,14 @@ return { }, }, }, + { + name = 'flush', + description = 'Immediately sends all modified vertex data in the Mesh to the graphics card.\n\nNormally it isn\'t necessary to call this method as love.graphics.draw(mesh, ...) will do it automatically if needed, but explicitly using **Mesh:flush** gives more control over when the work happens.\n\nIf this method is used, it generally shouldn\'t be called more than once (at most) between love.graphics.draw(mesh, ...) calls.', + variants = { + { + }, + }, + }, { name = 'getDrawMode', description = 'Gets the mode used when drawing the Mesh.', diff --git a/modules/math/Math.lua b/modules/math/Math.lua index 18691605..85e54c4a 100644 --- a/modules/math/Math.lua +++ b/modules/math/Math.lua @@ -117,132 +117,6 @@ return { }, }, }, - { - name = 'compress', - description = 'Compresses a string or data using a specific compression algorithm.', - variants = { - { - arguments = { - { - type = 'string', - name = 'rawstring', - description = 'The raw (un-compressed) string to compress.', - }, - { - type = 'CompressedDataFormat', - name = 'format', - description = 'The format to use when compressing the string.', - default = '\'lz4\'', - }, - { - type = 'number', - name = 'level', - description = 'The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.', - default = '-1', - }, - }, - returns = { - { - type = 'CompressedData', - name = 'compressedData', - description = 'A new Data object containing the compressed version of the string.', - }, - }, - }, - { - arguments = { - { - type = 'Data', - name = 'data', - description = 'A Data object containing the raw (un-compressed) data to compress.', - }, - { - type = 'CompressedDataFormat', - name = 'format', - description = 'The format to use when compressing the data.', - default = '\'lz4\'', - }, - { - type = 'number', - name = 'level', - description = 'The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.', - default = '-1', - }, - }, - returns = { - { - type = 'CompressedData', - name = 'compressedData', - description = 'A new Data object containing the compressed version of the raw data.', - }, - }, - }, - }, - }, - { - name = 'decompress', - description = 'Decompresses a CompressedData or previously compressed string or Data object.', - variants = { - { - arguments = { - { - type = 'CompressedData', - name = 'compressedData', - description = 'The compressed data to decompress.', - }, - }, - returns = { - { - type = 'string', - name = 'rawstring', - description = 'A string containing the raw decompressed data.', - }, - }, - }, - { - arguments = { - { - type = 'string', - name = 'compressedstring', - description = 'A string containing data previously compressed with love.math.compress.', - }, - { - type = 'CompressedDataFormat', - name = 'format', - description = 'The format that was used to compress the given string.', - }, - }, - returns = { - { - type = 'string', - name = 'rawstring', - description = 'A string containing the raw decompressed data.', - }, - }, - }, - { - arguments = { - { - type = 'Data', - name = 'data', - description = 'A Data object containing data previously compressed with love.math.compress.', - }, - { - type = 'CompressedDataFormat', - name = 'format', - description = 'The format that was used to compress the given data.', - }, - }, - returns = { - { - type = 'string', - name = 'rawstring', - description = 'A string containing the raw decompressed data.', - }, - }, - }, - }, - }, { name = 'gammaToLinear', description = 'Converts a color from gamma-space (sRGB) to linear-space (RGB). This is useful when doing gamma-correct rendering and you need to do math in linear RGB in the few cases where LÖVE doesn\'t handle conversions automatically.\n\nRead more about gamma-correct rendering here, here, and here.\n\nIn versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.', diff --git a/modules/thread/types/Thread.lua b/modules/thread/types/Thread.lua index c37defcc..518a9578 100644 --- a/modules/thread/types/Thread.lua +++ b/modules/thread/types/Thread.lua @@ -49,20 +49,10 @@ return { { description = 'Arguments passed to Thread:start are accessible in the thread\'s main file via \'\'\'...\'\'\' (the vararg expression.)', arguments = { - { - type = 'Variant', - name = 'arg1', - description = 'A string, number, boolean, LÖVE object, or simple table.', - }, - { - type = 'Variant', - name = 'arg2', - description = 'A string, number, boolean, LÖVE object, or simple table.', - }, { type = 'Variant', name = '...', - description = 'You can continue passing values to the thread.', + description = 'A string, number, boolean, LÖVE object, or simple table.', }, }, },