diff --git a/CMakeLists.txt b/CMakeLists.txt index baf600e..b9c6728 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,4 +115,13 @@ if(TARGET boo AND NOT WINDOWS_STORE) # Renderer add_executable(amuserender driver/amuserender.cpp) target_link_libraries(amuserender amuse boo ${BOO_SYS_LIBS} logvisor athena-core athena-libyaml ${ZLIB_LIBRARIES} ${LZO_LIB}) + + # Editor + find_package(Qt5Widgets) + if (Qt5Widgets_FOUND) + message(STATUS "Qt5 found, amuse-gui will be built") + add_subdirectory(Editor) + else() + message(STATUS "Qt5 not found, amuse-gui will not be built") + endif() endif() diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt new file mode 100644 index 0000000..424de6c --- /dev/null +++ b/Editor/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt5Widgets) +find_package(Qt5Network) +find_package(Qt5Xml) + +add_subdirectory(platforms/freedesktop) +declare_qticon_target() +list(APPEND PLAT_SRCS mainicon_qt.cpp) + +add_executable(amuse-gui WIN32 MACOSX_BUNDLE + MainWindow.ui MainWindow.hpp MainWindow.cpp + ${PLAT_SRCS} + main.cpp) + +set_target_properties(amuse-gui PROPERTIES + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist") + +target_link_libraries(amuse-gui ${PLAT_LIBS} + ${Qt5Widgets_LIBRARIES} + ${Qt5Network_LIBRARIES} + ${Qt5Xml_LIBRARIES} + boo logvisor zeus athena-core athena-libyaml xxhash z) diff --git a/Editor/MainWindow.cpp b/Editor/MainWindow.cpp new file mode 100644 index 0000000..93e4efa --- /dev/null +++ b/Editor/MainWindow.cpp @@ -0,0 +1,5 @@ +// +// Created by Jack Andersen on 3/5/18. +// + +#include "MainWindow.hpp" diff --git a/Editor/MainWindow.hpp b/Editor/MainWindow.hpp new file mode 100644 index 0000000..04e9ceb --- /dev/null +++ b/Editor/MainWindow.hpp @@ -0,0 +1,15 @@ +// +// Created by Jack Andersen on 3/5/18. +// + +#ifndef URDE_MAINWINDOW_HPP +#define URDE_MAINWINDOW_HPP + + +class MainWindow +{ + +}; + + +#endif //URDE_MAINWINDOW_HPP diff --git a/Editor/main.cpp b/Editor/main.cpp new file mode 100644 index 0000000..17553bf --- /dev/null +++ b/Editor/main.cpp @@ -0,0 +1,8 @@ +// +// Created by Jack Andersen on 3/5/18. +// + +int main(int argc, char* argv[]) +{ + // TODO: Do +} diff --git a/Editor/mainwindow.ui b/Editor/mainwindow.ui new file mode 100644 index 0000000..9ae3b50 --- /dev/null +++ b/Editor/mainwindow.ui @@ -0,0 +1,24 @@ + + + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/Editor/platforms/freedesktop/1024x1024/apps/amuse.png b/Editor/platforms/freedesktop/1024x1024/apps/amuse.png new file mode 100644 index 0000000..1018d38 Binary files /dev/null and b/Editor/platforms/freedesktop/1024x1024/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/128x128/apps/amuse.png b/Editor/platforms/freedesktop/128x128/apps/amuse.png new file mode 100644 index 0000000..8c1447a Binary files /dev/null and b/Editor/platforms/freedesktop/128x128/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/16x16/apps/amuse.png b/Editor/platforms/freedesktop/16x16/apps/amuse.png new file mode 100644 index 0000000..880cdb3 Binary files /dev/null and b/Editor/platforms/freedesktop/16x16/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/256x256/apps/amuse.png b/Editor/platforms/freedesktop/256x256/apps/amuse.png new file mode 100644 index 0000000..0e5ec99 Binary files /dev/null and b/Editor/platforms/freedesktop/256x256/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/32x32/apps/amuse.png b/Editor/platforms/freedesktop/32x32/apps/amuse.png new file mode 100644 index 0000000..faf7279 Binary files /dev/null and b/Editor/platforms/freedesktop/32x32/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/48x48/apps/amuse.png b/Editor/platforms/freedesktop/48x48/apps/amuse.png new file mode 100644 index 0000000..ab489cc Binary files /dev/null and b/Editor/platforms/freedesktop/48x48/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/512x512/apps/amuse.png b/Editor/platforms/freedesktop/512x512/apps/amuse.png new file mode 100644 index 0000000..b27857b Binary files /dev/null and b/Editor/platforms/freedesktop/512x512/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/64x64/apps/amuse.png b/Editor/platforms/freedesktop/64x64/apps/amuse.png new file mode 100644 index 0000000..1e98cde Binary files /dev/null and b/Editor/platforms/freedesktop/64x64/apps/amuse.png differ diff --git a/Editor/platforms/freedesktop/CMakeLists.txt b/Editor/platforms/freedesktop/CMakeLists.txt new file mode 100644 index 0000000..f9f5321 --- /dev/null +++ b/Editor/platforms/freedesktop/CMakeLists.txt @@ -0,0 +1,18 @@ +include_directories(${LIBPNG_INCLUDE_DIR}) +add_executable(amuse-mkqticon mkqticon.c) +target_link_libraries(amuse-mkqticon ${PNG_LIB} ${ZLIB_LIBRARIES}) + +macro(declare_qticon_target) +add_custom_command(OUTPUT ${amuse_BINARY_DIR}/Editor/platforms/freedesktop/mainicon_qt.bin + COMMAND $ + ARGS ${amuse_BINARY_DIR}/Editor/platforms/freedesktop/mainicon_qt.bin + DEPENDS + ${amuse_SOURCE_DIR}/Editor/platforms/freedesktop/128x128/apps/amuse.png + ${amuse_SOURCE_DIR}/Editor/platforms/freedesktop/64x64/apps/amuse.png + ${amuse_SOURCE_DIR}/Editor/platforms/freedesktop/48x48/apps/amuse.png + ${amuse_SOURCE_DIR}/Editor/platforms/freedesktop/32x32/apps/amuse.png + ${amuse_SOURCE_DIR}/Editor/platforms/freedesktop/16x16/apps/amuse.png + WORKING_DIRECTORY ${amuse_SOURCE_DIR}/Editor/platforms/freedesktop + COMMENT "Generating mainicon_qt.bin") +bintoc(mainicon_qt.cpp ${amuse_BINARY_DIR}/Editor/platforms/freedesktop/mainicon_qt.bin MAINICON_QT) +endmacro() diff --git a/Editor/platforms/freedesktop/amuse.desktop b/Editor/platforms/freedesktop/amuse.desktop new file mode 100644 index 0000000..41768cb --- /dev/null +++ b/Editor/platforms/freedesktop/amuse.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Amuse +GenericName=MusyX Game Audio Editor +Comment=Edit Audio Data of MusyX Sound Groups +Exec=amuse-gui +Icon=amuse +Terminal=false +Type=Application +Categories=Audio diff --git a/Editor/platforms/freedesktop/mkqticon.c b/Editor/platforms/freedesktop/mkqticon.c new file mode 100644 index 0000000..18e69e0 --- /dev/null +++ b/Editor/platforms/freedesktop/mkqticon.c @@ -0,0 +1,71 @@ +#include +#include +#include +#include + +static const int DIMS[] = +{ + 16, + 32, + 48, + 64, + 128, + 256, + 0 +}; + +int main(int argc, char* argv[]) +{ + if (argc < 2) + { + fprintf(stderr, "Usage: makeqticon \n"); + return 1; + } + + FILE* ofp = fopen(argv[1], "wb"); + if (!ofp) + { + fprintf(stderr, "'%s' is not able to be opened for writing as a regular file\n", argv[1]); + return 1; + } + + char command[2048]; + + for (const int* d = DIMS ; *d != 0 ; ++d) + { + printf("Rendering main icon @%dx%d\n", *d, *d); + fflush(stdout); + + snprintf(command, 2048, "%dx%d/apps/amuse.png", *d, *d); + FILE* fp = fopen(command, "rb"); + if (!fp) + { + fprintf(stderr, "unable to open '%s' for reading\n", command); + fclose(ofp); + return 1; + } + + fseek(fp, 0, SEEK_END); + uint32_t size = (uint32_t)ftell(fp); + fseek(fp, 0, SEEK_SET); + + fwrite(&size, 1, 4, ofp); + + uint8_t buf[1024]; + while (size > 0) + { + long thisSize = size; + if (thisSize > 1024) + thisSize = 1024; + + fread(buf, 1, (size_t)thisSize, fp); + fwrite(buf, 1, (size_t)thisSize, ofp); + size -= thisSize; + } + + fclose(fp); + } + + fclose(ofp); + return 0; +} diff --git a/Editor/platforms/mac/Info.plist b/Editor/platforms/mac/Info.plist new file mode 100644 index 0000000..ed530d4 --- /dev/null +++ b/Editor/platforms/mac/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleExecutable + amuse-gui + CFBundleGetInfoString + Version BETA + CFBundleShortVersionString + BETA + NSHumanReadableCopyright + 2015-2018 Antidote / Jackoalan + CFBundleIconFile + mainicon.icns + CFBundleIdentifier + com.axiodl.Amuse + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Amuse + CFBundleVersion + BETA + CFBundlePackageType + APPL + CFBundleSignature + ???? + NSPrincipalClass + NSApplication + NSHighResolutionCapable + + + diff --git a/Editor/platforms/mac/mainicon.icns b/Editor/platforms/mac/mainicon.icns new file mode 100644 index 0000000..2f613e5 Binary files /dev/null and b/Editor/platforms/mac/mainicon.icns differ diff --git a/Editor/platforms/win/amuse-gui.manifest b/Editor/platforms/win/amuse-gui.manifest new file mode 100644 index 0000000..cfbb443 --- /dev/null +++ b/Editor/platforms/win/amuse-gui.manifest @@ -0,0 +1,23 @@ + + + Amuse + + + + + + + + + + + + + + + + + true/PM + + + diff --git a/Editor/platforms/win/amuse-gui.rc b/Editor/platforms/win/amuse-gui.rc new file mode 100644 index 0000000..589fef4 --- /dev/null +++ b/Editor/platforms/win/amuse-gui.rc @@ -0,0 +1,33 @@ +#include "winver.h" +#define IDI_ICON1 101 + +IDI_ICON1 ICON DISCARDABLE "mainicon.ico" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 1,0,0,0 + FILEFLAGS 0x0L + FILEFLAGSMASK 0x3fL + FILEOS 0x00040004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", "Antidote / Jackoalan" + VALUE "FileDescription", "Amuse" + VALUE "FileVersion", "BETA" + VALUE "LegalCopyright", "Copyright (C) 2015-2018 Antidote / Jackoalan" + VALUE "InternalName", "amuse" + VALUE "OriginalFilename", "amuse-gui.exe" + VALUE "ProductName", "Amuse" + VALUE "ProductVersion", "BETA" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/Editor/platforms/win/mainicon.ico b/Editor/platforms/win/mainicon.ico new file mode 100644 index 0000000..ae26f64 Binary files /dev/null and b/Editor/platforms/win/mainicon.ico differ