fix visual studio 2010 build

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6903 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: b85a78f2ab0463dcbe134636f70878627eab542a
Former-commit-id: 7866d0a11b286dc1dc45becb4e72557dbe4354a5
This commit is contained in:
iobyte 2020-04-11 14:11:36 +00:00
parent ee206de5fb
commit b3d6bfa836
2 changed files with 25 additions and 25 deletions

View file

@ -280,9 +280,9 @@ void CarSetupMenu::loadSettings()
attnum &att = items[page][index];
att.labelId = getDynamicControlId(std::string("Label" + std::to_string(index)).c_str());
att.editId = getDynamicControlId(std::string("Edit" + std::to_string(index)).c_str());
att.defaultLabelId = getDynamicControlId(std::string("DefaultLabel" + std::to_string(index)).c_str());
att.labelId = getDynamicControlId(std::string("Label" + std::to_string(static_cast<unsigned long long>(index))).c_str());
att.editId = getDynamicControlId(std::string("Edit" + std::to_string(static_cast<unsigned long long>(index))).c_str());
att.defaultLabelId = getDynamicControlId(std::string("DefaultLabel" + std::to_string(static_cast<unsigned long long>(index))).c_str());
att.section = GfParmGetStr(hparmItems, strSection.c_str(), "section", "");
att.param = GfParmGetStr(hparmItems, strSection.c_str(), "param", "");
att.units = GfParmGetStr(hparmItems, strSection.c_str(), "unit", "");
@ -316,11 +316,11 @@ void CarSetupMenu::loadSettings()
attnum &att = items[page][index];
if (!att.labelId)
att.labelId = getDynamicControlId(std::string("Label" + std::to_string(index)).c_str());
att.labelId = getDynamicControlId(std::string("Label" + std::to_string(static_cast<unsigned long long>(index))).c_str());
if (!att.editId)
att.editId = getDynamicControlId(std::string("Edit" + std::to_string(index)).c_str());
att.editId = getDynamicControlId(std::string("Edit" + std::to_string(static_cast<unsigned long long>(index))).c_str());
if (!att.defaultLabelId)
att.defaultLabelId = getDynamicControlId(std::string("DefaultLabel" + std::to_string(index)).c_str());
att.defaultLabelId = getDynamicControlId(std::string("DefaultLabel" + std::to_string(static_cast<unsigned long long>(index))).c_str());
}
}
}
@ -412,9 +412,9 @@ bool CarSetupMenu::initialize(void *pMenu, const GfRace *pRace, const GfDriver *
// Create items.
for (size_t index = 0; index < ITEMS_PER_PAGE; ++index)
{
createLabelControl(std::string("Label" + std::to_string(index)).c_str());
createEditControl(std::string("Edit" + std::to_string(index)).c_str(), this, NULL, NULL);
createLabelControl(std::string("DefaultLabel" + std::to_string(index)).c_str());
createLabelControl(std::string("Label" + std::to_string(static_cast<unsigned long long>(index))).c_str());
createEditControl(std::string("Edit" + std::to_string(static_cast<unsigned long long>(index))).c_str(), this, NULL, NULL);
createLabelControl(std::string("DefaultLabel" + std::to_string(static_cast<unsigned long long>(index))).c_str());
}
// Create buttons.

View file

@ -49,22 +49,6 @@ public:
const GfCar *getCar() const { return _pDriver->getCar(); }
const GfTrack *getTrack() const { return _pRace->getTrack(); }
protected:
//callback functions must be static
static void onActivate(void *pMenu);
static void onAccept(void *pMenu);
static void onCancel(void *pMenu);
static void onReset(void *pMenu);
static void onPrevious(void *pMenu);
static void onNext(void *pMenu);
// The target race.
const GfRace *_pRace;
// The target driver.
const GfDriver *_pDriver;
struct attnum
{
int labelId;
@ -88,6 +72,22 @@ protected:
}
};
protected:
//callback functions must be static
static void onActivate(void *pMenu);
static void onAccept(void *pMenu);
static void onCancel(void *pMenu);
static void onReset(void *pMenu);
static void onPrevious(void *pMenu);
static void onNext(void *pMenu);
// The target race.
const GfRace *_pRace;
// The target driver.
const GfDriver *_pDriver;
void readCurrentPage();
std::vector<std::array<attnum, ITEMS_PER_PAGE> > items;