16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 18:39:18 +02:00

enabled hardware texture compression, minor debug info enhancements

This commit is contained in:
tmj-fstate
2017-03-26 19:13:50 +02:00
parent f8673a9f41
commit fbba5589f7
4 changed files with 8 additions and 5 deletions

View File

@@ -290,6 +290,7 @@ void TGroundNode::RaRenderVBO()
} }
void TGroundNode::RenderVBO() { // renderowanie obiektu z VBO - faza nieprzezroczystych void TGroundNode::RenderVBO() { // renderowanie obiektu z VBO - faza nieprzezroczystych
switch( iType ) { // obiekty renderowane niezależnie od odległości switch( iType ) { // obiekty renderowane niezależnie od odległości
case TP_SUBMODEL: case TP_SUBMODEL:
TSubModel::fSquareDist = 0; TSubModel::fSquareDist = 0;
@@ -363,7 +364,6 @@ void TGroundNode::RenderAlphaVBO()
return; return;
} }
switch( iType ) { switch( iType ) {
case TP_TRACTION: { case TP_TRACTION: {
if( bVisible ) { if( bVisible ) {

View File

@@ -118,7 +118,7 @@ bool TSegment::Init(vector3 &NewPoint1, vector3 NewCPointOut, vector3 NewCPointI
fStep = fNewStep; fStep = fNewStep;
if (fLength <= 0) if (fLength <= 0)
{ {
ErrorLog("Bad geometry: Length <= 0 in TSegment::Init at " + Where(Point1)); ErrorLog( "Bad geometry (zero length) for spline \"" + pOwner->NameGet() + "\" at " + Where( Point1 ) );
// MessageBox(0,"Length<=0","TSegment::Init",MB_OK); // MessageBox(0,"Length<=0","TSegment::Init",MB_OK);
return false; // zerowe nie mogą być return false; // zerowe nie mogą być
} }
@@ -220,7 +220,7 @@ double TSegment::GetTFromS(double s)
// Newton's method failed. If this happens, increase iterations or // Newton's method failed. If this happens, increase iterations or
// tolerance or integration accuracy. // tolerance or integration accuracy.
// return -1; //Ra: tu nigdy nie dojdzie // return -1; //Ra: tu nigdy nie dojdzie
ErrorLog( "Bad geometry: Too many iterations at " + Where( Point1 ) ); ErrorLog( "Bad geometry (shape estimation failed) for spline \"" + pOwner->NameGet() + "\" at " + Where( Point1 ) );
// MessageBox(0,"Too many iterations","GetTFromS",MB_OK); // MessageBox(0,"Too many iterations","GetTFromS",MB_OK);
return fTime; return fTime;
}; };

View File

@@ -580,9 +580,9 @@ opengl_texture::create() {
dataheight = std::max( dataheight / 2, 1 ); dataheight = std::max( dataheight / 2, 1 );
} }
else { else {
// uncompressed texture data // uncompressed texture data. have the gfx card do the compression as it sees fit
::glTexImage2D( ::glTexImage2D(
GL_TEXTURE_2D, 0, GL_RGBA8, GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA,
data_width, data_height, 0, data_width, data_height, 0,
data_format, GL_UNSIGNED_BYTE, (GLubyte *)&data[ 0 ] ); data_format, GL_UNSIGNED_BYTE, (GLubyte *)&data[ 0 ] );
} }

View File

@@ -106,7 +106,9 @@ opengl_renderer::Init( GLFWwindow *Window ) {
m_lights.emplace_back( light ); m_lights.emplace_back( light );
} }
// preload some common textures // preload some common textures
WriteLog( "Loading common gfx data..." );
m_glaretextureid = GetTextureId( "fx\\lightglare", szTexturePath ); m_glaretextureid = GetTextureId( "fx\\lightglare", szTexturePath );
WriteLog( "...gfx data pre-loading done" );
return true; return true;
} }
@@ -897,6 +899,7 @@ opengl_renderer::Init_caps() {
WriteLog( "Supported extensions:" + std::string((char *)glGetString( GL_EXTENSIONS )) ); WriteLog( "Supported extensions:" + std::string((char *)glGetString( GL_EXTENSIONS )) );
WriteLog( std::string("Render path: ") + ( Global::bUseVBO ? "VBO" : "Display lists" ) );
if( Global::iMultisampling ) if( Global::iMultisampling )
WriteLog( "Using multisampling x" + std::to_string( 1 << Global::iMultisampling ) ); WriteLog( "Using multisampling x" + std::to_string( 1 << Global::iMultisampling ) );
{ // ograniczenie maksymalnego rozmiaru tekstur - parametr dla skalowania tekstur { // ograniczenie maksymalnego rozmiaru tekstur - parametr dla skalowania tekstur