Fix issue with OLC_PGE_HEADLESS flag causing segfaults with image loading. Undefine unwanted extra windows defines. Release Build 13484.
Some checks failed
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 7m47s
Emscripten Build / UnitTesting (push) Failing after 8m47s

This commit is contained in:
AMay 2026-05-01 03:09:22 -05:00
parent 408209fb94
commit 3e282fa8e9
8 changed files with 47 additions and 29 deletions

View File

@ -251,7 +251,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>UNIT_TESTING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>UNIT_TESTING;OLC_PGE_HEADLESS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)steam;$(ProjectDir)discord-files;C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\LabUser\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\niconiconii\OneDrive\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

View File

@ -202,6 +202,7 @@ AiL::AiL(bool testingMode){
}
void InitializeGameConfigurations(){
if(PACK_KEY=="INSERT_PACK_KEY_HERE"||PACK_KEY=="INSERT PACK KEY HERE")ERR("ERROR! Starting the game with the default pack ID is not allowed!");
game=nullptr;
DATA.Reset();
@ -296,10 +297,11 @@ void InitializeGameConfigurations(){
}
bool AiL::OnUserCreate(){
if(PACK_KEY=="INSERT_PACK_KEY_HERE"||PACK_KEY=="INSERT PACK KEY HERE")ERR("ERROR! Starting the game with the default pack ID is not allowed!");
gamepack.LoadPack("assets/"+"gamepack_file"_S,PACK_KEY);
#ifndef OLC_PGE_HEADLESS
GamePad::init();
#endif
Input::Initialize();
Font::init();
@ -4304,14 +4306,14 @@ const bool AiL::GameInitialized()const {
rcode AiL::LoadResource(Renderable&renderable,std::string_view imgPath,bool filter,bool clamp){
rcode returnCode;
if(gamepack.Loaded()){
returnCode=renderable.Load(std::string(imgPath),&gamepack,filter,clamp);
}else{
returnCode=renderable.Load(std::string(imgPath),nullptr,filter,clamp);
if("GENERATE_GAMEPACK"_B){
gamepack.AddFile(std::string(imgPath));
if(gamepack.Loaded()){
returnCode=renderable.Load(std::string(imgPath),&gamepack,filter,clamp);
}else{
returnCode=renderable.Load(std::string(imgPath),nullptr,filter,clamp);
if("GENERATE_GAMEPACK"_B){
gamepack.AddFile(std::string(imgPath));
}
}
}
return returnCode;
}

View File

@ -472,3 +472,8 @@ private:
Pixel vignetteOverlayCol{"Interface.Vignette Color"_Pixel};
std::vector<Notification>notifications;
};
#undef min
#undef max
#undef GetClassName

View File

@ -1124,31 +1124,35 @@ const bool Input::AxesActive(){
}
void Input::StartVibration(const bool override){
if(!GameSettings::RumbleEnabled(override))return;
if(UsingGamepad()){
STEAMINPUT(
SteamInput()->TriggerVibration(steamControllers[activeSteamControllerIndex],std::numeric_limits<unsigned short>::max(),std::numeric_limits<unsigned short>::max());
)else{
for(GamePad*gamepad:GamePad::getGamepads()){
if(gamepad->stillConnected){
gamepad->startVibration();
#ifndef OLC_PGE_HEADLESS
if(!GameSettings::RumbleEnabled(override))return;
if(UsingGamepad()){
STEAMINPUT(
SteamInput()->TriggerVibration(steamControllers[activeSteamControllerIndex],std::numeric_limits<unsigned short>::max(),std::numeric_limits<unsigned short>::max());
)else{
for(GamePad*gamepad:GamePad::getGamepads()){
if(gamepad->stillConnected){
gamepad->startVibration();
}
}
}
}
}
#endif
}
void Input::StopVibration(){
STEAMINPUT(
for(int i=0;i<controllerCount;i++){
SteamInput()->TriggerVibration(steamControllers[i],0U,0U);
}
)else{
for(GamePad*gamepad:GamePad::getGamepads()){
if(gamepad->stillConnected){
gamepad->stopVibration();
#ifndef OLC_PGE_HEADLESS
STEAMINPUT(
for(int i=0;i<controllerCount;i++){
SteamInput()->TriggerVibration(steamControllers[i],0U,0U);
}
)else{
for(GamePad*gamepad:GamePad::getGamepads()){
if(gamepad->stillConnected){
gamepad->stopVibration();
}
}
}
}
#endif
}
const bool operator<(const InputGroup&group1,const InputGroup&group2){

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 13463
#define VERSION_BUILD 13484
#define stringify(a) stringify_(a)
#define stringify_(a) #a

View File

@ -1701,6 +1701,7 @@ namespace olc
olc::rcode Sprite::LoadFromFile(const std::string& sImageFile, olc::ResourcePack* pack)
{
UNUSED(pack);
if(!loader)return olc::rcode::OK;
return loader->LoadImageResource(this, util::GetCaseInsensitiveFilename(sImageFile), pack);
}

View File

@ -54,6 +54,9 @@ David Barr, aka javidx9, <20>OneLoneCoder 2019, 2020, 2021, 2022
#pragma once
#include "olcUTIL_Geometry2D.h"
#undef min
#undef max
namespace olc::utils
{
class Camera2D
@ -216,6 +219,7 @@ namespace olc::utils
case Mode::LazyFollow:
{
#undef min
m_vPosition += (GetTarget() - m_vPosition) * std::min(1.f,m_fLazyFollowRate * fElapsedTime);
}
break;

View File

@ -2498,4 +2498,6 @@ namespace olc::utils::geom2d
}
using namespace olc;
using namespace olc::utils;
using namespace olc::utils;
#undef min
#undef max