diff --git a/blend.go b/blend.go index f76a90b9e..1f5c446ab 100644 --- a/blend.go +++ b/blend.go @@ -49,7 +49,7 @@ type Blend struct { // BlendFactorDestinationRGB is a factor for destination RGB values. BlendFactorDestinationRGB BlendFactor - // BlendFactorDestinationAlpha is a factor for destination apha values. + // BlendFactorDestinationAlpha is a factor for destination alpha values. BlendFactorDestinationAlpha BlendFactor // BlendOperationRGB is an operation for source and destination RGB values. diff --git a/cmd/ebitenmobile/_files/EbitenViewController.m b/cmd/ebitenmobile/_files/EbitenViewController.m index 2d852cce3..33d7ae18d 100644 --- a/cmd/ebitenmobile/_files/EbitenViewController.m +++ b/cmd/ebitenmobile/_files/EbitenViewController.m @@ -84,7 +84,7 @@ - (void)initView { // initView must be called only when viewDidLoad_, and gameSet_ are true i.e. mobile.SetGame is called. // 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"); if (!started_) { diff --git a/colorm.go b/colorm.go index b1053111d..b82d68484 100644 --- a/colorm.go +++ b/colorm.go @@ -72,7 +72,7 @@ func (c *ColorM) Apply(clr color.Color) color.Color { } // 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. func (c *ColorM) Concat(other ColorM) { diff --git a/examples/blocks/blocks/field.go b/examples/blocks/blocks/field.go index fd3852e42..612d24c4a 100644 --- a/examples/blocks/blocks/field.go +++ b/examples/blocks/blocks/field.go @@ -126,7 +126,7 @@ func (f *Field) flushable() bool { } // 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 { for i := 0; i < fieldBlockCountX; i++ { if f.blocks[i][j] == BlockTypeNone { diff --git a/examples/blocks/blocks/gamepad.go b/examples/blocks/blocks/gamepad.go index 5502e304e..a2d7693be 100644 --- a/examples/blocks/blocks/gamepad.go +++ b/examples/blocks/blocks/gamepad.go @@ -120,7 +120,7 @@ func (c *gamepadConfig) initializeIfNeeded() { // It is assumed that all axes are not pressed here. // // 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 { c.defaultAxesValues = map[int]float64{} 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 -// 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 { if !c.gamepadIDInitialized { panic("not reached") @@ -249,7 +249,7 @@ func (c *gamepadConfig) IsButtonJustPressed(b virtualGamepadButton) bool { 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 { if !c.gamepadIDInitialized { panic("not reached") diff --git a/examples/blocks/blocks/piece.go b/examples/blocks/blocks/piece.go index c527b756c..7548d9af0 100644 --- a/examples/blocks/blocks/piece.go +++ b/examples/blocks/blocks/piece.go @@ -82,7 +82,7 @@ func transpose(bs [][]bool) [][]bool { for j, row := range bs { blocks[j] = make([]bool, len(row)) } - // Tranpose the argument matrix. + // Transpose the argument matrix. for i, col := range bs { for j, v := range col { blocks[j][i] = v diff --git a/examples/piano/main.go b/examples/piano/main.go index 397630333..74e51780d 100644 --- a/examples/piano/main.go +++ b/examples/piano/main.go @@ -104,7 +104,7 @@ func init() { for i := range keys { 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) l := make([]int16, length) r := make([]int16, length) diff --git a/gameforui.go b/gameforui.go index a6852a237..bff312f75 100644 --- a/gameforui.go +++ b/gameforui.go @@ -97,7 +97,7 @@ func (g *gameForUI) NewOffscreenImage(width, height int) *ui.Image { // and the shader program unexpectedly picks the pixel on the edges. imageType := atlas.ImageTypeUnmanaged if ui.Get().IsScreenClearedEveryFrame() { - // A violatile image is also always isolated. + // A volatile image is also always isolated. imageType = atlas.ImageTypeVolatile } g.offscreen = newImage(image.Rect(0, 0, width, height), imageType) diff --git a/image_test.go b/image_test.go index b5be81819..91c3a0626 100644 --- a/image_test.go +++ b/image_test.go @@ -4541,7 +4541,7 @@ func TestImageWritePixelAndDeallocate(t *testing.T) { img.WritePixels(pix) 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 { t.Errorf("got: %v, want: %v", got, want) } diff --git a/internal/affine/colorm.go b/internal/affine/colorm.go index b3a023e58..2bdcc96d1 100644 --- a/internal/affine/colorm.go +++ b/internal/affine/colorm.go @@ -61,7 +61,7 @@ type ColorM interface { Equals(other ColorM) bool // 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 // Scale scales the matrix by (r, g, b, a). @@ -618,7 +618,7 @@ func (c *colorMImplBodyTranslate) Concat(other ColorM) ColorM { return &colorMImplBodyTranslate{ // 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), translate: [...]float32{ 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. -// hueTheta is a radian value to ratate hue. +// hueTheta is a radian value to rotate hue. // saturationScale is a value to scale saturation. // valueScale is a value to scale value (a.k.a. brightness). // diff --git a/internal/atlas/image_test.go b/internal/atlas/image_test.go index fc3116662..de2d3ea7c 100644 --- a/internal/atlas/image_test.go +++ b/internal/atlas/image_test.go @@ -791,7 +791,7 @@ func TestIteratingImagesToPutOnSourceBackend(t *testing.T) { dst := atlas.NewImage(w, h, atlas.ImageTypeRegular) defer dst.Deallocate() - // Use srcs as detinations once. + // Use srcs as destinations once. vs := quadVertices(w, h, 0, 0, 1) is := graphics.QuadIndices() dr := image.Rect(0, 0, w, h) diff --git a/internal/clock/clock.go b/internal/clock/clock.go index 50f916669..8a446b4c8 100644 --- a/internal/clock/clock.go +++ b/internal/clock/clock.go @@ -32,7 +32,7 @@ var ( lastNow int64 // 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 actualFPS float64 diff --git a/internal/glfw/context_unix.go b/internal/glfw/context_unix.go index 63dd7ded9..5626c2cd6 100644 --- a/internal/glfw/context_unix.go +++ b/internal/glfw/context_unix.go @@ -17,7 +17,7 @@ import ( // MakeContextCurrent makes the context of the window current. // 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. func (w *Window) MakeContextCurrent() error { C.glfwMakeContextCurrent(w.data) diff --git a/internal/glfw/error_unix.go b/internal/glfw/error_unix.go index 6fdf77392..288c727e1 100644 --- a/internal/glfw/error_unix.go +++ b/internal/glfw/error_unix.go @@ -44,7 +44,7 @@ func init() { C.glfwSetErrorCallbackCB() } -// fetchErrorIgnoringPlatformError is fetchError igoring platformError. +// fetchErrorIgnoringPlatformError is fetchError ignoring platformError. func fetchErrorIgnoringPlatformError() error { select { case err := <-lastError: diff --git a/internal/glfw/win32_platform_windows.go b/internal/glfw/win32_platform_windows.go index 8ba293942..f4f5bb3f4 100644 --- a/internal/glfw/win32_platform_windows.go +++ b/internal/glfw/win32_platform_windows.go @@ -33,7 +33,7 @@ type platformWindowState struct { lastCursorPosX 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 } diff --git a/internal/glfw/win32_window_windows.go b/internal/glfw/win32_window_windows.go index 56da8abe1..e1f8ef101 100644 --- a/internal/glfw/win32_window_windows.go +++ b/internal/glfw/win32_window_windows.go @@ -1361,7 +1361,7 @@ func registerWindowClassWin32() error { wc.hCursor = cursor className, err := windows.UTF16FromString(_GLFW_WNDCLASSNAME) 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] defer runtime.KeepAlive(className) diff --git a/internal/glfw/x11_init_linbsd.c b/internal/glfw/x11_init_linbsd.c index 95de3d6c5..1936b8df6 100644 --- a/internal/glfw/x11_init_linbsd.c +++ b/internal/glfw/x11_init_linbsd.c @@ -991,7 +991,7 @@ static Window createHelperWindow(void) 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) { diff --git a/internal/graphics/bytes.go b/internal/graphics/bytes.go index 69e7ecc99..a92e299ac 100644 --- a/internal/graphics/bytes.go +++ b/internal/graphics/bytes.go @@ -22,7 +22,7 @@ import ( // ManagedBytes is a managed byte slice. // 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. -// This can redduce allocations and GCs. +// This can reduce allocations and GCs. type ManagedBytes struct { bytes []byte pool *bytesPool diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 9f0ca439b..ec1a6b069 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -205,8 +205,8 @@ func dstRegionFromVertices(vertices []float32) (minX, minY, maxX, maxY float32) func mightOverlapDstRegions(vertices1, vertices2 []float32) bool { minX1, minY1, maxX1, maxY1 := dstRegionFromVertices(vertices1) minX2, minY2, maxX2, maxY2 := dstRegionFromVertices(vertices2) - const mergin = 1 - return minX1 < maxX2+mergin && minX2 < maxX1+mergin && minY1 < maxY2+mergin && minY2 < maxY1+mergin + const margin = 1 + return minX1 < maxX2+margin && minX2 < maxX1+margin && minY1 < maxY2+margin && minY2 < maxY1+margin } // writePixelsCommand represents a command to replace pixels of an image. diff --git a/internal/graphicscommand/commandqueue.go b/internal/graphicscommand/commandqueue.go index 8eb8ed796..cf0c55275 100644 --- a/internal/graphicscommand/commandqueue.go +++ b/internal/graphicscommand/commandqueue.go @@ -184,7 +184,7 @@ func (q *commandQueue) Flush(graphicsDriver graphicsdriver.Graphics, endFrame bo } 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 { sync = true } diff --git a/internal/graphicsdriver/directx/graphics11_windows.go b/internal/graphicsdriver/directx/graphics11_windows.go index e1fbfe065..3a9f41152 100644 --- a/internal/graphicsdriver/directx/graphics11_windows.go +++ b/internal/graphicsdriver/directx/graphics11_windows.go @@ -168,7 +168,7 @@ func newGraphics11(useWARP bool, useDebugLayer bool) (gr11 *graphics11, ferr err 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). featureLevels := []_D3D_FEATURE_LEVEL{ _D3D_FEATURE_LEVEL_11_0, diff --git a/internal/graphicsdriver/directx/graphics12_windows.go b/internal/graphicsdriver/directx/graphics12_windows.go index 50f27cd15..c594f0a30 100644 --- a/internal/graphicsdriver/directx/graphics12_windows.go +++ b/internal/graphicsdriver/directx/graphics12_windows.go @@ -688,7 +688,7 @@ func (g *graphics12) End(present bool) error { // Release vertices and indices buffers when too many ones were created. // 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 err := g.waitForCommandQueue(); err != nil { return err diff --git a/internal/shader/expr.go b/internal/shader/expr.go index 8b4a0ffba..cf94626ee 100644 --- a/internal/shader/expr.go +++ b/internal/shader/expr.go @@ -625,7 +625,7 @@ func (cs *compileState) parseExpr(block *block, fname string, expr ast.Expr, mar }, []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. stmts = append(stmts, shaderir.Stmt{ Type: shaderir.ExprStmt, diff --git a/internal/ui/image.go b/internal/ui/image.go index aa14046ac..05e4ae9cc 100644 --- a/internal/ui/image.go +++ b/internal/ui/image.go @@ -351,7 +351,7 @@ func (i *bigOffscreenImage) drawTriangles(srcs [graphics.ShaderImageCount]*Image if len(i.tmpVerticesForCopying) < 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( i.tmpVerticesForCopying, float32(i.region.Min.X), float32(i.region.Min.Y), float32(i.region.Max.X), float32(i.region.Max.Y), diff --git a/internal/ui/init_nintendosdk.cpp b/internal/ui/init_nintendosdk.cpp index 83537992d..c4dff2922 100644 --- a/internal/ui/init_nintendosdk.cpp +++ b/internal/ui/init_nintendosdk.cpp @@ -14,7 +14,7 @@ //go:build nintendosdk -// The actual implementaiton will be provided by -overlay. +// The actual implementation will be provided by -overlay. #include "init_nintendosdk.h" diff --git a/internal/ui/run.go b/internal/ui/run.go index 03946076f..b5d8007e1 100644 --- a/internal/ui/run.go +++ b/internal/ui/run.go @@ -39,7 +39,7 @@ func (u *UserInterface) runMultiThread(game Game, options *RunOptions) error { graphicscommand.SetRenderThread(u.renderThread) // 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. u.setRunning(true) defer u.setRunning(false) diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go index b2d70f41d..ceb5dd5d6 100644 --- a/internal/ui/ui_js.go +++ b/internal/ui/ui_js.go @@ -435,7 +435,7 @@ func (u *UserInterface) loopGame() error { go f() // 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. go func() { defer close(resStopAudioCh) @@ -484,7 +484,7 @@ func (u *UserInterface) init() error { savedCursorY: math.NaN(), } - // docuemnt is undefined on node.js + // document is undefined on node.js if !document.Truthy() { return nil } diff --git a/run.go b/run.go index 7427ecda5..a37e37822 100644 --- a/run.go +++ b/run.go @@ -578,7 +578,7 @@ func MaxTPS() int { } // 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. // @@ -588,7 +588,7 @@ func ActualTPS() float64 { } // 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. func CurrentTPS() float64 { @@ -604,7 +604,7 @@ const SyncWithFPS = clock.SyncWithFPS const UncappedTPS = SyncWithFPS // 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. // // 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), -// 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. func SetMaxTPS(tps int) { diff --git a/text/v2/std.go b/text/v2/std.go index 4c8703d91..0ffd1710e 100644 --- a/text/v2/std.go +++ b/text/v2/std.go @@ -62,7 +62,7 @@ func (s *StdFace) copyCheck() { } } -// Metrics implelements Face. +// Metrics implements Face. func (s *StdFace) Metrics() Metrics { s.copyCheck() @@ -178,7 +178,7 @@ func (s *StdFace) glyphImageImpl(r rune, subpixelOffset fixed.Point26_6, glyphBo return ebiten.NewImageFromImage(rgba) } -// direction implelements Face. +// direction implements Face. func (s *StdFace) direction() Direction { return DirectionLeftToRight } @@ -187,6 +187,6 @@ func (s *StdFace) direction() Direction { func (s *StdFace) appendVectorPathForLine(path *vector.Path, line string, originX, originY float64) { } -// Metrics implelements Face. +// Metrics implements Face. func (s *StdFace) private() { } diff --git a/text/v2/text.go b/text/v2/text.go index d014127e2..ee0bad26a 100644 --- a/text/v2/text.go +++ b/text/v2/text.go @@ -59,15 +59,15 @@ type Metrics struct { HDescent float64 // 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 // 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 // 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 } diff --git a/window.go b/window.go index 0a5940e0b..05a88db6b 100644 --- a/window.go +++ b/window.go @@ -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. // -// 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. // // 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 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. func IsWindowMousePassthrough() bool {