- Timestamp:
- Mar 4, 2005, 10:01:43 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3455 r3456 39 39 skysphere.cc \ 40 40 light.cc \ 41 sfont/ cone3dfont.cc41 sfont/fontset.cc 42 42 43 43 noinst_HEADERS = ability.h \ … … 82 82 debug.h \ 83 83 skysphere.h \ 84 light.h 84 light.h \ 85 sfont/fontset.h 85 86 86 87 ## orxonox.conf will be used from home-dir instead. -
orxonox/trunk/src/Makefile.in
r3455 r3456 64 64 helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \ 65 65 matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \ 66 skysphere.$(OBJEXT) light.$(OBJEXT) cone3dfont.$(OBJEXT)66 skysphere.$(OBJEXT) light.$(OBJEXT) fontset.$(OBJEXT) 67 67 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 68 68 orxonox_LDADD = $(LDADD) … … 74 74 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \ 75 75 @AMDEP_TRUE@ ./$(DEPDIR)/campaign.Po ./$(DEPDIR)/collision.Po \ 76 @AMDEP_TRUE@ ./$(DEPDIR)/command_node.Po \ 77 @AMDEP_TRUE@ ./$(DEPDIR)/cone3dfont.Po ./$(DEPDIR)/curve.Po \ 76 @AMDEP_TRUE@ ./$(DEPDIR)/command_node.Po ./$(DEPDIR)/curve.Po \ 78 77 @AMDEP_TRUE@ ./$(DEPDIR)/data_tank.Po \ 79 @AMDEP_TRUE@ ./$(DEPDIR)/environment.Po \78 @AMDEP_TRUE@ ./$(DEPDIR)/environment.Po ./$(DEPDIR)/fontset.Po \ 80 79 @AMDEP_TRUE@ ./$(DEPDIR)/game_loader.Po \ 81 80 @AMDEP_TRUE@ ./$(DEPDIR)/glmenu_imagescreen.Po \ … … 250 249 skysphere.cc \ 251 250 light.cc \ 252 sfont/ cone3dfont.cc251 sfont/fontset.cc 253 252 254 253 noinst_HEADERS = ability.h \ … … 293 292 debug.h \ 294 293 skysphere.h \ 295 light.h 294 light.h \ 295 sfont/fontset.h 296 296 297 297 EXTRA_DIST = orxonox.conf … … 381 381 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision.Po@am__quote@ 382 382 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command_node.Po@am__quote@ 383 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cone3dfont.Po@am__quote@384 383 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve.Po@am__quote@ 385 384 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@ 386 385 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Po@am__quote@ 386 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontset.Po@am__quote@ 387 387 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game_loader.Po@am__quote@ 388 388 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glmenu_imagescreen.Po@am__quote@ … … 504 504 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.obj `if test -f 'importer/texture.cc'; then $(CYGPATH_W) 'importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/importer/texture.cc'; fi` 505 505 506 cone3dfont.o: sfont/cone3dfont.cc507 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cone3dfont.o -MD -MP -MF "$(DEPDIR)/cone3dfont.Tpo" -c -o cone3dfont.o `test -f 'sfont/cone3dfont.cc' || echo '$(srcdir)/'`sfont/cone3dfont.cc; \508 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ cone3dfont.Tpo" "$(DEPDIR)/cone3dfont.Po"; else rm -f "$(DEPDIR)/cone3dfont.Tpo"; exit 1; fi509 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='sfont/ cone3dfont.cc' object='cone3dfont.o' libtool=no @AMDEPBACKSLASH@510 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/ cone3dfont.Po' tmpdepfile='$(DEPDIR)/cone3dfont.TPo' @AMDEPBACKSLASH@511 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 512 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cone3dfont.o `test -f 'sfont/cone3dfont.cc' || echo '$(srcdir)/'`sfont/cone3dfont.cc513 514 cone3dfont.obj: sfont/cone3dfont.cc515 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cone3dfont.obj -MD -MP -MF "$(DEPDIR)/cone3dfont.Tpo" -c -o cone3dfont.obj `if test -f 'sfont/cone3dfont.cc'; then $(CYGPATH_W) 'sfont/cone3dfont.cc'; else $(CYGPATH_W) '$(srcdir)/sfont/cone3dfont.cc'; fi`; \516 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ cone3dfont.Tpo" "$(DEPDIR)/cone3dfont.Po"; else rm -f "$(DEPDIR)/cone3dfont.Tpo"; exit 1; fi517 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='sfont/ cone3dfont.cc' object='cone3dfont.obj' libtool=no @AMDEPBACKSLASH@518 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/ cone3dfont.Po' tmpdepfile='$(DEPDIR)/cone3dfont.TPo' @AMDEPBACKSLASH@519 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 520 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cone3dfont.obj `if test -f 'sfont/cone3dfont.cc'; then $(CYGPATH_W) 'sfont/cone3dfont.cc'; else $(CYGPATH_W) '$(srcdir)/sfont/cone3dfont.cc'; fi`506 fontset.o: sfont/fontset.cc 507 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fontset.o -MD -MP -MF "$(DEPDIR)/fontset.Tpo" -c -o fontset.o `test -f 'sfont/fontset.cc' || echo '$(srcdir)/'`sfont/fontset.cc; \ 508 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/fontset.Tpo" "$(DEPDIR)/fontset.Po"; else rm -f "$(DEPDIR)/fontset.Tpo"; exit 1; fi 509 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='sfont/fontset.cc' object='fontset.o' libtool=no @AMDEPBACKSLASH@ 510 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/fontset.Po' tmpdepfile='$(DEPDIR)/fontset.TPo' @AMDEPBACKSLASH@ 511 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 512 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fontset.o `test -f 'sfont/fontset.cc' || echo '$(srcdir)/'`sfont/fontset.cc 513 514 fontset.obj: sfont/fontset.cc 515 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fontset.obj -MD -MP -MF "$(DEPDIR)/fontset.Tpo" -c -o fontset.obj `if test -f 'sfont/fontset.cc'; then $(CYGPATH_W) 'sfont/fontset.cc'; else $(CYGPATH_W) '$(srcdir)/sfont/fontset.cc'; fi`; \ 516 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/fontset.Tpo" "$(DEPDIR)/fontset.Po"; else rm -f "$(DEPDIR)/fontset.Tpo"; exit 1; fi 517 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='sfont/fontset.cc' object='fontset.obj' libtool=no @AMDEPBACKSLASH@ 518 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/fontset.Po' tmpdepfile='$(DEPDIR)/fontset.TPo' @AMDEPBACKSLASH@ 519 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 520 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fontset.obj `if test -f 'sfont/fontset.cc'; then $(CYGPATH_W) 'sfont/fontset.cc'; else $(CYGPATH_W) '$(srcdir)/sfont/fontset.cc'; fi` 521 521 uninstall-info-am: 522 522 … … 642 642 643 643 distdir: $(DISTFILES) 644 $(mkdir_p) $(distdir)/sfont 644 645 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 645 646 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ -
orxonox/trunk/src/sfont/fontset.cc
r3455 r3456 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific: 12 main-programmer: Benjamin Grauer 13 co-programmer: ... 14 15 *** 16 * This file is extended to the needs of the orxonox-project. * 17 * The main difference to the version of Marius is, that textures get * 18 * loaded by orxonox Texture-class, and that the comments are set up, * 19 * in doxygen style * 20 * the Copyright of the original file is below this copyright, and we * 21 * hope not to offend Marius through this. * 22 *** 23 24 */ 25 1 26 /*************************************************************************** 2 27 cone3dfont.cpp - description … … 16 41 ***************************************************************************/ 17 42 18 #include "cone3dfont.h" 43 44 #include "fontset.h" 19 45 #include <stdarg.h> 20 46 21 47 #include "../importer/texture.h" 22 48 23 int Cone3DFont::SetSize(float x, float y) // Set the size of the font 49 /** 50 \brief initializes a new fontset 51 */ 52 FontSet::FontSet() 53 { 54 this->sizex=1.0f; 55 this->sizey=1.0f; 56 this->font = NULL; 57 } 58 59 /** 60 \brief initializes a new fontset with a texture for the font 61 \param fontFile The fontfile to load 62 */ 63 FontSet::FontSet(char* fontFile) 64 { 65 this->sizex=1.0f; 66 this->sizey=1.0f; 67 this->font = NULL; 68 69 } 70 71 /** 72 \brief deletes the Fontset by freeing all allocated space 73 and then deleting the Texture. 74 */ 75 FontSet::~FontSet() 76 { 77 killFont(); 78 // delete the texture; 79 delete font; 80 } 81 82 /** 83 \brief sets the size of the font 84 \param x the width of the font 85 \param y the height of the font 86 */ 87 int FontSet::setSize(float x, float y) 24 88 { 25 89 sizex=x; … … 29 93 } 30 94 31 int Cone3DFont::BuildFont(char *file) // Build Our Font Display List 95 /** 96 \brief builds the fontset 97 \param file the name of the file to get the fontset from. 98 */ 99 int FontSet::buildFont(char *file) 32 100 { 33 101 int loop1; 34 102 float cx, cy; 35 103 104 if (!font) 105 delete font; 36 106 font = new Texture(); 37 107 font->loadImage(file); … … 61 131 } 62 132 63 int Cone3DFont::KillFont(GLvoid) // Delete The Font From Memory 133 /** 134 \brief deletes the display lists. 135 */ 136 int FontSet::killFont(void) // Delete The Font From Memory 64 137 { 65 138 glDeleteLists(base,256); // Delete All 256 Display Lists … … 67 140 } 68 141 69 int Cone3DFont::PrintText(GLint x, GLint y, char type, char *fmt,...)// Where The Printing Happens 142 /** 143 \brief prints out some text 144 \param x most left coordinate of the text. 145 \param y the top coordinate of the text 146 \param type Type of text 147 \param fmt The text to display 148 \param ... more text 149 */ 150 int FontSet::printText(int x, int y, char type, char *fmt,...)// Where The Printing Happens 70 151 { 71 152 char text[1024]; // Holds Our String -
orxonox/trunk/src/sfont/fontset.h
r3455 r3456 1 /*************************************************************************** 2 cone3dfont.h - description 3 ------------------- 4 copyright : (C) 2001 by Marius Andra aka Cone3D 5 email : marius@hot.ee 6 ICQ : 43999510 7 ***************************************************************************/ 1 /*! 2 \file fontset.h 3 \brief Handles the display of Text. 4 */ 8 5 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 /* 6 /** 18 7 This file is extended to the needs of the orxonox-project. 19 8 The main difference to the version of Marius is, that textures get … … 23 12 class Texture; 24 13 14 //! A class to handle a FontSet. 15 /** 16 A fontset is an entire Alphabet (256 entries) of one font. 17 It is made by creating a file containing a matrix with 256 18 little pictures in it, displaying the letters of this alphabet. 19 Then these letters are projected onto Quads, which can be aranged 20 in a sorted order, to display some text 25 21 26 class Cone3DFont 22 usage: 23 1. initialize the Class by loading the source-font-picture 24 2. set the size 25 3. write some text with printText 26 4. delete the class again. 27 */ 28 class FontSet 27 29 { 28 public: 29 Cone3DFont() {sizex=1.0f; sizey=1.0f;}; 30 ~Cone3DFont() {KillFont();}; 31 int BuildFont(char *file); 32 int PrintText(int x, int y, char type, char *fmt, ...); 33 int KillFont(); 34 int SetSize(float x, float y); 35 36 // Cone3DTGA font; 37 private: 38 int base; 39 float sizex,sizey; 40 Texture* font; 30 public: 31 FontSet(); 32 FontSet(char *file); 33 ~FontSet(); 34 35 int buildFont(char* fontFile); 36 int printText(int x, int y, char type, char *fmt, ...); 37 int killFont(void); 38 int setSize(float x, float y); 39 40 private: 41 int base; //!< Save the glLists here. 42 float sizex; //!< the width of the text. 43 float sizey; //!< the height of the text. 44 Texture* font; //!< texture of the font. 41 45 42 46 }; -
orxonox/trunk/src/world.cc
r3455 r3456 29 29 #include "skysphere.h" 30 30 #include "light.h" 31 #include "sfont/ cone3dfont.h"31 #include "sfont/fontset.h" 32 32 33 33 using namespace std; … … 205 205 { 206 206 // initializing Font 207 testFont = new Cone3DFont();208 testFont-> BuildFont("../data/pictures/font.tga");207 testFont = new FontSet(); 208 testFont->buildFont("../data/pictures/font.tga"); 209 209 210 210 // initializing the TrackManager … … 660 660 skySphere->draw(); 661 661 662 testFont-> PrintText(10, 10, 1, "orxonox_" PACKAGE_VERSION);662 testFont->printText(0, 0, 1, "orxonox_" PACKAGE_VERSION); 663 663 664 664 } -
orxonox/trunk/src/world.h
r3455 r3456 18 18 class Skysphere; 19 19 class Light; 20 class Cone3DFont;20 class FontSet; 21 21 22 22 //! The game world … … 73 73 bool bPause; //!< pause mode 74 74 75 Cone3DFont* testFont;//!< A test Font. \todo fix this, so it is for real.75 FontSet* testFont; //!< A test Font. \todo fix this, so it is for real. 76 76 GLMenuImageScreen* glmis; //!< The Level-Loader Display 77 77
Note: See TracChangeset
for help on using the changeset viewer.