90% fixes, 10% skel refactoring

This commit is contained in:
eray orçunus
2020-07-24 20:43:51 +03:00
parent bcb2b7a534
commit 15918feb8e
8 changed files with 68 additions and 46 deletions

View File

@ -8,6 +8,7 @@
#include "common.h"
#include "crossplatform.h"
#include "platform.h"
#ifdef XINPUT
#include <xinput.h>
#pragma comment( lib, "Xinput9_1_0.lib" )
@ -544,9 +545,9 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
void CPad::UpdateMouse()
{
#if defined RW_D3D9 || defined RWLIBS
if ( IsForegroundApp() )
{
#if defined RW_D3D9 || defined RWLIBS
if ( PSGLOBAL(mouse) == nil )
_InputInitialiseMouse();
@ -583,7 +584,10 @@ void CPad::UpdateMouse()
OldMouseControllerState = NewMouseControllerState;
NewMouseControllerState = PCTempMouseControllerState;
}
}
#else
if ( IsForegroundApp() && PSGLOBAL(cursorIsInWindow) )
{
double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
if (xpos == 0.f)
@ -621,8 +625,8 @@ void CPad::UpdateMouse()
OldMouseControllerState = NewMouseControllerState;
NewMouseControllerState = PCTempMouseControllerState;
#endif
}
#endif
}
CControllerState CPad::ReconcileTwoControllersInput(CControllerState const &State1, CControllerState const &State2)
@ -1072,6 +1076,13 @@ void CPad::UpdatePads(void)
#else
CapturePad(0);
#endif
// Improve keyboard input latency part 1
#ifdef FIX_BUGS
OldKeyState = NewKeyState;
NewKeyState = TempKeyState;
#endif
#ifdef DETECT_PAD_INPUT_SWITCH
if (GetPad(0)->PCTempJoyState.CheckForInput())
IsAffectedByController = true;
@ -1101,8 +1112,11 @@ void CPad::UpdatePads(void)
GetPad(1)->OldState.Clear();
#endif
// Improve keyboard input latency part 2
#ifndef FIX_BUGS
OldKeyState = NewKeyState;
NewKeyState = TempKeyState;
#endif
}
void CPad::ProcessPCSpecificStuff(void)

View File

@ -210,11 +210,7 @@ CStreaming::Init2(void)
desiredNumVehiclesLoaded = (int32)((ms_memoryAvailable / MB - 50) / 3 + 12);
if(desiredNumVehiclesLoaded > MAXVEHICLESLOADED)
desiredNumVehiclesLoaded = MAXVEHICLESLOADED;
#if defined(__LP64__) || defined(_WIN64)
debug("Memory allocated to Streaming is %lluMB", ms_memoryAvailable/MB);
#else
debug("Memory allocated to Streaming is %dMB", ms_memoryAvailable/MB);
#endif
debug("Memory allocated to Streaming is %zuMB", ms_memoryAvailable/MB); // original modifier was %d
#undef MB
#endif
@ -2497,11 +2493,7 @@ CStreaming::UpdateForAnimViewer(void)
if (CStreaming::ms_channelError == -1) {
CStreaming::AddModelsToRequestList(CVector(0.0f, 0.0f, 0.0f));
CStreaming::LoadRequestedModels();
#if defined(__LP64__) || defined(_WIN64)
sprintf(gString, "Requested %d, memory size %lluK\n", CStreaming::ms_numModelsRequested, 2 * CStreaming::ms_memoryUsed);
#else
sprintf(gString, "Requested %d, memory size %dK\n", CStreaming::ms_numModelsRequested, 2 * CStreaming::ms_memoryUsed);
#endif
sprintf(gString, "Requested %d, memory size %zuK\n", CStreaming::ms_numModelsRequested, 2 * CStreaming::ms_memoryUsed); // original modifier was %d
}
else {
CStreaming::RetryLoadFile(CStreaming::ms_channelError);