OpenDiablo2/d2common/d2util/debug_print.go

92 lines
2.0 KiB
Go
Raw Normal View History

package d2util
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
import (
"image"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2util/assets"
2020-09-12 20:25:09 +00:00
"github.com/hajimehoshi/ebiten/v2"
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
)
const (
cw = assets.CharWidth
ch = assets.CharHeight
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
)
// NewDebugPrinter creates a new debug printer
func NewDebugPrinter() *GlyphPrinter {
img := ebiten.NewImageFromImage(assets.CreateTextImage())
printer := &GlyphPrinter{
glyphImageTable: img,
glyphs: make(map[rune]*ebiten.Image),
}
return printer
}
// GlyphPrinter uses an image containing glyphs to draw text onto ebiten images
type GlyphPrinter struct {
glyphImageTable *ebiten.Image
glyphs map[rune]*ebiten.Image
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
}
// Print draws the string str on the image on left top corner.
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
//
// The available runes are in U+0000 to U+00FF, which is C0 Controls and
// Basic Latin and C1 Controls and Latin-1 Supplement.
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
//
// DebugPrint always returns nil as of 1.5.0-alpha.
func (p *GlyphPrinter) Print(target interface{}, str string) error {
p.PrintAt(target.(*ebiten.Image), str, 0, 0)
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
return nil
}
// PrintAt draws the string str on the image at (x, y) position.
// The available runes are in U+0000 to U+00FF, which is C0 Controls and
// Basic Latin and C1 Controls and Latin-1 Supplement.
func (p *GlyphPrinter) PrintAt(target interface{}, str string, x, y int) {
p.drawDebugText(target.(*ebiten.Image), str, x, y, false)
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
}
func (p *GlyphPrinter) drawDebugText(target *ebiten.Image, str string, ox, oy int, shadow bool) {
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
op := &ebiten.DrawImageOptions{}
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
if shadow {
op.ColorM.Scale(0, 0, 0, 0.5)
}
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
x := 0
y := 0
w, _ := p.glyphImageTable.Size()
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
for _, c := range str {
if c == '\n' {
x = 0
y += ch
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
continue
}
s, ok := p.glyphs[c]
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
if !ok {
n := w / cw
sx := (int(c) % n) * cw
sy := (int(c) / n) * ch
rect := image.Rect(sx, sy, sx+cw, sy+ch)
s = p.glyphImageTable.SubImage(rect).(*ebiten.Image)
p.glyphs[c] = s
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
}
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
op.GeoM.Reset()
op.GeoM.Translate(float64(x), float64(y))
op.GeoM.Translate(float64(ox+1), float64(oy))
op.CompositeMode = ebiten.CompositeModeLighter
target.DrawImage(s, op)
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577) * lint updates for /d2astar * png issue * debug package * load bmp properly * debug draft * Vector float64 (#565) * Fixed nil pointer in Copy() * Position added Added Floor() and String() methods to Vector. Also added Position which declares an embedded Vector2 and returns various forms of it. * d2vector.Vector2 renamed to d2vector.BigFloat * vector.go renamed to big_float.go * Float64 stub and more renaming * Vector value getters * Separate vector types with initial methods. * Divide and lint warnings. * Distance and Length. * Scale, Abs and Negate. * CompareFloat64Fuzzy delta direction reversed. * Refactor vector_test.go. * Renamed Approx methods. * Distance and Length. * Distance and Length. * Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests. * Angle, SignedAngle and other small functions. * Receiver rename. * SingedAngle and test fixed * Rotate. * SetLength. * Cross. * NinetyAnti and NinetyClock. * Lerp and Clamp. * Reflect and ReflectSurface. * Cardinal convenience functions. * Comments. * Panic on NaN and Inf in Position. * Lint warnings and comments. * D2map lint warnings (#566) * Comments and newlines in engine.go * Comments and newlines in object.go * Comments and newlines in animated_entity.go * Comments and newlines in missile.go * Comments and newlines in npc.go * Comments and newlines in player.go * Removed object.go (incorrectly merged it in during rebase). * Comments and newlines in renderer.go. * Comments and newlines in map_entity.go. * Comments and newlines in walk_mesh.go. * Comments and newlines in viewport.go and tile_cache.go. * Comments and newlines in stamp.go and wilderness_tile_types.go. * Comments and newlines in everything else. * removing inventory grid test for now because it causes builds to fail on github (#570) * Refactored d2enum (#567) * Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file * compressed image * Replaced restruct with StreamReader (#574) * Fixed bug in palette.go (#575) * Javascript console commands (#572) * Allow the execution of JS from the terminal when hosting a local game or playing a single game Signed-off-by: William Claude <w.claude@thebeat.co> * Reorganise imports on edited files Signed-off-by: William Claude <w.claude@thebeat.co> * Remove Reset Signed-off-by: William Claude <w.claude@thebeat.co> * Add inventory.txt loader, use the records (#573) * adding resource entry for inventory.txt * adding loader for inventory.txt * adding call to inventory.txt loader in d2app * d2game now uses the inventory.txt records for making the inventory panel * removed comments * remove unused files * update go.mod * lint updates for /d2astar * png issue * update go.mod Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com> Co-authored-by: dk <dknuth0101@gmail.com> Co-authored-by: Intyre <Intyre@gmail.com> Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 22:12:20 +00:00
x += cw
}
}