16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 19:09:20 +02:00

gfx resource sweep configuration switches, diesel electric vehicle engine power output scaling with engine revolutions, velocity-based activation points for combined running noise sounds, shadow colour take into account overcast value

This commit is contained in:
tmj-fstate
2018-01-20 00:37:42 +01:00
parent 872abc2c00
commit 9abaf7414f
10 changed files with 117 additions and 47 deletions

View File

@@ -589,8 +589,12 @@ opengl_texture::create() {
}
}
data = std::vector<char>();
data_state = resource_state::none;
if( ( true == Global::ResourceMove )
|| ( false == Global::ResourceSweep ) ) {
// if garbage collection is disabled we don't expect having to upload the texture more than once
data = std::vector<char>();
data_state = resource_state::none;
}
is_ready = true;
}
@@ -599,11 +603,14 @@ opengl_texture::create() {
// releases resources allocated on the opengl end, storing local copy if requested
void
opengl_texture::release( bool const Backup ) {
opengl_texture::release() {
if( id == -1 ) { return; }
if( true == Backup ) {
if( true == Global::ResourceMove ) {
// if resource move is enabled we don't keep a cpu side copy after upload
// so need to re-acquire the data before release
// TBD, TODO: instead of vram-ram transfer fetch the data 'normally' from the disk using worker thread
::glBindTexture( GL_TEXTURE_2D, id );
GLint datasize {};
GLint iscompressed {};