From 8491c63f3cbf40d1f33e3fc5a0425543e0a371c6 Mon Sep 17 00:00:00 2001 From: tmj-fstate Date: Fri, 15 Jun 2018 18:56:50 +0200 Subject: [PATCH] files missing from previous commit fixes version --- Segment.cpp | 17 ----------------- Traction.cpp | 12 +----------- renderer.cpp | 16 +++++++++++----- renderer.h | 12 +++++++----- skydome.cpp | 1 + stdafx.h | 1 + uilayer.cpp | 2 +- utilities.cpp | 15 +++++++++++++++ utilities.h | 4 +++- version.h | 2 +- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Segment.cpp b/Segment.cpp index 91999747..b723be85 100644 --- a/Segment.cpp +++ b/Segment.cpp @@ -16,23 +16,6 @@ http://mozilla.org/MPL/2.0/. #include "Track.h" #include "renderer.h" -//--------------------------------------------------------------------------- - -// helper, restores content of a 3d vector from provided input stream -// TODO: review and clean up the helper routines, there's likely some redundant ones -Math3D::vector3 LoadPoint( cParser &Input ) { - // pobranie współrzędnych punktu - Input.getTokens( 3 ); - Math3D::vector3 point; - Input - >> point.x - >> point.y - >> point.z; - - return point; -} - - void segment_data::deserialize( cParser &Input, Math3D::vector3 const &Offset ) { diff --git a/Traction.cpp b/Traction.cpp index 0ec7d8f1..3178a32b 100644 --- a/Traction.cpp +++ b/Traction.cpp @@ -19,6 +19,7 @@ http://mozilla.org/MPL/2.0/. #include "Globals.h" #include "Logs.h" #include "renderer.h" +#include "utilities.h" //--------------------------------------------------------------------------- /* @@ -93,17 +94,6 @@ sekcji z sąsiedniego przęsła). TTraction::TTraction( scene::node_data const &Nodedata ) : basic_node( Nodedata ) {} -glm::dvec3 LoadPoint( cParser &Input ) { - // pobranie współrzędnych punktu - glm::dvec3 point; - Input.getTokens( 3 ); - Input - >> point.x - >> point.y - >> point.z; - return point; -} - void TTraction::Load( cParser *parser, glm::dvec3 const &pOrigin ) { diff --git a/renderer.cpp b/renderer.cpp index e1501ff4..8df465b1 100644 --- a/renderer.cpp +++ b/renderer.cpp @@ -841,14 +841,20 @@ opengl_renderer::setup_pass( renderpass_config &Config, rendermode const Mode, f auto const zfar = Config.draw_range * Global.fDistanceFactor * Zfar; auto const znear = ( Znear > 0.f ? - Znear * zfar : - 0.1f * Global.ZoomFactor ); + Znear * zfar : + 0.1f * Global.ZoomFactor ); camera.projection() *= glm::perspective( glm::radians( Global.FieldOfView / Global.ZoomFactor ), std::max( 1.f, (float)Global.iWindowWidth ) / std::max( 1.f, (float)Global.iWindowHeight ), znear, zfar ); +/* + m_sunandviewangle = + glm::dot( + m_sunlight.direction, + glm::vec3( 0.f, 0.f, -1.f ) * glm::mat3( viewmatrix ) ); +*/ break; } case rendermode::shadows: { @@ -2985,7 +2991,7 @@ opengl_renderer::Render_Alpha( TTraction *Traction ) { ::glColor4fv( glm::value_ptr( glm::vec4{ - Traction->wire_color(), + Traction->wire_color() /* * ( DebugModeFlag ? 1.f : clamp( m_sunandviewangle, 0.25f, 1.f ) ) */, linealpha } ) ); // render m_geometry.draw( Traction->m_geometry ); @@ -3442,7 +3448,7 @@ opengl_renderer::Update_Pick_Control() { return control; } -editor::basic_node const * +scene::basic_node const * opengl_renderer::Update_Pick_Node() { #ifdef EU07_USE_PICKING_FRAMEBUFFER @@ -3477,7 +3483,7 @@ opengl_renderer::Update_Pick_Node() { unsigned char pickreadout[4]; ::glReadPixels( pickbufferpos.x, pickbufferpos.y, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, pickreadout ); auto const nodeindex = pick_index( glm::ivec3{ pickreadout[ 2 ], pickreadout[ 1 ], pickreadout[ 0 ] } ); - editor::basic_node const *node { nullptr }; + scene::basic_node const *node { nullptr }; if( ( nodeindex > 0 ) && ( nodeindex <= m_picksceneryitems.size() ) ) { node = m_picksceneryitems[ nodeindex - 1 ]; diff --git a/renderer.h b/renderer.h index 440e96aa..7737a6b9 100644 --- a/renderer.h +++ b/renderer.h @@ -163,14 +163,14 @@ public: // utility methods TSubModel const * Pick_Control() const { return m_pickcontrolitem; } - editor::basic_node const * + scene::basic_node const * Pick_Node() const { return m_picksceneryitem; } // maintenance methods void Update( double const Deltatime ); TSubModel const * Update_Pick_Control(); - editor::basic_node const * + scene::basic_node const * Update_Pick_Node(); // debug methods std::string const & @@ -320,7 +320,9 @@ private: texture_manager m_textures; opengl_light m_sunlight; opengllight_array m_lights; - +/* + float m_sunandviewangle; // cached dot product of sunlight and camera vectors +*/ gfx::geometry_handle m_billboardgeometry { 0, 0 }; texture_handle m_glaretexture { -1 }; texture_handle m_suntexture { -1 }; @@ -386,8 +388,8 @@ private: renderpass_config m_cabshadowpass; // parameters of most recent cab shadowmap pass std::vector m_pickcontrolsitems; TSubModel const *m_pickcontrolitem { nullptr }; - std::vector m_picksceneryitems; - editor::basic_node const *m_picksceneryitem { nullptr }; + std::vector m_picksceneryitems; + scene::basic_node const *m_picksceneryitem { nullptr }; #ifdef EU07_USE_DEBUG_CAMERA renderpass_config m_worldcamera; // debug item #endif diff --git a/skydome.cpp b/skydome.cpp index a781dfe6..e2e8f979 100644 --- a/skydome.cpp +++ b/skydome.cpp @@ -2,6 +2,7 @@ #include "skydome.h" #include "color.h" #include "utilities.h" +#include // sky gradient based on "A practical analytic model for daylight" // by A. J. Preetham Peter Shirley Brian Smits (University of Utah) diff --git a/stdafx.h b/stdafx.h index 20ac3fa2..c1d4739e 100644 --- a/stdafx.h +++ b/stdafx.h @@ -90,6 +90,7 @@ #endif #define GLM_ENABLE_EXPERIMENTAL +#define GLM_FORCE_CTOR_INIT #include #include #include diff --git a/uilayer.cpp b/uilayer.cpp index cdf32076..00175eec 100644 --- a/uilayer.cpp +++ b/uilayer.cpp @@ -973,7 +973,7 @@ ui_layer::render() { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glPushAttrib( GL_ENABLE_BIT | GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT ); // blendfunc included since 3rd party gui doesn't play nice + glPushAttrib( GL_ENABLE_BIT | GL_CURRENT_BIT);// | GL_COLOR_BUFFER_BIT ); // blendfunc included since 3rd party gui doesn't play nice glDisable( GL_LIGHTING ); glDisable( GL_DEPTH_TEST ); glDisable( GL_ALPHA_TEST ); diff --git a/utilities.cpp b/utilities.cpp index 58e74ed1..1eb02df0 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -25,6 +25,7 @@ Copyright (C) 2007-2014 Maciej Cierniak #include "utilities.h" #include "Globals.h" +#include "parser.h" bool DebugModeFlag = false; bool FreeFlyModeFlag = false; @@ -387,3 +388,17 @@ substr_path( std::string const &Filename ) { Filename.substr( 0, Filename.rfind( '/' ) + 1 ) : "" ); } + +// helper, restores content of a 3d vector from provided input stream +// TODO: review and clean up the helper routines, there's likely some redundant ones + +glm::dvec3 LoadPoint( cParser &Input ) { + // pobranie współrzędnych punktu + glm::dvec3 point; + Input.getTokens( 3 ); + Input + >> point.x + >> point.y + >> point.z; + return point; +} diff --git a/utilities.h b/utilities.h index 84687898..e811c9c0 100644 --- a/utilities.h +++ b/utilities.h @@ -16,6 +16,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include +#include "dumb3d.h" /*rozne takie duperele do operacji na stringach w paszczalu, pewnie w delfi sa lepsze*/ /*konwersja zmiennych na stringi, funkcje matematyczne, logiczne, lancuchowe, I/O etc*/ @@ -300,4 +301,5 @@ nearest_segment_point( VecType_ const &Segmentstart, VecType_ const &Segmentend, return c1 / c2; } -//--------------------------------------------------------------------------- +class cParser; +glm::dvec3 LoadPoint( cParser &Input ); diff --git a/version.h b/version.h index fb20cd65..3cb60cf0 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define VERSION_INFO "M7 15.06.2018, based on tmj e54468f8" +#define VERSION_INFO "M7 16.06.2018, based on tmj ef5811e6"