forked from mirrors/0ad
dehydra-inspired fix: get rid of all using namespace std (potentially confusing / pollutes namespace).
Long iterator type names are better expressed via typedefs, anyway :) (or 'auto' keyword of upcoming C++09) This was SVN commit r6226.
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include "ps/CLogger.h"
|
||||
#define LOG_CATEGORY "graphics"
|
||||
|
||||
using namespace std;
|
||||
|
||||
CTerrainProperties::CTerrainProperties(CTerrainPropertiesPtr parent):
|
||||
m_pParent(parent),
|
||||
@@ -246,7 +245,7 @@ u32 CTerrainProperties::GetBaseColor()
|
||||
|
||||
const STerrainPassability &CTerrainProperties::GetPassability(HEntity entity)
|
||||
{
|
||||
vector<STerrainPassability>::iterator it=m_Passabilities.begin();
|
||||
std::vector<STerrainPassability>::iterator it=m_Passabilities.begin();
|
||||
for (;it != m_Passabilities.end();++it)
|
||||
{
|
||||
if (entity->m_classes.IsMember(it->m_Type))
|
||||
|
||||
@@ -8,7 +8,6 @@ CButton
|
||||
|
||||
#include "lib/ogl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
|
||||
@@ -9,7 +9,6 @@ CCheckBox
|
||||
#include "ps/Font.h"
|
||||
#include "ps/CLogger.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
|
||||
@@ -9,7 +9,6 @@ CDropDown
|
||||
#include "lib/ogl.h"
|
||||
#include "lib/external_libraries/sdl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
@@ -352,7 +351,7 @@ float CDropDown::GetBufferedZ() const
|
||||
{
|
||||
float bz = CList::GetBufferedZ();
|
||||
if (m_Open)
|
||||
return min(bz + 500.f, 1000.f); // TODO - don't use magic number for max z value
|
||||
return std::min(bz + 500.f, 1000.f); // TODO - don't use magic number for max z value
|
||||
else
|
||||
return bz;
|
||||
}
|
||||
|
||||
+7
-9
@@ -42,8 +42,6 @@ CGUI
|
||||
#include "ps/Globals.h"
|
||||
#include "ps/Filesystem.h"
|
||||
|
||||
// namespaces used
|
||||
using namespace std;
|
||||
const double SELECT_DBLCLICK_RATE = 0.5;
|
||||
#include "ps/CLogger.h"
|
||||
#define LOG_CATEGORY "gui"
|
||||
@@ -669,7 +667,7 @@ SGUIText CGUI::GenerateText(const CGUIString &string,
|
||||
// (it doesn't count the line spacing)
|
||||
|
||||
// Images on the left or the right side.
|
||||
vector<SGenerateTextImage> Images[2];
|
||||
std::vector<SGenerateTextImage> Images[2];
|
||||
int pos_last_img=-1; // Position in the string where last img (either left or right) were encountered.
|
||||
// in order to avoid duplicate processing.
|
||||
|
||||
@@ -702,7 +700,7 @@ SGUIText CGUI::GenerateText(const CGUIString &string,
|
||||
// Loop left/right
|
||||
for (int j=0; j<2; ++j)
|
||||
{
|
||||
for (vector<CStr>::const_iterator it = Feedback.m_Images[j].begin();
|
||||
for (std::vector<CStr>::const_iterator it = Feedback.m_Images[j].begin();
|
||||
it != Feedback.m_Images[j].end();
|
||||
++it)
|
||||
{
|
||||
@@ -763,7 +761,7 @@ SGUIText CGUI::GenerateText(const CGUIString &string,
|
||||
// Loop through left and right side, from and to.
|
||||
for (int j=0; j<2; ++j)
|
||||
{
|
||||
for (vector<SGenerateTextImage>::const_iterator it = Images[j].begin();
|
||||
for (std::vector<SGenerateTextImage>::const_iterator it = Images[j].begin();
|
||||
it != Images[j].end();
|
||||
++it)
|
||||
{
|
||||
@@ -845,7 +843,7 @@ SGUIText CGUI::GenerateText(const CGUIString &string,
|
||||
// x, that is what x_pointer is for.
|
||||
float x_pointer=0.f;
|
||||
|
||||
vector<SGUIText::STextCall>::iterator it;
|
||||
std::vector<SGUIText::STextCall>::iterator it;
|
||||
for (it = Feedback2.m_TextCalls.begin(); it != Feedback2.m_TextCalls.end(); ++it)
|
||||
{
|
||||
it->m_Pos = CPos(x + x_pointer, y);
|
||||
@@ -954,7 +952,7 @@ void CGUI::DrawText(SGUIText &Text, const CColor &DefaultColor,
|
||||
CFont* font = NULL;
|
||||
CStr LastFontName;
|
||||
|
||||
for (vector<SGUIText::STextCall>::const_iterator it = Text.m_TextCalls.begin();
|
||||
for (std::vector<SGUIText::STextCall>::const_iterator it = Text.m_TextCalls.begin();
|
||||
it != Text.m_TextCalls.end();
|
||||
++it)
|
||||
{
|
||||
@@ -987,7 +985,7 @@ void CGUI::DrawText(SGUIText &Text, const CColor &DefaultColor,
|
||||
if (font)
|
||||
delete font;
|
||||
|
||||
for (list<SGUIText::SSpriteCall>::iterator it=Text.m_SpriteCalls.begin();
|
||||
for (std::list<SGUIText::SSpriteCall>::iterator it=Text.m_SpriteCalls.begin();
|
||||
it!=Text.m_SpriteCalls.end();
|
||||
++it)
|
||||
{
|
||||
@@ -1043,7 +1041,7 @@ void CGUI::ReportParseError(const char *str, ...)
|
||||
/**
|
||||
* @callgraph
|
||||
*/
|
||||
void CGUI::LoadXmlFile(const string &Filename)
|
||||
void CGUI::LoadXmlFile(const std::string &Filename)
|
||||
{
|
||||
// Reset parse error
|
||||
// we can later check if this has increased
|
||||
|
||||
@@ -8,7 +8,6 @@ IGUIScrollBar
|
||||
#include "ps/CLogger.h"
|
||||
#define LOG_CATEGORY "gui"
|
||||
|
||||
using namespace std;
|
||||
|
||||
CGUIScrollBarVertical::CGUIScrollBarVertical()
|
||||
{
|
||||
@@ -149,7 +148,7 @@ CRect CGUIScrollBarVertical::GetBarRect() const
|
||||
}
|
||||
|
||||
// Setup rectangle
|
||||
ret.top = (from + (to-from)*(m_Pos/(max(1.f, m_ScrollRange - m_ScrollSpace))));
|
||||
ret.top = (from + (to-from)*(m_Pos/(std::max(1.f, m_ScrollRange - m_ScrollSpace))));
|
||||
ret.bottom = ret.top+size;
|
||||
ret.right = m_X + ((m_RightAligned)?(0.f):(GetStyle()->m_Width));
|
||||
ret.left = ret.right - GetStyle()->m_Width;
|
||||
|
||||
@@ -8,7 +8,6 @@ CImage
|
||||
|
||||
#include "lib/ogl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
|
||||
+20
-21
@@ -18,7 +18,6 @@ CInput
|
||||
|
||||
#define LOG_CATEGORY "gui"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
@@ -304,7 +303,7 @@ InReaction CInput::ManuallyHandleEvent(const SDL_Event_* ev)
|
||||
m_iBufferPos_Tail = m_iBufferPos;
|
||||
}
|
||||
|
||||
list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
std::list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
while (current != m_CharacterPositions.end())
|
||||
{
|
||||
if (m_iBufferPos >= current->m_ListStart &&
|
||||
@@ -352,7 +351,7 @@ InReaction CInput::ManuallyHandleEvent(const SDL_Event_* ev)
|
||||
m_iBufferPos_Tail = m_iBufferPos;
|
||||
}
|
||||
|
||||
list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
std::list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
while (current != m_CharacterPositions.end())
|
||||
{
|
||||
if (m_iBufferPos >= current->m_ListStart &&
|
||||
@@ -780,7 +779,7 @@ void CInput::Draw()
|
||||
|
||||
|
||||
bool done = false;
|
||||
for (list<SRow>::const_iterator it = m_CharacterPositions.begin();
|
||||
for (std::list<SRow>::const_iterator it = m_CharacterPositions.begin();
|
||||
it != m_CharacterPositions.end();
|
||||
++it, buffered_y += ls, x_pointer = 0.f)
|
||||
{
|
||||
@@ -902,7 +901,7 @@ void CInput::Draw()
|
||||
|
||||
bool using_selected_color = false;
|
||||
|
||||
for (list<SRow>::const_iterator it = m_CharacterPositions.begin();
|
||||
for (std::list<SRow>::const_iterator it = m_CharacterPositions.begin();
|
||||
it != m_CharacterPositions.end();
|
||||
++it, buffered_y += ls)
|
||||
{
|
||||
@@ -1032,7 +1031,7 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
|
||||
CFont font(font_name);
|
||||
|
||||
list<SRow>::iterator current_line;
|
||||
std::list<SRow>::iterator current_line;
|
||||
|
||||
// used to replace the last updated copy, because it might contain a "space"
|
||||
// in the end, which shouldn't be there because of word-wrapping. the only
|
||||
@@ -1055,10 +1054,10 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
{
|
||||
debug_assert(to_before != -1);
|
||||
|
||||
list<SRow>::iterator destroy_row_from, destroy_row_to;
|
||||
std::list<SRow>::iterator destroy_row_from, destroy_row_to;
|
||||
// Used to check if the above has been set to anything,
|
||||
// previously a comparison like:
|
||||
// destroy_row_from == list<SRow>::iterator()
|
||||
// destroy_row_from == std::list<SRow>::iterator()
|
||||
// ... was used, but it didn't work with GCC.
|
||||
bool destroy_row_from_used=false, destroy_row_to_used=false;
|
||||
|
||||
@@ -1067,7 +1066,7 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
// to be redone. And when going along, we'll delete a row at a time
|
||||
// when continuing to see how much more after 'to' we need to remake.
|
||||
int i=0;
|
||||
for (list<SRow>::iterator it=m_CharacterPositions.begin();
|
||||
for (std::list<SRow>::iterator it=m_CharacterPositions.begin();
|
||||
it!=m_CharacterPositions.end(); ++it, ++i)
|
||||
{
|
||||
if (destroy_row_from_used == false &&
|
||||
@@ -1153,7 +1152,7 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
// in the coming erase.
|
||||
current_line = destroy_row_to;
|
||||
|
||||
list<SRow>::iterator temp_it = destroy_row_to;
|
||||
std::list<SRow>::iterator temp_it = destroy_row_to;
|
||||
--temp_it;
|
||||
|
||||
CStr c_caption1(caption.substr(destroy_row_from->m_ListStart, (temp_it->m_ListStart + temp_it->m_ListOfX.size()) -destroy_row_from->m_ListStart));
|
||||
@@ -1167,7 +1166,7 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
int delta = to_after - to_before;
|
||||
if (delta != 0)
|
||||
{
|
||||
for (list<SRow>::iterator it=current_line;
|
||||
for (std::list<SRow>::iterator it=current_line;
|
||||
it!=m_CharacterPositions.end();
|
||||
++it)
|
||||
{
|
||||
@@ -1266,10 +1265,10 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
// check all rows and see if any existing
|
||||
if (row.m_ListStart != check_point_row_start)
|
||||
{
|
||||
list<SRow>::iterator destroy_row_from, destroy_row_to;
|
||||
std::list<SRow>::iterator destroy_row_from, destroy_row_to;
|
||||
// Are used to check if the above has been set to anything,
|
||||
// previously a comparison like:
|
||||
// destroy_row_from == list<SRow>::iterator()
|
||||
// destroy_row_from == std::list<SRow>::iterator()
|
||||
// was used, but it didn't work with GCC.
|
||||
bool destroy_row_from_used=false, destroy_row_to_used=false;
|
||||
|
||||
@@ -1278,7 +1277,7 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
// to be redone. And when going along, we'll delete a row at a time
|
||||
// when continuing to see how much more after 'to' we need to remake.
|
||||
int i=0;
|
||||
for (list<SRow>::iterator it=m_CharacterPositions.begin();
|
||||
for (std::list<SRow>::iterator it=m_CharacterPositions.begin();
|
||||
it!=m_CharacterPositions.end(); ++it, ++i)
|
||||
{
|
||||
if (destroy_row_from_used == false &&
|
||||
@@ -1357,7 +1356,7 @@ void CInput::UpdateText(int from, int to_before, int to_after)
|
||||
|
||||
copy_used = true;
|
||||
|
||||
list<SRow>::iterator temp = destroy_row_to;
|
||||
std::list<SRow>::iterator temp = destroy_row_to;
|
||||
|
||||
--temp;
|
||||
|
||||
@@ -1406,7 +1405,7 @@ int CInput::GetMouseHoveringTextPosition()
|
||||
GUI<float>::GetSetting(this, "buffer_zone", buffer_zone);
|
||||
GUI<bool>::GetSetting(this, "multiline", multiline);
|
||||
|
||||
list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
std::list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
|
||||
CPos mouse = GetMousePos();
|
||||
|
||||
@@ -1448,7 +1447,7 @@ int CInput::GetMouseHoveringTextPosition()
|
||||
if (row > (int)m_CharacterPositions.size()-1)
|
||||
row = (int)m_CharacterPositions.size()-1;
|
||||
|
||||
// TODO Gee (2004-11-21): Okay, I need a 'list' for some reasons, but I would really like to
|
||||
// TODO Gee (2004-11-21): Okay, I need a 'std::list' for some reasons, but I would really like to
|
||||
// be able to get the specific element here. This is hopefully a temporary hack.
|
||||
|
||||
for (int i=0; i<row; ++i)
|
||||
@@ -1474,14 +1473,14 @@ int CInput::GetMouseHoveringTextPosition()
|
||||
}
|
||||
|
||||
// Does not process horizontal scrolling, 'x' must be modified before inputted.
|
||||
int CInput::GetXTextPosition(const list<SRow>::iterator ¤t, const float &x, float &wanted)
|
||||
int CInput::GetXTextPosition(const std::list<SRow>::iterator ¤t, const float &x, float &wanted)
|
||||
{
|
||||
int Ret=0;
|
||||
|
||||
float previous=0.f;
|
||||
int i=0;
|
||||
|
||||
for (vector<float>::iterator it=current->m_ListOfX.begin();
|
||||
for (std::vector<float>::iterator it=current->m_ListOfX.begin();
|
||||
it!=current->m_ListOfX.end();
|
||||
++it, ++i)
|
||||
{
|
||||
@@ -1581,10 +1580,10 @@ void CInput::UpdateAutoScroll()
|
||||
float spacing = (float)font.GetLineSpacing();
|
||||
//float height = font.GetHeight();
|
||||
|
||||
// TODO Gee (2004-11-21): Okay, I need a 'list' for some reasons, but I would really like to
|
||||
// TODO Gee (2004-11-21): Okay, I need a 'std::list' for some reasons, but I would really like to
|
||||
// be able to get the specific element here. This is hopefully a temporary hack.
|
||||
|
||||
list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
std::list<SRow>::iterator current = m_CharacterPositions.begin();
|
||||
int row=0;
|
||||
while (current != m_CharacterPositions.end())
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@ CList
|
||||
#include "ps/CLogger.h"
|
||||
#include "lib/external_libraries/sdl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
@@ -67,7 +66,7 @@ void CList::SetupText()
|
||||
// Delete all generated texts. Some could probably be saved,
|
||||
// but this is easier, and this function will never be called
|
||||
// continuously, or even often, so it'll probably be okay.
|
||||
vector<SGUIText*>::iterator it;
|
||||
std::vector<SGUIText*>::iterator it;
|
||||
for (it=m_GeneratedTexts.begin(); it!=m_GeneratedTexts.end(); ++it)
|
||||
{
|
||||
if (*it)
|
||||
|
||||
@@ -8,7 +8,6 @@ CProgressBar
|
||||
|
||||
#include "lib/ogl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
|
||||
@@ -6,7 +6,6 @@ CCheckBox
|
||||
#include "GUI.h"
|
||||
#include "CRadioButton.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void CRadioButton::HandleMessage(const SGUIMessage &Message)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ CText
|
||||
|
||||
#include "lib/ogl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
|
||||
+17
-18
@@ -13,7 +13,6 @@ GUI text
|
||||
|
||||
#include "ps/Font.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
static const wchar_t TagStart = '[';
|
||||
static const wchar_t TagEnd = ']';
|
||||
@@ -40,7 +39,7 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
|
||||
// Check out which text chunk this is within.
|
||||
//bool match_found = false;
|
||||
vector<TextChunk>::const_iterator itTextChunk;
|
||||
std::vector<TextChunk>::const_iterator itTextChunk;
|
||||
for (itTextChunk=m_TextChunks.begin(); itTextChunk!=m_TextChunks.end(); ++itTextChunk)
|
||||
{
|
||||
// - GL - Temp
|
||||
@@ -50,8 +49,8 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
// Get the area that is overlapped by both the TextChunk and
|
||||
// by the from/to inputted.
|
||||
int _from, _to;
|
||||
_from = max(from, itTextChunk->m_From);
|
||||
_to = min(to, itTextChunk->m_To);
|
||||
_from = std::max(from, itTextChunk->m_From);
|
||||
_to = std::min(to, itTextChunk->m_To);
|
||||
|
||||
// If from is larger than to, than they are not overlapping
|
||||
if (_to == _from && itTextChunk->m_From == itTextChunk->m_To)
|
||||
@@ -74,7 +73,7 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
GetRawString()[to-1] == '\n')
|
||||
continue;
|
||||
}
|
||||
// This string is just a break
|
||||
// This std::string is just a break
|
||||
if (_from == from && from >= 1)
|
||||
{
|
||||
if (GetRawString()[from] == '\n' &&
|
||||
@@ -132,7 +131,7 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
|
||||
// append width, and make maximum height the height.
|
||||
Feedback.m_Size.cx += size.cx;
|
||||
Feedback.m_Size.cy = max(Feedback.m_Size.cy, size.cy);
|
||||
Feedback.m_Size.cy = std::max(Feedback.m_Size.cy, size.cy);
|
||||
|
||||
// These are also needed later
|
||||
TextCall.m_Size = size;
|
||||
@@ -140,7 +139,7 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
|
||||
// Now displace the sprite if the additional value in the tag
|
||||
// exists
|
||||
if (itTextChunk->m_Tags[0].m_TagAdditionalValue != string())
|
||||
if (itTextChunk->m_Tags[0].m_TagAdditionalValue != std::string())
|
||||
{
|
||||
CSize displacement;
|
||||
// Parse the value
|
||||
@@ -177,11 +176,11 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
TextCall.m_Font = DefaultFont;
|
||||
TextCall.m_UseCustomColor = false;
|
||||
|
||||
// Extract substring from RawString.
|
||||
// Extract substd::string from RawString.
|
||||
TextCall.m_String = GetRawString().substr(_from, _to-_from);
|
||||
|
||||
// Go through tags and apply changes.
|
||||
vector<CGUIString::TextChunk::Tag>::const_iterator it2;
|
||||
std::vector<CGUIString::TextChunk::Tag>::const_iterator it2;
|
||||
for (it2 = itTextChunk->m_Tags.begin(); it2 != itTextChunk->m_Tags.end(); ++it2)
|
||||
{
|
||||
if (it2->m_TagType == CGUIString::TextChunk::Tag::TAG_COLOR)
|
||||
@@ -189,7 +188,7 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
// Set custom color
|
||||
TextCall.m_UseCustomColor = true;
|
||||
|
||||
// Try parsing the color string
|
||||
// Try parsing the color std::string
|
||||
if (!GUI<CColor>::ParseString(it2->m_TagValue, TextCall.m_Color))
|
||||
{
|
||||
if (pObject)
|
||||
@@ -219,7 +218,7 @@ void CGUIString::GenerateTextCall(SFeedback &Feedback,
|
||||
|
||||
// Append width, and make maximum height the height.
|
||||
Feedback.m_Size.cx += size.cx;
|
||||
Feedback.m_Size.cy = max(Feedback.m_Size.cy, size.cy);
|
||||
Feedback.m_Size.cy = std::max(Feedback.m_Size.cy, size.cy);
|
||||
|
||||
// These are also needed later
|
||||
TextCall.m_Size = size;
|
||||
@@ -304,8 +303,8 @@ void CGUIString::SetValue(const CStrW& str)
|
||||
Parser.InputTaskType("end", "/$ident");
|
||||
|
||||
long position = 0;
|
||||
long from=0; // the position in the raw string where the last tag ended
|
||||
long from_nonraw=0; // like from only in position of the REAL string, with tags.
|
||||
long from=0; // the position in the raw std::string where the last tag ended
|
||||
long from_nonraw=0; // like from only in position of the REAL std::string, with tags.
|
||||
long curpos = 0;
|
||||
|
||||
// Current Text Chunk
|
||||
@@ -378,14 +377,14 @@ void CGUIString::SetValue(const CStrW& str)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check for possible value-strings
|
||||
// Check for possible value-std::strings
|
||||
if (Line.GetArgCount() >= 2)
|
||||
Line.GetArgString(1, tag.m_TagValue);
|
||||
|
||||
// Check if an additional parameter was specified
|
||||
if (Line.GetArgCount() == 4)
|
||||
{
|
||||
string str;
|
||||
std::string str;
|
||||
Line.GetArgString(2, str);
|
||||
|
||||
if (tag.m_TagType == TextChunk::Tag::TAG_ICON &&
|
||||
@@ -431,7 +430,7 @@ void CGUIString::SetValue(const CStrW& str)
|
||||
{
|
||||
// Add that tag, but first, erase previous occurences of the
|
||||
// same tag.
|
||||
vector<TextChunk::Tag>::iterator it;
|
||||
std::vector<TextChunk::Tag>::iterator it;
|
||||
for (it = CurrentTextChunk.m_Tags.begin(); it != CurrentTextChunk.m_Tags.end(); ++it)
|
||||
{
|
||||
if (it->m_TagType == tag.m_TagType)
|
||||
@@ -473,7 +472,7 @@ void CGUIString::SetValue(const CStrW& str)
|
||||
|
||||
// Search for the tag, if it's not added, then
|
||||
// pass it as plain text.
|
||||
vector<TextChunk::Tag>::iterator it;
|
||||
std::vector<TextChunk::Tag>::iterator it;
|
||||
for (it = CurrentTextChunk.m_Tags.begin(); it != CurrentTextChunk.m_Tags.end(); ++it)
|
||||
{
|
||||
if (it->m_TagType == tag.m_TagType)
|
||||
@@ -555,7 +554,7 @@ void CGUIString::SetValue(const CStrW& str)
|
||||
// Remove duplicates (only if larger than 2)
|
||||
if (m_Words.size() > 2)
|
||||
{
|
||||
vector<int>::iterator it;
|
||||
std::vector<int>::iterator it;
|
||||
int last_word = -1;
|
||||
for (it = m_Words.begin(); it != m_Words.end(); )
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@ GUI utilities
|
||||
|
||||
extern int g_yres;
|
||||
|
||||
using namespace std;
|
||||
|
||||
template <>
|
||||
bool __ParseString<bool>(const CStr& Value, bool &Output)
|
||||
@@ -45,7 +44,7 @@ bool __ParseString<CRect>(const CStr& Value, CRect &Output)
|
||||
// Use the parser to parse the values
|
||||
CParser& parser (CParserCache::Get("_$value_$value_$value_$value_"));
|
||||
|
||||
string str = Value;
|
||||
std::string str = Value;
|
||||
|
||||
CParserLine line;
|
||||
line.ParseString(parser, str);
|
||||
@@ -111,7 +110,7 @@ bool __ParseString<CSize>(const CStr& Value, CSize &Output)
|
||||
// Use the parser to parse the values
|
||||
CParser& parser (CParserCache::Get("_$value_$value_"));
|
||||
|
||||
string str = Value;
|
||||
std::string str = Value;
|
||||
|
||||
CParserLine line;
|
||||
line.ParseString(parser, str);
|
||||
|
||||
@@ -5,7 +5,6 @@ IGUIButtonBehavior
|
||||
#include "precompiled.h"
|
||||
#include "GUI.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
|
||||
@@ -5,17 +5,13 @@ IGUIObject
|
||||
#include "precompiled.h"
|
||||
#include "GUI.h"
|
||||
|
||||
///// janwas: again, including etiquette?
|
||||
#include "ps/Parser.h"
|
||||
|
||||
/////
|
||||
|
||||
#include "gui/scripting/JSInterface_IGUIObject.h"
|
||||
#include "gui/scripting/JSInterface_GUITypes.h"
|
||||
|
||||
extern int g_xres, g_yres;
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Implementation Macros
|
||||
@@ -56,7 +52,7 @@ IGUIObject::IGUIObject() :
|
||||
IGUIObject::~IGUIObject()
|
||||
{
|
||||
{
|
||||
map<CStr, SGUISetting>::iterator it;
|
||||
std::map<CStr, SGUISetting>::iterator it;
|
||||
for (it = m_Settings.begin(); it != m_Settings.end(); ++it)
|
||||
{
|
||||
switch (it->second.m_Type)
|
||||
@@ -453,7 +449,7 @@ void IGUIObject::SetScriptHandler(const CStr& Action, JSObject* Function)
|
||||
|
||||
void IGUIObject::ScriptEvent(const CStr& Action)
|
||||
{
|
||||
map<CStr, JSObject**>::iterator it = m_ScriptHandlers.find(Action);
|
||||
std::map<CStr, JSObject**>::iterator it = m_ScriptHandlers.find(Action);
|
||||
if (it == m_ScriptHandlers.end())
|
||||
return;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ IGUIScrollBar
|
||||
#include "precompiled.h"
|
||||
#include "GUI.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// IGUIScrollBar
|
||||
@@ -31,7 +30,7 @@ IGUIScrollBar::~IGUIScrollBar()
|
||||
|
||||
void IGUIScrollBar::SetupBarSize()
|
||||
{
|
||||
m_BarSize = min((float)m_ScrollSpace/(float)m_ScrollRange, 1.f);
|
||||
m_BarSize = std::min((float)m_ScrollSpace/(float)m_ScrollRange, 1.f);
|
||||
}
|
||||
|
||||
SGUIScrollBarStyle *IGUIScrollBar::GetStyle() const
|
||||
|
||||
@@ -5,7 +5,6 @@ IGUIScrollBarOwner
|
||||
#include "precompiled.h"
|
||||
#include "GUI.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
@@ -17,7 +16,7 @@ IGUIScrollBarOwner::IGUIScrollBarOwner()
|
||||
IGUIScrollBarOwner::~IGUIScrollBarOwner()
|
||||
{
|
||||
// Delete scroll-bars
|
||||
vector<IGUIScrollBar*>::iterator it;
|
||||
std::vector<IGUIScrollBar*>::iterator it;
|
||||
for (it=m_ScrollBars.begin(); it!=m_ScrollBars.end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
@@ -28,7 +27,7 @@ void IGUIScrollBarOwner::ResetStates()
|
||||
{
|
||||
IGUIObject::ResetStates();
|
||||
|
||||
vector<IGUIScrollBar*>::iterator it;
|
||||
std::vector<IGUIScrollBar*>::iterator it;
|
||||
for (it=m_ScrollBars.begin(); it!=m_ScrollBars.end(); ++it)
|
||||
{
|
||||
(*it)->SetBarPressed(false);
|
||||
@@ -61,7 +60,7 @@ SGUIScrollBarStyle * IGUIScrollBarOwner::GetScrollBarStyle(const CStr& style) co
|
||||
|
||||
void IGUIScrollBarOwner::HandleMessage(const SGUIMessage &Message)
|
||||
{
|
||||
vector<IGUIScrollBar*>::iterator it;
|
||||
std::vector<IGUIScrollBar*>::iterator it;
|
||||
for (it=m_ScrollBars.begin(); it!=m_ScrollBars.end(); ++it)
|
||||
{
|
||||
(*it)->HandleMessage(Message);
|
||||
@@ -70,7 +69,7 @@ void IGUIScrollBarOwner::HandleMessage(const SGUIMessage &Message)
|
||||
|
||||
void IGUIScrollBarOwner::Draw()
|
||||
{
|
||||
vector<IGUIScrollBar*>::iterator it;
|
||||
std::vector<IGUIScrollBar*>::iterator it;
|
||||
for (it=m_ScrollBars.begin(); it!=m_ScrollBars.end(); ++it)
|
||||
{
|
||||
(*it)->Draw();
|
||||
|
||||
@@ -5,7 +5,6 @@ IGUITextOwner
|
||||
#include "precompiled.h"
|
||||
#include "GUI.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
@@ -17,7 +16,7 @@ IGUITextOwner::IGUITextOwner()
|
||||
IGUITextOwner::~IGUITextOwner()
|
||||
{
|
||||
// Delete all generated texts.
|
||||
vector<SGUIText*>::iterator it;
|
||||
std::vector<SGUIText*>::iterator it;
|
||||
for (it=m_GeneratedTexts.begin(); it!=m_GeneratedTexts.end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <cmath>
|
||||
#include <boost/random.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace
|
||||
{
|
||||
/// Random number generator (Boost Mersenne Twister)
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
|
||||
#define LOG_CATEGORY "config"
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef map <CStr, CConfigValueSet> TConfigMap;
|
||||
typedef std::map <CStr, CConfigValueSet> TConfigMap;
|
||||
TConfigMap CConfigDB::m_Map[CFG_LAST];
|
||||
CStr CConfigDB::m_ConfigFile[CFG_LAST];
|
||||
bool CConfigDB::m_UseVFS[CFG_LAST];
|
||||
@@ -284,8 +282,8 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
// Send line to parser
|
||||
bool parseOk=parserLine.ParseString(parser, std::string(pos, lend));
|
||||
// Get name and value from parser
|
||||
string name;
|
||||
string value;
|
||||
std::string name;
|
||||
std::string value;
|
||||
|
||||
if (parseOk &&
|
||||
parserLine.GetArgCount()>=2 &&
|
||||
@@ -304,7 +302,7 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
CConfigValue argument;
|
||||
argument.m_String = value;
|
||||
newMap[name].push_back( argument );
|
||||
LOG(CLogger::Normal, LOG_CATEGORY, "Loaded config string \"%s\" = \"%s\"", name.c_str(), value.c_str());
|
||||
LOG(CLogger::Normal, LOG_CATEGORY, "Loaded config std::string \"%s\" = \"%s\"", name.c_str(), value.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "ps/XML/Xeromyces.h"
|
||||
#include "simulation/LOSManager.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
CPlayerSlot::CPlayerSlot(size_t slotID, CPlayer *pPlayer):
|
||||
m_SlotID(slotID),
|
||||
@@ -282,7 +281,7 @@ void CGameAttributes::ScriptingInit()
|
||||
|
||||
jsval_t CGameAttributes::JSI_GetOpenSlot(JSContext* UNUSED(cx), uintN UNUSED(argc), jsval* UNUSED(argv))
|
||||
{
|
||||
vector <CPlayerSlot *>::iterator it;
|
||||
std::vector <CPlayerSlot *>::iterator it;
|
||||
for (it = m_PlayerSlots.begin();it != m_PlayerSlots.end();++it)
|
||||
{
|
||||
if ((*it)->GetAssignment() == SLOT_OPEN)
|
||||
@@ -353,10 +352,10 @@ CPlayerSlot *CGameAttributes::GetSlot(size_t index)
|
||||
|
||||
void CGameAttributes::FinalizeSlots()
|
||||
{
|
||||
// Back up our old slots, and empty the resulting vector
|
||||
vector<CPlayerSlot *> oldSlots;
|
||||
// Back up our old slots, and empty the resulting std::vector
|
||||
std::vector<CPlayerSlot *> oldSlots;
|
||||
oldSlots.swap(m_PlayerSlots);
|
||||
vector<CPlayer *> oldPlayers;
|
||||
std::vector<CPlayer *> oldPlayers;
|
||||
oldPlayers.swap(m_Players);
|
||||
m_Players.push_back(oldPlayers[0]); // Gaia
|
||||
|
||||
|
||||
@@ -9,14 +9,13 @@ Overlay.cpp
|
||||
#include "Overlay.h"
|
||||
#include "Parser.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
bool CColor::ParseString(const CStr& Value, float DefaultAlpha)
|
||||
{
|
||||
// Use the parser to parse the values
|
||||
CParser& parser (CParserCache::Get("_[-$arg(_minus)]$value_[-$arg(_minus)]$value_[-$arg(_minus)]$value_[[-$arg(_minus)]$value_]"));
|
||||
|
||||
string str = Value;
|
||||
std::string str = Value;
|
||||
|
||||
CParserLine line;
|
||||
line.ParseString(parser, str);
|
||||
|
||||
+38
-39
@@ -6,7 +6,6 @@
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-------------------------------------------------
|
||||
// Macros
|
||||
@@ -80,7 +79,7 @@ CParserValue::~CParserValue()
|
||||
{
|
||||
}
|
||||
|
||||
// Parse the string in Value to different types
|
||||
// Parse the std::string in Value to different types
|
||||
|
||||
// bool
|
||||
bool CParserValue::GetBool(bool &ret)
|
||||
@@ -133,7 +132,7 @@ bool CParserValue::GetDouble(double &ret)
|
||||
|
||||
// find decimal position
|
||||
DecimalPos = m_String.find(".");
|
||||
if (DecimalPos == string::npos)
|
||||
if (DecimalPos == std::string::npos)
|
||||
DecimalPos = Size;
|
||||
|
||||
// Iterate left of the decimal sign
|
||||
@@ -184,7 +183,7 @@ bool CParserValue::GetDouble(double &ret)
|
||||
return true;
|
||||
}
|
||||
|
||||
// string - only return m_String, can't fail
|
||||
// std::string - only return m_String, can't fail
|
||||
bool CParserValue::GetString(std::string &ret)
|
||||
{
|
||||
ret = m_String;
|
||||
@@ -285,7 +284,7 @@ bool CParserLine::ClearArguments()
|
||||
// Implementation of CParserFile::GetArg*
|
||||
// it just checks if argument isn't out of range, and
|
||||
// then it uses the the respective function in CParserValue
|
||||
FUNC_IMPL_GETARG(GetArgString, GetString, string)
|
||||
FUNC_IMPL_GETARG(GetArgString, GetString, std::string)
|
||||
FUNC_IMPL_GETARG(GetArgBool, GetBool, bool)
|
||||
FUNC_IMPL_GETARG(GetArgChar, GetChar, char)
|
||||
FUNC_IMPL_GETARG(GetArgShort, GetShort, short)
|
||||
@@ -308,8 +307,8 @@ FUNC_IMPL_GETARG(GetArgDouble, GetDouble, double)
|
||||
// TODO Gee: Make Parser use CStr.
|
||||
bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
{
|
||||
// Don't process empty string
|
||||
if (strLine == string())
|
||||
// Don't process empty std::string
|
||||
if (strLine == std::string())
|
||||
{
|
||||
m_ParseOK = false; // Empty lines should never be inputted by CParserFile
|
||||
return m_ParseOK;
|
||||
@@ -319,9 +318,9 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
bool Extract=false;
|
||||
size_t ExtractPos=0;
|
||||
char Buffer[256];
|
||||
char Letter[] = {'\0','\0'}; // Letter as string
|
||||
vector<string> Segments;
|
||||
string strSub;
|
||||
char Letter[] = {'\0','\0'}; // Letter as std::string
|
||||
std::vector<std::string> Segments;
|
||||
std::string strSub;
|
||||
size_t i;
|
||||
|
||||
// Set result to false, then if a match is found, turn it true
|
||||
@@ -332,11 +331,11 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
// Remove C++-styled comments!
|
||||
// * * * *
|
||||
int pos = strLine.find("//");
|
||||
if (pos != string::npos)
|
||||
if (pos != std::string::npos)
|
||||
strLine = strLine.substr(0,pos);
|
||||
*/
|
||||
|
||||
// Divide string into smaller vectors, separators are unusual signs
|
||||
// Divide std::string into smaller std::vectors, separators are unusual signs
|
||||
// * * * *
|
||||
|
||||
for (i=0; i<strLine.size(); ++i)
|
||||
@@ -355,12 +354,12 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
// GET STRING BETWEEN QUOTES
|
||||
if (strLine[i] == '\"')
|
||||
{
|
||||
// Extract a string, search for another "
|
||||
// Extract a std::string, search for another "
|
||||
size_t pos = strLine.find("\"", i+1);
|
||||
|
||||
// If matching can't be found,
|
||||
// the parsing will fail!
|
||||
if (pos == string::npos)
|
||||
if (pos == std::string::npos)
|
||||
{
|
||||
// TODO Gee - Output in logfile
|
||||
m_ParseOK = false;
|
||||
@@ -368,7 +367,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
}
|
||||
|
||||
// Get substring
|
||||
// Add a " to indicate this is a "..." string
|
||||
// Add a " to indicate this is a "..." std::string
|
||||
// and can't be used as name
|
||||
strSub = "\"" + strLine.substr(i+1, pos-i-1);
|
||||
|
||||
@@ -398,7 +397,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Extract string after $ !
|
||||
// Extract std::string after $ !
|
||||
// break whenever we reach a sign that's not A-Z a-z
|
||||
if (_IsValueChar(strLine[i]))
|
||||
{
|
||||
@@ -415,7 +414,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
--i;
|
||||
}
|
||||
|
||||
// Check if string is complete
|
||||
// Check if std::string is complete
|
||||
if (i == strLine.size()-1)
|
||||
Extract=false;
|
||||
}
|
||||
@@ -423,7 +422,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
// If extraction was finished! Input Buffer
|
||||
if (Extract == false)
|
||||
{
|
||||
Segments.push_back( string(Buffer) );
|
||||
Segments.push_back( std::string(Buffer) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,15 +434,15 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
size_t Progress; // progress in Segments index
|
||||
size_t Lane=0; // Have many alternative routes we are in
|
||||
bool Match; // If a task-type match has been found
|
||||
// The vector of these three represents the different lanes
|
||||
// The std::vector of these three represents the different lanes
|
||||
// LastValidProgress[1] takes you back to lane 1 and how
|
||||
// the variables was set at that point
|
||||
vector<size_t> LastValidProgress; // When diving into a dynamic argument store store
|
||||
std::vector<size_t> LastValidProgress; // When diving into a dynamic argument store store
|
||||
// the last valid so you can go back to it
|
||||
vector<size_t> LastValidArgCount; // If an alternative route turns out to fail, we
|
||||
std::vector<size_t> LastValidArgCount; // If an alternative route turns out to fail, we
|
||||
// need to know the amount of arguments on the last
|
||||
// valid position, so we can remove them.
|
||||
vector<bool> LastValidMatch; // Match at that point
|
||||
std::vector<bool> LastValidMatch; // Match at that point
|
||||
bool BlockAltNode = false; // If this turns true, the alternative route
|
||||
// tested was not a success, and the settings
|
||||
// should be set back in order to test the
|
||||
@@ -459,7 +458,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
// the similarities. If enough
|
||||
// similarities are found, then we can declare progress as
|
||||
// that type and exit loop
|
||||
vector<CParserTaskType>::const_iterator cit_tt;
|
||||
std::vector<CParserTaskType>::const_iterator cit_tt;
|
||||
for (cit_tt = Parser.m_TaskTypes.begin();
|
||||
cit_tt != Parser.m_TaskTypes.end();
|
||||
++cit_tt)
|
||||
@@ -634,7 +633,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
else
|
||||
{
|
||||
// Alright! An ident or const has been acquired, if we
|
||||
// can't find any or if the string has run out
|
||||
// can't find any or if the std::string has run out
|
||||
// that invalidates the match
|
||||
|
||||
// String end?
|
||||
@@ -651,7 +650,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
switch(CurNode->m_Type)
|
||||
{
|
||||
case typeIdent:
|
||||
// Check if this really is a string
|
||||
// Check if this really is a std::string
|
||||
if (!_IsStrictNameChar(Segments[Progress][0]))
|
||||
{
|
||||
Match = false;
|
||||
@@ -672,7 +671,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
++Progress;
|
||||
break;
|
||||
case typeValue:
|
||||
// Check if this really is a string
|
||||
// Check if this really is a std::string
|
||||
if (!_IsValueChar(Segments[Progress][0]) &&
|
||||
Segments[Progress][0] != '\"')
|
||||
{
|
||||
@@ -694,10 +693,10 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
|
||||
++Progress;
|
||||
break;
|
||||
case typeRest:
|
||||
// Extract the whole of the string
|
||||
// Extract the whole of the std::string
|
||||
|
||||
// Reset, probably is but still
|
||||
value.m_String = string();
|
||||
value.m_String = std::string();
|
||||
|
||||
for (i=Progress; i<Segments.size(); ++i)
|
||||
{
|
||||
@@ -799,7 +798,7 @@ CParser::CParser()
|
||||
CParser::~CParser()
|
||||
{
|
||||
// Delete all task type trees
|
||||
vector<CParserTaskType>::iterator itTT;
|
||||
std::vector<CParserTaskType>::iterator itTT;
|
||||
for (itTT = m_TaskTypes.begin();
|
||||
itTT != m_TaskTypes.end();
|
||||
++itTT)
|
||||
@@ -810,10 +809,10 @@ CParser::~CParser()
|
||||
|
||||
// InputTaskType
|
||||
// ------------------------------------------------------------------| Function
|
||||
// A task-type is a string representing the acquired syntax when parsing
|
||||
// This function converts that string into a binary tree, making it easier
|
||||
// A task-type is a std::string representing the acquired syntax when parsing
|
||||
// This function converts that std::string into a binary tree, making it easier
|
||||
// and faster to later parse.
|
||||
bool CParser::InputTaskType(const string& strName, const string& strSyntax)
|
||||
bool CParser::InputTaskType(const std::string& strName, const std::string& strSyntax)
|
||||
{
|
||||
// Locals
|
||||
CParserTaskType TaskType; // Object we acquire to create
|
||||
@@ -832,7 +831,7 @@ bool CParser::InputTaskType(const string& strName, const string& strSyntax)
|
||||
// Working node
|
||||
CParserTaskTypeNode *CurNode = TaskType.m_BaseNode;
|
||||
|
||||
// Loop through the string and construct nodes in the binary tree
|
||||
// Loop through the std::string and construct nodes in the binary tree
|
||||
// when applicable
|
||||
for (i=0; i<strSyntax.size(); ++i)
|
||||
{
|
||||
@@ -956,7 +955,7 @@ next [a] Null [a] <-- added NewNode
|
||||
}
|
||||
else
|
||||
{
|
||||
// Extract string after $ !
|
||||
// Extract std::string after $ !
|
||||
// break whenever we reach a sign that's not A-Z a-z
|
||||
if (_IsStrictNameChar(strSyntax[i]))
|
||||
{
|
||||
@@ -973,7 +972,7 @@ next [a] Null [a] <-- added NewNode
|
||||
--i;
|
||||
}
|
||||
|
||||
// Check if string is complete
|
||||
// Check if std::string is complete
|
||||
if (i == strSyntax.size()-1)
|
||||
Extract=false;
|
||||
}
|
||||
@@ -991,7 +990,7 @@ next [a] Null [a] <-- added NewNode
|
||||
|
||||
CurNode->m_Letter = '\0';
|
||||
|
||||
string str = string(Buffer);
|
||||
std::string str = std::string(Buffer);
|
||||
|
||||
// Check value and set up CurNode accordingly
|
||||
if (str == "value") CurNode->m_Type = typeValue;
|
||||
@@ -1012,7 +1011,7 @@ next [a] Null [a] <-- added NewNode
|
||||
else
|
||||
if (str == "arg")
|
||||
{
|
||||
// After $arg, you need a parenthesis, within that parenthesis is a string
|
||||
// After $arg, you need a parenthesis, within that parenthesis is a std::string
|
||||
// that will be added as an argument when it's passed through
|
||||
|
||||
CurNode->m_Type = typeAddArg;
|
||||
@@ -1036,13 +1035,13 @@ next [a] Null [a] <-- added NewNode
|
||||
size_t Pos = strSyntax.find(")", ExtractPos+5);
|
||||
|
||||
// Check if ')' exists at all
|
||||
if (Pos == string::npos)
|
||||
if (Pos == std::string::npos)
|
||||
{
|
||||
Error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Now extract string within ( and )
|
||||
// Now extract std::string within ( and )
|
||||
CurNode->m_String = strSyntax.substr(ExtractPos+4, Pos-(ExtractPos+4));
|
||||
|
||||
// Now update position
|
||||
|
||||
@@ -43,7 +43,6 @@ Example SoundGroup.xml
|
||||
#include "lib/res/sound/snd_mgr.h"
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
enum eSndGrpFlags
|
||||
{
|
||||
@@ -61,9 +60,9 @@ class CSoundGroup
|
||||
|
||||
Handle m_hReplacement;
|
||||
|
||||
vector<Handle> snd_group; // we store the handles so we can load now and play later
|
||||
vector<CStr> filenames; // we need the filenames so we can reload when necessary.
|
||||
vector<float> playtimes; // it would be better to store this in with the Handles perhaps?
|
||||
std::vector<Handle> snd_group; // we store the handles so we can load now and play later
|
||||
std::vector<CStr> filenames; // we need the filenames so we can reload when necessary.
|
||||
std::vector<float> playtimes; // it would be better to store this in with the Handles perhaps?
|
||||
CStr m_filepath; // the file path for the list of sound file resources
|
||||
CStr m_intensity_file; // the replacement aggregate 'intense' sound
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#include "precompiled.h"
|
||||
#include "SoundGroupMgr.h"
|
||||
|
||||
typedef std::vector<CSoundGroup*> SoundGroups;
|
||||
typedef SoundGroups::iterator SoundGroupIt;
|
||||
|
||||
|
||||
CSoundGroupMgr *CSoundGroupMgr::m_pInstance = 0;
|
||||
|
||||
@@ -48,8 +51,7 @@ void CSoundGroupMgr::DeleteInstance()
|
||||
{
|
||||
if(m_pInstance)
|
||||
{
|
||||
|
||||
vector<CSoundGroup *>::iterator vIter = m_pInstance->m_Groups.begin();
|
||||
SoundGroupIt vIter = m_pInstance->m_Groups.begin();
|
||||
while(vIter != m_pInstance->m_Groups.end())
|
||||
vIter = m_pInstance->RemoveGroup(vIter);
|
||||
|
||||
@@ -76,17 +78,14 @@ size_t CSoundGroupMgr::AddGroup(const char *XMLFile)
|
||||
///////////////////////////////////////////
|
||||
// RemoveGroup()
|
||||
// in: size_t index into m_Groups
|
||||
// out: vector<CSoundGroup *>::iterator - one past the index removed (sometimes useful)
|
||||
// out: SoundGroupIt - one past the index removed (sometimes useful)
|
||||
// Removes and Releases a given soundgroup
|
||||
///////////////////////////////////////////
|
||||
vector<CSoundGroup *>::iterator CSoundGroupMgr::RemoveGroup(size_t index)
|
||||
SoundGroupIt CSoundGroupMgr::RemoveGroup(size_t index)
|
||||
{
|
||||
|
||||
vector<CSoundGroup *>::iterator vIter = m_Groups.begin();
|
||||
SoundGroupIt vIter = m_Groups.begin();
|
||||
if(index >= m_Groups.size())
|
||||
return vIter;
|
||||
|
||||
|
||||
|
||||
CSoundGroup *temp = (*vIter);
|
||||
(*vIter)->ReleaseGroup();
|
||||
@@ -100,11 +99,11 @@ vector<CSoundGroup *>::iterator CSoundGroupMgr::RemoveGroup(size_t index)
|
||||
|
||||
///////////////////////////////////////////
|
||||
// RemoveGroup()
|
||||
// in: vector<CSoundGroup *>::iterator - item to remove
|
||||
// out: vector<CSoundGroup *>::iterator - one past the index removed (sometimes useful)
|
||||
// in: SoundGroupIt - item to remove
|
||||
// out: SoundGroupIt - one past the index removed (sometimes useful)
|
||||
// Removes and Releases a given soundgroup
|
||||
///////////////////////////////////////////
|
||||
vector<CSoundGroup *>::iterator CSoundGroupMgr::RemoveGroup(vector<CSoundGroup *>::iterator iter)
|
||||
SoundGroupIt CSoundGroupMgr::RemoveGroup(SoundGroupIt iter)
|
||||
{
|
||||
|
||||
(*iter)->ReleaseGroup();
|
||||
@@ -125,7 +124,7 @@ vector<CSoundGroup *>::iterator CSoundGroupMgr::RemoveGroup(vector<CSoundGroup *
|
||||
///////////////////////////////////////////
|
||||
void CSoundGroupMgr::UpdateSoundGroups(float TimeSinceLastFrame)
|
||||
{
|
||||
vector<CSoundGroup *>::iterator vIter = m_Groups.begin();
|
||||
SoundGroupIt vIter = m_Groups.begin();
|
||||
while(vIter != m_Groups.end())
|
||||
{
|
||||
(*vIter)->Update(TimeSinceLastFrame);
|
||||
|
||||
@@ -10,12 +10,11 @@
|
||||
|
||||
#include "SoundGroup.h"
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
class CSoundGroupMgr
|
||||
{
|
||||
public:
|
||||
vector <CSoundGroup *> m_Groups; // a collection of sound groups
|
||||
std::vector <CSoundGroup *> m_Groups; // a collection of sound groups
|
||||
static CSoundGroupMgr *m_pInstance; // our static instance of the manager
|
||||
static CSoundGroupMgr *GetInstance();
|
||||
static void DeleteInstance();
|
||||
@@ -44,18 +43,18 @@ public:
|
||||
///////////////////////////////////////////
|
||||
// RemoveGroup()
|
||||
// in: size_t index into m_Groups
|
||||
// out: vector<CSoundGroup *>::iterator - one past the index removed (sometimes useful)
|
||||
// out: std::vector<CSoundGroup *>::iterator - one past the index removed (sometimes useful)
|
||||
// Removes and Releases a given soundgroup
|
||||
///////////////////////////////////////////
|
||||
vector<CSoundGroup *>::iterator RemoveGroup(size_t index);
|
||||
std::vector<CSoundGroup *>::iterator RemoveGroup(size_t index);
|
||||
|
||||
///////////////////////////////////////////
|
||||
// RemoveGroup()
|
||||
// in: vector<CSoundGroup *>::iterator - item to remove
|
||||
// out: vector<CSoundGroup *>::iterator - one past the index removed (sometimes useful)
|
||||
// in: std::vector<CSoundGroup *>::iterator - item to remove
|
||||
// out: std::vector<CSoundGroup *>::iterator - one past the index removed (sometimes useful)
|
||||
// Removes and Releases a given soundgroup
|
||||
///////////////////////////////////////////
|
||||
vector<CSoundGroup *>::iterator RemoveGroup(vector<CSoundGroup *>::iterator iter);
|
||||
std::vector<CSoundGroup *>::iterator RemoveGroup(std::vector<CSoundGroup *>::iterator iter);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user