From 4066bf79681137abd982fc9e61df7cd6e1f18192 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Tue, 5 Aug 2025 23:31:49 +0200 Subject: [PATCH] less extern and ignore lib c file --- CMakeLists.txt | 2 +- lib/n64graphics/n64graphics.h | 42 +++++++++++++++++------------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac5294b..26328fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) file(GLOB_RECURSE CXX_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/lib/strhash64/*.cpp) -file(GLOB C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c ${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.c ${CMAKE_CURRENT_SOURCE_DIR}/lib/**/*.c) +file(GLOB C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c ${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.c) set(SRC_DIR ${CXX_FILES} ${C_FILES} ${LGFXD_FILES}) if(BUILD_SM64) diff --git a/lib/n64graphics/n64graphics.h b/lib/n64graphics/n64graphics.h index 9ebc747..f842b3b 100644 --- a/lib/n64graphics/n64graphics.h +++ b/lib/n64graphics/n64graphics.h @@ -46,20 +46,20 @@ typedef struct //--------------------------------------------------------- // N64 raw RGBA16/RGBA32 -> intermediate RGBA -extern rgba *raw2rgba(const uint8_t *raw, int width, int height, int depth); +rgba *raw2rgba(const uint8_t *raw, int width, int height, int depth); // N64 raw IA1/IA4/IA8/IA16 -> intermediate IA -extern ia *raw2ia(const uint8_t *raw, int width, int height, int depth); +ia *raw2ia(const uint8_t *raw, int width, int height, int depth); // N64 raw I4/I8 -> intermediate IA -extern ia *raw2i(const uint8_t *raw, int width, int height, int depth); +ia *raw2i(const uint8_t *raw, int width, int height, int depth); // N64 raw CI4/CI8 -> intermediate CI -extern ci *raw2ci_torch(const uint8_t* raw, int width, int height, int depth); +ci *raw2ci_torch(const uint8_t* raw, int width, int height, int depth); -extern int convert_raw_to_ci8(unsigned char **png_output, int *size_output, uint8_t *texture, uint8_t *palette, int format, int width, int height, int depth, int pal_depth); +int convert_raw_to_ci8(unsigned char **png_output, int *size_output, uint8_t *texture, uint8_t *palette, int format, int width, int height, int depth, int pal_depth); -extern int imgpal2rawci(uint8_t *rawci, const rgba *img, const rgba *pal, const uint8_t *wheel_mask, int raw_size, int ci_depth, int img_size, int pal_size); +int imgpal2rawci(uint8_t *rawci, const rgba *img, const rgba *pal, const uint8_t *wheel_mask, int raw_size, int ci_depth, int img_size, int pal_size); //--------------------------------------------------------- // intermediate RGBA/IA -> N64 RGBA/IA/I/CI @@ -67,54 +67,54 @@ extern int imgpal2rawci(uint8_t *rawci, const rgba *img, const rgba *pal, const //--------------------------------------------------------- // intermediate RGBA -> N64 raw RGBA16/RGBA32 -extern int rgba2raw(uint8_t *raw, const rgba *img, int width, int height, int depth); +int rgba2raw(uint8_t *raw, const rgba *img, int width, int height, int depth); // intermediate IA -> N64 raw IA1/IA4/IA8/IA16 -extern int ia2raw(uint8_t *raw, const ia *img, int width, int height, int depth); +int ia2raw(uint8_t *raw, const ia *img, int width, int height, int depth); // intermediate IA -> N64 raw I4/I8 -extern int i2raw(uint8_t *raw, const ia *img, int width, int height, int depth); +int i2raw(uint8_t *raw, const ia *img, int width, int height, int depth); // intermediate CI -> N64 raw CI4/CI8 -extern int ci2raw_torch(uint8_t* raw, const ci* img, int width, int height, int depth); +int ci2raw_torch(uint8_t* raw, const ci* img, int width, int height, int depth); //--------------------------------------------------------- // N64 CI <-> N64 RGBA16/IA16 //--------------------------------------------------------- // N64 CI raw data and palette to raw data (either RGBA16 or IA16) -extern uint8_t *ci2raw(const uint8_t *rawci, const uint8_t *palette, int width, int height, int ci_depth); +uint8_t *ci2raw(const uint8_t *rawci, const uint8_t *palette, int width, int height, int ci_depth); // convert from raw (RGBA16 or IA16) format to CI + palette -extern int raw2ci(uint8_t *rawci, palette_t *pal, const uint8_t *raw, int raw_len, int ci_depth); +int raw2ci(uint8_t *rawci, palette_t *pal, const uint8_t *raw, int raw_len, int ci_depth); //--------------------------------------------------------- // intermediate RGBA/IA -> PNG //--------------------------------------------------------- // intermediate RGBA write to PNG file -extern int rgba2png(unsigned char** png_output, int* size_output, const rgba* img, int width, int height); +int rgba2png(unsigned char** png_output, int* size_output, const rgba* img, int width, int height); // intermediate IA write to grayscale PNG file -extern int ia2png(unsigned char** png_output, int* size_output, const ia* img, int width, int height); +int ia2png(unsigned char** png_output, int* size_output, const ia* img, int width, int height); -extern int ci2png(unsigned char** png_output, int* size_output, const ci* img, int width, int height); +int ci2png(unsigned char** png_output, int* size_output, const ci* img, int width, int height); //--------------------------------------------------------- // PNG -> intermediate RGBA/IA //--------------------------------------------------------- // PNG file -> intermediate RGBA -extern rgba *png2rgba(unsigned char* png_input, int size_input, int *width, int *height); +rgba *png2rgba(unsigned char* png_input, int size_input, int *width, int *height); // PNG file -> intermediate RGB -extern rgb* png2rgb(unsigned char* png_input, int size_input, int* width, int* height); +rgb* png2rgb(unsigned char* png_input, int size_input, int* width, int* height); // PNG file -> intermediate IA -extern ia *png2ia(unsigned char* png_input, int size_input, int *width, int *height); +ia *png2ia(unsigned char* png_input, int size_input, int *width, int *height); // PNG file -> intermediate CI -extern ci* png2ci(unsigned char* png_input, int size_input, int* width, int* height); +ci* png2ci(unsigned char* png_input, int size_input, int* width, int* height); // Adds colours to palette data static int pal_add_color(palette_t* pal, uint16_t val); @@ -124,10 +124,10 @@ static int pal_add_color(palette_t* pal, uint16_t val); //--------------------------------------------------------- // get version of underlying graphics reading library -extern const char *n64graphics_get_read_version(void); +const char *n64graphics_get_read_version(void); // get version of underlying graphics writing library -extern const char *n64graphics_get_write_version(void); +const char *n64graphics_get_write_version(void); #ifdef __cplusplus }