Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ugozapad committed Jan 25, 2024
1 parent 8e96f42 commit b818c98
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SourceCode/CryAnimation/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void IController::PQLog::blendPQ (const PQLog& pqFrom, const PQLog& pqTo, float
// builds the matrix out of the position and orientation stored in this PQLog
void IController::PQLog::buildMatrix(Matrix44& matDest)const
{
CryQuat qRot;
CryQuat qRot(1.f, 0.f, 0.f, 0.f);
quaternionExponentOptimized(vRotLog, qRot);
//BuildMatrixFromQP(matDest, qRot, vPos);
matDest=Matrix44(qRot);
Expand Down
10 changes: 10 additions & 0 deletions SourceCode/CryAnimation/MathUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ inline bool isEqual (const CryQuat& q, const CryQuat& p)
return true;
}

#if 0
__inline void quaternionExponentOptimized(const Vec3& rSrcVector, CryQuat& rDstQuat)
{
#if DO_ASM && defined (_CPU_X86)
Expand All @@ -147,6 +148,15 @@ __inline void quaternionExponentOptimized(const Vec3& rSrcVector, CryQuat& rDstQ
rDstQuat = exp(tmp);
#endif
}
#else
__inline void quaternionExponentOptimized(const Vec3& rSrcVector, CryQuat& rDstQuat)
{
CryQuat tmp;
tmp.v = rSrcVector;
tmp.w = 0;
rDstQuat = exp(tmp);
}
#endif



Expand Down
2 changes: 1 addition & 1 deletion SourceCode/CrySystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ target_include_directories(${PROJECT_NAME} PRIVATE
)

target_link_libraries(${PROJECT_NAME} PRIVATE
${SYSTEM_DEPS}
${SYSTEM_DEPS} SDL2
)
2 changes: 2 additions & 0 deletions SourceCode/CrySystem/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ void CLog::LogStringToFile( const char *szString,bool bAdd )
}
#endif

OutputDebugStringA(szTemp);

if (bAdd)
{
FILE *fp=fxopen(m_szFilename,"r+t");
Expand Down
39 changes: 38 additions & 1 deletion SourceCode/CrySystem/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
//#include "ini_vars.h"
#include "CryLibrary.h"

#include <SDL.h>

#ifndef _XBOX
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
Expand Down Expand Up @@ -761,6 +763,8 @@ void CSystem::UpdateScriptSink()
m_pScriptSink->Update(false); // LUA Garbage collection might be called in here
}

bool g_bWindowInFocus = false;

// nPauseMode: 0=normal(no pause)
// nPauseMode: 1=menu/pause
// nPauseMode: 2=cutscene
Expand Down Expand Up @@ -849,6 +853,7 @@ bool CSystem::Update( int updateFlags, int nPauseMode )
{
FRAME_PROFILER( "SysUpdate:PeekMessage",this,PROFILE_SYSTEM );

#if 0
if (m_hWnd && ::IsWindow((HWND)m_hWnd))
{
MSG msg;
Expand All @@ -858,6 +863,36 @@ bool CSystem::Update( int updateFlags, int nPauseMode )
DispatchMessage(&msg);
}
}
#else
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT: Quit(); break;
case SDL_WINDOWEVENT:
{
switch (event.window.type)
{
case SDL_WINDOWEVENT_SHOWN:
case SDL_WINDOWEVENT_RESTORED:
case SDL_WINDOWEVENT_MAXIMIZED:
case SDL_WINDOWEVENT_ENTER:
case SDL_WINDOWEVENT_FOCUS_GAINED:
g_bWindowInFocus = true;
break;

case SDL_WINDOWEVENT_HIDDEN:
case SDL_WINDOWEVENT_MINIMIZED:
case SDL_WINDOWEVENT_LEAVE:
case SDL_WINDOWEVENT_FOCUS_LOST:
g_bWindowInFocus = false;
break;
}
}break;
}
}
#endif
}
#endif
#endif
Expand Down Expand Up @@ -888,7 +923,9 @@ bool CSystem::Update( int updateFlags, int nPauseMode )
#if defined(_XBOX) || defined(LINUX)
m_pIInput->Update(true);
#else
bool bFocus = (GetFocus()==m_hWnd) || m_bEditor;
// bool bFocus = (GetFocus()==m_hWnd) || m_bEditor;
//bool bFocus = g_bWindowInFocus;
bool bFocus = true;
m_pIInput->Update(bFocus);
#endif
}
Expand Down

0 comments on commit b818c98

Please sign in to comment.