- Timestamp:
- Jan 18, 2006, 1:20:02 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/class_id.h
r6455 r6532 192 192 CL_NPC_TEST1 = 0x00000301, 193 193 CL_NPC_TEST2 = 0x00000302, 194 CL_MOVIE_ENTITY = 0x00000303, 194 195 195 196 … … 226 227 CL_TEXTURE_SEQUENCE = 0x00004805, 227 228 CL_OBJ_MODEL = 0x00000807, 229 230 CL_MOVIE_PLAYER = 0x00000805, 231 CL_MEDIA_CONTAINER = 0x00000806, 228 232 CL_PROMITIVE_MODEL = 0x00000808, 229 233 CL_MD2Model = 0x00000809, -
trunk/src/lib/graphics/importer/Makefile.am
r6455 r6532 14 14 texture.cc \ 15 15 texture_sequence.cc \ 16 height_map.cc 16 height_map.cc \ 17 media_container.cc \ 18 movie_player.cc 17 19 18 20 libtc_a_SOURCES = tc.cc … … 32 34 height_map.h \ 33 35 anorms.h \ 34 anormtab.h 36 anormtab.h \ 37 media_container.h \ 38 movie_player.h -
trunk/src/lib/graphics/importer/texture.cc
r6523 r6532 199 199 0xFF000000 200 200 #else 201 201 0xFF000000, 202 202 0x00FF0000, 203 203 0x0000FF00, -
trunk/src/lib/graphics/importer/texture_sequence.cc
r5885 r6532 47 47 TextureSequence::~TextureSequence() 48 48 { 49 this->clearLists(); 50 } 51 52 void TextureSequence::clearLists() 53 { 49 54 // delete all images 50 55 while(!this->images.empty()) … … 54 59 } 55 60 56 this->setTexture(0);57 61 // delete all textures. 58 62 while(!this->textures.empty()) … … 63 67 } 64 68 } 65 66 69 67 70 /** … … 149 152 } 150 153 this->setAlpha(hasAlpha); 154 151 155 return true; 152 156 } 153 157 158 /** 159 * @brief adds a new Frame at the end of the Sequence. 160 * @param texture the texture to add at the end of the Sequence. 161 */ 162 bool TextureSequence::addFrame(GLuint texture) 163 { 164 if (texture == 0) 165 return false; 166 this->textures.push_back(texture); 154 167 168 return true; 169 } 155 170 156 171 /** … … 158 173 * @param frameNumber the n-th frame 159 174 */ 160 void TextureSequence::gotoFrame(unsigned int frameNumber)175 /*void TextureSequence::gotoFrame(unsigned int frameNumber) 161 176 { 162 177 if (this->textures.size() > frameNumber) 163 178 this->setTexture(this->textures[frameNumber]); 164 179 } 180 */ -
trunk/src/lib/graphics/importer/texture_sequence.h
r5865 r6532 29 29 bool addFrame(const char* image); 30 30 bool addFrame(SDL_Surface* surface); 31 bool addFrame(GLuint texture); 32 33 void clearLists(); 31 34 32 35 virtual bool rebuild(); … … 35 38 inline unsigned int getFrameCount() const { return this->textures.size(); }; 36 39 37 void gotoFrame(unsigned int frameNumber);40 //void gotoFrame(unsigned int frameNumber); 38 41 /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series. */ 39 42 inline GLuint getFrameTexture(unsigned int frameNumber) const { return (this->textures.size()>frameNumber)?this->textures[frameNumber]:0; }; -
trunk/src/subprojects/importer/Makefile.am
r6310 r6532 7 7 8 8 bin_PROGRAMS = importer \ 9 multitex 9 multitex \ 10 movie_player_test 10 11 11 12 importer_LDADD = $(MAINSRCDIR)/lib/event/libORXevent.a \ … … 63 64 $(MAINSRCDIR)/lib/util/executor/executor.cc \ 64 65 $(MAINSRCDIR)/util/loading/factory.cc 66 67 movie_player_test_LDADD = $(MAINSRCDIR)/lib/event/libORXevent.a \ 68 $(MAINSRCDIR)/lib/parser/tinyxml/libtinyxml.a \ 69 $(MAINSRCDIR)/lib/graphics/libORXgraphics.a \ 70 $(MAINSRCDIR)/lib/shell/libORXshell.a \ 71 $(MAINSRCDIR)/lib/sound/libORXsound.a \ 72 $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a 73 74 movie_player_test_SOURCES= ../framework.cc \ 75 movie_player_test.cc \ 76 $(MAINSRCDIR)/util/state.cc \ 77 $(MAINSRCDIR)/world_entities/camera.cc \ 78 $(MAINSRCDIR)/lib/lang/base_object.cc \ 79 $(MAINSRCDIR)/lib/lang/class_list.cc \ 80 $(MAINSRCDIR)/lib/math/vector.cc \ 81 $(MAINSRCDIR)/util/loading/resource_manager.cc \ 82 $(MAINSRCDIR)/lib/parser/ini_parser/ini_parser.cc \ 83 $(MAINSRCDIR)/lib/coord/p_node.cc \ 84 $(MAINSRCDIR)/lib/coord/null_parent.cc \ 85 $(MAINSRCDIR)/util/loading/load_param.cc \ 86 $(MAINSRCDIR)/util/loading/load_param_description.cc \ 87 $(MAINSRCDIR)/lib/util/helper_functions.cc \ 88 $(MAINSRCDIR)/lib/util/substring.cc \ 89 $(MAINSRCDIR)/lib/util/color.cc \ 90 $(MAINSRCDIR)/lib/util/multi_type.cc \ 91 $(MAINSRCDIR)/lib/util/executor/executor.cc \ 92 $(MAINSRCDIR)/util/loading/factory.cc -
trunk/src/subprojects/importer/multitex.cc
r5866 r6532 10 10 11 11 ### File Specific: 12 main-programmer: Benjamin Grauer12 main-programmer: David Hasenfratz 13 13 co-programmer: ... 14 14 … … 20 20 #include "light.h" 21 21 22 #include "texture_sequence.h"23 22 #include "material.h" 24 25 #include "objModel.h"26 27 23 #include "primitive_model.h" 28 24 #include <stdlib.h> 29 25 30 #include " resource_manager.h"26 #include "media_container.h" 31 27 32 28 Model* obj; 33 TextureSequence* seq;34 Texture* test;35 29 Material* testMat; 30 MediaContainer* media_container; 36 31 37 float counter = 0; 32 int counter = 0; 33 float timer = 0; 34 float fps; 38 35 39 36 40 37 void Framework::moduleInit(int argc, char** argv) 41 38 { 42 ResourceManager::getInstance()->addImageDir("./"); 39 if( argc <= 1) 40 { 41 printf("Wrong arguments try following notations:\n"); 42 printf("./multitex [media_file]\n"); 43 exit(0); 44 } 45 46 media_container = new MediaContainer(argv[1]); 43 47 44 48 testMat = new Material; 45 46 seq = new TextureSequence(); 47 for (int i = 1; i < argc; i++) 48 { 49 seq->addFrame(argv[i]); 50 printf("%s\n", argv[i]); 51 } 52 test = new Texture(argv[1]); 53 testMat->setDiffuseMap(argv[1]); 54 55 ResourceManager::getInstance()->addImageDir(""); 56 57 58 obj = new PrimitiveModel(PRIM_SPHERE, 10.0); 59 60 ResourceManager::getInstance()->debug(); 49 testMat->setDiffuseMap("maps/radialTransparency.png"); 50 obj = new PrimitiveModel(PRIM_PLANE, 10.0); 61 51 62 52 LightManager* lightMan = LightManager::getInstance(); … … 64 54 (new Light())->setAbsCoor(5.0, 10.0, 40.0); 65 55 (new Light())->setAbsCoor(-10, -20, -100); 56 57 fps = media_container->getFPS(); 66 58 } 67 59 … … 73 65 switch (event->key.keysym.sym) 74 66 { 75 case SDLK_i: 67 case SDLK_1: 68 obj = new PrimitiveModel(PRIM_CUBE, 10.0); 69 break; 70 case SDLK_2: 71 obj = new PrimitiveModel(PRIM_SPHERE, 10.0); 72 break; 73 case SDLK_3: 74 obj = new PrimitiveModel(PRIM_PLANE, 10.0); 75 break; 76 // increase fps 77 case SDLK_9: 78 fps++; 79 PRINTF(0)("fps: %0.2f\n", fps); 80 break; 81 // decrease fps 82 case SDLK_8: 83 if(fps > 0) 84 fps--; 85 PRINTF(0)("fps: %0.2f\n", fps); 76 86 break; 77 87 } … … 81 91 void Framework::moduleTick(float dt) 82 92 { 83 counter+=dt;93 timer += dt; 84 94 85 seq->gotoFrame((unsigned int)counter); 86 if ((unsigned int)counter > seq->getFrameCount()) 87 counter = 0; 95 if(counter != fps * timer) 96 { 97 counter = fps * timer; 98 99 if (counter >= media_container->getFrameCount()) 100 { 101 timer = 0; 102 counter = 0; 103 } 104 } 88 105 } 89 106 … … 91 108 { 92 109 testMat->select(); 93 glBindTexture(GL_TEXTURE_2D, seq->getTexture());110 glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter)); 94 111 obj->draw(); 95 112 … … 97 114 } 98 115 99 100 116 void Framework::moduleHelp(void) const 101 117 { -
trunk/src/world_entities/Makefile.am
r6455 r6532 20 20 world_entities/terrain.cc \ 21 21 world_entities/satellite.cc \ 22 world_entities/movie_entity.cc \ 22 23 world_entities/character_attributes.cc \ 23 24 world_entities/test_entity.cc \ … … 68 69 world_entities/terrain.h \ 69 70 world_entities/satellite.h \ 71 world_entities/movie_entity.h \ 70 72 world_entities/character_attributes.h \ 71 73 world_entities/test_entity.h \ -
trunk/src/world_entities/movie_entity.cc
r6526 r6532 65 65 void MovieEntity::loadParams(const TiXmlElement* root) 66 66 { 67 static_cast<WorldEntity*>(this)->loadParams(root);67 WorldEntity::loadParams(root); 68 68 69 69 LoadParam(root, "name", this, MovieEntity, loadMovie); … … 107 107 if(counter != fps * timer) 108 108 { 109 counter = fps * timer;109 counter = (int)(fps * timer); 110 110 111 111 if (counter >= media_container->getFrameCount()) -
trunk/src/world_entities/movie_entity.h
r6526 r6532 35 35 virtual void tick (float time); 36 36 37 v oid loadParams(const TiXmlElement* root);37 virtual void loadParams(const TiXmlElement* root); 38 38 39 39 void loadMovie(const char* filename); -
trunk/src/world_entities/space_ships/space_ship.cc
r6518 r6532 123 123 PRINTF(4)("SPACESHIP INIT\n"); 124 124 125 EventHandler::getInstance()->grabEvents(true);125 //EventHandler::getInstance()->grabEvents(true); 126 126 127 127 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
Note: See TracChangeset
for help on using the changeset viewer.