Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/TextureManager.cpp
Show First 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | bool GenerateCachedTexture(const VfsPath& sourcePath, VfsPath& archiveCachePath) | ||||
while (true) | while (true) | ||||
{ | { | ||||
CTexturePtr textureOut; | CTexturePtr textureOut; | ||||
VfsPath dest; | VfsPath dest; | ||||
bool ok; | bool ok; | ||||
if (m_TextureConverter.Poll(textureOut, dest, ok)) | if (m_TextureConverter.Poll(textureOut, dest, ok)) | ||||
return ok; | return ok; | ||||
// Spin-loop is dumb but it works okay for now | std::this_thread::sleep_for(std::chrono::microseconds(1)); | ||||
Stan: That comment is still accurate isn't it ? | |||||
wraitiiAuthorUnsubmitted Done Inline Actionstechnically a spin-loop wouldn't sleep at all... So maybe? wraitii: technically a spin-loop wouldn't sleep at all... So maybe? | |||||
Not Done Inline ActionsSDL_Delay(0) == 1 millisec ? Stan: SDL_Delay(0) == 1 millisec ? | |||||
Not Done Inline ActionsSDL_Delay(x) = wait for x + some time It waits at least the specified time, but possibly longer due to OS scheduling Silier: SDL_Delay(x) = wait for x + some time
It waits at least the specified time, but possibly… | |||||
SDL_Delay(0); | |||||
} | } | ||||
} | } | ||||
bool MakeProgress() | bool MakeProgress() | ||||
{ | { | ||||
// Process any completed conversion tasks | // Process any completed conversion tasks | ||||
{ | { | ||||
CTexturePtr texture; | CTexturePtr texture; | ||||
VfsPath dest; | VfsPath dest; | ||||
bool ok; | bool ok; | ||||
if (m_TextureConverter.Poll(texture, dest, ok)) | if (m_TextureConverter.Poll(texture, dest, ok)) | ||||
{ | { | ||||
if (ok) | if (ok) | ||||
Not Done Inline ActionsDebug Stan: Debug | |||||
{ | { | ||||
LoadTexture(texture, dest); | LoadTexture(texture, dest); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
LOGERROR("Texture failed to convert: \"%s\"", texture->m_Properties.m_Path.string8()); | LOGERROR("Texture failed to convert: \"%s\"", texture->m_Properties.m_Path.string8()); | ||||
texture->SetHandle(m_ErrorHandle); | texture->SetHandle(m_ErrorHandle); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
That comment is still accurate isn't it ?