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

merge branch 'renderer_upgrades'

This commit is contained in:
tmj-fstate
2017-02-13 22:16:31 +01:00
21 changed files with 863 additions and 989 deletions

View File

@@ -71,7 +71,6 @@ TWorld::~TWorld()
// Ground.Free(); //Ra: usunięcie obiektów przed usunięciem dźwięków - sypie się
TSoundsManager::Free();
TModelsManager::Free();
TTexturesManager::Free();
glDeleteLists(base, 96);
if (hinstGLUT32)
FreeLibrary(hinstGLUT32);
@@ -479,9 +478,8 @@ bool TWorld::Init(HWND NhWnd, HDC hDC)
glDisable(GL_DEPTH_TEST); // Disables depth testing
glColor3f(3.0f, 3.0f, 3.0f);
GLuint logo;
logo = TTexturesManager::GetTextureID(szTexturePath, szSceneryPath, "logo", 6);
glBindTexture(GL_TEXTURE_2D, logo); // Select our texture
auto logo = TextureManager.GetTextureId( "logo", szTexturePath, 6 );
TextureManager.Bind(logo); // Select our texture
glBegin(GL_QUADS); // Drawing using triangles
glTexCoord2f(0.0f, 0.0f);
@@ -527,8 +525,9 @@ bool TWorld::Init(HWND NhWnd, HDC hDC)
glPrint("Tekstury / Textures...");
}
SwapBuffers(hDC); // Swap Buffers (Double Buffering)
TTexturesManager::Init();
/*
TTexturesManager.Init();
*/
WriteLog("Textures init OK");
if (Global::detonatoryOK)
{
@@ -663,9 +662,9 @@ bool TWorld::Init(HWND NhWnd, HDC hDC)
// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); //{Texture blends with object
// background}
if (Global::bOldSmudge == true)
light = TTexturesManager::GetTextureID(szTexturePath, szSceneryPath, "smuga.tga");
light = TextureManager.GetTextureId( "smuga.tga", szTexturePath );
else
light = TTexturesManager::GetTextureID(szTexturePath, szSceneryPath, "smuga2.tga");
light = TextureManager.GetTextureId( "smuga2.tga", szTexturePath );
// Camera.Reset();
Timer::ResetTimers();
WriteLog( "Load time: " +
@@ -1604,7 +1603,7 @@ TWorld::Render_Cab() {
glDisable( GL_DEPTH_TEST );
glDisable( GL_LIGHTING );
glDisable( GL_FOG );
glBindTexture( GL_TEXTURE_2D, light ); // Select our texture
TextureManager.Bind( light ); // Select our texture
glBegin( GL_QUADS );
float fSmudge =
dynamic->MoverParameters->DimHalf.y + 7; // gdzie zaczynać smugę
@@ -1646,7 +1645,7 @@ TWorld::Render_Cab() {
glDisable( GL_LIGHTING );
glDisable( GL_FOG );
//glColor4f(0.15f, 0.15f, 0.15f, 0.25f);
glBindTexture( GL_TEXTURE_2D, light ); // Select our texture
TextureManager.Bind( light ); // Select our texture
//float ddl = (0.15*Global::diffuseDayLight[0]+0.295*Global::diffuseDayLight[1]+0.055*Global::diffuseDayLight[2]); //0.24:0
glBegin( GL_QUADS );
float fSmudge = dynamic->MoverParameters->DimHalf.y + 7; // gdzie zaczynać smugę
@@ -1947,7 +1946,7 @@ TWorld::Render_UI() {
SetWindowText( hWnd, Controlled->MoverParameters->Name.c_str() );
else
SetWindowText( hWnd, Global::SceneryFile.c_str() ); // nazwa scenerii
glBindTexture( GL_TEXTURE_2D, 0 );
TextureManager.Bind( 0 );
glColor4f( 1.0f, 0.0f, 0.0f, 1.0f );
glLoadIdentity();
glTranslatef( 0.0f, 0.0f, -0.50f );