iolivia / rust-sokoban

Rust Sokoban book and code samples
https://sokoban.iolivia.me
MIT License
155 stars 29 forks source link

Add an image cache in section 3.4 #90

Closed NiklasEi closed 1 year ago

NiklasEi commented 3 years ago

Introduce an image cache in section 3.4 after batch rendering.

Resolves #89

NiklasEi commented 3 years ago

Should I propagate my code changes to 3.5 and 4.1? I am not sure what else changed since there are no chapters for those versions yet.

I have one issue with the updated chapter 3.4. One of the code examples during the implementation of batch rendering will give users an error since it includes code changes from the image caching (last code block in batch rendering includes a call to #load_image). Not sure how to resolve that one.

NiklasEi commented 3 years ago

What do you think about adding the cache in a separate small chapter? I can't find a way to not have an influence on the code examples in batch rendering. If it should stay in the same chapter I could also create my own code directory for the image cache part of the chapter.

iolivia commented 3 years ago

@NiklasEi I think it would be a great idea to add this as a separate section to the last chapter, maybe after batch rendering. what do you think?

NiklasEi commented 3 years ago

@NiklasEi I think it would be a great idea to add this as a separate section to the last chapter, maybe after batch rendering. what do you think?

So just like the current code changes? The issue in my second comment is still not resolved though.