godot icon indicating copy to clipboard operation
godot copied to clipboard

Extract and reorganize texture resource classes

Open Geometror opened this issue 3 years ago • 2 comments

Split up texture.h/cpp into:

  • texture.h/cpp (now only contains Texture, Texture2D, TextureLayered, Texture3D)
  • animated_texture.h/cpp
  • atlas_texture.h/cpp
  • camera_texture.h/cpp
  • compressed_texture.h/cpp
  • curve_texture.h/cpp
  • image_texture.h/cpp
  • gradient_texture.h/cpp
  • mesh_texture.h/cpp
  • portable_compressed_texture.h/cpp
  • placeholder_textures.h (contains all PlaceholderXXX classes since they are very small)
  • proxy_texture.h/cpp

1D/2D/3D variants are grouped together in one file because that made the most sense to me, but if we wan't to be really strict (one class per file), I could split them up as well. Part of the ongoing effort to have only one class per file (or at least have smaller source files) with the goal of improving the structure of the codebase in terms of readability and compilation speed. texture.h/texture.cpp were especially problematic since the header was around 1100 LOC long and the source file over 3500 LOC. Also introducing forward declarations of some classes to further improve compilation speed.

Geometror avatar Nov 09 '22 19:11 Geometror

I am ok with this push for one class per cpp. Other people thoughts?

fire avatar Nov 09 '22 20:11 fire

@Geometror I think we are ready to merge it in the next couple of weeks. So if you could do a rebase, it would be great!

YuriSizov avatar Jul 10 '23 14:07 YuriSizov

Thanks! Love me some healthy and maintainable codebase <3

YuriSizov avatar Jul 14 '23 19:07 YuriSizov