Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

371 optimize asset streaming #372

Merged
merged 2 commits into from
Sep 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void ERS_CLASS_AsyncTextureUpdater::SetLevelRAM(ERS_STRUCT_Model* Model, bool Lo
// Also apparenly I don't know how to spell...
// Load New Levels Into Memory
if (Model->TextureLevelInRAM_ < Model->TargetTextureLevelRAM) {
for (int LevelToLoad = Model->TextureLevelInRAM_; LevelToLoad <= Model->TargetTextureLevelRAM; LevelToLoad++) {
for (int LevelToLoad = std::max(Model->TextureLevelInRAM_, 0); LevelToLoad <= Model->TargetTextureLevelRAM; LevelToLoad++) {
for (unsigned int TextureIndex = 0; TextureIndex < Model->Textures_.size(); TextureIndex++) {
LoadImageDataRAM(&Model->Textures_[TextureIndex], LevelToLoad, LogEnable);
}
Expand Down Expand Up @@ -623,7 +623,6 @@ void ERS_CLASS_AsyncTextureUpdater::SortModels(ERS_STRUCT_Scene* Scene) {


}

void ERS_CLASS_AsyncTextureUpdater::TexturePusherThread(int Index) {

// Name Thread
Expand Down Expand Up @@ -724,24 +723,18 @@ void ERS_CLASS_AsyncTextureUpdater::TextureLoaderThread(int Index) {
// Shut Down FreeImage
FreeImage_DeInitialise();
}


int ERS_CLASS_AsyncTextureUpdater::GetNumLoaderThreads() {
return NumLoaderThreads_;
}

int ERS_CLASS_AsyncTextureUpdater::GetNumStreamerThreads() {
return NumPusherThreads_;
}

void ERS_CLASS_AsyncTextureUpdater::SetNumLoaderThreads(int NumThreads) {
NumLoaderThreads_ = NumThreads;
}

void ERS_CLASS_AsyncTextureUpdater::SetNumStreamerThreads(int NumThreads) {
NumPusherThreads_ = NumThreads;
}

void ERS_CLASS_AsyncTextureUpdater::SetupPusherThreads() {

// Setup Threads
Expand Down