Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 12, 2006, 8:54:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/std:: compile and run again, with many more std::strings….

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/graphics/render2D/element_2d.cc

    r7199 r7216  
    180180 * @param alignment the alignment @see loadParams
    181181*/
    182 void Element2D::setAlignment(const char* alignment)
    183 {
    184   if (!strcmp(alignment, "center"))
     182void Element2D::setAlignment(const std::string& alignment)
     183{
     184  if (alignment == "center")
    185185    this->setAlignment(E2D_ALIGN_CENTER);
    186   else if (!strcmp(alignment, "left"))
     186  else if (alignment == "left")
    187187    this->setAlignment(E2D_ALIGN_LEFT);
    188   else if (!strcmp(alignment, "right"))
     188  else if (alignment == "right")
    189189    this->setAlignment(E2D_ALIGN_RIGHT);
    190   else if (!strcmp(alignment, "screen-center"))
     190  else if (alignment == "screen-center")
    191191    this->setAlignment(E2D_ALIGN_SCREEN_CENTER);
    192192}
     
    213213/**
    214214 * sets the layer onto which this 2D-element is projected to.
    215  * @param layer the layer @see loadParams @see Element2D::charToLayer2D(const char* layer)
    216  */
    217 void Element2D::setLayer(const char* layer)
     215 * @param layer the layer @see loadParams @see Element2D::charToLayer2D(const std::string& layer)
     216 */
     217void Element2D::setLayer(const std::string& layer)
    218218{
    219219  this->setLayer(Element2D::charToLayer2D(layer));
     
    235235 * @param bindNode the name of the Node (should be existing)
    236236 */
    237 void Element2D::setBindNode(const char* bindNode)
     237void Element2D::setBindNode(const std::string& bindNode)
    238238{
    239239  const PNode* tmpBindNode = dynamic_cast<const PNode*>(ClassList::getObject(bindNode, CL_PARENT_NODE));
     
    572572 * @param childName the name of the child to add to this PNode
    573573 */
    574 void Element2D::addChild2D (const char* childName)
     574void Element2D::addChild2D (const std::string& childName)
    575575{
    576576  Element2D* childNode = dynamic_cast<Element2D*>(ClassList::getObject(childName, CL_ELEMENT_2D));
     
    651651 * @param parentName the name of the Parent to set to this Element2D
    652652 */
    653 void Element2D::setParent2D (const char* parentName)
     653void Element2D::setParent2D (const std::string& parentName)
    654654{
    655655  Element2D* parentNode = dynamic_cast<Element2D*>(ClassList::getObject(parentName, CL_ELEMENT_2D));
     
    658658  else
    659659    PRINTF(2)("Not Found Element2D's (%s::%s) new Parent by Name: %s\n",
    660                 this->getClassName(), this->getName(), parentName);
     660                this->getClassName(), this->getName(), parentName.c_str());
    661661}
    662662
     
    704704 * @param bias the speed to iterate to this new Positions
    705705 */
    706 void Element2D::setParentSoft2D(const char* parentName, float bias)
     706void Element2D::setParentSoft2D(const std::string& parentName, float bias)
    707707{
    708708  Element2D* parentNode = dynamic_cast<Element2D*>(ClassList::getObject(parentName, CL_ELEMENT_2D));
     
    724724 * @param parentMode a String representing this parentingMode
    725725 */
    726 void Element2D::setParentMode2D (const char* parentingMode)
     726void Element2D::setParentMode2D (const std::string& parentingMode)
    727727{
    728728  this->setParentMode2D(Element2D::charToParentingMode2D(parentingMode));
     
    10931093 * @return the int corresponding to the named parentingMode
    10941094 */
    1095 E2D_PARENT_MODE Element2D::charToParentingMode2D(const char* parentingMode)
    1096 {
    1097   if (!strcmp(parentingMode, "local-rotate"))
     1095E2D_PARENT_MODE Element2D::charToParentingMode2D(const std::string& parentingMode)
     1096{
     1097  if (parentingMode == "local-rotate")
    10981098    return (E2D_PARENT_LOCAL_ROTATE);
    1099   else  if (!strcmp(parentingMode, "rotate-movement"))
     1099  else  if (parentingMode == "rotate-movement")
    11001100    return (E2D_PARENT_ROTATE_MOVEMENT);
    1101   else  if (!strcmp(parentingMode, "movement"))
     1101  else  if (parentingMode == "movement")
    11021102    return (E2D_PARENT_MOVEMENT);
    1103   else  if (!strcmp(parentingMode, "all"))
     1103  else  if (parentingMode == "all")
    11041104    return (E2D_PARENT_ALL);
    1105   else  if (!strcmp(parentingMode, "rotate-and-move"))
     1105  else  if (parentingMode == "rotate-and-move")
    11061106    return (E2D_PARENT_ROTATE_AND_MOVE);
    11071107}
     
    11391139 * @returns the E2D_LAYER on success, E2D_DEFAULT_LAYER on error.
    11401140 */
    1141 E2D_LAYER Element2D::charToLayer2D(const char* layer)
    1142 {
    1143   if (!strcmp(layer, "top"))
     1141E2D_LAYER Element2D::charToLayer2D(const std::string& layer)
     1142{
     1143  if (layer =="top")
    11441144    return (E2D_LAYER_TOP);
    1145   else  if (!strcmp(layer, "medium"))
     1145  else  if (layer == "medium")
    11461146    return (E2D_LAYER_MEDIUM);
    1147   else  if (!strcmp(layer, "bottom"))
     1147  else  if (layer == "bottom")
    11481148    return (E2D_LAYER_BOTTOM);
    1149   else  if (!strcmp(layer, "below-all"))
     1149  else  if (layer == "below-all")
    11501150    return (E2D_LAYER_BELOW_ALL);
    11511151  else
Note: See TracChangeset for help on using the changeset viewer.