From 5cb81562d22db932b54b91a8194ac7e45706603f Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Thu, 10 Aug 2006 06:20:12 -0400 Subject: [PATCH] *** empty log message *** --- src/camera.cpp | 42 ++++++------------------------------------ src/level.h | 20 ++++++++++---------- src/macosx.cpp | 13 +++++++++---- src/main.cpp | 9 +++++++++ src/main.h | 26 ++++++++++++-------------- src/mygl.h | 21 ++++++++++----------- src/window.cpp | 2 ++ 7 files changed, 58 insertions(+), 75 deletions(-) diff --git a/src/camera.cpp b/src/camera.cpp index f5cd131..9fadef4 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -75,40 +75,7 @@ namespace OpenArena void Camera::SetViewByMouse(Window window) { - //Remove the ifdef and use the linux section for both linux and windows - #ifdef __linux - static double currentRotX = 0.0f; - Vec2i pos; - Vec2i middle; - double angleZ; - - middle.x = window.GetWidth()/2; - middle.y = window.GetHeight()/2; - pos = window.GetMousePosition(); - if(pos != middle) - { - window.SetMousePosition(middle); - angleZ = (middle.y - pos.y)/1000.0; - currentRotX-=angleZ; - if(currentRotX >1.0) - { - currentRotX = 1.0; - } - else if(currentRotX < -1.0) - { - currentRotX = -1.0; - } - else - { - Vec3d axis = (m_vView - m_vPosition).cross(m_vUpVector); - axis.normalize(); - RotateView(angleZ, axis.x, axis.y, axis.z); - RotateView((middle.x-pos.x)/1000.0, 0, 1, 0); - //RotateView((middle.x-pos.x)/1000.0, m_vUpVector.x, m_vUpVector.y, m_vUpVector.z); - } - } - #endif - #ifdef __APPLE__ + #if defined USE_GLX static double currentRotX = 0.0f; Vec2i pos; Vec2i middle; @@ -139,8 +106,11 @@ namespace OpenArena //RotateView((middle.x-pos.x)/1000.0, m_vUpVector.x, m_vUpVector.y, m_vUpVector.z); } } - #endif - #ifdef WIN32 + #elif defined USE_AGL + #error unimplemented method + #elif defined USE_CGL + #error unimplemented method + #elif defined USE_WGL static double currentRotX = 0.0f; POINT mpos; POINT middle; diff --git a/src/level.h b/src/level.h index d00e56a..630673f 100644 --- a/src/level.h +++ b/src/level.h @@ -5,23 +5,23 @@ #include "config.h" #endif -#ifdef WIN32 -#include //prolly used for alot but should be removed -#endif #include #include #include #include #include -#ifdef WIN32 + +#if defined USE_GLX +#include +#elif defined USE_AGL +#error unimplemented method +#elif defined USE_CGL +#error unimplemented method +#elif defined USE_WGL +#include #include #endif -#ifdef __linux -#include -#endif -#ifdef __APPLE___ -#include -#endif + #include //for file I/O #include "mydefs.h" diff --git a/src/macosx.cpp b/src/macosx.cpp index 3a0fe9d..6e52982 100644 --- a/src/macosx.cpp +++ b/src/macosx.cpp @@ -28,15 +28,15 @@ // //////////////////////////////////////////////////////////////////////////////// #ifdef __APPLE__ - -//include necessary header files #include "main.h" #include "version.h" +//include necessary header files using namespace std; - -//void InitControls(); unsigned char TranslateKey(int keyCode); unsigned char TranslateButton(int keyCode); + +#if defined USE_GLX +//void InitControls(); void HandleConsoleKeyPress(OpenArena::Keys key); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -885,5 +885,10 @@ void HandleConsoleKeyPress(OpenArena::Keys key) } } } +#elif defined USE_AGL +#error +#elif defined USE_CGL +#error +#endif #endif diff --git a/src/main.cpp b/src/main.cpp index e6777e9..4187185 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1 +1,10 @@ #include +#include +#include + +/* +OSStatus main(int argc, char** argv) +{ + +} +*/ \ No newline at end of file diff --git a/src/main.h b/src/main.h index daef564..d3479e0 100644 --- a/src/main.h +++ b/src/main.h @@ -5,22 +5,20 @@ #include "config.h" #endif -#ifdef WIN32 -#include // Header file for windows +#if defined USE_GLX +#include // Header file for OpenGL32 library +#include // Header file for Glu32 library +#elif defined USE_AGL +#error unimplemented method +#elif defined USE_CGL +#error unimplemented method +#elif defined USE_WGL +#include +#include // Header file for OpenGL32 library +#include // Header file for Glu32 library #endif + #include // Header file for standard input/output -#ifdef WIN32 -#include // Header file for OpenGL32 library -#include // Header file for Glu32 library -#endif -#ifdef __linux -#include // Header file for OpenGL32 library -#include // Header file for Glu32 library -#endif -#ifdef __APPLE__ -#include // Header file for OpenGL32 library -#include // Header file for Glu32 library -#endif #include #include "camera.h" diff --git a/src/mygl.h b/src/mygl.h index 95466d1..29faa05 100644 --- a/src/mygl.h +++ b/src/mygl.h @@ -5,20 +5,19 @@ #include "config.h" #endif -#ifdef WIN32 -#include //Remove if possible +#if defined USE_GLX +#include +#include +#elif defined USE_AGL +#error unimplemented method +#elif defined USE_CGL +#error unimplemented method +#elif defined USE_WGL +#include #include #include #endif -#ifdef __linux -#include -#include -#endif -#ifdef __APPLE__ -#include -#include -#endif -//#include //Hopefully nothing needs this remove if it works in windows + #include #include "datatypes.h" #include "screen.h" diff --git a/src/window.cpp b/src/window.cpp index 0fd937f..18aff40 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -39,7 +39,9 @@ void OpenArena::Window::Close() XCloseDisplay(display); #elif defined USE_AGL + #error unimplemented method #elif defined USE_CGL + #error unimplemented method #elif defined USE_WGL if(_fullscreen) {