Tracked down and fixed segmentation fault upon close.
This commit is contained in:
@@ -18,10 +18,17 @@ namespace CaveGame::Client
|
||||
{
|
||||
using namespace JUI;
|
||||
|
||||
struct Accreditation
|
||||
{
|
||||
unsigned int text_size;
|
||||
Color4 text_color;
|
||||
std::string content;
|
||||
|
||||
};
|
||||
|
||||
// We currently lack Rich Text, so we'll do this...
|
||||
std::vector<std::tuple<unsigned int, Color4, std::string>> Credits =
|
||||
{
|
||||
// NOTE: this must be static const, or the program will segfault upon exit.
|
||||
static const std::vector<Accreditation> Credits = {
|
||||
{34, Colors::White, "cavegame"},
|
||||
{20, Colors::White, "A Redacted Software Product"},
|
||||
{18, Colors::Yellows::Moccasin, "Josh O'Leary"},
|
||||
|
@@ -29,13 +29,15 @@ JUI::Window *CaveGame::Client::CreateCreditsWindowWidget(JUI::Widget *parent) {
|
||||
listing->Margin(4_px);
|
||||
listing->Padding(5_px);
|
||||
|
||||
int min_height = 0;
|
||||
for (auto[size, color, msg] : Credits)
|
||||
{
|
||||
listing->Add(line_item(msg, size, color));
|
||||
min_height += size;
|
||||
}
|
||||
|
||||
/*
|
||||
int min_height = 0;
|
||||
for (auto line : Credits)
|
||||
{
|
||||
listing->Add(line_item(line.content, line.text_size, line.text_color));
|
||||
min_height += line.text_size;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
line_item("CaveGame", 40, listing);
|
||||
line_item("A Redacted Software Product", 16, listing);
|
||||
@@ -52,7 +54,7 @@ JUI::Window *CaveGame::Client::CreateCreditsWindowWidget(JUI::Widget *parent) {
|
||||
line_item("Karl Darling", 24, listing);
|
||||
line_item("Financial Advisor", 16, listing);*/
|
||||
|
||||
credits_window->Size({300, Math::Max(400, min_height), 0, 0});
|
||||
//credits_window->Size({300, Math::Max(400, min_height), 0, 0});
|
||||
|
||||
return credits_window;
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ if (CLIENT_BUILD_WITH_STEAM)
|
||||
add_library(SteamworksSDK SHARED IMPORTED)
|
||||
|
||||
# TODO: Can we legally ship the steam SDK with source code?
|
||||
set_target_properties(SteamworksSDK PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/assets/steamworks_sdk/linux64/libsteam_api.so")
|
||||
#set_target_properties(SteamworksSDK PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/assets/steamworks_sdk/linux64/libsteam_api.so")
|
||||
|
||||
|
||||
target_include_directories(CaveClientApp PUBLIC "../Steam/")
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#include <steam_api.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <JGL/JGL.h>
|
||||
#include <ClientApp/CaveGameWindow.hpp>
|
||||
#include <Core/Loggers.hpp>
|
||||
@@ -22,6 +24,8 @@
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
|
||||
|
||||
// Hide logs from engine components so we can focus on CaveGame.
|
||||
JGL::Logger::Warning.EnableConsole(false);
|
||||
JGL::Logger::Debug.EnableConsole(false);
|
||||
@@ -52,4 +56,5 @@ int main(int argc, char** argv) {
|
||||
|
||||
CaveGame::Logs::Info.Log("Exiting client program.");
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user