From: Thomas Geymayer Date: Wed, 6 Jun 2012 22:11:10 +0000 (+0200) Subject: Allow filling paths and do some clean up/fixing. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=05c107ba9c35772772edcfc5a843448583aedc71;p=simgear.git Allow filling paths and do some clean up/fixing. --- diff --git a/simgear/canvas/ShivaVG/src/CMakeLists.txt b/simgear/canvas/ShivaVG/src/CMakeLists.txt index 4d7acf53..63dcdef7 100644 --- a/simgear/canvas/ShivaVG/src/CMakeLists.txt +++ b/simgear/canvas/ShivaVG/src/CMakeLists.txt @@ -1,12 +1,14 @@ -#SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib") +include(CheckIncludeFile) +check_include_file("inttypes.h" HAVE_INTTYPES_H) -ADD_DEFINITIONS( - -DVG_API_EXPORT - -DHAVE_INTTYPES_H -) +if(HAVE_INTTYPES_H) + add_definitions(-DHAVE_INTTYPES_H) +endif() +add_definitions(-DVG_API_EXPORT) INCLUDE_DIRECTORIES( - ${OPENGL_INCLUDE_DIR} + ${OPENGL_INCLUDE_DIR} + ../include ) SET(INCROOT ../include/VG) @@ -43,11 +45,4 @@ TARGET_LINK_LIBRARIES( ShivaVG ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} -) - -#INSTALL( -# TARGETS OpenVG -# RUNTIME DESTINATION bin COMPONENT bin -# LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT bin -# ARCHIVE DESTINATION lin${LIB_SUFFIX} COMPONENT devel -#) +) \ No newline at end of file diff --git a/simgear/canvas/ShivaVG/src/shVgu.c b/simgear/canvas/ShivaVG/src/shVgu.c index f42e819b..30cb35e2 100644 --- a/simgear/canvas/ShivaVG/src/shVgu.c +++ b/simgear/canvas/ShivaVG/src/shVgu.c @@ -317,21 +317,23 @@ VGU_API_CALL VGUErrorCode vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0, VGfloat *matrix) { /* Basic idea taken from the reference implementation */ + VGfloat mat[3][3]; + VGfloat det, det00, det01, det02; + if( !matrix ) return VGU_ILLEGAL_ARGUMENT_ERROR; - VGfloat mat[3][3]; if( vguComputeWarpSquareToQuad( sx0, sy0, sx1, sy1, sx2, sy2, sx3, sy3, (VGfloat*)mat ) == VGU_BAD_WARP_ERROR ) return VGU_BAD_WARP_ERROR; // Invert the matrix... - VGfloat det00 = mat[1][1]*mat[2][2] - mat[2][1]*mat[1][2]; - VGfloat det01 = mat[2][0]*mat[1][2] - mat[1][0]*mat[2][2]; - VGfloat det02 = mat[1][0]*mat[2][1] - mat[2][0]*mat[1][1]; + det00 = mat[1][1]*mat[2][2] - mat[2][1]*mat[1][2]; + det01 = mat[2][0]*mat[1][2] - mat[1][0]*mat[2][2]; + det02 = mat[1][0]*mat[2][1] - mat[2][0]*mat[1][1]; - VGfloat det = mat[0][0]*det00 + mat[0][1]*det01 + mat[0][2]*det02; + det = mat[0][0]*det00 + mat[0][1]*det01 + mat[0][2]*det02; if( det == 0.0f ) return VGU_BAD_WARP_ERROR;