TrackBooster.cpp

Go to the documentation of this file.
00001 
00005 /* Copyright © 2009 James Legg.
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 */
00011 
00012 #include "TrackBooster.h"
00013 #include "FormErrors.h"
00014 #include "Mesh/DrawableMesh.h"
00015 #include "Texture.h"
00016 
00017 #include <GL/gl.h>
00018 
00019 namespace Track
00020 {
00021 
00022 std::string TrackBooster::get_class_identifier() const
00023 {
00024     return std::string("Track::TrackBooster");
00025 }
00026 
00027 const unsigned int latest_track_booster_version = 1;
00028 
00029 TrackBooster::TrackBooster(std::istream & source)
00030     :   TrackAttachment(source)
00031 {
00032     unsigned int version;
00033     source >> version;
00034     if (version < latest_track_booster_version) throw DepreciatedVersionError();
00035     if (version > latest_track_booster_version) throw NewVersionError();
00036     
00037 }
00038 
00039 TrackBooster::TrackBooster()
00040 {
00041 }
00042 
00043 TrackBooster::~TrackBooster()
00044 {
00045 }
00046 
00047 void TrackBooster::draw() const
00048 {
00049     static DrawableMesh booster("data/generic/booster");
00050     static Texture texture("data/generic/booster.png");
00051     texture.bind();
00052     booster.draw();
00053 }
00054 
00055 void TrackBooster::add_data(std::ostream & stream) const
00056 {
00057     TrackAttachment::add_data(stream);
00058     stream << ' ' << latest_track_booster_version;
00059 }
00060 
00061 std::ostream & operator<<(std::ostream & destination, TrackBooster booster)
00062 {
00063 }
00064 
00065 } // namespace Track

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:12 2010 by Doxygen version 1.4.7 for Racer version svn335.