From 71b030e35fccef16ad43dbff710ffcc45fd2537d Mon Sep 17 00:00:00 2001 From: tx00100xt Date: Fri, 13 Oct 2023 14:14:56 +0300 Subject: [PATCH] Fixed HUD, player FOV, weapon FOV for Serious Editor --- CHANGELOG.md | 16 +++++++ SamTFE/Sources/CMakeLists.txt | 2 +- SamTFE/Sources/WorldEditor/ChildFrm.cpp | 60 +++++++++++++++++++++++++ SamTFE/Sources/WorldEditor/ChildFrm.h | 1 + SamTSE/Sources/CMakeLists.txt | 2 +- SamTSE/Sources/WorldEditor/ChildFrm.cpp | 60 +++++++++++++++++++++++++ SamTSE/Sources/WorldEditor/ChildFrm.h | 1 + 7 files changed, 140 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da1276e1..83984233 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -163,3 +163,19 @@ All notable changes to this project will be documented in this file. ## 2023-06-07 - 2023-06-09 - Adding root CMakeLists.txt to build files for Serious Sam Classic The First Encounter and Serious Sam Classic The Second Encounter. - Added debian directory for building deb package using regular tools(bzr debuild) under Debian/Ubuntu. + +## 2023-06-15 - 2023-07-07 +- Fixed OpenGL lens flares,fix platform definition and CMakeList. +- Fixed loading of some incorrect custom maps. + +## 2023-10-03 - 2023-10-14 +- Added support building only OpenGL version of game. +- Fixed Obelisk textures and Alley Of Sphinxes textures (TFE). +- Fixed incorrect variable type in Beast.es. +- Removed deprecated PlatformToolset from aml11lib (Win). +- Fixed Serious Editor 64-bit crash when calling the function to show all entities . + Now the 64-bit editor has full functionality, just like its 32-bit version. + The cause of the crash was the conversion of pointers to 32 bits. +- SeriousModeler: Fixed conversion of pointers to 32 bits (Win). +- SeriousSkaStudio: Fixed conversion of pointers to 32 bits (Win). +- Fixed HUD, player FOV, weapon FOV for Serious Editor. diff --git a/SamTFE/Sources/CMakeLists.txt b/SamTFE/Sources/CMakeLists.txt index a6f00e6b..825233c9 100644 --- a/SamTFE/Sources/CMakeLists.txt +++ b/SamTFE/Sources/CMakeLists.txt @@ -140,7 +140,7 @@ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local" OR CMAKE_INSTALL_PREFIX STREQUAL " set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/../") # set install path to project root directory since endif() # since one wasn't set during config set(LOCAL_INSTALL TRUE) - message(STATUS "Using LOCAL Imstall") + message(STATUS "Using LOCAL Install") endif() if(CMAKE_INSTALL_PREFIX STREQUAL "/usr" ) # Only works for linux since I don't know what default is for windows/macos/freebsd. set(LOCAL_INSTALL FALSE) diff --git a/SamTFE/Sources/WorldEditor/ChildFrm.cpp b/SamTFE/Sources/WorldEditor/ChildFrm.cpp index 9684baac..3d262cb3 100644 --- a/SamTFE/Sources/WorldEditor/ChildFrm.cpp +++ b/SamTFE/Sources/WorldEditor/ChildFrm.cpp @@ -29,6 +29,11 @@ static char THIS_FILE[] = __FILE__; extern INDEX wed_bSaveTestGameFirstTime = TRUE; ENGINE_API extern INDEX snd_iFormat; +extern ENGINE_API FLOAT _fPlayerFOVAdjuster; +extern ENGINE_API FLOAT _fWeaponFOVAdjuster; +extern ENGINE_API FLOAT _fArmorHeightAdjuster; +extern ENGINE_API FLOAT _fFragScorerHeightAdjuster; + ///////////////////////////////////////////////////////////////////////////// // CChildFrame @@ -401,6 +406,48 @@ CWorldEditorView *CChildFrame::GetPerspectiveView(void) #define APPLICATION_NAME "TestGame FullScreen" +void CChildFrame::SetAdjusters(float ratio) +{ + //if (pdp == NULL) return; + //float ratio = (float)pdp->GetWidth() / (float)pdp->GetHeight(); + if (ratio >= 1.30f && ratio < 1.43f) //4:3 + { + _fWeaponFOVAdjuster = 1.0f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.0f; //Field of View for player + _fArmorHeightAdjuster = 0.7f; + _fFragScorerHeightAdjuster = 0.75f; + }else if (ratio >= 1.2f && ratio < 1.30f) //5:4 + { + _fWeaponFOVAdjuster = 1.0f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.0f; //Field of View for player + _fArmorHeightAdjuster = 0.7f; + _fFragScorerHeightAdjuster = 0.75f; + }else if (ratio >= 1.73f && ratio < 1.8f) //16:9 + { + _fWeaponFOVAdjuster = 1.25f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.15f; //Field of View for player + _fArmorHeightAdjuster = 0.835f; + _fFragScorerHeightAdjuster = 1.5f; + }else if (ratio >= 1.43f && ratio < 1.73f) //16:10 + { + _fWeaponFOVAdjuster = 1.15f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.10f; //Field of View for player + _fArmorHeightAdjuster = 0.78f; + _fFragScorerHeightAdjuster = 1.17f; + }else if (ratio >= 1.8f && ratio <= 4.2f) //21:9 + { + _fWeaponFOVAdjuster = 1.55f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.35f; //Field of View for player + _fArmorHeightAdjuster = 1.0f; + _fFragScorerHeightAdjuster = 2.35f; + } + _pShell->SetFLOAT("_fWeaponFOVAdjuster", _fWeaponFOVAdjuster); + _pShell->SetFLOAT("_fPlayerFOVAdjuster", _fPlayerFOVAdjuster); + _pShell->SetFLOAT("_fArmorHeightAdjuster", _fArmorHeightAdjuster); + _pShell->SetFLOAT("_fFragScorerHeightAdjuster", _fFragScorerHeightAdjuster); + /* CPrintF("[WorlEditor] _fWeaponFOVAdjuster: %f _fPlayerFOVAdjuster: %f _fArmorHeightAdjuster: %f _fFragScorerHeightAdjuster: %f\n", + _fWeaponFOVAdjuster,_fPlayerFOVAdjuster, _fArmorHeightAdjuster,_fFragScorerHeightAdjuster ); */ // For Debug +} void CChildFrame::TestGame( BOOL bFullScreen) { @@ -467,6 +514,19 @@ void CChildFrame::TestGame( BOOL bFullScreen) HINSTANCE hInstanceFullScreen; WNDCLASSEX wcFullScreen; char achWindowTitle[256]; // current window title + + // Set Adjusters for HUD and FOV + FLOAT ratio; + if (bFullScreen) { + ratio = (FLOAT)theApp.m_dmFullScreen.dm_pixSizeI / (FLOAT)theApp.m_dmFullScreen.dm_pixSizeJ; + } else { + ratio = (FLOAT)pdp->GetWidth() / (FLOAT)pdp->GetHeight(); + } + /* + CPrintF("[WorlEditor] pdp->GetWidth: %d pdp->GetHeight: %d Ratio: %f\n",pdp->GetWidth(), pdp->GetHeight(), ratio); + */ // For Debug + SetAdjusters(ratio); + if( bFullScreen) { // get full screen display mode info diff --git a/SamTFE/Sources/WorldEditor/ChildFrm.h b/SamTFE/Sources/WorldEditor/ChildFrm.h index 0125c888..fc51a830 100644 --- a/SamTFE/Sources/WorldEditor/ChildFrm.h +++ b/SamTFE/Sources/WorldEditor/ChildFrm.h @@ -77,6 +77,7 @@ class CChildFrame : public CMDIChildWnd inline INDEX CChildFrame::GetVSplitters(void) { return m_wndSplitter.GetRowCount();} CWorldEditorView *GetPerspectiveView(void); void TestGame( BOOL bFullScreen); + void SetAdjusters(float ratio); // Overrides // ClassWizard generated virtual function overrides diff --git a/SamTSE/Sources/CMakeLists.txt b/SamTSE/Sources/CMakeLists.txt index ed040ba5..d9bdee4b 100644 --- a/SamTSE/Sources/CMakeLists.txt +++ b/SamTSE/Sources/CMakeLists.txt @@ -140,7 +140,7 @@ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local" OR CMAKE_INSTALL_PREFIX STREQUAL " set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/../") # set install path to project root directory since endif() # since one wasn't set during config set(LOCAL_INSTALL TRUE) - message(STATUS "Using LOCAL Imstall") + message(STATUS "Using LOCAL Install") endif() if(CMAKE_INSTALL_PREFIX STREQUAL "/usr" ) # Only works for linux since I don't know what default is for windows/macos/freebsd. set(LOCAL_INSTALL FALSE) diff --git a/SamTSE/Sources/WorldEditor/ChildFrm.cpp b/SamTSE/Sources/WorldEditor/ChildFrm.cpp index 9684baac..3d262cb3 100644 --- a/SamTSE/Sources/WorldEditor/ChildFrm.cpp +++ b/SamTSE/Sources/WorldEditor/ChildFrm.cpp @@ -29,6 +29,11 @@ static char THIS_FILE[] = __FILE__; extern INDEX wed_bSaveTestGameFirstTime = TRUE; ENGINE_API extern INDEX snd_iFormat; +extern ENGINE_API FLOAT _fPlayerFOVAdjuster; +extern ENGINE_API FLOAT _fWeaponFOVAdjuster; +extern ENGINE_API FLOAT _fArmorHeightAdjuster; +extern ENGINE_API FLOAT _fFragScorerHeightAdjuster; + ///////////////////////////////////////////////////////////////////////////// // CChildFrame @@ -401,6 +406,48 @@ CWorldEditorView *CChildFrame::GetPerspectiveView(void) #define APPLICATION_NAME "TestGame FullScreen" +void CChildFrame::SetAdjusters(float ratio) +{ + //if (pdp == NULL) return; + //float ratio = (float)pdp->GetWidth() / (float)pdp->GetHeight(); + if (ratio >= 1.30f && ratio < 1.43f) //4:3 + { + _fWeaponFOVAdjuster = 1.0f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.0f; //Field of View for player + _fArmorHeightAdjuster = 0.7f; + _fFragScorerHeightAdjuster = 0.75f; + }else if (ratio >= 1.2f && ratio < 1.30f) //5:4 + { + _fWeaponFOVAdjuster = 1.0f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.0f; //Field of View for player + _fArmorHeightAdjuster = 0.7f; + _fFragScorerHeightAdjuster = 0.75f; + }else if (ratio >= 1.73f && ratio < 1.8f) //16:9 + { + _fWeaponFOVAdjuster = 1.25f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.15f; //Field of View for player + _fArmorHeightAdjuster = 0.835f; + _fFragScorerHeightAdjuster = 1.5f; + }else if (ratio >= 1.43f && ratio < 1.73f) //16:10 + { + _fWeaponFOVAdjuster = 1.15f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.10f; //Field of View for player + _fArmorHeightAdjuster = 0.78f; + _fFragScorerHeightAdjuster = 1.17f; + }else if (ratio >= 1.8f && ratio <= 4.2f) //21:9 + { + _fWeaponFOVAdjuster = 1.55f; //Field of View for weapon + _fPlayerFOVAdjuster = 1.35f; //Field of View for player + _fArmorHeightAdjuster = 1.0f; + _fFragScorerHeightAdjuster = 2.35f; + } + _pShell->SetFLOAT("_fWeaponFOVAdjuster", _fWeaponFOVAdjuster); + _pShell->SetFLOAT("_fPlayerFOVAdjuster", _fPlayerFOVAdjuster); + _pShell->SetFLOAT("_fArmorHeightAdjuster", _fArmorHeightAdjuster); + _pShell->SetFLOAT("_fFragScorerHeightAdjuster", _fFragScorerHeightAdjuster); + /* CPrintF("[WorlEditor] _fWeaponFOVAdjuster: %f _fPlayerFOVAdjuster: %f _fArmorHeightAdjuster: %f _fFragScorerHeightAdjuster: %f\n", + _fWeaponFOVAdjuster,_fPlayerFOVAdjuster, _fArmorHeightAdjuster,_fFragScorerHeightAdjuster ); */ // For Debug +} void CChildFrame::TestGame( BOOL bFullScreen) { @@ -467,6 +514,19 @@ void CChildFrame::TestGame( BOOL bFullScreen) HINSTANCE hInstanceFullScreen; WNDCLASSEX wcFullScreen; char achWindowTitle[256]; // current window title + + // Set Adjusters for HUD and FOV + FLOAT ratio; + if (bFullScreen) { + ratio = (FLOAT)theApp.m_dmFullScreen.dm_pixSizeI / (FLOAT)theApp.m_dmFullScreen.dm_pixSizeJ; + } else { + ratio = (FLOAT)pdp->GetWidth() / (FLOAT)pdp->GetHeight(); + } + /* + CPrintF("[WorlEditor] pdp->GetWidth: %d pdp->GetHeight: %d Ratio: %f\n",pdp->GetWidth(), pdp->GetHeight(), ratio); + */ // For Debug + SetAdjusters(ratio); + if( bFullScreen) { // get full screen display mode info diff --git a/SamTSE/Sources/WorldEditor/ChildFrm.h b/SamTSE/Sources/WorldEditor/ChildFrm.h index 0125c888..fc51a830 100644 --- a/SamTSE/Sources/WorldEditor/ChildFrm.h +++ b/SamTSE/Sources/WorldEditor/ChildFrm.h @@ -77,6 +77,7 @@ class CChildFrame : public CMDIChildWnd inline INDEX CChildFrame::GetVSplitters(void) { return m_wndSplitter.GetRowCount();} CWorldEditorView *GetPerspectiveView(void); void TestGame( BOOL bFullScreen); + void SetAdjusters(float ratio); // Overrides // ClassWizard generated virtual function overrides