缓存下面结果
AtlasRegion com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegion(String name)
当前还有其他的方法,只要是对 com.badlogic.gdx.graphics.g2d.TextureAtlas 中 regions 中获取的操作。
regions 具体引用情况查看源码
主要是因为查找的方法是一个很“昂贵”的功能调用,所有调用后就把结果存起来,避免重复调用造成性能问题
本文介绍了一种针对com.badlogic.gdx.graphics.g2d.TextureAtlas中查找操作进行优化的方法。通过缓存findRegion方法的返回结果来减少重复计算,提高游戏性能。
缓存下面结果
AtlasRegion com.badlogic.gdx.graphics.g2d.TextureAtlas.findRegion(String name)
当前还有其他的方法,只要是对 com.badlogic.gdx.graphics.g2d.TextureAtlas 中 regions 中获取的操作。
regions 具体引用情况查看源码
主要是因为查找的方法是一个很“昂贵”的功能调用,所有调用后就把结果存起来,避免重复调用造成性能问题
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率
1674
884

被折叠的 条评论
为什么被折叠?