mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-09 20:47:26 +01:00
all: fix typos (#2864)
This commit is contained in:
parent
3e50f59ca4
commit
b8df1217c3
2
blend.go
2
blend.go
@ -49,7 +49,7 @@ type Blend struct {
|
|||||||
// BlendFactorDestinationRGB is a factor for destination RGB values.
|
// BlendFactorDestinationRGB is a factor for destination RGB values.
|
||||||
BlendFactorDestinationRGB BlendFactor
|
BlendFactorDestinationRGB BlendFactor
|
||||||
|
|
||||||
// BlendFactorDestinationAlpha is a factor for destination apha values.
|
// BlendFactorDestinationAlpha is a factor for destination alpha values.
|
||||||
BlendFactorDestinationAlpha BlendFactor
|
BlendFactorDestinationAlpha BlendFactor
|
||||||
|
|
||||||
// BlendOperationRGB is an operation for source and destination RGB values.
|
// BlendOperationRGB is an operation for source and destination RGB values.
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
- (void)initView {
|
- (void)initView {
|
||||||
// initView must be called only when viewDidLoad_, and gameSet_ are true i.e. mobile.SetGame is called.
|
// initView must be called only when viewDidLoad_, and gameSet_ are true i.e. mobile.SetGame is called.
|
||||||
// Or, EbitenmobileviewIsGL causes a dead lock (#2768).
|
// Or, EbitenmobileviewIsGL causes a dead lock (#2768).
|
||||||
// A game is requried to determine a graphics driver, and EbitenmobileviewIsGL cannot return a value without a game.
|
// A game is required to determine a graphics driver, and EbitenmobileviewIsGL cannot return a value without a game.
|
||||||
NSAssert(viewDidLoad_ && gameSet_, @"viewDidLoad must be called and a game must be set at initView");
|
NSAssert(viewDidLoad_ && gameSet_, @"viewDidLoad must be called and a game must be set at initView");
|
||||||
|
|
||||||
if (!started_) {
|
if (!started_) {
|
||||||
|
@ -72,7 +72,7 @@ func (c *ColorM) Apply(clr color.Color) color.Color {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Concat multiplies a color matrix with the other color matrix.
|
// Concat multiplies a color matrix with the other color matrix.
|
||||||
// This is same as muptiplying the matrix other and the matrix c in this order.
|
// This is same as multiplying the matrix other and the matrix c in this order.
|
||||||
//
|
//
|
||||||
// Deprecated: as of v2.5. Use the colorm package instead.
|
// Deprecated: as of v2.5. Use the colorm package instead.
|
||||||
func (c *ColorM) Concat(other ColorM) {
|
func (c *ColorM) Concat(other ColorM) {
|
||||||
|
@ -126,7 +126,7 @@ func (f *Field) flushable() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// flushableLine returns a boolean value indicating whether
|
// flushableLine returns a boolean value indicating whether
|
||||||
// the line j is flushabled or not.
|
// the line j is flushable or not.
|
||||||
func (f *Field) flushableLine(j int) bool {
|
func (f *Field) flushableLine(j int) bool {
|
||||||
for i := 0; i < fieldBlockCountX; i++ {
|
for i := 0; i < fieldBlockCountX; i++ {
|
||||||
if f.blocks[i][j] == BlockTypeNone {
|
if f.blocks[i][j] == BlockTypeNone {
|
||||||
|
@ -120,7 +120,7 @@ func (c *gamepadConfig) initializeIfNeeded() {
|
|||||||
// It is assumed that all axes are not pressed here.
|
// It is assumed that all axes are not pressed here.
|
||||||
//
|
//
|
||||||
// These default values are used to detect if an axis is actually pressed.
|
// These default values are used to detect if an axis is actually pressed.
|
||||||
// For example, on PS4 controllers, L2/R2's axes valuse can be -1.0.
|
// For example, on PS4 controllers, L2/R2's axes value can be -1.0.
|
||||||
if c.defaultAxesValues == nil {
|
if c.defaultAxesValues == nil {
|
||||||
c.defaultAxesValues = map[int]float64{}
|
c.defaultAxesValues = map[int]float64{}
|
||||||
na := ebiten.GamepadAxisCount(c.gamepadID)
|
na := ebiten.GamepadAxisCount(c.gamepadID)
|
||||||
@ -138,7 +138,7 @@ func (c *gamepadConfig) Reset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Scan scans the current input state and assigns the given virtual gamepad button b
|
// Scan scans the current input state and assigns the given virtual gamepad button b
|
||||||
// to the current (pysical) pressed buttons of the gamepad.
|
// to the current (physical) pressed buttons of the gamepad.
|
||||||
func (c *gamepadConfig) Scan(b virtualGamepadButton) bool {
|
func (c *gamepadConfig) Scan(b virtualGamepadButton) bool {
|
||||||
if !c.gamepadIDInitialized {
|
if !c.gamepadIDInitialized {
|
||||||
panic("not reached")
|
panic("not reached")
|
||||||
@ -249,7 +249,7 @@ func (c *gamepadConfig) IsButtonJustPressed(b virtualGamepadButton) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name returns the pysical button's name for the given virtual button.
|
// Name returns the physical button's name for the given virtual button.
|
||||||
func (c *gamepadConfig) ButtonName(b virtualGamepadButton) string {
|
func (c *gamepadConfig) ButtonName(b virtualGamepadButton) string {
|
||||||
if !c.gamepadIDInitialized {
|
if !c.gamepadIDInitialized {
|
||||||
panic("not reached")
|
panic("not reached")
|
||||||
|
@ -82,7 +82,7 @@ func transpose(bs [][]bool) [][]bool {
|
|||||||
for j, row := range bs {
|
for j, row := range bs {
|
||||||
blocks[j] = make([]bool, len(row))
|
blocks[j] = make([]bool, len(row))
|
||||||
}
|
}
|
||||||
// Tranpose the argument matrix.
|
// Transpose the argument matrix.
|
||||||
for i, col := range bs {
|
for i, col := range bs {
|
||||||
for j, v := range col {
|
for j, v := range col {
|
||||||
blocks[j][i] = v
|
blocks[j][i] = v
|
||||||
|
@ -104,7 +104,7 @@ func init() {
|
|||||||
for i := range keys {
|
for i := range keys {
|
||||||
freq := baseFreq * math.Exp2(float64(i-1)/12.0)
|
freq := baseFreq * math.Exp2(float64(i-1)/12.0)
|
||||||
|
|
||||||
// Clculate the wave data for the freq.
|
// Calculate the wave data for the freq.
|
||||||
length := 4 * sampleRate * baseFreq / int(freq)
|
length := 4 * sampleRate * baseFreq / int(freq)
|
||||||
l := make([]int16, length)
|
l := make([]int16, length)
|
||||||
r := make([]int16, length)
|
r := make([]int16, length)
|
||||||
|
@ -97,7 +97,7 @@ func (g *gameForUI) NewOffscreenImage(width, height int) *ui.Image {
|
|||||||
// and the shader program unexpectedly picks the pixel on the edges.
|
// and the shader program unexpectedly picks the pixel on the edges.
|
||||||
imageType := atlas.ImageTypeUnmanaged
|
imageType := atlas.ImageTypeUnmanaged
|
||||||
if ui.Get().IsScreenClearedEveryFrame() {
|
if ui.Get().IsScreenClearedEveryFrame() {
|
||||||
// A violatile image is also always isolated.
|
// A volatile image is also always isolated.
|
||||||
imageType = atlas.ImageTypeVolatile
|
imageType = atlas.ImageTypeVolatile
|
||||||
}
|
}
|
||||||
g.offscreen = newImage(image.Rect(0, 0, width, height), imageType)
|
g.offscreen = newImage(image.Rect(0, 0, width, height), imageType)
|
||||||
|
@ -4541,7 +4541,7 @@ func TestImageWritePixelAndDeallocate(t *testing.T) {
|
|||||||
img.WritePixels(pix)
|
img.WritePixels(pix)
|
||||||
img.Deallocate()
|
img.Deallocate()
|
||||||
|
|
||||||
// Confirm that any pixel information is cleared after Dealocate is called.
|
// Confirm that any pixel information is cleared after Deallocate is called.
|
||||||
if got, want := img.At(0, 0), (color.RGBA{}); got != want {
|
if got, want := img.At(0, 0), (color.RGBA{}); got != want {
|
||||||
t.Errorf("got: %v, want: %v", got, want)
|
t.Errorf("got: %v, want: %v", got, want)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ type ColorM interface {
|
|||||||
Equals(other ColorM) bool
|
Equals(other ColorM) bool
|
||||||
|
|
||||||
// Concat multiplies a color matrix with the other color matrix.
|
// Concat multiplies a color matrix with the other color matrix.
|
||||||
// This is same as muptiplying the matrix other and the matrix c in this order.
|
// This is same as multiplying the matrix other and the matrix c in this order.
|
||||||
Concat(other ColorM) ColorM
|
Concat(other ColorM) ColorM
|
||||||
|
|
||||||
// Scale scales the matrix by (r, g, b, a).
|
// Scale scales the matrix by (r, g, b, a).
|
||||||
@ -618,7 +618,7 @@ func (c *colorMImplBodyTranslate) Concat(other ColorM) ColorM {
|
|||||||
|
|
||||||
return &colorMImplBodyTranslate{
|
return &colorMImplBodyTranslate{
|
||||||
// TODO: This is a temporary hack to calculate multiply of transposed matrices.
|
// TODO: This is a temporary hack to calculate multiply of transposed matrices.
|
||||||
// Fix mulSquare implmentation and swap the arguments.
|
// Fix mulSquare implementation and swap the arguments.
|
||||||
body: mulSquare(rhsb, &lhsb, ColorMDim-1),
|
body: mulSquare(rhsb, &lhsb, ColorMDim-1),
|
||||||
translate: [...]float32{
|
translate: [...]float32{
|
||||||
lhsb[0]*rhst[0] + lhsb[4]*rhst[1] + lhsb[8]*rhst[2] + lhsb[12]*rhst[3] + lhst[0],
|
lhsb[0]*rhst[0] + lhsb[4]*rhst[1] + lhsb[8]*rhst[2] + lhsb[12]*rhst[3] + lhst[0],
|
||||||
@ -755,7 +755,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ChangeHSV changes HSV (Hue-Saturation-Value) elements.
|
// ChangeHSV changes HSV (Hue-Saturation-Value) elements.
|
||||||
// hueTheta is a radian value to ratate hue.
|
// hueTheta is a radian value to rotate hue.
|
||||||
// saturationScale is a value to scale saturation.
|
// saturationScale is a value to scale saturation.
|
||||||
// valueScale is a value to scale value (a.k.a. brightness).
|
// valueScale is a value to scale value (a.k.a. brightness).
|
||||||
//
|
//
|
||||||
|
@ -791,7 +791,7 @@ func TestIteratingImagesToPutOnSourceBackend(t *testing.T) {
|
|||||||
dst := atlas.NewImage(w, h, atlas.ImageTypeRegular)
|
dst := atlas.NewImage(w, h, atlas.ImageTypeRegular)
|
||||||
defer dst.Deallocate()
|
defer dst.Deallocate()
|
||||||
|
|
||||||
// Use srcs as detinations once.
|
// Use srcs as destinations once.
|
||||||
vs := quadVertices(w, h, 0, 0, 1)
|
vs := quadVertices(w, h, 0, 0, 1)
|
||||||
is := graphics.QuadIndices()
|
is := graphics.QuadIndices()
|
||||||
dr := image.Rect(0, 0, w, h)
|
dr := image.Rect(0, 0, w, h)
|
||||||
|
@ -32,7 +32,7 @@ var (
|
|||||||
lastNow int64
|
lastNow int64
|
||||||
|
|
||||||
// lastSystemTime is the last system time in the previous UpdateFrame.
|
// lastSystemTime is the last system time in the previous UpdateFrame.
|
||||||
// lastSystemTime indicates the logical time in the game, so this can be bigger than the curren time.
|
// lastSystemTime indicates the logical time in the game, so this can be bigger than the current time.
|
||||||
lastSystemTime int64
|
lastSystemTime int64
|
||||||
|
|
||||||
actualFPS float64
|
actualFPS float64
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
|
|
||||||
// MakeContextCurrent makes the context of the window current.
|
// MakeContextCurrent makes the context of the window current.
|
||||||
// Originally GLFW 3 passes a null pointer to detach the context.
|
// Originally GLFW 3 passes a null pointer to detach the context.
|
||||||
// But since we're using receievers, DetachCurrentContext should
|
// But since we're using receivers, DetachCurrentContext should
|
||||||
// be used instead.
|
// be used instead.
|
||||||
func (w *Window) MakeContextCurrent() error {
|
func (w *Window) MakeContextCurrent() error {
|
||||||
C.glfwMakeContextCurrent(w.data)
|
C.glfwMakeContextCurrent(w.data)
|
||||||
|
@ -44,7 +44,7 @@ func init() {
|
|||||||
C.glfwSetErrorCallbackCB()
|
C.glfwSetErrorCallbackCB()
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetchErrorIgnoringPlatformError is fetchError igoring platformError.
|
// fetchErrorIgnoringPlatformError is fetchError ignoring platformError.
|
||||||
func fetchErrorIgnoringPlatformError() error {
|
func fetchErrorIgnoringPlatformError() error {
|
||||||
select {
|
select {
|
||||||
case err := <-lastError:
|
case err := <-lastError:
|
||||||
|
@ -33,7 +33,7 @@ type platformWindowState struct {
|
|||||||
lastCursorPosX int
|
lastCursorPosX int
|
||||||
lastCursorPosY int
|
lastCursorPosY int
|
||||||
|
|
||||||
// The last recevied high surrogate when decoding pairs of UTF-16 messages
|
// The last received high surrogate when decoding pairs of UTF-16 messages
|
||||||
highSurrogate uint16
|
highSurrogate uint16
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1361,7 +1361,7 @@ func registerWindowClassWin32() error {
|
|||||||
wc.hCursor = cursor
|
wc.hCursor = cursor
|
||||||
className, err := windows.UTF16FromString(_GLFW_WNDCLASSNAME)
|
className, err := windows.UTF16FromString(_GLFW_WNDCLASSNAME)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("glfw: _GLFW_WNDCLASSNAME must not inclucde a NUL character")
|
panic("glfw: _GLFW_WNDCLASSNAME must not include a NUL character")
|
||||||
}
|
}
|
||||||
wc.lpszClassName = &className[0]
|
wc.lpszClassName = &className[0]
|
||||||
defer runtime.KeepAlive(className)
|
defer runtime.KeepAlive(className)
|
||||||
|
@ -991,7 +991,7 @@ static Window createHelperWindow(void)
|
|||||||
CWEventMask, &wa);
|
CWEventMask, &wa);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the pipe for empty events without assumuing the OS has pipe2(2)
|
// Create the pipe for empty events without assuming the OS has pipe2(2)
|
||||||
//
|
//
|
||||||
static GLFWbool createEmptyEventPipe(void)
|
static GLFWbool createEmptyEventPipe(void)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
// ManagedBytes is a managed byte slice.
|
// ManagedBytes is a managed byte slice.
|
||||||
// The internal byte alice are managed in a pool.
|
// The internal byte alice are managed in a pool.
|
||||||
// ManagedBytes is useful when its lifetime is explicit, as the underlying byte slice can be reused for another ManagedBytes later.
|
// ManagedBytes is useful when its lifetime is explicit, as the underlying byte slice can be reused for another ManagedBytes later.
|
||||||
// This can redduce allocations and GCs.
|
// This can reduce allocations and GCs.
|
||||||
type ManagedBytes struct {
|
type ManagedBytes struct {
|
||||||
bytes []byte
|
bytes []byte
|
||||||
pool *bytesPool
|
pool *bytesPool
|
||||||
|
@ -205,8 +205,8 @@ func dstRegionFromVertices(vertices []float32) (minX, minY, maxX, maxY float32)
|
|||||||
func mightOverlapDstRegions(vertices1, vertices2 []float32) bool {
|
func mightOverlapDstRegions(vertices1, vertices2 []float32) bool {
|
||||||
minX1, minY1, maxX1, maxY1 := dstRegionFromVertices(vertices1)
|
minX1, minY1, maxX1, maxY1 := dstRegionFromVertices(vertices1)
|
||||||
minX2, minY2, maxX2, maxY2 := dstRegionFromVertices(vertices2)
|
minX2, minY2, maxX2, maxY2 := dstRegionFromVertices(vertices2)
|
||||||
const mergin = 1
|
const margin = 1
|
||||||
return minX1 < maxX2+mergin && minX2 < maxX1+mergin && minY1 < maxY2+mergin && minY2 < maxY1+mergin
|
return minX1 < maxX2+margin && minX2 < maxX1+margin && minY1 < maxY2+margin && minY2 < maxY1+margin
|
||||||
}
|
}
|
||||||
|
|
||||||
// writePixelsCommand represents a command to replace pixels of an image.
|
// writePixelsCommand represents a command to replace pixels of an image.
|
||||||
|
@ -184,7 +184,7 @@ func (q *commandQueue) Flush(graphicsDriver graphicsdriver.Graphics, endFrame bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
var sync bool
|
var sync bool
|
||||||
// Disable asynchrnous rendering when vsync is on, as this causes a rendering delay (#2822).
|
// Disable asynchronous rendering when vsync is on, as this causes a rendering delay (#2822).
|
||||||
if endFrame && atomic.LoadInt32(&vsyncEnabled) != 0 {
|
if endFrame && atomic.LoadInt32(&vsyncEnabled) != 0 {
|
||||||
sync = true
|
sync = true
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ func newGraphics11(useWARP bool, useDebugLayer bool) (gr11 *graphics11, ferr err
|
|||||||
flags |= _D3D11_CREATE_DEVICE_DEBUG
|
flags |= _D3D11_CREATE_DEVICE_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avoid _D3D_FEATURE_LEVEL_11_1 as DirectX 11.0 doesn't recgonize this.
|
// Avoid _D3D_FEATURE_LEVEL_11_1 as DirectX 11.0 doesn't recognize this.
|
||||||
// Avoid _D3D_FEATURE_LEVEL_9_* for some shaders features (#1431).
|
// Avoid _D3D_FEATURE_LEVEL_9_* for some shaders features (#1431).
|
||||||
featureLevels := []_D3D_FEATURE_LEVEL{
|
featureLevels := []_D3D_FEATURE_LEVEL{
|
||||||
_D3D_FEATURE_LEVEL_11_0,
|
_D3D_FEATURE_LEVEL_11_0,
|
||||||
|
@ -688,7 +688,7 @@ func (g *graphics12) End(present bool) error {
|
|||||||
|
|
||||||
// Release vertices and indices buffers when too many ones were created.
|
// Release vertices and indices buffers when too many ones were created.
|
||||||
// The threshold is an arbitrary number.
|
// The threshold is an arbitrary number.
|
||||||
// This is needed espciallly for testings, where present is always false.
|
// This is needed especially for testings, where present is always false.
|
||||||
if len(g.vertices[g.frameIndex]) >= 16 {
|
if len(g.vertices[g.frameIndex]) >= 16 {
|
||||||
if err := g.waitForCommandQueue(); err != nil {
|
if err := g.waitForCommandQueue(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -625,7 +625,7 @@ func (cs *compileState) parseExpr(block *block, fname string, expr ast.Expr, mar
|
|||||||
}, []shaderir.Type{t}, stmts, true
|
}, []shaderir.Type{t}, stmts, true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Even if the function doesn't return anything, calling the function should be done eariler to keep
|
// Even if the function doesn't return anything, calling the function should be done earlier to keep
|
||||||
// the evaluation order.
|
// the evaluation order.
|
||||||
stmts = append(stmts, shaderir.Stmt{
|
stmts = append(stmts, shaderir.Stmt{
|
||||||
Type: shaderir.ExprStmt,
|
Type: shaderir.ExprStmt,
|
||||||
|
@ -351,7 +351,7 @@ func (i *bigOffscreenImage) drawTriangles(srcs [graphics.ShaderImageCount]*Image
|
|||||||
if len(i.tmpVerticesForCopying) < 4*graphics.VertexFloatCount {
|
if len(i.tmpVerticesForCopying) < 4*graphics.VertexFloatCount {
|
||||||
i.tmpVerticesForCopying = make([]float32, 4*graphics.VertexFloatCount)
|
i.tmpVerticesForCopying = make([]float32, 4*graphics.VertexFloatCount)
|
||||||
}
|
}
|
||||||
// i.tmpVerticesForCopying can be resused as this is sent to DrawTriangles immediately.
|
// i.tmpVerticesForCopying can be reused as this is sent to DrawTriangles immediately.
|
||||||
graphics.QuadVertices(
|
graphics.QuadVertices(
|
||||||
i.tmpVerticesForCopying,
|
i.tmpVerticesForCopying,
|
||||||
float32(i.region.Min.X), float32(i.region.Min.Y), float32(i.region.Max.X), float32(i.region.Max.Y),
|
float32(i.region.Min.X), float32(i.region.Min.Y), float32(i.region.Max.X), float32(i.region.Max.Y),
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
//go:build nintendosdk
|
//go:build nintendosdk
|
||||||
|
|
||||||
// The actual implementaiton will be provided by -overlay.
|
// The actual implementation will be provided by -overlay.
|
||||||
|
|
||||||
#include "init_nintendosdk.h"
|
#include "init_nintendosdk.h"
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ func (u *UserInterface) runMultiThread(game Game, options *RunOptions) error {
|
|||||||
graphicscommand.SetRenderThread(u.renderThread)
|
graphicscommand.SetRenderThread(u.renderThread)
|
||||||
|
|
||||||
// Set the running state true after the main thread is set, and before initOnMainThread is called (#2742).
|
// Set the running state true after the main thread is set, and before initOnMainThread is called (#2742).
|
||||||
// TODO: As the existance of the main thread is the same as the value of `running`, this is redundant.
|
// TODO: As the existence of the main thread is the same as the value of `running`, this is redundant.
|
||||||
// Make `mainThread` atomic and remove `running` if possible.
|
// Make `mainThread` atomic and remove `running` if possible.
|
||||||
u.setRunning(true)
|
u.setRunning(true)
|
||||||
defer u.setRunning(false)
|
defer u.setRunning(false)
|
||||||
|
@ -435,7 +435,7 @@ func (u *UserInterface) loopGame() error {
|
|||||||
go f()
|
go f()
|
||||||
|
|
||||||
// Run another loop to watch suspended() as the above update function is never called when the tab is hidden.
|
// Run another loop to watch suspended() as the above update function is never called when the tab is hidden.
|
||||||
// To check the document's visiblity, visibilitychange event should usually be used. However, this event is
|
// To check the document's visibility, visibilitychange event should usually be used. However, this event is
|
||||||
// not reliable and sometimes it is not fired (#961). Then, watch the state regularly instead.
|
// not reliable and sometimes it is not fired (#961). Then, watch the state regularly instead.
|
||||||
go func() {
|
go func() {
|
||||||
defer close(resStopAudioCh)
|
defer close(resStopAudioCh)
|
||||||
@ -484,7 +484,7 @@ func (u *UserInterface) init() error {
|
|||||||
savedCursorY: math.NaN(),
|
savedCursorY: math.NaN(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// docuemnt is undefined on node.js
|
// document is undefined on node.js
|
||||||
if !document.Truthy() {
|
if !document.Truthy() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
8
run.go
8
run.go
@ -578,7 +578,7 @@ func MaxTPS() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ActualTPS returns the current TPS (ticks per second),
|
// ActualTPS returns the current TPS (ticks per second),
|
||||||
// that represents how many Update function is called in a second.
|
// that represents how many times Update function is called in a second.
|
||||||
//
|
//
|
||||||
// This value is for measurement and/or debug, and your game logic should not rely on this value.
|
// This value is for measurement and/or debug, and your game logic should not rely on this value.
|
||||||
//
|
//
|
||||||
@ -588,7 +588,7 @@ func ActualTPS() float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CurrentTPS returns the current TPS (ticks per second),
|
// CurrentTPS returns the current TPS (ticks per second),
|
||||||
// that represents how many Update function is called in a second.
|
// that represents how many times Update function is called in a second.
|
||||||
//
|
//
|
||||||
// Deprecated: as of v2.4. Use ActualTPS instead.
|
// Deprecated: as of v2.4. Use ActualTPS instead.
|
||||||
func CurrentTPS() float64 {
|
func CurrentTPS() float64 {
|
||||||
@ -604,7 +604,7 @@ const SyncWithFPS = clock.SyncWithFPS
|
|||||||
const UncappedTPS = SyncWithFPS
|
const UncappedTPS = SyncWithFPS
|
||||||
|
|
||||||
// SetTPS sets the maximum TPS (ticks per second),
|
// SetTPS sets the maximum TPS (ticks per second),
|
||||||
// that represents how many updating function is called per second.
|
// that represents how many times updating function is called per second.
|
||||||
// The initial value is 60.
|
// The initial value is 60.
|
||||||
//
|
//
|
||||||
// If tps is SyncWithFPS, TPS is uncapped and the game is updated per frame.
|
// If tps is SyncWithFPS, TPS is uncapped and the game is updated per frame.
|
||||||
@ -616,7 +616,7 @@ func SetTPS(tps int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetMaxTPS sets the maximum TPS (ticks per second),
|
// SetMaxTPS sets the maximum TPS (ticks per second),
|
||||||
// that represents how many updating function is called per second.
|
// that represents how many times updating function is called per second.
|
||||||
//
|
//
|
||||||
// Deprecated: as of v2.4. Use SetTPS instead.
|
// Deprecated: as of v2.4. Use SetTPS instead.
|
||||||
func SetMaxTPS(tps int) {
|
func SetMaxTPS(tps int) {
|
||||||
|
@ -62,7 +62,7 @@ func (s *StdFace) copyCheck() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Metrics implelements Face.
|
// Metrics implements Face.
|
||||||
func (s *StdFace) Metrics() Metrics {
|
func (s *StdFace) Metrics() Metrics {
|
||||||
s.copyCheck()
|
s.copyCheck()
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ func (s *StdFace) glyphImageImpl(r rune, subpixelOffset fixed.Point26_6, glyphBo
|
|||||||
return ebiten.NewImageFromImage(rgba)
|
return ebiten.NewImageFromImage(rgba)
|
||||||
}
|
}
|
||||||
|
|
||||||
// direction implelements Face.
|
// direction implements Face.
|
||||||
func (s *StdFace) direction() Direction {
|
func (s *StdFace) direction() Direction {
|
||||||
return DirectionLeftToRight
|
return DirectionLeftToRight
|
||||||
}
|
}
|
||||||
@ -187,6 +187,6 @@ func (s *StdFace) direction() Direction {
|
|||||||
func (s *StdFace) appendVectorPathForLine(path *vector.Path, line string, originX, originY float64) {
|
func (s *StdFace) appendVectorPathForLine(path *vector.Path, line string, originX, originY float64) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Metrics implelements Face.
|
// Metrics implements Face.
|
||||||
func (s *StdFace) private() {
|
func (s *StdFace) private() {
|
||||||
}
|
}
|
||||||
|
@ -59,15 +59,15 @@ type Metrics struct {
|
|||||||
HDescent float64
|
HDescent float64
|
||||||
|
|
||||||
// VLineGap is the recommended amount of horizontal space between two lines of text in pixels.
|
// VLineGap is the recommended amount of horizontal space between two lines of text in pixels.
|
||||||
// If the face is StdFace or the font dosen't support a vertical direction, VLineGap is 0.
|
// If the face is StdFace or the font doesn't support a vertical direction, VLineGap is 0.
|
||||||
VLineGap float64
|
VLineGap float64
|
||||||
|
|
||||||
// VAscent is the distance in pixels from the top of a line to its baseline for vertical lines.
|
// VAscent is the distance in pixels from the top of a line to its baseline for vertical lines.
|
||||||
// If the face is StdFace or the font dosen't support a vertical direction, VAscent is 0.
|
// If the face is StdFace or the font doesn't support a vertical direction, VAscent is 0.
|
||||||
VAscent float64
|
VAscent float64
|
||||||
|
|
||||||
// VDescent is the distance in pixels from the top of a line to its baseline for vertical lines.
|
// VDescent is the distance in pixels from the top of a line to its baseline for vertical lines.
|
||||||
// If the face is StdFace or the font dosen't support a vertical direction, VDescent is 0.
|
// If the face is StdFace or the font doesn't support a vertical direction, VDescent is 0.
|
||||||
VDescent float64
|
VDescent float64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ func IsWindowClosingHandled() bool {
|
|||||||
|
|
||||||
// SetWindowMousePassthrough sets whether a mouse cursor passthroughs the window or not on desktops. The default state is false.
|
// SetWindowMousePassthrough sets whether a mouse cursor passthroughs the window or not on desktops. The default state is false.
|
||||||
//
|
//
|
||||||
// Even if this is set true, some platforms might requrie a window to be undecorated
|
// Even if this is set true, some platforms might require a window to be undecorated
|
||||||
// in order to make the mouse cursor passthrough the window.
|
// in order to make the mouse cursor passthrough the window.
|
||||||
//
|
//
|
||||||
// SetWindowMousePassthrough works only on desktops.
|
// SetWindowMousePassthrough works only on desktops.
|
||||||
@ -335,7 +335,7 @@ func SetWindowMousePassthrough(enabled bool) {
|
|||||||
|
|
||||||
// IsWindowMousePassthrough reports whether a mouse cursor passthroughs the window or not on desktops.
|
// IsWindowMousePassthrough reports whether a mouse cursor passthroughs the window or not on desktops.
|
||||||
//
|
//
|
||||||
// IsWindowMousePassthrough alaywas returns false if the platform is not a desktop.
|
// IsWindowMousePassthrough always returns false if the platform is not a desktop.
|
||||||
//
|
//
|
||||||
// IsWindowMousePassthrough is concurrent-safe.
|
// IsWindowMousePassthrough is concurrent-safe.
|
||||||
func IsWindowMousePassthrough() bool {
|
func IsWindowMousePassthrough() bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user