From a94049b1a43f83d750b9b5dee031c19a6b1fafb0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 30 Jan 2008 17:32:00 +0000 Subject: accomodate the new modules --- src/client/Makefile.am | 13 +++++++------ src/client/camera.cc | 10 ++++------ src/client/camera.h | 16 ++++++++-------- src/client/client.cc | 16 ++++++---------- src/client/console.cc | 9 ++++----- src/client/console.h | 16 ++++++++-------- src/client/input.cc | 2 ++ src/client/shipdrawer.cc | 6 ++++-- src/client/shipdrawer.h | 1 + src/client/stardrawer.cc | 6 ++++-- src/client/video.cc | 11 ++++++----- src/client/video.h | 7 ++++--- src/client/view.cc | 12 ++++++------ src/client/view.h | 15 +++++++++------ 14 files changed, 73 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/client/Makefile.am b/src/client/Makefile.am index 12b8f5d..6298936 100644 --- a/src/client/Makefile.am +++ b/src/client/Makefile.am @@ -1,16 +1,17 @@ METASOURCES = AUTO bin_PROGRAMS = osirion -osirion_LDADD = $(top_builddir)/src/game/libgame.la \ - $(top_builddir)/src/gl/libosiriongl.la + +osirion_LDADD = $(top_builddir)/src/common/libcommon.la \ + $(top_builddir)/src/filesystem/libfilesystem.la \ + $(top_builddir)/src/game/libgame.la \ + $(top_builddir)/src/gl/libgl.la osirion_SOURCES = camera.cc client.cc console.cc hud.cc input.cc main.cc \ shipdrawer.cc stardrawer.cc video.cc view.cc - - INCLUDES = -I$(top_srcdir)/src -osirion_CFLAGS = $(LIBSDL_CFLAGS) -osirion_LDFLAGS = $(LIBSDL_LIBS) +osirion_CFLAGS = $(LIBSDL_CFLAGS) $(GL_CFLAGS) +osirion_LDFLAGS = $(LIBSDL_LIBS) $(GL_LIBS) noinst_HEADERS = camera.h client.h console.h input.h shipdrawer.h stardrawer.h \ video.h view.h diff --git a/src/client/camera.cc b/src/client/camera.cc index c195d20..08c60fa 100644 --- a/src/client/camera.cc +++ b/src/client/camera.cc @@ -4,14 +4,12 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "camera.h" - -#include "gl/osiriongl.h" +#include "client/camera.h" #include "game/game.h" -#include "common/functions.h" +#include "math/mathlib.h" -using common::degrees360f; -using common::degrees180f; +using math::degrees360f; +using math::degrees180f; namespace client { diff --git a/src/client/camera.h b/src/client/camera.h index ec8d4d6..da0890b 100644 --- a/src/client/camera.h +++ b/src/client/camera.h @@ -4,17 +4,17 @@ the terms and conditions of the GNU General Public License version 2 */ -#ifndef __INCLUDED_CAMERA_H__ -#define __INCLUDED_CAMERA_H__ +#ifndef __INCLUDED_CLIENT_CAMERA_H__ +#define __INCLUDED_CLIENT_CAMERA_H__ -#include "gl/osiriongl.h" +#include "gl/gllib.h" namespace client { /// camera functions -/** The functions in this namespace performs the transformations -for the camera eye location. The camera always looks at (0,0,0) -*/ +/** The functions in this class perform the transformations + * for the camera eye location. The camera always looks at (0,0,0) + */ class Camera { public: @@ -41,7 +41,7 @@ public: /// camera target /** The location the camera is looking at */ - gl::Vector3f target; + math::Vector3f target; /// target yaw, angle in XZ plane, positive is looking left float yaw_target; @@ -67,4 +67,4 @@ protected: } // namespace client -#endif // __INCLUDED_CAMERA_H__ +#endif // __INCLUDED_CLIENT_CAMERA_H__ diff --git a/src/client/client.cc b/src/client/client.cc index f146a8f..a94219b 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -4,14 +4,14 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "camera.h" -#include "view.h" -#include "video.h" -#include "input.h" -#include "console.h" +#include "client/camera.h" +#include "client/view.h" +#include "client/video.h" +#include "client/input.h" +#include "client/console.h" #include "game/game.h" -#include "osirion.h" +#include "common/common.h" #include @@ -26,7 +26,6 @@ Input input; // private instance of the client console object Console clientconsole; - void quit(int status) { SDL_Quit(); @@ -35,9 +34,6 @@ void quit(int status) void init() { - // set clientconsole as the common console object - common::Console::instance = &clientconsole; - // Initialize the video subsystem video.init(); if (!video.initialized) { diff --git a/src/client/console.cc b/src/client/console.cc index f270108..6a3dfaa 100644 --- a/src/client/console.cc +++ b/src/client/console.cc @@ -4,22 +4,21 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "console.h" -#include +#include "client/console.h" namespace client { -std::ostream & Console::message() +std::ostream & Console::messagestream() { return (std::cout << ". "); } -std::ostream & Console::warning() +std::ostream & Console::warningstream() { return (std::cout << "! "); } -std::ostream & Console::debug() +std::ostream & Console::debugstream() { return (std::cout << "? "); } diff --git a/src/client/console.h b/src/client/console.h index 1dc7109..21d5df9 100644 --- a/src/client/console.h +++ b/src/client/console.h @@ -4,8 +4,8 @@ the terms of the GNU General Public License version 2 */ -#ifndef __INCLUDED_CLIENTCONSOLE_H__ -#define __INCLUDED_CLIENTCONSOLE_H__ +#ifndef __INCLUDED_CLIENT_CONSOLE_H__ +#define __INCLUDED_CLIENT_CONSOLE_H__ #include "common/console.h" @@ -15,17 +15,17 @@ namespace client { class Console : public common::Console { public: /// stream to send normal messages too - virtual std::ostream & message(); + virtual std::ostream & messagestream(); /// stream to send warning messages too - virtual std::ostream & warning(); + virtual std::ostream & warningstream(); /// stream to send debug messages too - virtual std::ostream & debug(); + virtual std::ostream & debugstream(); -}; // class Console +}; -} // namespace server +} -#endif // __INCLUDED_CLIENTCONSOLE_H__ +#endif // __INCLUDED_CLIENT_CONSOLE_H__ diff --git a/src/client/input.cc b/src/client/input.cc index 270ccb7..7d26a2b 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -33,6 +33,8 @@ void Input::handle_keyreleased(SDL_keysym* keysym) case SDLK_SPACE: camera.nextmode(); break; + default: + break; } } diff --git a/src/client/shipdrawer.cc b/src/client/shipdrawer.cc index 09f95b1..e1c9adf 100644 --- a/src/client/shipdrawer.cc +++ b/src/client/shipdrawer.cc @@ -4,8 +4,8 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "shipdrawer.h" -#include "gl/osiriongl.h" +#include "client/shipdrawer.h" +#include "gl/gllib.h" #include "gl/box.h" #include @@ -13,6 +13,8 @@ namespace client { using namespace gl; +using math::Vector3f; +using math::Color; Vector3f v0(1.0f, -1.0f, -1.0f); Vector3f v1(1.0f, 1.0f, -1.0f); diff --git a/src/client/shipdrawer.h b/src/client/shipdrawer.h index 73db28d..3ad7208 100644 --- a/src/client/shipdrawer.h +++ b/src/client/shipdrawer.h @@ -29,3 +29,4 @@ private: } // namespace client #endif // __INCLUDED_SHIPDRAWER_H__ + diff --git a/src/client/stardrawer.cc b/src/client/stardrawer.cc index d5a0f9f..0f591bf 100644 --- a/src/client/stardrawer.cc +++ b/src/client/stardrawer.cc @@ -3,8 +3,9 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "gl/osiriongl.h" -#include "stardrawer.h" +// projet headers +#include "client/stardrawer.h" +#include "gl/gllib.h" namespace client { @@ -24,3 +25,4 @@ void StarDrawer::draw(float elapsed) } } // namespace client + diff --git a/src/client/video.cc b/src/client/video.cc index a76b4b9..9a542f3 100644 --- a/src/client/video.cc +++ b/src/client/video.cc @@ -4,8 +4,9 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "client.h" -#include "gl/osiriongl.h" +#include "client/client.h" +#include "gl/gllib.h" +#include "common/common.h" #include @@ -61,13 +62,13 @@ void Video::init() int flags = 0; if( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - conwarn << "SDL_Init() failed: " << SDL_GetError() << std::endl; + con_warn << "SDL_Init() failed: " << SDL_GetError() << std::endl; return; } const SDL_VideoInfo* sdl_videoinfo = SDL_GetVideoInfo(); if( !sdl_videoinfo) { - conwarn << "SDL_GetVideoInfo() failed: " << SDL_GetError() << std::endl; + con_warn << "SDL_GetVideoInfo() failed: " << SDL_GetError() << std::endl; return; } @@ -85,7 +86,7 @@ void Video::init() flags = SDL_OPENGL | SDL_FULLSCREEN; if(!SDL_SetVideoMode(width, height, bpp, flags )) { - conwarn << "SDL_SetVideoMode() failed: " << SDL_GetError() << std::endl; + con_warn << "SDL_SetVideoMode() failed: " << SDL_GetError() << std::endl; return; } diff --git a/src/client/video.h b/src/client/video.h index 4c07652..6da89f3 100644 --- a/src/client/video.h +++ b/src/client/video.h @@ -2,8 +2,8 @@ This file is part of the Osirion project */ -#ifndef __INCLUDED_VIDEO_H__ -#define __INCLUDED_VIDEO_H__ +#ifndef __INCLUDED_CLIENT_VIDEO_H__ +#define __INCLUDED_CLIENT_VIDEO_H__ namespace client { @@ -34,4 +34,5 @@ public: } // namespace client -#endif // __INCLUDED_VIDEO_H__ +#endif // __INCLUDED_CLIENT_VIDEO_H__ + diff --git a/src/client/view.cc b/src/client/view.cc index ca41831..63a6942 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -4,13 +4,13 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "client.h" -#include "shipdrawer.h" -#include "stardrawer.h" -#include "gl/osiriongl.h" +#include "client/client.h" +#include "client/shipdrawer.h" +#include "client/stardrawer.h" #include "game/game.h" -#include "common/functions.h" -#include "osirion.h" +#include "gl/gllib.h" +#include "common/common.h" +#include "math/mathlib.h" #include diff --git a/src/client/view.h b/src/client/view.h index 0087ae5..fa62d98 100644 --- a/src/client/view.h +++ b/src/client/view.h @@ -3,33 +3,36 @@ the terms and conditions of the GNU General Public License version 2 */ -#ifndef __INCLUDED_VIEW_H__ -#define __INCLUDED_VIEW_H__ +#ifndef __INCLUDED_CLIENT_VIEW_H__ +#define __INCLUDED_CLIENT_VIEW_H__ namespace client { -/// Draws the userinterface +/// Draws the user interface class View { public: /// intialize the view void init(); + /// shutdown the view void shutdown(); - /// Update the chronometer and draw the game view + /// update the chronometer and draw the game view void draw(float elapsed); - /// Reset the projection matrix + /// reset the projection matrix void reset(); protected: /// draw the world void draw_world(float elapsed); + /// draw the background void draw_background(float elapsed); }; } // namespace client -#endif // __INCLUDED_VIEW_H__ +#endif // __INCLUDED_CLIENT_VIEW_H__ + -- cgit v1.2.3