Fix issue with OLC_PGE_HEADLESS flag causing segfaults with image loading. Undefine unwanted extra windows defines. Release Build 13484.
This commit is contained in:
parent
408209fb94
commit
3e282fa8e9
@ -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>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -472,3 +472,8 @@ private:
|
||||
Pixel vignetteOverlayCol{"Interface.Vignette Color"_Pixel};
|
||||
std::vector<Notification>notifications;
|
||||
};
|
||||
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#undef GetClassName
|
||||
@ -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){
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -2498,4 +2498,6 @@ namespace olc::utils::geom2d
|
||||
}
|
||||
|
||||
using namespace olc;
|
||||
using namespace olc::utils;
|
||||
using namespace olc::utils;
|
||||
#undef min
|
||||
#undef max
|
||||
Loading…
x
Reference in New Issue
Block a user