本文整理汇总了C++中std::tr1::shared_ptr::center方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::center方法的具体用法?C++ shared_ptr::center怎么用?C++ shared_ptr::center使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::tr1::shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::center方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: step
bool step(const float delta_time)
{
task_.step(delta_time);
u_char key_inp = env_.keyinp->get();
if (key_inp != '\0')
{
static const u_char tbl[] = {
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c',
'd', 'e'
};
int i;
for (i = 0; i < elemsof(tbl); ++i)
{
if (tbl[i] == key_inp) break;
}
if (i < elemsof(tbl))
{
env_.earth_texture = i;
earth_.texture(env_.earth_texture);
}
if (key_inp == 'r')
{
rotate_mix_ = !rotate_mix_;
env_.task->sendMsgAll(rotate_mix_ ? MSG_CONTROL_MIX : MSG_CONTROL_XY);
}
}
// 地球のテクスチャを変更する
// 問題と回答を表示するテスト
if (key_inp == 'q' || key_inp == 'w')
{
if (key_inp == 'w')
{
--place_index_;
if (place_index_ < 0) place_index_ = place_names_.size() - 1;
}
DOUT << *place_names_[place_index_] << ":" << place_index_ << "(" << place_names_.size() << ")" << std::endl;
picojson::object place = places_[*place_names_[place_index_]].get<picojson::object>();
env_.cur_place = place["name"].get<std::string>();
env_.answer = place["answer"].is<std::string>();
if (env_.answer) env_.ans_place = place["answer"].get<std::string>();
env_.onetime = place["onetime"].is<bool>() ? place["onetime"].get<bool>() : false;
if (key_inp == 'q')
{
place_index_ = (place_index_ + 1) % place_names_.size();
}
{
std::string& f = place["file"].get<std::string>();
std::string path = *(env_.path) + "devdata/place/" + f;
place_ = std::tr1::shared_ptr<Place>(new Place(path));
std::vector<Vec2<float> > center;
place_->center(center); // 各範囲の中心を求める
env_.place_center.clear();
for(std::vector<Vec2<float> >::iterator it = center.begin(); it != center.end(); ++it)
{
Vec3<float> pos = locToPos(*it);
env_.place_center.push_back(pos);
}
this->ansDisp();
}
// 問題の正解位置を表示
env_.task->sendMsgAll(MSG_GAME_PLACEDISP_START);
if (env_.answer) env_.task->sendMsgAll(MSG_GAME_PLACEDISP_ANS);
env_.task->sendMsgAll(MSG_GAME_TOUCH_DISP);
}
else
if (key_inp == 'E')
{
localize_.reload("en.lang");
DOUT << "Localize:en.lang" << std::endl;
// 強制的に英語モード
}
else
if (key_inp == 'J')
{
localize_.reload("jp.lang");
DOUT << "Localize:jp.lang" << std::endl;
// 強制的に日本語モード
}
else
if (key_inp == 'Z')
{
earth_.airDraw();
}
else
if (key_inp == 'X')
{
earth_.bodyDraw();
}
else
//.........这里部分代码省略.........