*** empty log message ***
This commit is contained in:
@@ -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;
|
||||
|
||||
20
src/level.h
20
src/level.h
@@ -5,23 +5,23 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h> //prolly used for alot but should be removed
|
||||
#endif
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <cctype>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#ifdef WIN32
|
||||
|
||||
#if defined USE_GLX
|
||||
#include <GL/gl.h>
|
||||
#elif defined USE_AGL
|
||||
#error unimplemented method
|
||||
#elif defined USE_CGL
|
||||
#error unimplemented method
|
||||
#elif defined USE_WGL
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#ifdef __linux
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#ifdef __APPLE___
|
||||
#include <gl.h>
|
||||
#endif
|
||||
|
||||
#include <cstdio> //for file I/O
|
||||
|
||||
#include "mydefs.h"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <AGL/agl.h>
|
||||
#include <OpenGL/gl.h>
|
||||
|
||||
/*
|
||||
OSStatus main(int argc, char** argv)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
26
src/main.h
26
src/main.h
@@ -5,22 +5,20 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h> // Header file for windows
|
||||
#if defined USE_GLX
|
||||
#include <GL/gl.h> // Header file for OpenGL32 library
|
||||
#include <GL/glu.h> // Header file for Glu32 library
|
||||
#elif defined USE_AGL
|
||||
#error unimplemented method
|
||||
#elif defined USE_CGL
|
||||
#error unimplemented method
|
||||
#elif defined USE_WGL
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h> // Header file for OpenGL32 library
|
||||
#include <GL/glu.h> // Header file for Glu32 library
|
||||
#endif
|
||||
|
||||
#include <cstdio> // Header file for standard input/output
|
||||
#ifdef WIN32
|
||||
#include <GL/gl.h> // Header file for OpenGL32 library
|
||||
#include <GL/glu.h> // Header file for Glu32 library
|
||||
#endif
|
||||
#ifdef __linux
|
||||
#include <GL/gl.h> // Header file for OpenGL32 library
|
||||
#include <GL/glu.h> // Header file for Glu32 library
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
#include <GL/gl.h> // Header file for OpenGL32 library
|
||||
#include <GL/glu.h> // Header file for Glu32 library
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
||||
#include "camera.h"
|
||||
|
||||
21
src/mygl.h
21
src/mygl.h
@@ -5,20 +5,19 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h> //Remove if possible
|
||||
#if defined USE_GLX
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#elif defined USE_AGL
|
||||
#error unimplemented method
|
||||
#elif defined USE_CGL
|
||||
#error unimplemented method
|
||||
#elif defined USE_WGL
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
#ifdef __linux
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
//#include <gl/glaux.h> //Hopefully nothing needs this remove if it works in windows
|
||||
|
||||
#include <string>
|
||||
#include "datatypes.h"
|
||||
#include "screen.h"
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user