*** empty log message ***

This commit is contained in:
2006-07-04 15:44:46 -04:00
parent f7e0898510
commit 4cb2663ba3
6 changed files with 98 additions and 244 deletions

View File

@@ -105,7 +105,7 @@ namespace OpenArena{
uint32 palletteEntries = 0; uint32 palletteEntries = 0;
fread(&bmpHeader, sizeof(bmpHeader), 1, f); fread(&bmpHeader, sizeof(bmpHeader), 1, f);
byte t[2] = {1,0}; uint8 t[2] = {1,0};
if( *((short*)t) !=1) if( *((short*)t) !=1)
{ {
//If big endian reorder bytes //If big endian reorder bytes
@@ -124,7 +124,6 @@ namespace OpenArena{
(bmpHeader.offset & 0x0000ff00) << 8 | (bmpHeader.offset & 0x0000ff00) << 8 |
(bmpHeader.offset & 0x000000ff) << 24; (bmpHeader.offset & 0x000000ff) << 24;
} }
PrintBMPHeader(bmpHeader);
fread(&bmpInfo, sizeof(bmpInfo), 1, f); fread(&bmpInfo, sizeof(bmpInfo), 1, f);
if( *((short*)t) !=1) if( *((short*)t) !=1)
@@ -171,8 +170,6 @@ namespace OpenArena{
(bmpInfo.clrImportant & 0x0000ff00) << 8 | (bmpInfo.clrImportant & 0x0000ff00) << 8 |
(bmpInfo.clrImportant & 0x000000ff) << 24; (bmpInfo.clrImportant & 0x000000ff) << 24;
} }
PrintBMPInfo(bmpInfo);
if(bmpInfo.width < 0) if(bmpInfo.width < 0)
{ {

View File

@@ -6,24 +6,18 @@
namespace OpenArena{ namespace OpenArena{
/*! /*!
* \brief * \brief
* Write brief comment for LoadBMP here. * Loads a bitmap (*.bmp) file and returns a pointer to a TextureImage object.
* *
* \param Filename * \param filename
* Description of parameter Filename. * The path to the file to open.
* *
* \returns * \returns
* Write description of return value here. * A pointer to the created TextureImage object.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for LoadBMP here.
* *
* \remarks * \remarks
* Write remarks for LoadBMP here. * Will be replaced with an actual class soon
* *
* \see * \see
* Separate items with the '|' character.
*/ */
TextureImage* LoadBMP(const char* Filename); TextureImage* LoadBMP(const char* Filename);
}; };

View File

@@ -1,7 +1,7 @@
/*! /*!
* <File comment goes here!!> * <File comment goes here!!>
* *
* Copyright (c) 2005 by <your name/ organization here> * Copyright (c) 2005 by Tom Hicks tomhicks@olympusonline.net
*/ */
#ifndef __camera_h__ #ifndef __camera_h__
#define __camera_h__ #define __camera_h__
@@ -18,15 +18,13 @@ namespace OpenArena
{ {
/*! /*!
* \brief * \brief
* Write brief comment for Camera here. * The Camera class represents a camera or view in 3-dimensional space.
* *
* Write detailed description for Camera here. * The Camera class maintains location, view, and orientation (up view) vectors. The Camera can be moved and rotated in any direction. It includes a wrapper, Look(), for gluLookAt.
* *
* \remarks * \remarks
* Write remarks for Camera here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
class Camera class Camera
{ {
@@ -56,251 +54,168 @@ namespace OpenArena
/*! /*!
* \brief * \brief
* Write brief comment for View here. * Returns the view vector of this camera.
* *
* \returns * \returns
* Write description of return value here. * The view vector of this camera.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for View here.
* *
* \remarks * \remarks
* Write remarks for View here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
Vec3f View(); Vec3d View();
//Purpose:
// Returns the view vector of this camera.
// This vector is the direction the camera is pointing.
/*! /*!
* \brief * \brief
* Write brief comment for UpVector here. * Returns a vector pointing up with respect to the view.
* *
* \returns * \returns
* Write description of return value here. * A vector pointing up with respect to the view.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for UpVector here.
* *
* \remarks * \remarks
* Write remarks for UpVector here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
Vec3f UpVector(); Vec3d UpVector();
//Purpose:
// Returns the up vector of this camera.
// This vector points up in the rendered view.
/*! /*!
* \brief * \brief
* Write brief comment for Strafe here. * Returns this Camera's strafe vector.
*
* The strafe axis is an axis perpendicular to both the up vector and the view vector.
* *
* \returns * \returns
* Write description of return value here. * This Camera's strafe vector.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for Strafe here.
* *
* \remarks * \remarks
* Write remarks for Strafe here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
Vec3f Strafe(); Vec3d Strafe();
//Purpose:
// Returns the strafe vector fo this camera.
// This is the direction StrafeCamera will move
//Mutators
/*! /*!
* \brief * \brief
* Write brief comment for PositionCamera here. * Relocates and reorients this Camera.
* *
* \param xpos * \param xpos
* Description of parameter xpos. * The x-coordinate of the new position vector.
* *
* \param ypos * \param ypos
* Description of parameter ypos. * The y-coordinate of the new position vector.
* *
* \param zpos * \param zpos
* Description of parameter zpos. * The z-coordinate of the new position vector.
* *
* \param xview * \param xview
* Description of parameter xview. * The x-coordinate of the new view vector.
* *
* \param yview * \param yview
* Description of parameter yview. * The y-coordinate of the new view vector.
* *
* \param zview * \param zview
* Description of parameter zview. * The z-coordinate of the new view vector.
* *
* \param xup * \param xup
* Description of parameter xup. * The x-coordinate of the new up vector.
* *
* \param yup * \param yup
* Description of parameter yup. * The y-coordinate of the new up vector.
* *
* \param zup * \param zup
* Description of parameter zup. * The z-coordinate of the new up vector.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for PositionCamera here.
* *
* \remarks * \remarks
* Write remarks for PositionCamera here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void PositionCamera(double xpos, double ypos, double zpos, void PositionCamera(double xpos, double ypos, double zpos,
double xview, double yview, double zview, double xview, double yview, double zview,
double xup, double yup, double zup); double xup, double yup, double zup);
//Purpose:
// Relocates and reorientates the camera as determined by the given vector components.
/*! /*!
* \brief * \brief
* Write brief comment for PositionCamera here. * Relocates and reorients this Camera.
* *
* \param pos * \param pos
* Description of parameter pos. * The new position vector.
* *
* \param view * \param view
* Description of parameter view. * The new view vector.
* *
* \param up * \param up
* Description of parameter up. * The new up vector.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for PositionCamera here.
* *
* \remarks * \remarks
* Write remarks for PositionCamera here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void PositionCamera(Vec3f pos, Vec3f view, Vec3f up); void PositionCamera(Vec3d pos, Vec3d view, Vec3d up);
//Purpose:
// Relocates and reorientates the camera as determined by the given vectos.
/*! /*!
* \brief * \brief
* Write brief comment for RotateView here. * Rotates the camera a given ammount around a given axis.
* *
* \param angle * \param angle
* Description of parameter angle. * The number of degrees to rotate.
* *
* \param axis * \param axis
* Description of parameter axis. * A vector representing the axis to rotate around.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for RotateView here.
* *
* This method passes the arguments to glRotatef()
* \remarks * \remarks
* Write remarks for RotateView here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void Camera::RotateView(double angle, Vec3d axis); void Camera::RotateView(double angle, Vec3d axis);
//Purpose:
// Rotates the camera by angle degrees about the axis specified by axis.
/*! /*!
* \brief * \brief
* Write brief comment for RotateView here. * Rotates the camera a given ammount around a given axis.
* *
* \param angle * \param angle
* Description of parameter angle. * The number of degrees to rotate.
* *
* \param X * \param X
* Description of parameter X. * The x component of the vector representing the axis to rotate around
* *
* \param Y * \param Y
* Description of parameter Y. * The y component of the vector representing the axis to rotate around
* *
* \param Z * \param Z
* Description of parameter Z. * The z component of the vector representing the axis to rotate around
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for RotateView here.
* *
* \remarks * \remarks
* Write remarks for RotateView here. * The vector should be normalized as the values get passed directly to glRotatef().
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void RotateView(double angle, double X, double Y, double Z); void RotateView(double angle, double X, double Y, double Z);
//Purpose:
// Rotates the camera by angle degrees about the axis specified by the given components.
// Works the same as glRotatef(angle, X, Y, Z).
/*! /*!
* \brief * \brief
* Write brief comment for SetViewByMouse here. * Updates the view and up vectors based on mouse movement.
* *
* \param window * \param window
* Description of parameter window. * The Window used to get the mouse coordinates.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for SetViewByMouse here.
* *
* \remarks * \remarks
* Write remarks for SetViewByMouse here. * This will be removed in favor of some sort of event trigger.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void SetViewByMouse(Window window); void SetViewByMouse(Window window);
//Purpose:
// Updates the view Vector based on the change in mouse position since the last time it was called.
//This function needs to be reimagined and better fleshed out.
//void RotateAroundPoint(Vec3f vCenter, double X, double Y, double Z);
//Purpose:
// Rotates the camera arount the point vCenter X degrees around the x-axis, Y degrees around the y-axis, and Z degrees around the z-axis in that order
/*! /*!
* \brief * \brief
* Write brief comment for StrafeCamera here. * Moves the camera along its strafe axis a given distance.
* *
* \param speed * \param speed
* Description of parameter speed. * The distance to move.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for StrafeCamera here.
* *
* \remarks * \remarks
* Write remarks for StrafeCamera here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void StrafeCamera(double speed); void StrafeCamera(double speed);
//Purpose: //Purpose:
@@ -308,69 +223,43 @@ namespace OpenArena
/*! /*!
* \brief * \brief
* Write brief comment for MoveCamera here. * Moves the camera along its view vector a given number of units.
* *
* \param speed * \param speed
* Description of parameter speed. * The distance to move the camera.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for MoveCamera here.
* *
* \remarks * \remarks
* Write remarks for MoveCamera here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void MoveCamera(double speed); void MoveCamera(double speed);
//Purpose:
// Moves the camera along it's view vector speed units.
/*! /*!
* \brief * \brief
* Write brief comment for Update here. * Recalculates the strafe vector.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for Update here.
* *
* \remarks * \remarks
* Write remarks for Update here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void Update(); void Update();
//Purpose:
// Recalculates the strafe vector.
/*! /*!
* \brief * \brief
* Write brief comment for Look here. * Calls gluLookAt to tell OpenGL where to render from.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for Look here.
* *
* \remarks * \remarks
* Write remarks for Look here. * Uses the position, view, and up vectors.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void Look(); void Look();
//Purpose:
// Calls gluLookAt with stored values to set the scene to the camera.
private: private:
Vec3f m_vPosition; Vec3d m_vPosition;
Vec3f m_vView; Vec3d m_vView;
Vec3f m_vUpVector; Vec3d m_vUpVector;
Vec3f m_vStrafe; Vec3d m_vStrafe;
}; };
}; };

View File

@@ -6,15 +6,14 @@
namespace OpenArena{ namespace OpenArena{
/*! /*!
* \brief * \brief
* Write brief comment for ControlScheme here. * This class represents a user's control scheme.
* *
* Write detailed description for ControlScheme here. * This class manages a set of actions and their associated keys.
* *
* \remarks * \remarks
* Write remarks for ControlScheme here. * This could become a set of keys with associated actions.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
class ControlScheme class ControlScheme
{ {
@@ -24,80 +23,56 @@ namespace OpenArena{
ACTION_ROLLLEFT, ACTION_ROLLRIGHT, ACTION_FIREPRIMARY, ACTION_FIRESECONDARY, ACTION_ROLLLEFT, ACTION_ROLLRIGHT, ACTION_FIREPRIMARY, ACTION_FIRESECONDARY,
ACTION_WEAPONNEXT, ACTION_WEAPONPREV, ACTION_TOGGLE_LIGHTS, ACTION_TOGGLE_FPS, ACTION_WEAPONNEXT, ACTION_WEAPONPREV, ACTION_TOGGLE_LIGHTS, ACTION_TOGGLE_FPS,
ACTION_TOGGLE_CONSOLE, ACTION_TOGGLE_MOUSELOOK, ACTION_QUICKMOUSELOOK}; ACTION_TOGGLE_CONSOLE, ACTION_TOGGLE_MOUSELOOK, ACTION_QUICKMOUSELOOK};
/*! /*!
* \brief * \brief
* Write brief comment for LoadDefaultControlScheme here. * This method loads a hard coded default control scheme.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for LoadDefaultControlScheme here.
* *
* \remarks * \remarks
* Write remarks for LoadDefaultControlScheme here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void LoadDefaultControlScheme(); void LoadDefaultControlScheme();
/*! /*!
* \brief * \brief
* Write brief comment for ClearControlScheme here. * This method clears this control scheme so that no keys are bound to any actions.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for ClearControlScheme here.
* *
* \remarks * \remarks
* Write remarks for ClearControlScheme here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void ClearControlScheme(); void ClearControlScheme();
/*! /*!
* \brief * \brief
* Write brief comment for Unbind here. * This method removes a key from all actions.
* *
* \param * \param
* Description of parameter . * The KEY_* constant for the key to unbind.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for Unbind here.
* *
* \remarks * \remarks
* Write remarks for Unbind here.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
void Unbind(uint8); void Unbind(uint8);
/*! /*!
* \brief * \brief
* Write brief comment for Bind here. * This method binds a key to an action.
* *
* \param * \param
* Description of parameter . * The ACTION_* constant for the action to bind to.
* *
* \param * \param
* Description of parameter . * The KEY_* constant for the key to bind.
* *
* \returns * \returns
* Write description of return value here. * Returns false if an invalid action is specified and true otherwise.
*
* \throws <exception class>
* Description of criteria for throwing this exception.
*
* Write detailed description for Bind here.
* *
* \remarks * \remarks
* Write remarks for Bind here. * This unbinds the key before binding it to the new action.
* *
* \see * \see
* Separate items with the '|' character.
*/ */
bool Bind(uint32, uint8); bool Bind(uint32, uint8);

View File

@@ -4,7 +4,7 @@
#include "datatypes.h" #include "datatypes.h"
enum { //Begin entity declaration enum EntityType{ //Begin entity declaration
ENTITY_NONE=0, //Nonexistant entity this should never be used. ENTITY_NONE=0, //Nonexistant entity this should never be used.
ENTITY_PLAYER_MULTI_START //Player start position for multiplayer. ENTITY_PLAYER_MULTI_START //Player start position for multiplayer.
}; //End entity declaration }; //End entity declaration

View File

@@ -432,7 +432,6 @@ namespace OpenArena
void Level::LoadGLTextures() void Level::LoadGLTextures()
{ {
printf("In LoadGLTextures: _window = %d\n", _window);
if(_window != NULL) if(_window != NULL)
{ {
/* /*