ddnet/src/game/editor/mapitems
Robert Müller dde45f7a40 Add CImageInfo::PixelSize function, use enum EImageFormat
Use `enum EImageFormat` type for image format literals and variables.

Add `PixelSize` function to get the number of bytes/color channels per pixel for a specified image format.

Remove unused store format argument of texture loading functions. All textures are automatically being stored as RGBA, so the argument was unused. Also remove the therefore unused `FORMAT_AUTO`.

Rename variables consistently to `PixelSize` and use `size_t`, instead of mixing different names like `BPP` and `ColorChannelCount`.

Validate image format loaded from maps using `CImageInfo::ImageFormatFromInt`. Add `FORMAT_ERROR` to represent invalid formats.

Remove redundant `PixelSize` parameter from graphics backends and commands, which can be derived from the texture format.

Fix memory leak when RGB image data is being converted to RGBA format when saving map in editor.
2023-09-03 20:40:28 +02:00
..
image.cpp let CEditorImage inherit CEditorComponent 2023-09-01 18:57:35 +02:00
image.h let CEditorImage inherit CEditorComponent 2023-09-01 18:57:35 +02:00
layer_front.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
layer_game.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
layer_group.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
layer_quads.cpp extract CEditorImage into separate header 2023-08-29 22:08:12 +02:00
layer_sounds.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
layer_speedup.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
layer_switch.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
layer_tele.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
layer_tiles.cpp extract CEditorImage into separate header 2023-08-29 22:08:12 +02:00
layer_tune.cpp extract code from editor mapitems into separate files 2023-08-27 16:04:53 +02:00
map.cpp move CEditorMap::HandleMapDrop to CEditor 2023-09-01 18:57:36 +02:00
map_io.cpp Add CImageInfo::PixelSize function, use enum EImageFormat 2023-09-03 20:40:28 +02:00
sound.cpp let CEditorSound inherit CEditorComponent 2023-08-29 22:28:07 +02:00
sound.h let CEditorSound inherit CEditorComponent 2023-08-29 22:28:07 +02:00