Skip to content

Commit

Permalink
v1.1.6 | 2024/03/11 | Worked a bit more on User_Data.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ZERICO2005 committed Mar 11, 2024
1 parent b2e212a commit de2a5a4
Show file tree
Hide file tree
Showing 11 changed files with 341 additions and 75 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ find_package(SDL2 REQUIRED)
find_package(OpenCL REQUIRED)
find_package(OpenCV REQUIRED)

# Icon
set(ICON_FILE "./icons/ABS-Icon.ico")
file(GLOB SRC_FILES "${SRC_DIR}/*.c" "${SRC_DIR}/*.cpp")
file(GLOB IMGUI_FILES "${IMGUI_DIR}/*.c" "${IMGUI_DIR}/*.cpp")
# Create an executable
Expand All @@ -35,5 +37,6 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${IMGUI_DIR})
# Compiler Flags Debug(-g -O0) Release(-O3)
set(OPT_FLAG -g -O3)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
set(MARCH_FLAGS "")
target_compile_options(${PROJECT_NAME} PUBLIC ${OPT_FLAG} ${MARCH_FLAGS} -fdiagnostics-color=always -Wall -Wno-unused-variable -Wno-comment)
target_link_libraries(${PROJECT_NAME} PUBLIC -static-libgcc -static-libstdc++ SDL2 SDL2main OpenCL quadmath ${OpenCV_LIBS})
target_link_libraries(${PROJECT_NAME} PUBLIC -static-libgcc -static-libstdc++ SDL2 SDL2main OpenCL quadmath ${OpenCV_LIBS})
24 changes: 24 additions & 0 deletions src/Common_Def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,30 @@ fp64 getDecimalTime() { // Returns the time in seconds
return (fp64)getNanoTime() / 1.0e9;
}

// const char* getDateAndTimeUTC(
// char DateDelimiter, char DateSeparator, char TimeDelimiter
// ) {
// static char timeFormat[sizeof("%Y-%m-%d_%H-%M-%S")];
// memset(timeFormat,'\0',sizeof(timeFormat));

// char* timeText = nullptr;
// size_t timeTextLen = sizeof("YYYY-mm-dd_HH-MM-SS");
// timeText = (char*)calloc(timeTextLen,sizeof(char));
// if (timeText == nullptr) {
// return nullptr;
// }

// snprintf(timeFormat,sizeof(timeFormat),"%%Y%c%%m%c%%d%c%%H%c%%M%c%%S",
// DateDelimiter,DateDelimiter,DateSeparator,TimeDelimiter,TimeDelimiter
// );
// time_t currentTime;
// struct tm *localTime;
// time(&currentTime);
// localTime = localtime(&currentTime);
// strftime(timeText, timeTextLen, timeFormat, localTime);
// return timeText;
// }

/* Color 24bit */

// (&R,&G,&B) H 0.0-360.0, S 0.0-1.0, V 0.0-1.0
Expand Down
9 changes: 8 additions & 1 deletion src/Common_Def.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ typedef double fp64;

typedef int64_t nano64_t;

typedef int int_enum;

/* Version */

//#define BUILD_DEBUG
Expand Down Expand Up @@ -113,7 +115,12 @@ typedef int64_t nano64_t;

#define SECONDS_TO_NANO(t) (nano64_t)((t) * 1.0e9)
#define NANO_TO_SECONDS(t) ((fp64)(t) / 1.0e9)


// // Callocs the date and time in UTC
// const char* getDateAndTimeUTC(
// char DateDelimiter = '-', char DateSeparator = '_', char TimeDelimiter = '-'
// );

/* Print Functions */
#define printFlush(...) printf(__VA_ARGS__); fflush(stdout)
#define printFatalError(...) printf("\n============\nFATAL ERROR: "); printf(__VA_ARGS__); printf("\n============\n"); fflush(stdout)
Expand Down
2 changes: 1 addition & 1 deletion src/Program_Def.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define PROGRAM_DATE "2024/03/11" /* YYYY/MM/DD */
#define PROGRAM_V_MAJOR 1
#define PROGRAM_V_MINOR 1
#define PROGRAM_V_PATCH 5
#define PROGRAM_V_PATCH 6
#define PROGRAM_V_TAG "Alpha"
#define PROGRAM_VERSION STR_N(PROGRAM_V_MAJOR) "." STR_N(PROGRAM_V_MINOR) "." STR_N(PROGRAM_V_PATCH) " " PROGRAM_V_TAG

Expand Down
1 change: 1 addition & 0 deletions src/display_GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,7 @@ void Menu_Keybinds() {
}
ImGui::Text(" ");
ImGui::Text("Global Sensitivity Multiplier:");

sen_slider("##sen_global",user_sensitivity.global,0.4,2.5);
if (ImGui::Button("Reset Sensitvity")) {
set_default_sensitivity(&user_sensitivity);
Expand Down
29 changes: 29 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,34 @@ int init_Fractal_Engine(int argc, char* argv[]) {
return 0;
}

// int write_ini_file(const char* path) {
// if (path == nullptr) { printError("write_ini_file has nullptr path"); return -1; }
// // if (config_data.Configuration_Behaviour.AutoSave_Config_File == false) { return 0; }
// FILE* file = nullptr;
// file = fopen(path, "r");
// if (file != nullptr) { // File already exists
// fclose(file);
// return 0;
// }
// file = fopen(path, "w");
// if (file == nullptr) {
// printError("Unable to write_ini_file to %s", path);
// return -1;
// }

// fprintf(file,
// "[Desktop Entry]\n"\
// "Name=ABS-Fractal-Explorer\n"\
// "Exec=ABS-Fractal-Explorer.exe\n"\
// "Icon=ABS-Icon.ico\n"\
// "Type=Application"
// );

// fclose(file);

// return 0;
// }

//#define print_pointer_sizes

int main(int argc, char* argv[]) {
Expand All @@ -59,6 +87,7 @@ int main(int argc, char* argv[]) {
if (argc >= 2) {
printFlush("\nArgument Count: %d\n",argc - 1);
}
//write_ini_file("./ABS-Fractal-Explorer.ini");
init_Fractal_Engine(argc, argv);
terminate_Fractal_Engine();
return 0;
Expand Down
4 changes: 3 additions & 1 deletion src/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ int init_Render(std::atomic<bool>& QUIT_FLAG, std::atomic<bool>& ABORT_RENDERING
//cleanKeyBind(&currentKeyBind);
init_default_sensitivity(&user_sensitivity);
/* User Config Test */
User_Configuration_Data config_data = {0};
// User_Configuration_Data config_data = {0};
// char filePath[320]; memset(filePath,'\0',sizeof(filePath));
// openFileInterface(filePath,ARRAY_LENGTH(filePath));
if (import_config_data(config_data,"./config.fracExpConfig") == 0) {
Expand All @@ -1535,6 +1535,8 @@ int init_Render(std::atomic<bool>& QUIT_FLAG, std::atomic<bool>& ABORT_RENDERING
screenshotFileType = (Image_File_Format::Image_File_Format_Enum)temp_screenshotFileType;
User_PNG_Compression_Level = config_data.Screenshot_Settings.PNG_Compression_Level;
User_JPG_Quality_Level = config_data.Screenshot_Settings.JPG_Quality_Level;
} else {
default_User_Configuration_Data(config_data);
}


Expand Down
1 change: 1 addition & 0 deletions src/temp_global_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@

/* Other */

User_Configuration_Data config_data = {0};
bool SaveUsernameInFiles = false; /* This MUST be False by Default */
//#define FileUsernameLength 32
char FileUsername[FileUsernameLength] = {0};
Expand Down
1 change: 1 addition & 0 deletions src/temp_global_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,6 @@
#define FileUsernameLength 32
extern char FileUsername[FileUsernameLength];
extern bool SaveHardwareInfoInFiles; /* This MUST be False by Default */
extern User_Configuration_Data config_data;

#endif /* TEMP_GLOBAL_RENDER_H */
Loading

0 comments on commit de2a5a4

Please sign in to comment.