mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
// Filename: textureReloadRequest.cxx
|
|
// Created by: drose (12Aug08)
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
//
|
|
// PANDA 3D SOFTWARE
|
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
|
//
|
|
// All use of this software is subject to the terms of the revised BSD
|
|
// license. You should have received a copy of this license along
|
|
// with this source code in a file named "LICENSE."
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
#include "textureReloadRequest.h"
|
|
#include "loader.h"
|
|
|
|
TypeHandle TextureReloadRequest::_type_handle;
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: TextureReloadRequest::do_task
|
|
// Access: Protected, Virtual
|
|
// Description: Performs the task: that is, loads the one model.
|
|
////////////////////////////////////////////////////////////////////
|
|
bool TextureReloadRequest::
|
|
do_task() {
|
|
// Don't reload the texture if it doesn't need it.
|
|
if (_texture_context->was_image_modified()) {
|
|
double delay = async_load_delay;
|
|
if (delay != 0.0) {
|
|
Thread::sleep(delay);
|
|
}
|
|
|
|
if (_allow_compressed) {
|
|
_texture->get_ram_image();
|
|
} else {
|
|
_texture->get_uncompressed_ram_image();
|
|
}
|
|
}
|
|
_is_ready = true;
|
|
|
|
// Don't continue the task; we're done.
|
|
return false;
|
|
}
|