mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Move PNG handling to src/engine/gfx
This way, it's no longer compiled into the server.
This commit is contained in:
parent
955084693d
commit
4625b55ad6
|
@ -1759,10 +1759,6 @@ set_src(ENGINE_SHARED GLOB_RECURSE src/engine/shared
|
|||
http.h
|
||||
huffman.cpp
|
||||
huffman.h
|
||||
image_loader.cpp
|
||||
image_loader.h
|
||||
image_manipulation.cpp
|
||||
image_manipulation.h
|
||||
jobs.cpp
|
||||
jobs.h
|
||||
json.cpp
|
||||
|
@ -1811,6 +1807,12 @@ set_src(ENGINE_SHARED GLOB_RECURSE src/engine/shared
|
|||
websockets.cpp
|
||||
websockets.h
|
||||
)
|
||||
set_src(ENGINE_GFX GLOB src/engine/gfx
|
||||
image_loader.cpp
|
||||
image_loader.h
|
||||
image_manipulation.cpp
|
||||
image_manipulation.h
|
||||
)
|
||||
set_src(GAME_SHARED GLOB src/game
|
||||
bezier.cpp
|
||||
bezier.h
|
||||
|
@ -1874,7 +1876,6 @@ set(LIBS
|
|||
${CURL_LIBRARIES}
|
||||
${SQLite3_LIBRARIES}
|
||||
${WEBSOCKETS_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${PLATFORM_LIBS}
|
||||
# Add pthreads (on non-Windows) at the end, so that other libraries can depend
|
||||
|
@ -1883,10 +1884,11 @@ set(LIBS
|
|||
)
|
||||
|
||||
# Targets
|
||||
add_library(engine-gfx EXCLUDE_FROM_ALL OBJECT ${ENGINE_GFX})
|
||||
target_include_directories(engine-gfx PRIVATE ${PNG_INCLUDE_DIRS})
|
||||
add_library(engine-shared EXCLUDE_FROM_ALL OBJECT ${ENGINE_INTERFACE} ${ENGINE_SHARED} ${ENGINE_UUID_SHARED} ${BASE})
|
||||
target_include_directories(engine-shared PRIVATE ${PNG_INCLUDE_DIRS})
|
||||
add_library(game-shared EXCLUDE_FROM_ALL OBJECT ${GAME_SHARED} ${GAME_GENERATED_SHARED})
|
||||
list(APPEND TARGETS_OWN engine-shared game-shared)
|
||||
list(APPEND TARGETS_OWN engine-gfx engine-shared game-shared)
|
||||
|
||||
if(DISCORD AND NOT DISCORD_DYNAMIC)
|
||||
add_library(discord-shared SHARED IMPORTED)
|
||||
|
@ -2168,6 +2170,7 @@ if(CLIENT)
|
|||
${CLIENT_ICON}
|
||||
${CLIENT_MANIFEST}
|
||||
${DEPS_CLIENT}
|
||||
$<TARGET_OBJECTS:engine-gfx>
|
||||
$<TARGET_OBJECTS:engine-shared>
|
||||
$<TARGET_OBJECTS:game-shared>
|
||||
)
|
||||
|
@ -2177,6 +2180,7 @@ if(CLIENT)
|
|||
${CLIENT_ICON}
|
||||
${CLIENT_MANIFEST}
|
||||
${DEPS_CLIENT}
|
||||
$<TARGET_OBJECTS:engine-gfx>
|
||||
$<TARGET_OBJECTS:engine-shared>
|
||||
$<TARGET_OBJECTS:game-shared>
|
||||
)
|
||||
|
@ -2351,7 +2355,6 @@ if(SERVER)
|
|||
# Libraries
|
||||
set(LIBS_SERVER
|
||||
${LIBS}
|
||||
${PNG_LIBRARIES}
|
||||
${MYSQL_LIBRARIES}
|
||||
${TARGET_ANTIBOT}
|
||||
${MINIUPNPC_LIBRARIES}
|
||||
|
@ -2424,6 +2427,8 @@ if(TOOLS)
|
|||
set(TOOL_LIBS ${LIBS})
|
||||
if(TOOL MATCHES "^(dilate|map_convert_07|map_optimize|map_extract|map_replace_image)$")
|
||||
list(APPEND TOOL_INCLUDE_DIRS ${PNG_INCLUDE_DIRS})
|
||||
list(APPEND TOOL_DEPS $<TARGET_OBJECTS:engine-gfx>)
|
||||
list(APPEND TOOL_LIBS ${PNG_LIBRARIES})
|
||||
endif()
|
||||
if(TOOL MATCHES "^config_")
|
||||
list(APPEND EXTRA_TOOL_SRC "src/tools/config_common.h")
|
||||
|
@ -2548,11 +2553,12 @@ if(GTEST_FOUND OR DOWNLOAD_GTEST)
|
|||
add_executable(${TARGET_TESTRUNNER} EXCLUDE_FROM_ALL
|
||||
${TESTS}
|
||||
${TESTS_EXTRA}
|
||||
$<TARGET_OBJECTS:engine-gfx>
|
||||
$<TARGET_OBJECTS:engine-shared>
|
||||
$<TARGET_OBJECTS:game-shared>
|
||||
${DEPS}
|
||||
)
|
||||
target_link_libraries(${TARGET_TESTRUNNER} ${LIBS} ${MYSQL_LIBRARIES} ${GTEST_LIBRARIES})
|
||||
target_link_libraries(${TARGET_TESTRUNNER} ${LIBS} ${MYSQL_LIBRARIES} ${PNG_LIBRARIES} ${GTEST_LIBRARIES})
|
||||
target_include_directories(${TARGET_TESTRUNNER} SYSTEM PRIVATE ${GTEST_INCLUDE_DIRS})
|
||||
|
||||
list(APPEND TARGETS_OWN ${TARGET_TESTRUNNER})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "backend_base.h"
|
||||
#include "engine/shared/image_manipulation.h"
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
|
||||
size_t CCommandProcessorFragment_GLBase::TexFormatToImageColorChannelCount(int TexFormat)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <engine/client/backend/glsl_shader_compiler.h>
|
||||
|
||||
#include <engine/shared/image_manipulation.h>
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
|
||||
#ifndef BACKEND_AS_OPENGL_ES
|
||||
#include <GL/glew.h>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <engine/client/backend/opengl/opengl_sl.h>
|
||||
#include <engine/client/backend/opengl/opengl_sl_program.h>
|
||||
|
||||
#include <engine/shared/image_manipulation.h>
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
|
||||
#include <engine/client/backend/glsl_shader_compiler.h>
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
#include <engine/client/backend/backend_base.h>
|
||||
#include <engine/client/backend_sdl.h>
|
||||
#include <engine/client/graphics_threaded.h>
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/shared/config.h>
|
||||
#include <engine/shared/image_manipulation.h>
|
||||
#include <engine/storage.h>
|
||||
|
||||
#include <base/log.h>
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
#include <base/system.h>
|
||||
|
||||
#include <engine/shared/image_loader.h>
|
||||
|
||||
#include <engine/console.h>
|
||||
#include <engine/gfx/image_loader.h>
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/shared/config.h>
|
||||
#include <engine/storage.h>
|
||||
|
@ -20,8 +20,6 @@
|
|||
#include <game/generated/client_data7.h>
|
||||
#include <game/localization.h>
|
||||
|
||||
#include <engine/shared/image_manipulation.h>
|
||||
|
||||
#if defined(CONF_VIDEORECORDER)
|
||||
#include <engine/shared/video.h>
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef ENGINE_SHARED_IMAGE_LOADER_H
|
||||
#define ENGINE_SHARED_IMAGE_LOADER_H
|
||||
#ifndef ENGINE_GFX_IMAGE_LOADER_H
|
||||
#define ENGINE_GFX_IMAGE_LOADER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
@ -25,4 +25,4 @@ struct SImageByteBuffer
|
|||
bool LoadPNG(SImageByteBuffer &ByteLoader, const char *pFileName, int &Width, int &Height, uint8_t *&pImageBuff, EImageFormat &ImageFormat);
|
||||
bool SavePNG(EImageFormat ImageFormat, const uint8_t *pRawBuffer, SImageByteBuffer &WrittenBytes, int Width, int Height);
|
||||
|
||||
#endif
|
||||
#endif // ENGINE_GFX_IMAGE_LOADER_H
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef ENGINE_SHARED_IMAGE_MANIPULATION_H
|
||||
#define ENGINE_SHARED_IMAGE_MANIPULATION_H
|
||||
#ifndef ENGINE_GFX_IMAGE_MANIPULATION_H
|
||||
#define ENGINE_GFX_IMAGE_MANIPULATION_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -11,4 +11,4 @@ uint8_t *ResizeImage(const uint8_t *pImageData, int Width, int Height, int NewWi
|
|||
|
||||
int HighestBit(int OfVar);
|
||||
|
||||
#endif
|
||||
#endif // ENGINE_GFX_IMAGE_MANIPULATION_H
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <engine/client.h>
|
||||
#include <engine/console.h>
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/input.h>
|
||||
#include <engine/keys.h>
|
||||
|
@ -26,8 +27,6 @@
|
|||
#include <game/generated/client_data.h>
|
||||
#include <game/localization.h>
|
||||
|
||||
#include <engine/shared/image_manipulation.h>
|
||||
|
||||
#include "auto_map.h"
|
||||
#include "editor.h"
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#include <base/logger.h>
|
||||
#include <base/system.h>
|
||||
#include <engine/gfx/image_loader.h>
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/shared/image_loader.h>
|
||||
#include <engine/shared/image_manipulation.h>
|
||||
|
||||
int DilateFile(const char *pFilename)
|
||||
{
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
|
||||
#include <base/logger.h>
|
||||
#include <base/system.h>
|
||||
#include <engine/gfx/image_loader.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/shared/datafile.h>
|
||||
#include <engine/storage.h>
|
||||
#include <game/gamecore.h>
|
||||
#include <game/mapitems.h>
|
||||
|
||||
#include <engine/shared/image_loader.h>
|
||||
/*
|
||||
Usage: map_convert_07 <source map filepath> <dest map filepath>
|
||||
*/
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
// Adapted from TWMapImagesRecovery by Tardo: https://github.com/Tardo/TWMapImagesRecovery
|
||||
#include <base/logger.h>
|
||||
#include <base/system.h>
|
||||
#include <engine/gfx/image_loader.h>
|
||||
#include <engine/shared/datafile.h>
|
||||
#include <engine/storage.h>
|
||||
#include <game/mapitems.h>
|
||||
|
||||
#include <engine/shared/image_loader.h>
|
||||
|
||||
bool Process(IStorage *pStorage, const char *pMapName, const char *pPathSave)
|
||||
{
|
||||
CDataFileReader Reader;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#include <base/logger.h>
|
||||
#include <base/system.h>
|
||||
#include <cstdint>
|
||||
#include <engine/gfx/image_manipulation.h>
|
||||
#include <engine/shared/datafile.h>
|
||||
#include <engine/shared/image_manipulation.h>
|
||||
#include <engine/storage.h>
|
||||
#include <game/mapitems.h>
|
||||
#include <vector>
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
|
||||
#include <base/logger.h>
|
||||
#include <base/system.h>
|
||||
#include <engine/gfx/image_loader.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/shared/datafile.h>
|
||||
#include <engine/storage.h>
|
||||
#include <game/mapitems.h>
|
||||
|
||||
#include <engine/shared/image_loader.h>
|
||||
/*
|
||||
Usage: map_replace_image <source map filepath> <dest map filepath> <current image name> <new image filepath>
|
||||
Notes: map filepath must be relative to user default teeworlds folder
|
||||
|
|
Loading…
Reference in a new issue