Fixed extern variables def

This commit is contained in:
JackCarterSmith 2020-09-09 18:21:56 +02:00
parent 854dba8a26
commit a7e1fd65cf
No known key found for this signature in database
GPG Key ID: B05F75E5934B1D7F
5 changed files with 5 additions and 10 deletions

View File

@ -8,7 +8,6 @@ cmake_policy(VERSION 3.1)
# define project # define project
project(rse-texture VERSION 1.0.1 DESCRIPTION "RogueSquadron Extractor - Texture" LANGUAGES C) project(rse-texture VERSION 1.0.1 DESCRIPTION "RogueSquadron Extractor - Texture" LANGUAGES C)
set(CMAKE_BUILD_TYPE Release)
set(RSE_TEX_NAME RSE_Texture-${PROJECT_VERSION}) set(RSE_TEX_NAME RSE_Texture-${PROJECT_VERSION})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY)
@ -31,8 +30,10 @@ SOURCE_GROUP("Header Files" FILES ${RSE_TEX_HRDS})
# begin building RSE-Texture # begin building RSE-Texture
#set(CMAKE_BUILD_TYPE Debug)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}) #include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(rse-texture ${RSE_TEX_SRCS} ${RSE_TEX_HRDS}) add_executable(rse-texture ${RSE_TEX_SRCS} ${RSE_TEX_HRDS})
#set_property(TARGET rse-texture PROPERTY C_STANDARD 99)
set_target_properties(rse-texture PROPERTIES OUTPUT_NAME ${RSE_TEX_NAME}) set_target_properties(rse-texture PROPERTIES OUTPUT_NAME ${RSE_TEX_NAME})
if(MSVC) if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name # msvc does not append 'lib' - do it here to have consistent name

View File

@ -1,8 +1,6 @@
#include "HMT_Parser.h" #include "HMT_Parser.h"
extern int _options; // Global options settings variable
HMT_FILE *parseHMTFile(FILE *hmt_src) { HMT_FILE *parseHMTFile(FILE *hmt_src) {
int i; int i;
HMT_FILE *_buff = NULL; HMT_FILE *_buff = NULL;
@ -132,12 +130,10 @@ int getSamplesFromFile(RS_IMAGE *img, FILE *f) {
int sample_bits = img->sampleBits; int sample_bits = img->sampleBits;
int size = div(img->width*img->height*sample_bits, 8).quot; int size = div(img->width*img->height*sample_bits, 8).quot;
/* if (f->_bufsiz >= ftell(f)+size) { //TODO: Check C equivalent
if (f->_bufsize >= ftell(f)+size) { //TODO: Check C equivalent
printf("[ERR] WARNING! Please fix size/sample."); printf("[ERR] WARNING! Please fix size/sample.");
return EXIT_FAILURE; return EXIT_FAILURE;
} }
*/
img->samples = calloc(1, size); img->samples = calloc(1, size);
fread(img->samples, size, 1, f); fread(img->samples, size, 1, f);

View File

@ -1,8 +1,6 @@
#include "Image_Exporter.h" #include "Image_Exporter.h"
extern int _options; // Global options settings variable
int saveToPNG(RS_IMAGE *img, char *tex_path, char *hmt_fileName) { int saveToPNG(RS_IMAGE *img, char *tex_path, char *hmt_fileName) {
if (tex_path == NULL || img == NULL) return EXIT_FAILURE; if (tex_path == NULL || img == NULL) return EXIT_FAILURE;
char export_path[128]; char export_path[128];

View File

@ -10,7 +10,7 @@
#include "Texture-Extractor.h" #include "Texture-Extractor.h"
extern int _options; // Global options settings variable int _options; // Global options settings variable
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
// Init buffer vars // Init buffer vars

View File

@ -4,6 +4,6 @@
#define VERBOSE_ENABLED 0x0001 #define VERBOSE_ENABLED 0x0001
#define OUTPUT_DIR 0x0002 #define OUTPUT_DIR 0x0002
int _options; extern int _options;
#endif #endif