Browse Source

Kamera2D erweitert

kolja 5 years ago
parent
commit
7e34dd3e01
3 changed files with 29 additions and 3 deletions
  1. 5 3
      Framework Linux.vcxproj
  2. 20 0
      Kamera2D.cpp
  3. 4 0
      Kamera2D.h

+ 5 - 3
Framework Linux.vcxproj

@@ -222,15 +222,17 @@
     <ClCompile>
       <CppAdditionalWarning>switch;no-deprecated-declarations;empty-body;conversion;return-type;parentheses;no-format;uninitialized;unreachable-code;unused-function;unused-value;unused-variable;%(CppAdditionalWarning)</CppAdditionalWarning>
       <AdditionalOptions>-fPIC</AdditionalOptions>
-      <PositionIndependentCode>false</PositionIndependentCode>
+      <PositionIndependentCode>true</PositionIndependentCode>
     </ClCompile>
     <Link>
       <AdditionalDependencies>$(StlAdditionalDependencies)</AdditionalDependencies>
       <LibraryDependencies>pthread;%(LibraryDependencies)</LibraryDependencies>
       <GenerateMapFile>
       </GenerateMapFile>
-      <Trace>true</Trace>
-      <TraceSymbols>test;%(TraceSymbols)</TraceSymbols>
+      <Trace>false</Trace>
+      <TraceSymbols>
+      </TraceSymbols>
+      <Relocation>true</Relocation>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

+ 20 - 0
Kamera2D.cpp

@@ -29,6 +29,11 @@ void Kamera2D::lookAtWorldPos( int x, int y )
     wPos.y = (float)y;
 }
 
+void Kamera2D::lookAtWorldPos( Vertex pos )
+{
+    wPos = pos;
+}
+
 void Kamera2D::lookAtWorldArea( int width, int height )
 {
     zoom = (float)getBreite() / (float)width;
@@ -103,6 +108,21 @@ Vertex Kamera2D::getWorldDirection( Vertex dir )
     return Vertex( dir.x, dir.y ).rotation( -rotation ) * ( 1 / zoom );
 }
 
+Vertex Kamera2D::getWorldPosition()
+{
+    return wPos;
+}
+
+float Kamera2D::getRotation()
+{
+    return rotation;
+}
+
+float Kamera2D::getZoom()
+{
+    return zoom;
+}
+
 Kamera2D *Kamera2D::getThis()
 {
     ref++;

+ 4 - 0
Kamera2D.h

@@ -23,6 +23,7 @@ namespace Framework
     public:
         __declspec( dllexport ) Kamera2D();
         __declspec( dllexport ) virtual ~Kamera2D();
+        __declspec( dllexport ) void lookAtWorldPos( Vertex pos );
         __declspec( dllexport ) void lookAtWorldPos( int x, int y );
         __declspec( dllexport ) void lookAtWorldArea( int width, int height );
         __declspec( dllexport ) void setDrehung( float rotation );
@@ -32,6 +33,9 @@ namespace Framework
         __declspec( dllexport ) void render( Bild &zRObj );
         __declspec( dllexport ) Vertex getWorldCoordinates( Punkt screenPos );
         __declspec( dllexport ) Vertex getWorldDirection( Vertex dir );
+        __declspec( dllexport ) Vertex getWorldPosition();
+        __declspec( dllexport ) float getRotation();
+        __declspec( dllexport ) float getZoom();
         __declspec( dllexport ) Kamera2D *getThis();
         __declspec( dllexport ) Kamera2D *release();
     };