mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
Add comments
This commit is contained in:
parent
749a751369
commit
3dad97af8a
@ -85,6 +85,7 @@ func (i *Image) Size() (int, int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) Fill(clr color.Color) error {
|
func (i *Image) Fill(clr color.Color) error {
|
||||||
|
// TODO: Need to clone clr value
|
||||||
c := &fillCommand{
|
c := &fillCommand{
|
||||||
dst: i,
|
dst: i,
|
||||||
color: clr,
|
color: clr,
|
||||||
|
@ -79,6 +79,8 @@ func (p *Pixels) AppendDrawImageHistory(image *graphics.Image, vertices []int16,
|
|||||||
if p.stale {
|
if p.stale {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// All images must be resolved and not stale each after frame.
|
||||||
|
// So we don't have to care if image is stale or not here.
|
||||||
item := &drawImageHistoryItem{
|
item := &drawImageHistoryItem{
|
||||||
image: image,
|
image: image,
|
||||||
vertices: vertices,
|
vertices: vertices,
|
||||||
@ -107,6 +109,7 @@ func (p *Pixels) DependsOn(target *graphics.Image) bool {
|
|||||||
if p.stale {
|
if p.stale {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
// TODO: Performance is bad when drawImageHistory is too many.
|
||||||
for _, c := range p.drawImageHistory {
|
for _, c := range p.drawImageHistory {
|
||||||
if c.image == target {
|
if c.image == target {
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user