mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
Small cleanup (#877)
* Remove unused variables and constants * Remove redundant return statement * Change flock.NewFlock to flock.New
This commit is contained in:
parent
f9cec31bf6
commit
21abd85a63
@ -71,7 +71,6 @@ type decoder interface {
|
|||||||
|
|
||||||
type decoded struct {
|
type decoded struct {
|
||||||
totalBytes int
|
totalBytes int
|
||||||
readBytes int
|
|
||||||
posInBytes int
|
posInBytes int
|
||||||
source io.Closer
|
source io.Closer
|
||||||
decoder decoder
|
decoder decoder
|
||||||
|
@ -151,11 +151,6 @@ var (
|
|||||||
zeroProgram program
|
zeroProgram program
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
maxTriangles = graphics.IndicesNum / 3
|
|
||||||
maxQuads = maxTriangles / 2
|
|
||||||
)
|
|
||||||
|
|
||||||
// reset resets or initializes the OpenGL state.
|
// reset resets or initializes the OpenGL state.
|
||||||
func (s *openGLState) reset(context *context) error {
|
func (s *openGLState) reset(context *context) error {
|
||||||
if err := context.reset(); err != nil {
|
if err := context.reset(); err != nil {
|
||||||
|
@ -432,11 +432,6 @@ func TestRestoreRecursive(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestReplacePixels(t *testing.T) {
|
func TestReplacePixels(t *testing.T) {
|
||||||
const (
|
|
||||||
w = 17
|
|
||||||
h = 31
|
|
||||||
)
|
|
||||||
|
|
||||||
img := NewImage(17, 31)
|
img := NewImage(17, 31)
|
||||||
defer img.Dispose()
|
defer img.Dispose()
|
||||||
|
|
||||||
|
@ -468,7 +468,6 @@ func (i *Image) allocate(shareable bool) {
|
|||||||
i.backend = b
|
i.backend = b
|
||||||
i.node = n
|
i.node = n
|
||||||
runtime.SetFinalizer(i, (*Image).Dispose)
|
runtime.SetFinalizer(i, (*Image).Dispose)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) MakeVolatile() {
|
func (i *Image) MakeVolatile() {
|
||||||
|
@ -28,7 +28,7 @@ import (
|
|||||||
"github.com/gofrs/flock"
|
"github.com/gofrs/flock"
|
||||||
)
|
)
|
||||||
|
|
||||||
var theLock = flock.NewFlock(filepath.Join(os.TempDir(), "ebitentest"))
|
var theLock = flock.New(filepath.Join(os.TempDir(), "ebitentest"))
|
||||||
|
|
||||||
func Lock() {
|
func Lock() {
|
||||||
if err := theLock.Lock(); err != nil {
|
if err := theLock.Lock(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user