- Timestamp:
- 06/21/11 04:56:49 (14 years ago)
- Location:
- ps/trunk/source/tools/atlas
- Files:
-
- 3 edited
-
AtlasObject/AtlasObject.h (modified) (1 diff)
-
AtlasObject/AtlasObjectImpl.cpp (modified) (1 diff)
-
AtlasUI/ScenarioEditor/Sections/Player/Player.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/tools/atlas/AtlasObject/AtlasObject.h
r9639 r9643 140 140 double getDouble() const; 141 141 142 // Return the integer value of this object 143 int getInt() const; 144 142 145 // Check whether the object contains anything (even if those things are empty) 143 146 bool defined() const { return (bool)p; } -
ps/trunk/source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp
r9639 r9643 141 141 } 142 142 143 int AtObj::getInt() const 144 { 145 int val = 0; 146 if (p) 147 { 148 std::wstringstream s; 149 s << p->value; 150 s >> val; 151 } 152 return val; 153 } 154 143 155 void AtObj::add(const char* key, AtObj& data) 144 156 { -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp
r9639 r9643 553 553 if (clrObj.defined()) 554 554 { 555 colour = wxColor( wxAtoi(*clrObj["r"]), wxAtoi(*clrObj["g"]), wxAtoi(*clrObj["b"]));555 colour = wxColor((*clrObj["r"]).getInt(), (*clrObj["g"]).getInt(), (*clrObj["b"]).getInt()); 556 556 } 557 557 else 558 558 { 559 559 clrObj = *playerDefs["Colour"]; 560 colour = wxColor( wxAtoi(*clrObj["r"]), wxAtoi(*clrObj["g"]), wxAtoi(*clrObj["b"]));560 colour = wxColor((*clrObj["r"]).getInt(), (*clrObj["g"]).getInt(), (*clrObj["b"]).getInt()); 561 561 } 562 562 controls.colour->SetBackgroundColour(colour); … … 617 617 // team 618 618 if (player["Team"].defined()) 619 controls.team->SetSelection( wxAtoi(*player["Team"]));619 controls.team->SetSelection((*player["Team"]).getInt()); 620 620 else 621 621 controls.team->SetSelection(0); … … 625 625 { 626 626 sCameraInfo info; 627 // Don't use wxAtof because it depends on locales which 628 // may cause problems with decimal points 629 // see: http://www.wxwidgets.org/docs/faqgtk.htm#locale 627 630 AtObj camPos = *player["StartingCamera"]["Position"]; 628 631 info.pX = (float)(*camPos["x"]).getDouble();
Note:
See TracChangeset
for help on using the changeset viewer.
