Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7230 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Mar 21, 2006, 3:20:36 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the std::branche back

Location:
trunk/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/skybox.cc

    r7221 r7230  
    300300    textureName = "";
    301301  }
    302   char* texName;
    303   SYNCHELP_READ_STRINGM( texName, NWT_SB_TEXTURENAME );
     302  std::string texName;
     303  SYNCHELP_READ_STRING( texName, NWT_SB_TEXTURENAME );
    304304
    305305  this->setSize( size );
     
    330330
    331331    SYNCHELP_WRITE_FLOAT(this->size, NWT_SB_SIZE);
    332     SYNCHELP_WRITE_STRING(this->textureName.c_str(), NWT_SB_TEXTURENAME);
     332    SYNCHELP_WRITE_STRING(this->textureName, NWT_SB_TEXTURENAME);
    333333
    334334    return SYNCHELP_WRITE_N;
  • trunk/src/world_entities/world_entity.cc

    r7221 r7230  
    519519int WorldEntity::writeState( const byte * data, int length, int sender )
    520520{
    521   char* modelFileName;
     521  std::string modelFileName;
    522522  SYNCHELP_READ_BEGIN();
    523523
    524524  SYNCHELP_READ_FKT( PNode::writeState, NWT_WE_PN_WRITESTATE );
    525525
    526   SYNCHELP_READ_STRINGM( modelFileName, NWT_WE_PN_MODELFILENAME );
     526  SYNCHELP_READ_STRING( modelFileName, NWT_WE_PN_MODELFILENAME );
    527527  SYNCHELP_READ_FLOAT( scaling, NWT_WE_PN_SCALING );
    528528  //check if modelFileName is relative to datadir or absolute
    529529
    530530
    531   PRINTF(0)("================ LOADING MODEL %s, %f\n", modelFileName, scaling);
    532 
    533   if ( strcmp(modelFileName, "") )
     531  PRINTF(0)("================ LOADING MODEL %s, %f\n", modelFileName.c_str(), scaling);
     532
     533  if ( modelFileName != "" )
    534534  {
    535535    loadModel( modelFileName, scaling);
    536536    PRINTF(0)("modelfilename: %s\n", getModel( 0 )->getName());
    537537  }
    538   delete[] modelFileName;
    539538
    540539  /*SYNCHELP_READ_STRINGM( modelFileName );
     
    568567  SYNCHELP_WRITE_FKT( PNode::readState, NWT_WE_PN_WRITESTATE );
    569568
    570   if ( getModel(0) && getModel(0)->getName() )
    571   {
    572     char* name = (char*)(getModel( 0 )->getName());
    573 
    574     if (  ResourceManager::getInstance()->getDataDir() == name ) /// FIXME (do not know what to do here.)
    575     {
    576       name += ResourceManager::getInstance()->getDataDir().size();
     569  if ( getModel(0) && getModel(0)->getName() != "" )
     570  {
     571    std::string name = getModel( 0 )->getName();
     572
     573    if (  name.find( ResourceManager::getInstance()->getDataDir() ) == 0 )
     574    {
     575      name.erase(ResourceManager::getInstance()->getDataDir().size());
    577576    }
    578577
Note: See TracChangeset for help on using the changeset viewer.