最佳答案
你需要自己做。 SDL 未完成与 NES 纹理格式的工作。 您需要加载纹理数组。创建一个大小合适的新曲面。之后,您可以使用与您的调色板相对应的颜色填充像素。您可以使用自定义 SDL_Palette 来完成,但这不是一个好的做法。
An SDL_Palette should never need to be created manually. It is automatically created when SDL allocates an SDL_PixelFormat for a surface. The colors values of an SDL_Surface's palette can be set with SDL_SetPaletteColors(). SDL_Palette Wiki Page
关于c++ - 在 SDL2 和 C++ 中编码图像和改变颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42259554/