Skip to content

Commit

Permalink
Better versioning + rename to Glacier 1 Audio Tool
Browse files Browse the repository at this point in the history
  • Loading branch information
WSSDude committed Jul 3, 2023
1 parent d31a5b7 commit 9839a55
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 7 deletions.
30 changes: 30 additions & 0 deletions src/Config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,33 @@
// Copyright © 2015-2023 Feldarian Softworks. All rights reserved.
// SPDX-License-Identifier: EUPL-1.2
//

#pragma once

#define G1AT_VERSION_STRING "${VERSION}"
#define G1AT_VERSION_MAJOR ${VERSION_MAJOR}
#define G1AT_VERSION_MINOR ${VERSION_MINOR}
#define G1AT_VERSION_PATCH ${VERSION_ALTER}

#define G1AT_VERSION_STRING_GIT "${GIT_TAG_LONG}"

#define G1AT_NAME "${G1AT_NAME}"
#define G1AT_DESCRIPTION "${G1AT_DESCRIPTION}"
#define G1AT_HOMEPAGE "${G1AT_HOMEPAGE}"

#define G1AT_DEBUG_BUILD (${DEBUG})
#define G1AT_RELEASE_BUILD (!(G1AT_DEBUG_BUILD))

#if !defined(_DEBUG) && G1AT_DEBUG_BUILD
#define _DEBUG 1
#endif

#if !defined(NDEBUG) && G1AT_RELEASE_BUILD
#define NDEBUG 1
#endif

#ifdef G1AT_DEBUG_BUILD
#define G1AT_TITLE G1AT_NAME " (" G1AT_VERSION_STRING_GIT ")"
#else
#define G1AT_TITLE G1AT_NAME " (" G1AT_VERSION_STRING ")"
#endif
13 changes: 13 additions & 0 deletions src/Config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Created by Andrej Redeky.
// Copyright © 2015-2023 Feldarian Softworks. All rights reserved.
// SPDX-License-Identifier: EUPL-1.2
//

#pragma once

extern "C"
{
// Generated by xmake from "src/Config.h.in"
#include <Config.h>
}
6 changes: 4 additions & 2 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "Precompiled.hpp"

#include "Config.hpp"

#include "Hitman1Dialog.hpp"
#include "Hitman23Dialog.hpp"
#include "Hitman4Dialog.hpp"
Expand Down Expand Up @@ -137,7 +139,7 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
constexpr auto window_flags =
static_cast<SDL_WindowFlags>(SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
SDL_Window *window =
SDL_CreateWindow("Hitman Audio Tool", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, window_flags);
SDL_CreateWindow(G1AT_TITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, window_flags);
const auto gl_context = SDL_GL_CreateContext(window);
SDL_GL_MakeCurrent(window, gl_context);
SDL_GL_SetSwapInterval(1);
Expand Down Expand Up @@ -249,7 +251,7 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)

ImGui::SetNextWindowPos({}, ImGuiCond_Always);
ImGui::SetNextWindowSize({static_cast<float>(windowWidth), static_cast<float>(windowHeight)}, ImGuiCond_Always);
ImGui::Begin("Hitman Audio Tool", nullptr,
ImGui::Begin(G1AT_NAME, nullptr,
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);

if (ImGui::BeginTabBar("##ToolsTab"))
Expand Down
2 changes: 2 additions & 0 deletions src/Precompiled.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

extern "C"
{

#include "Precompiled.h"

}

#include <imgui.h>
Expand Down
2 changes: 1 addition & 1 deletion src/Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "Precompiled.hpp"

#ifdef HAT_BUILD_TESTS
#ifdef G1AT_BUILD_TESTS

namespace
{
Expand Down
14 changes: 10 additions & 4 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ package("libsamplerate")
package_end()
add_requires("libsamplerate 0.2.2", { configs = { shared = true } })

target("HitmanAudioTool")
target("Glacier1AudioTool")
set_version("1.1.0")

set_rundir("$(projectdir)")
add_defines("IMGUI_USER_CONFIG=\""..imguiUserConfig.."\"")

--add_defines("HAT_BUILD_TESTS")
--add_defines("G1AT_BUILD_TESTS")

set_kind("binary")

Expand All @@ -110,10 +112,14 @@ target("HitmanAudioTool")
add_headerfiles("src/**.hpp")
add_files("src/**.cpp")

set_configvar("G1AT_NAME", "Glacier 1 Audio Tool")
set_configvar("G1AT_DESCRIPTION", "Tool able to read, write, import and export selected Glacier 1 sound-related formats.")
set_configvar("G1AT_HOMEPAGE", "https://github.com/WSSDude/Glacier1AudioTool")

set_configdir("$(buildir)/src/Config")
add_configfiles("src/Config.h.in")

add_headerfiles("$(buildir)/src/Config")
add_includedirs("$(buildir)/src/Config/")
add_headerfiles("$(buildir)/src/Config/**.h")

set_pcxxheader("src/Precompiled.hpp")

Expand Down

0 comments on commit 9839a55

Please sign in to comment.