- Timestamp:
- Feb 7, 2006, 2:58:08 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/md2Model.cc
r7068 r7071 157 157 the animation types can be looked up in the animationType table 158 158 */ 159 void MD2Model::setAnim(int type )159 void MD2Model::setAnim(int type, int animPlayback) 160 160 { 161 161 if( (type < 0) || (type > MAX_ANIMATIONS) ) … … 174 174 this->animationState.type = type; 175 175 this->animationState.numPlays = 0; 176 this->animationState.animPlaybackMode = animPlayback; 176 177 177 178 this->animationState.interpolationState = 0.0f; … … 315 316 } 316 317 317 if( this->animationState.currentFrame > (this->data->numFrames - 1) )318 if( this->animationState.currentFrame > (this->data->numFrames - 1) && this->animationState.animPlaybackMode == MD2_ANIM_LOOP) 318 319 this->animationState.currentFrame = 0; 319 320 if( this->animationState.nextFrame > (this->data->numFrames - 1) ) -
trunk/src/lib/graphics/importer/md2Model.h
r7059 r7071 136 136 int nextFrame; //!< the next frame in the list 137 137 int numPlays; //!< the number of times, this has been played in series 138 139 int animPlaybackMode; //!< the playback mode 138 140 } sAnimState; 139 141 … … 168 170 169 171 172 typedef enum animPlayback 173 { 174 MD2_ANIM_LOOP = 0, 175 MD2_ANIM_ONCE, 176 177 MD2_ANIM_NUM 178 }; 179 180 170 181 171 182 /* forward definitions */ … … 219 230 220 231 221 void setAnim(int type );232 void setAnim(int type, int animPlayback = MD2_ANIM_LOOP); 222 233 /** returns the current animation @returns animation type */ 223 234 inline int MD2Model::getAnim() { return this->animationState.type; } -
trunk/src/lib/network/network_game_manager.cc
r6994 r7071 558 558 { 559 559 560 ss->loadModel("models/ships/reap_ #.obj");560 ss->loadModel("models/ships/reap_0.obj"); 561 561 ss->toList(OM_GROUP_00); 562 562 } -
trunk/src/story_entities/multi_player_world_data.cc
r7014 r7071 141 141 element = element->FirstChildElement(); 142 142 143 while( element != NULL)144 { 145 if( NetworkManager::getInstance()->isGameServer())143 if( NetworkManager::getInstance()->isGameServer() ) 144 { 145 while( element != NULL) 146 146 { 147 147 /* pass the entity to the NetworkGameManager to be created */ … … 159 159 CDEngine::getInstance()->setTerrain(terrain); 160 160 } 161 162 element = element->NextSiblingElement(); 163 164 165 glmis->step(); 166 PRINTF(4)("Done loading NetworkWorldEntities\n"); 161 167 } 162 element = element->NextSiblingElement(); 163 164 165 glmis->step(); 166 PRINTF(4)("Done loading NetworkWorldEntities\n"); 167 } 168 } 169 else 170 { 171 while( element != NULL) 172 { 173 PRINTF(0)("load: %s\n", element->Value()); 174 if( !strcmp(element->Value(), "Terrain") || !strcmp(element->Value(), "Building") ) 175 { 176 177 /* pass the entity to the NetworkGameManager to be created */ 178 BaseObject* created = Factory::fabricate(element); 179 180 if( created != NULL ) 181 PRINTF(1)("Created a %s: %s (0x%8x) from %s\n", created->getClassName(), created->getName(), created->getLeafClassID(), element->Value()); 182 else 183 PRINTF(1)("NetworkWorld: could not create this entity\n"); 184 185 if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) 186 this->sky = dynamic_cast<WorldEntity*>(created); 187 if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) 188 { 189 this->terrain = dynamic_cast<Terrain*>(created); 190 CDEngine::getInstance()->setTerrain(terrain); 191 } 192 193 glmis->step(); 194 PRINTF(4)("Done loading NetworkWorldEntities\n"); 195 } 196 element = element->NextSiblingElement(); 197 } 198 } 199 168 200 169 201 if( NetworkManager::getInstance()->isGameServer()) … … 180 212 playable = dynamic_cast<Playable*>(playableList->front()); 181 213 this->localPlayer->setPlayable(playable); 214 playable->toList(OM_GROUP_00); 182 215 } 183 216 } -
trunk/src/world_entities/creatures/md2_creature.cc
r7069 r7071 226 226 { 227 227 PRINTF(0)("Collided with the md2 model\n"); 228 //entity->die();229 228 } 230 229 -
trunk/src/world_entities/test_entity.cc
r6512 r7071 76 76 77 77 78 void TestEntity::setAnim(int animationIndex )78 void TestEntity::setAnim(int animationIndex, int animPlaybackMode) 79 79 { 80 80 if( likely(this->getModel(0) != NULL)) 81 ((MD2Model*)this->getModel(0))->setAnim(animationIndex );81 ((MD2Model*)this->getModel(0))->setAnim(animationIndex, animPlaybackMode); 82 82 } 83 83 … … 92 92 93 93 void TestEntity::collidesWith(WorldEntity* entity, const Vector& location) 94 {} 94 { 95 if( this->lastCollided != entity) 96 { 97 this->dieHard(); 98 this->lastCollided = entity; 99 } 100 } 95 101 96 102 103 104 void TestEntity::dieHard() 105 { 106 this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE); 107 } 108 -
trunk/src/world_entities/test_entity.h
r7069 r7071 11 11 class Material; 12 12 class TiXmlElement; 13 class WorldEntity; 13 14 14 15 class TestEntity : public WorldEntity, public PhysicsInterface … … 24 25 virtual void loadParams(const TiXmlElement* root); 25 26 26 void setAnim(int animationIndex );27 void setAnim(int animationIndex, int animPlaybackMode); 27 28 28 29 void dieHard(); … … 37 38 Material* material; 38 39 40 WorldEntity* lastCollided; 41 39 42 }; 40 43
Note: See TracChangeset
for help on using the changeset viewer.