mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
UWP StorageFileLoader: Remove some excessive logging.
Some warning fixes in App.cpp.
This commit is contained in:
parent
bdf36a4141
commit
148625591d
2 changed files with 9 additions and 20 deletions
19
UWP/App.cpp
19
UWP/App.cpp
|
@ -140,7 +140,7 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Cor
|
||||||
float X = args->CurrentPoint->Position.X;
|
float X = args->CurrentPoint->Position.X;
|
||||||
float Y = args->CurrentPoint->Position.Y;
|
float Y = args->CurrentPoint->Position.Y;
|
||||||
int64_t timestamp = args->CurrentPoint->Timestamp;
|
int64_t timestamp = args->CurrentPoint->Timestamp;
|
||||||
m_main->OnTouchEvent(TOUCH_MOVE, pointerId, X, Y, timestamp);
|
m_main->OnTouchEvent(TOUCH_MOVE, pointerId, X, Y, (double)timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::OnPointerEntered(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args) {
|
void App::OnPointerEntered(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args) {
|
||||||
|
@ -157,7 +157,7 @@ void App::OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::C
|
||||||
float X = args->CurrentPoint->Position.X;
|
float X = args->CurrentPoint->Position.X;
|
||||||
float Y = args->CurrentPoint->Position.Y;
|
float Y = args->CurrentPoint->Position.Y;
|
||||||
int64_t timestamp = args->CurrentPoint->Timestamp;
|
int64_t timestamp = args->CurrentPoint->Timestamp;
|
||||||
m_main->OnTouchEvent(TOUCH_DOWN|TOUCH_MOVE, pointerId, X, Y, timestamp);
|
m_main->OnTouchEvent(TOUCH_DOWN|TOUCH_MOVE, pointerId, X, Y, (double)timestamp);
|
||||||
if (!m_isPhone) {
|
if (!m_isPhone) {
|
||||||
sender->SetPointerCapture();
|
sender->SetPointerCapture();
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ void App::OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::
|
||||||
float X = args->CurrentPoint->Position.X;
|
float X = args->CurrentPoint->Position.X;
|
||||||
float Y = args->CurrentPoint->Position.Y;
|
float Y = args->CurrentPoint->Position.Y;
|
||||||
int64_t timestamp = args->CurrentPoint->Timestamp;
|
int64_t timestamp = args->CurrentPoint->Timestamp;
|
||||||
m_main->OnTouchEvent(TOUCH_UP|TOUCH_MOVE, pointerId, X, Y, timestamp);
|
m_main->OnTouchEvent(TOUCH_UP|TOUCH_MOVE, pointerId, X, Y, (double)timestamp);
|
||||||
if (!m_isPhone) {
|
if (!m_isPhone) {
|
||||||
sender->ReleasePointerCapture();
|
sender->ReleasePointerCapture();
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ void App::OnPointerCaptureLost(Windows::UI::Core::CoreWindow^ sender, Windows::U
|
||||||
|
|
||||||
void App::OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args) {
|
void App::OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args) {
|
||||||
int pointerId = 0; // irrelevant
|
int pointerId = 0; // irrelevant
|
||||||
float delta = args->CurrentPoint->GetCurrentPoint(args->CurrentPoint->PointerId)->Properties->MouseWheelDelta;
|
float delta = (float)args->CurrentPoint->GetCurrentPoint(args->CurrentPoint->PointerId)->Properties->MouseWheelDelta;
|
||||||
m_main->OnMouseWheel(delta);
|
m_main->OnMouseWheel(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,20 +252,19 @@ void App::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ ar
|
||||||
auto view = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView();
|
auto view = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView();
|
||||||
g_Config.bFullScreen = view->IsFullScreenMode;
|
g_Config.bFullScreen = view->IsFullScreenMode;
|
||||||
|
|
||||||
int width = sender->Bounds.Width;
|
float width = sender->Bounds.Width;
|
||||||
int height = sender->Bounds.Height;
|
float height = sender->Bounds.Height;
|
||||||
float scale = m_deviceResources->GetDpi() / 96.0f;
|
float scale = m_deviceResources->GetDpi() / 96.0f;
|
||||||
|
|
||||||
m_deviceResources->SetLogicalSize(Size(width, height));
|
m_deviceResources->SetLogicalSize(Size(width, height));
|
||||||
m_main->CreateWindowSizeDependentResources();
|
m_main->CreateWindowSizeDependentResources();
|
||||||
|
|
||||||
PSP_CoreParameter().pixelWidth = width * scale;
|
PSP_CoreParameter().pixelWidth = (int)(width * scale);
|
||||||
PSP_CoreParameter().pixelHeight = height * scale;
|
PSP_CoreParameter().pixelHeight = (int)(height * scale);
|
||||||
|
|
||||||
if (UpdateScreenScale(width, height)) {
|
if (UpdateScreenScale((int)width, (int)height)) {
|
||||||
NativeMessageReceived("gpu_resized", "");
|
NativeMessageReceived("gpu_resized", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) {
|
void App::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) {
|
||||||
|
|
|
@ -20,7 +20,6 @@ StorageFileLoader::StorageFileLoader(Windows::Storage::StorageFile ^file) {
|
||||||
active_ = false;
|
active_ = false;
|
||||||
file_ = file;
|
file_ = file;
|
||||||
path_ = FromPlatformString(file_->Path);
|
path_ = FromPlatformString(file_->Path);
|
||||||
INFO_LOG(IO, "StorageFileLoader - launching thread");
|
|
||||||
thread_.reset(new std::thread([this]() { this->threadfunc(); }));
|
thread_.reset(new std::thread([this]() { this->threadfunc(); }));
|
||||||
|
|
||||||
// Before we proceed, we need to block until the thread has found the size.
|
// Before we proceed, we need to block until the thread has found the size.
|
||||||
|
@ -31,15 +30,12 @@ StorageFileLoader::StorageFileLoader(Windows::Storage::StorageFile ^file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
StorageFileLoader::~StorageFileLoader() {
|
StorageFileLoader::~StorageFileLoader() {
|
||||||
INFO_LOG(IO, "StorageFileLoader destructor");
|
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(mutex_);
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
INFO_LOG(IO, "StorageFileLoader - setting active to false");
|
|
||||||
active_ = false;
|
active_ = false;
|
||||||
operationRequested_ = false;
|
operationRequested_ = false;
|
||||||
cond_.notify_one();
|
cond_.notify_one();
|
||||||
}
|
}
|
||||||
INFO_LOG(IO, "StorageFileLoader - joining with thread");
|
|
||||||
thread_->join();
|
thread_->join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,12 +49,10 @@ void StorageFileLoader::threadfunc() {
|
||||||
auto opentask = create_task(file_->OpenReadAsync()).then([this](IRandomAccessStreamWithContentType ^stream) {
|
auto opentask = create_task(file_->OpenReadAsync()).then([this](IRandomAccessStreamWithContentType ^stream) {
|
||||||
stream_ = stream;
|
stream_ = stream;
|
||||||
active_ = true;
|
active_ = true;
|
||||||
INFO_LOG(IO, "StorageFileLoader: active");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
opentask.wait();
|
opentask.wait();
|
||||||
INFO_LOG(IO, "StorageFileLoader: first wait finished");
|
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
operationFailed_ = true;
|
operationFailed_ = true;
|
||||||
// TODO: What do we do?
|
// TODO: What do we do?
|
||||||
|
@ -70,11 +64,9 @@ void StorageFileLoader::threadfunc() {
|
||||||
|
|
||||||
auto sizetask = create_task(file_->GetBasicPropertiesAsync()).then([this](Windows::Storage::FileProperties::BasicProperties ^props) {
|
auto sizetask = create_task(file_->GetBasicPropertiesAsync()).then([this](Windows::Storage::FileProperties::BasicProperties ^props) {
|
||||||
size_ = props->Size;
|
size_ = props->Size;
|
||||||
INFO_LOG(IO, "StorageFileLoader: Got size: %d", (int)size_);
|
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
sizetask.wait();
|
sizetask.wait();
|
||||||
INFO_LOG(IO, "StorageFileLoader: second wait finished");
|
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
const char *what = e.what();
|
const char *what = e.what();
|
||||||
INFO_LOG(SYSTEM, "%s", what);
|
INFO_LOG(SYSTEM, "%s", what);
|
||||||
|
@ -113,7 +105,6 @@ void StorageFileLoader::threadfunc() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ERROR_LOG(SYSTEM, "Unknown operation");
|
|
||||||
operationRequested_ = false;
|
operationRequested_ = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +164,6 @@ size_t StorageFileLoader::ReadAt(s64 absolutePos, size_t bytes, size_t count, vo
|
||||||
while (!responseAvailable_) {
|
while (!responseAvailable_) {
|
||||||
condResponse_.wait(responseLock);
|
condResponse_.wait(responseLock);
|
||||||
}
|
}
|
||||||
INFO_LOG(IO, "StorageFileLoader: Got response");
|
|
||||||
// still under mutexResponse_ lock here.
|
// still under mutexResponse_ lock here.
|
||||||
responseAvailable_ = false;
|
responseAvailable_ = false;
|
||||||
if (operationFailed_) {
|
if (operationFailed_) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue