From 86f2b5bb397c8ae6f1d3655dac059d9b973c640b Mon Sep 17 00:00:00 2001 From: erg Date: Thu, 8 Oct 2009 21:11:53 +0000 Subject: [PATCH] Fix warning; make sure static functions defined in arcball.h are available. --- cmd/smyrna/arcball.c | 30 +++++++++++------------------- cmd/smyrna/arcball.h | 4 ++-- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/cmd/smyrna/arcball.c b/cmd/smyrna/arcball.c index 8f6a927fd..d37e2a7f1 100644 --- a/cmd/smyrna/arcball.c +++ b/cmd/smyrna/arcball.c @@ -1,15 +1,9 @@ #include "glcompdefs.h" +#define ARCBALL_C #include "arcball.h" #include "smyrnadefs.h" - - - - - - - void setBounds(ArcBall_t* a,GLfloat NewWidth, GLfloat NewHeight) { assert((NewWidth > 1.0f) && (NewHeight > 1.0f)); @@ -66,24 +60,22 @@ void _mapToSphere(ArcBall_t* a,const Point2fT* NewPt, Vector3fT* NewVec) } } -//Create/Destroy -void init_arcBall(ArcBall_t* a,GLfloat NewWidth, GLfloat NewHeight) -{ - - Matrix4fT Transform = { 1.0f, 0.0f, 0.0f, 0.0f, // NEW: Final Transform +static Matrix4fT Transform = {{ 1.0f, 0.0f, 0.0f, 0.0f, // NEW: Final Transform 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f }; + 0.0f, 0.0f, 0.0f, 1.0f }}; - Matrix3fT LastRot = { 1.0f, 0.0f, 0.0f, // NEW: Last Rotation +static Matrix3fT LastRot = {{ 1.0f, 0.0f, 0.0f, // NEW: Last Rotation 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 1.0f }; + 0.0f, 0.0f, 1.0f }}; - Matrix3fT ThisRot = { 1.0f, 0.0f, 0.0f, // NEW: This Rotation +static Matrix3fT ThisRot = {{ 1.0f, 0.0f, 0.0f, // NEW: This Rotation 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 1.0f }; - - + 0.0f, 0.0f, 1.0f }}; + +//Create/Destroy +void init_arcBall(ArcBall_t* a,GLfloat NewWidth, GLfloat NewHeight) +{ a->Transform=Transform; a->LastRot=LastRot; a->ThisRot=ThisRot; diff --git a/cmd/smyrna/arcball.h b/cmd/smyrna/arcball.h index 9ff5dcd90..b281808a2 100644 --- a/cmd/smyrna/arcball.h +++ b/cmd/smyrna/arcball.h @@ -60,6 +60,7 @@ typedef union Matrix3f_t { + GLfloat M[9]; struct { //column major @@ -73,11 +74,11 @@ union { GLfloat M12; GLfloat ZY; }; //ZAxis.Y union { GLfloat M22; GLfloat ZZ; GLfloat SZ; }; //ZAxis.Z and Scale Z } s; - GLfloat M[9]; } Matrix3fT; //A single precision floating point 3 by 3 matrix. typedef union Matrix4f_t { + GLfloat M[16]; struct { //column major @@ -98,7 +99,6 @@ union { GLfloat M23; GLfloat TZ; }; //Trans.Z union { GLfloat M33; GLfloat TW; GLfloat SW; }; //Trans.W and Scale W } s; - GLfloat M[16]; } Matrix4fT; //A single precision floating point 4 by 4 matrix. -- 2.40.0