Browse Source

code style

Kolja Strohm 4 years ago
parent
commit
e4b236a92e
2 changed files with 9 additions and 10 deletions
  1. 8 9
      DX11GraphicsApi.cpp
  2. 1 1
      Slider.cpp

+ 8 - 9
DX11GraphicsApi.cpp

@@ -629,7 +629,7 @@ void DirectX11::beginFrame( bool fill2D, bool fill3D, int fillColor )
     d3d11Context->OMSetDepthStencilState( depthStencilState, 1 );
 }
 
-void DirectX11::renderObject( Model3D * zObj )
+void DirectX11::renderObject( Model3D *zObj )
 {
     vertexBuffer->setData( (void *)zObj->zVertexBuffer() );
     vertexBuffer->setLength( sizeof( Vertex3D ) * zObj->getVertexAnzahl() );
@@ -693,7 +693,7 @@ void DirectX11::renderObject( Model3D * zObj )
 //  pos: Der Mittelpunkt der Kugel
 //  radius: Der Radius der Kugel
 //  dist: Einen Zeiger auf einen float, in dem das quadrat des Abstands zur Kammeraposition gespeichert wird, falls diese Funktion true zurückgiebt und der Zeiger nicht 0 ist
-bool DirectX11::isInFrustrum( const Vec3< float > & pos, float radius, float *dist ) const
+bool DirectX11::isInFrustrum( const Vec3< float > &pos, float radius, float *dist ) const
 {
     for( int i = 0; i < 6; i++ )
     {
@@ -705,7 +705,7 @@ bool DirectX11::isInFrustrum( const Vec3< float > & pos, float radius, float *di
     return 1;
 }
 
-void DirectX11::renderKamera( Kam3D * zKamera )
+void DirectX11::renderKamera( Kam3D *zKamera )
 {
     d3d11Context->RSSetViewports( 1, (D3D11_VIEWPORT *)zKamera->zViewPort() );
 
@@ -751,7 +751,7 @@ void DirectX11::renderKamera( Kam3D * zKamera )
         vertexShader->füllConstBuffer( (char *)viewAndProj, 1, sizeof( Mat4< float > ) * 2 );
     if( pixelShader )
         pixelShader->füllConstBuffer( (char *)& kamPos, 0, sizeof( float ) * 3 );
-    Welt3D * w = zKamera->zWelt();
+    Welt3D *w = zKamera->zWelt();
     w->lock();
     int alphaAnzahl = 0;
     int maxDist = 0;
@@ -823,7 +823,6 @@ void DirectX11::presentFrame()
 
     if( fenster && !IsIconic( fenster->getFensterHandle() ) )
         renderObject( texturModel );
-
     HRESULT result = d3d11SpawChain->Present( 0, 0 );
     if( !SUCCEEDED( result ) )
     {
@@ -837,7 +836,7 @@ Bild *DirectX11::zUIRenderBild() const
     return uiTextur->zBild();
 }
 
-Textur *DirectX11::createOrGetTextur( const char *name, Bild * b )
+Textur *DirectX11::createOrGetTextur( const char *name, Bild *b )
 {
     if( !d3d11Device )
     {
@@ -859,10 +858,10 @@ Textur *DirectX11::createOrGetTextur( const char *name, Bild * b )
     return ret;
 }
 
-typedef HRESULT( __stdcall * CreateDXGIFactory2Function )( UINT, REFIID, void ** );
+typedef HRESULT( __stdcall *CreateDXGIFactory2Function )( UINT, REFIID, void ** );
 
-typedef HRESULT( __stdcall * D3D11CreateDeviceFunction )( IDXGIAdapter *, D3D_DRIVER_TYPE, HMODULE, UINT, D3D_FEATURE_LEVEL *,
-                                                          UINT, UINT, ID3D11Device * *, D3D_FEATURE_LEVEL *, ID3D11DeviceContext * * );
+typedef HRESULT( __stdcall *D3D11CreateDeviceFunction )( IDXGIAdapter *, D3D_DRIVER_TYPE, HMODULE, UINT, D3D_FEATURE_LEVEL *,
+                                                         UINT, UINT, ID3D11Device **, D3D_FEATURE_LEVEL *, ID3D11DeviceContext ** );
 
 bool DirectX11::isAvailable()
 {

+ 1 - 1
Slider.cpp

@@ -30,7 +30,7 @@ void Slider::doMausEreignis( MausEreignis &me, bool userRet )
 {
     if( gr.x && ( me.id == ME_PLinks || ( me.id == ME_Bewegung && getMausStand( M_Links ) ) ) )
     {
-        value = ( 1 - ( (gr.x - 10) - me.mx ) / (gr.x - 20.0) ) * 100;
+        value = ( 1 - ( (gr.x - 10) - me.mx ) / (gr.x - 20.0f) ) * 100;
         if( value < 0 )
             value = 0;
         if( value > 100 )