\81¡\82»\82Ì\91¼
+ConsoleOut\82ÌgetInstance\82Å\83\81\83\82\83\8a\83\8a\81[\83N
+\91O\82Ì\83\8f\81[\83\8b\83h\82ª\8ec\82Á\82½\81A\82æ\82¤\82È\81E\81E\81E
+
\83^\83C\83g\83\8b\89æ\96Ê
- \83}\81[\83P\83b\83g\82Å\81A\92P\89¿\82Í\88ê\97\97\82É\95\\8e¦\82·\82é
- \83I\83u\83W\83F\83N\83g\82Ì\95`\89æpriority\90Ý\92è(TODO particle)
+ \83}\81[\83P\83b\83g\82Å\81A\92P\89¿\82Í\88ê\97\97\82É\95\\8e¦\82·\82é
\83G\83\8c\83\81\83\93\83g\94z\92u\83G\83t\83F\83N\83g
- \83_\83\93\83W\83\87\83\93\82Í\82Ç\82±\81H
- \83\81\83C\83\93\83\81\83j\83\85\81[\82Å\94w\8ci\82ð\90Ý\92è\82·\82é
+ - \83I\83u\83W\83F\83N\83g\82Ì\95`\89æpriority\90Ý\92è(TODO particle)
+ - \83^\83C\83g\83\8b\82Ì\96A\82Ì\83G\83t\83F\83N\83g
+ - \90X\82Ì\83G\83t\83F\83N\83g
+ - \91å\92n\82Ì\83G\83t\83F\83N\83g
+ - \90\85\82Ì\83G\83t\83F\83N\83g
+ - \83A\83C\83R\83\93\82ð\95Ï\8dX
\81¡\95Û\97¯
\8aX\82É\82à\83G\83\8c\83\81\83\93\83g\92u\82¯\82½\82Ù\82¤\82ª\82æ\82\82È\82¢\81H
lua_settop(L, 0)\98R\82ê\82ª\82 \82é\81H
\83e\83L\83X\83g\82Ì\8dX\90V(\83\81\83j\83\85\81[\81j
+ \83_\83\93\83W\83\87\83\93\82Í\82Ç\82±\81H
PART 10\88È\8d~
\81¡\82»\82Ì\91¼
- \83T\83E\83\93\83h\95Ò\8fW\83c\81[\83\8b\82Ì\8dì\90¬
+ \83G\83\8a\83A\95Ò\8fW\83c\81[\83\8b\82Ì\8dì\90¬
+ \83_\83\93\83W\83\87\83\93\95Ò\8fW\83c\81[\83\8b\82Ì\8dì\90¬
+
+ - history\82ÌDB\83\82\83f\83\8b\82É\83V\81[\83P\83\93\83XID\82ð\95t\97^\82·\82é
+ - \83Q\81[\83\80\83f\81[\83^\82Í\83V\81[\83P\83\93\83XID 0\94Ô\81A\83^\83C\83g\83\8b\90ê\97p\82Í\91¼\82ÌID\82É\90U\82è\95ª\82¯\82é
+ - \83Q\81[\83\80\83f\81[\83^\88È\8aO\82Ìhistory\82ð\83^\83C\83g\83\8b\89æ\96Ê\82Å\95\\8e¦\82·\82é
+ - \83\8f\81[\83\8b\83h\83V\81[\83\93\82Å\81A\8c»\8dÝ\82Ì\83q\83X\83g\83\8a\82ð\95\\8e¦\82·\82é\82æ\82¤\82É\82·\82é\81i\88ê\8e\9e\93I\81j
+ - \83\89\83\93\83_\83\80\82Åhisotry\82ÌID\82ð\91I\91ð\82·\82é\82æ\82¤\82É\82·\82é
+ - \8fã\8bL\82Ì\83q\83X\83g\83\8a\82ðDB\82É\93o\98^
+ \83\81\83C\83\93\83\81\83j\83\85\81[\82Å\94w\8ci\82ð\90Ý\92è\82·\82é
+ - \83\8f\81[\83\8b\83h\83V\81[\83\93\82Ì\83I\83u\83W\83F\83N\83g\82ÉTag\82ð\82Â\82¯\82Ä\81A\83\81\83j\83\85\81[\92\86\82Í\94ñ\95\\8e¦\82É\82·\82é
+
\81¡\83}\83b\83v\88Ú\93®
\83}\83b\83v\88Ú\93®\95\9c\8a\88
\81¡\83T\83E\83\93\83h\82Ì\8b\89»
\81@\81@\81@\81@\83X\83N\83\8a\83v\83g\82©\82ç\83T\83E\83\93\83h\82Ì\90§\8cä
+ \83T\83E\83\93\83h\82Ì\83|\81[\83Y
\81@\81@\81@\81@\83T\83E\83\93\83h\82Ì\83v\83\8a\83\8d\81[\83h
\81¡\83G\83t\83F\83N\83g
".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua"
#define LUA_CPATH_DEFAULT \
- ".\\?.dll;" ".\\?51.dll;" LUA_CDIR"?.dll;" LUA_CDIR"?51.dll;" LUA_CDIR"clibs\\?.dll;" LUA_CDIR"clibs\\?51.dll;" LUA_CDIR"loadall.dll;" LUA_CDIR"clibs\\loadall.dll"
+ ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
#else
#define LUA_ROOT "/usr/local/"
"./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
#define LUA_CPATH_DEFAULT \
- "./?.so;" "./lib?51.so;" LUA_CDIR"?.so;" LUA_CDIR"lib?51.so;" LUA_CDIR"loadall.so"
+ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
#endif
* @brief \83\81\83b\83Z\81[\83W\83E\83B\83\93\83h\83E\82ð\90¶\90¬\82·\82é\82½\82ß\82Ì\83R\81[\83\8b\83o\83b\83N
* @return \90¶\90¬\82µ\82½\83\81\83b\83Z\81[\83W\83E\83B\83\93\83h\83E
*/
- virtual int message_create(const mof::tstring& title, const GameData::entry_t& style, int priority) = 0;
+ virtual int message_create(unsigned int thread_id, const mof::tstring& title, const GameData::entry_t& style, int priority) = 0;
- virtual int menu_create(const mof::tstring& title, const std::vector<mof::tstring>& items, const GameData::entry_t& style, int priority) = 0;
+ virtual int menu_create(unsigned int thread_id, const mof::tstring& title, const std::vector<mof::tstring>& items, const GameData::entry_t& style, int priority) = 0;
virtual int vertex_buffer_create
(
+ unsigned int thread_id,
const mof::VertexXYZRHWCUV& front,
const mof::VertexXYZRHWCUV& back,
const mof::Texture::ptr& texture,
virtual int sound_create(const mof::tstring& filepath) = 0;
virtual void sound_play(int id) = 0;
+
+ virtual int music_create(const mof::tstring& filepath) = 0;
+
+ virtual void music_play(int id) = 0;
+
+ virtual void music_pause(int id) = 0;
- virtual int picture_create(const mof::tstring& filepath, int priority) = 0;
+ virtual int picture_create(unsigned int thread_id, const mof::tstring& filepath, int priority) = 0;
virtual int camera_create() = 0;
- virtual int particlegen_create() = 0;
+ virtual int particlegen_create(unsigned int thread_id) = 0;
- virtual int solid_create(const mof::tstring& class_path, int priority) = 0;
+ virtual int solid_create(unsigned int thread_id, const mof::tstring& class_path, int priority) = 0;
- virtual int light_create(const mof::tstring& class_path) = 0;
+ virtual int light_create(unsigned int thread_id, const mof::tstring& class_path) = 0;
virtual void set_light(int id, int light_id) = 0;
- virtual int board_create(const mof::tstring& filepath, const GameData::entry_t& style, int priority) = 0;
+ virtual int board_create(unsigned int thread_id, const mof::tstring& filepath, const GameData::entry_t& style, int priority) = 0;
/**
* @brief \83\81\83b\83Z\81[\83W\83E\83B\83\93\83h\83E\82É\83y\81[\83W\82ð\92Ç\89Á\82·\82é\82½\82ß\82Ì\83R\81[\83\8b\83o\83b\83N
virtual mof::InputReceiver::Key get_last_key() = 0;
virtual void wait_frame(size_t id, size_t frame) = 0;
+
+ virtual void routine_stop(unsigned int thread_id) = 0;
virtual bool is_waiting(size_t id) const = 0;
virtual int hide(int id, const mof::tstring& class_path) = 0;
virtual void dispose(int id, const mof::tstring& class_path) = 0;
+
+ virtual void set_enable(int id, bool is_enable, const mof::tstring& class_path) = 0;
virtual GameData::ptr get_properties(int id, const mof::tstring& class_path) = 0;
virtual void joint(int id1, const mof::tstring& class_name1, const mof::tstring& joint_type, int id2, const mof::tstring& class_name2) = 0;
+ virtual void quit() = 0;
+
// Application\82É\88Ë\91¶\82µ\82½\83R\83}\83\93\83h(TODO moflib\82©\82ç\94r\8f\9c\82·\82é\8ed\91g\82Ý)
virtual mof::frame_t put_element(ElementType type, int x, int y) = 0;
+
virtual void world_sleep() = 0;
- virtual int land_region_create(int x, int y, int priority) = 0;
+ virtual int land_region_create(unsigned int thread_id, int x, int y, int priority) = 0;
virtual ~CommandSet(){}
bool waiting_;///< Interpreter\82É\83R\83}\83\93\83h\8eÀ\8ds\82Ì\92â\8e~\82ð\93`\82¦\82é\82½\82ß\82Ì\8fó\91Ô\95Ï\90\94
mof::EventScheduler scheduler_; ///< \83L\81[\93ü\97Í\91Ò\8b@\82È\82Ç
};
+
+
+
//{{{ Impl
struct Environment::Impl
std::vector<mof::script::rendering_packet> rendering_memory_pool_;
std::vector<std::shared_ptr<mof::script::StaticSoundData>> static_sound_data_list_;
+ std::vector<std::shared_ptr<mof::script::StreamSoundData>> music_data_list_;
std::vector<std::shared_ptr<mof::script::SoundSourceData>> sound_source_data_list_;
std::vector<mof::script::CameraData::ptr> camera_data_list_;// \8c»\8dÝ\81A\97v\91f\90\94\82Í1\82Â\82¾\82¯
std::vector<mof::script::light_obj::ptr> light_obj_list_;
r_packet->queue_hook_.unlink();
rendering_dead_list_.push_back(*r_packet);
}
+
+ template <typename ListType>
+ void erase_by_thread_id(ListType& list, unsigned int thread_id)
+ {
+ foreach (auto& data, list)
+ {
+ if(data.get() != NULL && thread_id == data->thread_id_)
+ {
+ dispose_render_node(data->r_packet_);
+ data.reset();
+ }
+ }
+ }
+
};
//}}}
}
//}}}
//{{{ message_create
- int Environment::message_create(const mof::tstring& title, const GameData::entry_t& style, int priority)
+ int Environment::message_create(unsigned int thread_id, const mof::tstring& title, const GameData::entry_t& style, int priority)
{
using namespace mof::script;
using namespace boost;
// ***Data\82Í\8eÀ\91Ì\82Ì\94z\97ñ\82Å\8aÇ\97\9d\82µ\82½\82Ù\82¤\82ª\82æ\82¢
std::shared_ptr<MessageData> data = std::shared_ptr<MessageData>(create_message_data(title, style).release());
data->view_ = data->frame_->getView();
+ data->is_enable_ = true;
+ data->thread_id_ = thread_id;
return impl_->add_obj(impl_->message_data_list_, data, &MessageData::view_, priority, false);
}
//}}}
//{{{ menu_create
int Environment::menu_create
(
+ unsigned int thread_id,
const mof::tstring& title,
const std::vector<mof::tstring>& items,
const GameData::entry_t& style,
DEBUG_PRINT("menu_create(" << title << ")");
std::shared_ptr<MenuData> data = std::shared_ptr<MenuData>(create_menu_data(title, items, style).release());
data->view_ = data->frame_->getView();
+ data->is_enable_ = true;
+ data->thread_id_ = thread_id;
return impl_->add_obj(impl_->menu_data_list_, data, &MenuData::view_, priority, false);
}
//}}}
void Environment::wait_for_key(size_t id, mof::InputReceiver::Key key)
{
DEBUG_PRINT("wait_for_key(" << id << ", " << key << ")");
- if (impl_->threads.end() == impl_->threads.find(id)) {
+ if (impl_->threads.end() == impl_->threads.find(id))
+ {
impl_->threads.insert(std::make_pair(id, thread_t()));// \83X\83\8c\83b\83h\82ª\82È\82¯\82ê\82Î\82Â\82\82é
}
impl_->threads[id].waiting_ = true;
}
//}}}
+//{{{ routine_stop
+ void Environment::routine_stop(size_t thread_id)
+ {
+ DEBUG_PRINT("routine_stop(" << thread_id << ")");
+
+ for (auto itr = impl_->threads.begin(); itr != impl_->threads.end(); )
+ {
+ if (itr->first == thread_id)
+ {
+ // \89ð\95ú
+ itr = impl_->threads.erase(itr);
+ }
+ else
+ {
+ ++itr;
+ }
+ }
+
+
+ // \83X\83\8c\83b\83h\93à\82Å\90¶\90¬\82µ\82½\83I\83u\83W\83F\83N\83g\82ð\89ð\95ú
+ impl_->erase_by_thread_id(impl_->message_data_list_, thread_id);
+ impl_->erase_by_thread_id(impl_->menu_data_list_, thread_id);
+ impl_->erase_by_thread_id(impl_->picture_data_list_, thread_id);
+ impl_->erase_by_thread_id(impl_->solid_data_list_, thread_id);
+ impl_->erase_by_thread_id(impl_->board_data_list_, thread_id);
+ impl_->erase_by_thread_id(impl_->vertex_buffer_obj_list_, thread_id);
+
+ // light\82Í\95Ê\8f\88\97\9d
+ foreach (auto& data, impl_->light_obj_list_)
+ {
+ if(data.get() != NULL && thread_id == data->thread_id_)
+ {
+ data.reset();
+ }
+ }
+
+ // particlegen\82Í\95Ê\8f\88\97\9d
+ foreach (auto& data, impl_->particlegen_data_list_)
+ {
+ if(data.get() != NULL && thread_id == data->thread_id_)
+ {
+ data.reset();
+ }
+ }
+
+ }
+//}}}
//{{{ get_last_key
mof::InputReceiver::Key Environment::get_last_key()
{
impl_->static_sound_data_list_.push_back(data);
}
//}}}
+//{{{ music_create
+ int Environment::music_create(const mof::tstring& filepath)
+ {
+ using namespace mof::script;
+ using namespace boost;
+
+ DEBUG_PRINT("music_create(" << filepath << ")");
+ auto ptr = mof::sound::SoundDevice::create_streaming_sound(filepath);
+
+ auto data = std::make_shared<StreamSoundData>();
+ data->sound_ = std::shared_ptr<mof::StreamSoundBuffer>(ptr.release());
+ impl_->music_data_list_.push_back(data);
+ return impl_->music_data_list_.size() -1;
+ }
+//}}}
+//{{{ music_play
+ void Environment::music_play(int id)
+ {
+ using namespace mof::script;
+ using namespace boost;
+
+ DEBUG_PRINT("music_play(" << id << ")");
+ impl_->music_data_list_.at(id)->sound_->play(true);
+ }
+//}}}
+//{{{ music_pause
+ void Environment::music_pause(int id)
+ {
+ using namespace mof::script;
+ using namespace boost;
+
+ DEBUG_PRINT("music_pause(" << id << ")");
+ impl_->music_data_list_.at(id)->sound_->pause();
+ }
+//}}}
//{{{ load_game_data
GameData::ptr Environment::load_game_data(const mof::tstring& resource_path)
{
}
//}}}
//{{{ picture_create
- int Environment::picture_create(const mof::tstring& class_path, int priority)
+ int Environment::picture_create(unsigned int thread_id, const mof::tstring& class_path, int priority)
{
using namespace mof::script;
using namespace boost;
}
data->sprite_->getRectangleCoordinatesStream() <<
data->texcoord_ref_.makeRef(Rectangle<float>(0, 0, 1, 1));
+ data->is_enable_ = true;
+ data->thread_id_ = thread_id;
return impl_->add_obj(impl_->picture_data_list_, data, &PictureData::sprite_, priority, false);
}
//}}}
//{{{ particlegen_create
- int Environment::particlegen_create()
+ int Environment::particlegen_create(unsigned int thread_id)
{
using namespace mof::script;
using namespace boost;
data->particlegen_ = std::make_shared<mof::particlegen>();
data->particlegen_->world_transform() << data->position_ref_.makeRef(Matrix3D::createIdentity());
impl_->particlegen_data_list_.push_back(data);// TODO \8dÄ\97\98\97p
+ data->is_enable_ = true;
+ data->thread_id_ = thread_id;
return impl_->particlegen_data_list_.size() -1;
}
//}}}
//{{{ solid_create
- int Environment::solid_create(const mof::tstring& class_path, int priority)
+ int Environment::solid_create(unsigned int thread_id, const mof::tstring& class_path, int priority)
{
using namespace mof::script;
using namespace boost;
<< data->size_ref_.makeRef(Matrix3D::createIdentity())
<< data->rotate_ref_.makeRef(Matrix3D::createIdentity())
<< data->position_ref_.makeRef(Matrix3D::createIdentity());
+ data->is_enable_ = true;
+ data->thread_id_ = thread_id;
return impl_->add_obj(impl_->solid_data_list_, data, &SolidData::solid_, priority, true);
}
//}}}
//{{{ board_create
- int Environment::board_create(const mof::tstring& class_path, const GameData::entry_t& style, int priority)
+ int Environment::board_create(unsigned int thread_id, const mof::tstring& class_path, const GameData::entry_t& style, int priority)
{
using namespace mof::widget;
using namespace mof::script;
<< data->position_ref_.makeRef(Matrix3D::createIdentity());
data->board_->getColorStream()
<< data->color_ref_.makeRef(Color4f(1, 1, 1, 1));
+ data->is_enable_ = true;
+ data->thread_id_ = thread_id;
return impl_->add_obj(impl_->board_data_list_, data, &BoardData::board_, priority, z_buffer);
}
//}}}
}
//}}}
//{{{ light_create
- int Environment::light_create(const mof::tstring& class_path)
+ int Environment::light_create(unsigned int thread_id, const mof::tstring& class_path)
{
using namespace mof::script;
using namespace boost;
auto p = std::make_shared<light_obj>();
p->light_ = std::make_shared<DirectionalLight>();
p->type_ = class_path;
+ p->thread_id_ = thread_id;
impl_->light_obj_list_.push_back(p);
return impl_->light_obj_list_.size() -1;
}
//{{{ vertex_buffer_create
int Environment::vertex_buffer_create
(
+ unsigned int thread_id,
const mof::VertexXYZRHWCUV& front,
const mof::VertexXYZRHWCUV& back,
const mof::Texture::ptr& texture,
obj->vb_ = std::make_shared<vertex_buffer_with_texture>();
obj->vb_->buffer_ = std::make_shared<mof::VertexBuffer<mof::VertexXYZRHWCUV>>(front, back, mof::PRIMITIVE_TYPE_TRIANGLELIST);
obj->vb_->texture_ = texture;
+ obj->is_enable_ = true;
+ obj->thread_id_ = thread_id;
return impl_->add_obj(impl_->vertex_buffer_obj_list_, obj, &vertex_buffer_obj::vb_, priority, false);
}
//}}}
DEBUG_PRINT("picture_dispose(" << id << ")");
impl_->dispose_render_node(impl_->picture_data_list_.at(id)->r_packet_);
impl_->picture_data_list_.at(id).reset();
- } else if (class_path == "picture") {
} else if (class_path == "particlegen") {
DEBUG_PRINT("particlegen_dispose(" << id << ")");
impl_->particlegen_data_list_.at(id).reset();
impl_->board_data_list_.at(id).reset();
} else if (class_path == "sound") {
DEBUG_PRINT("sound_dispose(" << id << ")");
+ impl_->sound_source_data_list_.at(id)->source_->stop();
impl_->sound_source_data_list_.at(id).reset();
+ } else if (class_path == "music") {
+ DEBUG_PRINT("music_dispose(" << id << ")");
+ impl_->music_data_list_.at(id)->sound_->stop();
+ impl_->music_data_list_.at(id).reset();
} else if (class_path == "vertex_buffer") {
DEBUG_PRINT("vertex_buffer_dispose(" << id << ")");
impl_->dispose_render_node(impl_->vertex_buffer_obj_list_.at(id)->r_packet_);
DEBUG_PRINT("light_dispose(" << id << ")");
impl_->light_obj_list_.at(id).reset();
}
+ else throw std::invalid_argument("unknown class path:" + class_path);
+}
+//}}}
+//{{{ set_enable
+void Environment::set_enable(int id, bool is_enable, const mof::tstring& class_path)
+{
+ using namespace mof::script;
+ using namespace boost;
-
+ if (class_path == "menu") {
+ DEBUG_PRINT("menu_set_enable(" << id << ")");
+ impl_->menu_data_list_.at(id)->r_packet_->enable() = is_enable;
+ impl_->menu_data_list_.at(id)->is_enable_ = is_enable;
+ } else if (class_path == "message") {
+ DEBUG_PRINT("message_set_enable(" << id << ")");
+ impl_->message_data_list_.at(id)->r_packet_->enable() = is_enable;
+ impl_->message_data_list_.at(id)->is_enable_ = is_enable;
+ } else if (class_path == "picture") {
+ DEBUG_PRINT("picture_set_enable(" << id << ")");
+ impl_->picture_data_list_.at(id)->r_packet_->enable() = is_enable;
+ impl_->picture_data_list_.at(id)->is_enable_ = is_enable;
+ } else if (class_path == "particlegen") {
+ DEBUG_PRINT("particlegen_set_enable(" << id << ")");
+ impl_->particlegen_data_list_.at(id)->is_enable_ = is_enable;
+ } else if (class_path == "solid") {
+ DEBUG_PRINT("solid_set_enable(" << id << ")");
+ impl_->solid_data_list_.at(id)->r_packet_->enable() = is_enable;
+ impl_->solid_data_list_.at(id)->is_enable_ = is_enable;
+ } else if (class_path == "board") {
+ DEBUG_PRINT("board_set_enable(" << id << ")");
+ impl_->board_data_list_.at(id)->r_packet_->enable() = is_enable;
+ impl_->board_data_list_.at(id)->is_enable_ = is_enable;
+ } else if (class_path == "vertex_buffer") {
+ DEBUG_PRINT("vertex_buffer_set_enable(" << id << ")");
+ impl_->vertex_buffer_obj_list_.at(id)->r_packet_->enable() = is_enable;
+ impl_->vertex_buffer_obj_list_.at(id)->is_enable_ = is_enable;
+ }
else throw std::invalid_argument("unknown class path:" + class_path);
}
//}}}
else throw std::logic_error("unkown join");
}
//}}}
+//{{{ quit
+ void Environment::quit()
+ {
+ DEBUG_PRINT("quit");
+ Application::quit();
+ }
+//}}}
//{{{ update
void Environment::update()
{
using namespace std;
foreach (auto& th, impl_->threads) th.second.update();
foreach (auto& data, impl_->message_data_list_) {
- if (data.get()) data->frame_->update();
+ if (data.get() && data->is_enable_) data->frame_->update();
}
foreach (auto& data, impl_->menu_data_list_) {
- if (data.get()) data->frame_->update();
+ if (data.get() && data->is_enable_) data->frame_->update();
}
foreach (auto& data, impl_->picture_data_list_) {
- if (data.get()) data->sprite_->update();
+ if (data.get() && data->is_enable_) data->sprite_->update();
}
foreach (auto& data, impl_->particlegen_data_list_) {
- if (data) data->particlegen_->update();
+ if (data && data->is_enable_) data->particlegen_->update();
}
foreach (auto& data, impl_->solid_data_list_) {
- if (data) data->solid_->update();
+ if (data && data->is_enable_) data->solid_->update();
}
foreach (auto& data, impl_->board_data_list_) {
- if (data) data->board_->update();
+ if (data && data->is_enable_) data->board_->update();
}
foreach (auto& data, impl_->light_obj_list_) {
data->sound_->update();
}
}
+
+ foreach (auto& data, impl_->music_data_list_) {
+ if (data) {
+ data->sound_->update();
+ }
+ }
+
+
impl_->camera_data_list_.front()->camera_->update();
using namespace mof::script;
using namespace std;
+ mof::GraphicsDevice::clearZBuffer();
+
mof::GraphicsDevice::setViewTransform
(
impl_->camera_data_list_.front()->camera_->getViewMatrix()
);
- /*
- foreach (auto data, impl_->solid_data_list_) {
- if (data) {
- // \83\89\83C\83g\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82ê\82Î\81A\82»\82ê\82ð\8eg\82¤
- if (data->light_) {
- mof::GraphicsDevice::lightEnable(true);
- data->light_->setEnable(true);
- }
- else mof::GraphicsDevice::lightEnable(false);
- data->solid_->draw();
- }
-
- }
- */
foreach (auto r_packet, impl_->rendering_queue_set_) {
r_packet.draw();
}
- /*
- mof::GraphicsDevice::setWorldTransform(mof::Matrix3D());
- foreach (auto& obj, impl_->vertex_buffer_obj_list_) {
- if (obj) {
- mof::GraphicsDevice::setTexture(obj->texture_.get());
- obj->buffer_->draw();
- }
-
- }
- */
-
- /*
- foreach (auto data, impl_->board_data_list_) {
- if (data.get()) data->board_->draw();
- }
- */
-
-
mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ADD);
mof::GraphicsDevice::setZBuffer(false);
/*
mof::GraphicsDevice::setZBuffer(true);
mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);
- /*
- foreach (auto data, impl_->picture_data_list_) {
- if (data.get()) data->sprite_->draw();
- }
- */
-
-
- /*
- foreach (auto data, impl_->message_data_list_) {
- if (data.get()) data->frame_->getView()->draw();
- }
-
- foreach (auto data, impl_->menu_data_list_) {
- if (data.get()) data->frame_->getView()->draw();
- }//TODO \83\\81[\83g
- */
-
-
}
//}}}
//{{{ is_waiting
bool Environment::is_waiting(size_t id) const
{
- return impl_->threads[id].waiting_;
+ auto found = impl_->threads.find(id);
+ return found != impl_->threads.end() && found->second.waiting_;
}
//}}}
}
virtual ~Environment();
- virtual int message_create(const mof::tstring& title, const GameData::entry_t& style, int priority);
+ virtual int message_create(unsigned int thread_id, const mof::tstring& title, const GameData::entry_t& style, int priority);
virtual int message_next(int id, const tstring& text);
virtual void wait_frame(size_t id, size_t frame);
- virtual int menu_create(const mof::tstring& title, const std::vector<mof::tstring>& items, const GameData::entry_t& style, int priority);
+ virtual void routine_stop(unsigned int thread_id);
+
+ virtual int menu_create(unsigned int thread_id, const mof::tstring& title, const std::vector<mof::tstring>& items, const GameData::entry_t& style, int priority);
virtual int vertex_buffer_create
(
+ unsigned int thread_id,
const mof::VertexXYZRHWCUV& front,
const mof::VertexXYZRHWCUV& back,
const mof::Texture::ptr& texture,
virtual int sound_create(const mof::tstring& filepath);
virtual void sound_play(int id);
+
+ virtual int music_create(const mof::tstring& filepath);
+
+ virtual void music_play(int id);
+
+ virtual void music_pause(int id);
virtual GameData::ptr load_game_data(const mof::tstring& resource_path);
virtual void print_debug(const mof::tstring& message);
- virtual int picture_create(const mof::tstring& filepath, int priority);
+ virtual int picture_create(unsigned int thread_id, const mof::tstring& filepath, int priority);
virtual int camera_create();
- virtual int particlegen_create();
+ virtual int particlegen_create(unsigned int thread_id);
- virtual int solid_create(const mof::tstring& class_path, int priority);
+ virtual int solid_create(unsigned int thread_id, const mof::tstring& class_path, int priority);
- virtual int light_create(const mof::tstring& class_path);
+ virtual int light_create(unsigned int thread_id, const mof::tstring& class_path);
virtual void set_light(int id, int light_id);
- virtual int board_create(const mof::tstring& filepath, const GameData::entry_t& style, int priority);
+ virtual int board_create(unsigned int thread_id, const mof::tstring& filepath, const GameData::entry_t& style, int priority);
// 共通のメソッド
virtual int show(int id, const mof::tstring& class_path);
virtual int hide(int id, const mof::tstring& class_path);
virtual void dispose(int id, const mof::tstring& class_path);
+
+ virtual void set_enable(int id, bool is_enable, const mof::tstring& class_path);
virtual GameData::ptr get_properties(int id, const mof::tstring& class_path);
virtual void joint(int id1, const mof::tstring& class_name1, const mof::tstring& joint_type, int id2, const mof::tstring& class_name2);
+ virtual void quit();
+
void update();
void draw() const;
#include "luabind/luabind.hpp"
#include <mof/ConsoleIO.hpp>
#include <mof/utilities.hpp>
-#include <mof/id_pool.hpp>
#include <boost/bind.hpp>
-#include <map>
+#include <list>
namespace mof
{
namespace script
{
+//{{{ routine
+ struct routine_t
+ {
+ enum state
+ {
+ RUNNING, //!< 起動中
+ WAIT_DESTROY,//!< 破棄待ち
+ };
+ lua_State* thread_; //!< Luaスレッド
+ state state_; //!< 現在のルーチンの状態
+ unsigned int id_; //!< スレッドID
+ unsigned int parent_id_;//!< 親スレッドID 親がいなければid_と等しい
+
+ routine_t(unsigned int id, unsigned int parent_id, lua_State* threads)
+ : id_(id), parent_id_(parent_id), thread_(threads), state_(RUNNING)
+ {
+ // do nothing
+ }
+ };
+//}}}
//{{{ Impl
struct LuaInterpreter::Impl
{
- std::map<size_t, lua_State*> threads_;
- mof::id_pool thread_id_pool_;
+ std::list<routine_t> threads_;
+ unsigned int next_id_;//!< 次のスレッドに割り当てるID
Impl()
+ : next_id_(0)
{
}
{
}
+ //! thread_idのスレッドと、その子スレッドに削除待ちフラグを立てる
+ static void set_wait_destroy_recursive(std::list<routine_t>& threads, unsigned int thread_id)
+ {
+ for (auto itr = threads.begin(); itr != threads.end(); ++itr )
+ {
+ if (itr->id_ == thread_id)
+ {
+ itr->state_ = routine_t::WAIT_DESTROY;
+ }
+ else if (itr->parent_id_ == thread_id && itr->parent_id_ != itr->id_ )
+ {
+ // parent_id_ と id_ が一致するなら、それは親なし
+ set_wait_destroy_recursive(threads, itr->id_);
+ }
+ }
+ }
+
};
//}}}
//{{{ constructor
// impl_にアクセスできないので
auto& threads = impl_->threads_;
- auto& thread_id_pool = impl_->thread_id_pool_;
+ auto& next_id_ = impl_->next_id_;
lua_state::instance().bind(commands,
- [&threads, &thread_id_pool](lua_State* th) -> size_t
+ [&threads, &next_id_](lua_State* th, unsigned int parent_id) -> size_t
+ {
+ // 末尾に追加
+ threads.push_back(routine_t(next_id_++, parent_id, th));
+ return next_id_ - 1;
+ },
+ [&threads](size_t thread_id) -> void
{
- size_t id = thread_id_pool.make_id();
- threads.insert(std::make_pair(id, th));
- return id;
+ // このタイミングでは削除せず、フラグを設定するだけ
+ LuaInterpreter::Impl::set_wait_destroy_recursive(threads, thread_id);
}
);// TODO LuaInterpreterとlua_stateの責任分割を再考
}
//{{{ update
void LuaInterpreter::update(const std::shared_ptr<CommandSet>& commands)
{
- // TODO luaスレッドが死んだときにそれをCommandSetに通知するように
+ // 破棄待ちのスレッドの解放
+ for (auto itr = impl_->threads_.begin(); itr != impl_->threads_.end(); )
+ {
+ if(itr->state_ == routine_t::WAIT_DESTROY)
+ {
+ // スレッドは削除待ち
+ // 以降も別の場所からstopが呼ばれる可能性があるので、idは再利用しない
- for (auto itr = impl_->threads_.begin(); itr != impl_->threads_.end(); ) {
- if (commands->is_waiting(itr->first)) {
+ commands->routine_stop(itr->id_);
+ itr = impl_->threads_.erase(itr);
+ }
+ else
+ {
++itr;
- continue;// スレッドは休止中
}
+ }
- lua_state::instance().set_target_thread_id(itr->first);
- int result = lua_resume(itr->second, 0);
- if (result == 0) {
- // スレッドを解放する(正常終了)
- impl_->thread_id_pool_.release_id(itr->first);
- itr = impl_->threads_.erase(itr);
+ for (auto itr = impl_->threads_.begin(); itr != impl_->threads_.end(); ++itr)
+ {
+ if (itr->thread_ == NULL || commands->is_waiting(itr->id_))
+ {
+ continue;// スレッドは休止中
}
- else if (result == LUA_YIELD) {
- // resumeによる中断
- ++itr;
+
+ lua_state::instance().set_target_thread_id(itr->id_);
+ int result = lua_resume(itr->thread_, 0);
+ if (result == 0)
+ {
+ // 終了
+ itr->thread_ = NULL;
}
- else {
+ else if (result != LUA_YIELD)
+ {
// エラー
- throw std::logic_error(std::string("lua error:") + lua_tostring(itr->second, -1));
+ throw std::logic_error(std::string("lua error:") + lua_tostring(itr->thread_, -1));
}
}
}
void LuaInterpreter::start(const mof::tstring& entry_function)
{
lua_State* co = lua_newthread(lua_state::instance().raw_lua());
- if(!co) {
+ if (!co)
+ {
DEBUG_PRINT(_T("ERROR-Failed lua_newthread") );
throw std::runtime_error("Failed --- start lua script");
}
lua_getglobal(co, entry_function.c_str());
- size_t id = impl_->thread_id_pool_.make_id();
- impl_->threads_.insert(std::make_pair(id, co));
+ unsigned int id = impl_->next_id_++;
+ impl_->threads_.push_back(routine_t(id, id, co));
+
}
//}}}
std::shared_ptr<mof::widget::Pager> message_;
std::shared_ptr<mof::widget::Frame> frame_;
rendering_packet* r_packet_;
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\97L\8cø\82©\82Ç\82¤\82©
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
};
//}}}
//{{{ MenuData
std::shared_ptr<mof::widget::Menu> menu_;
std::shared_ptr<mof::widget::Frame> frame_;
rendering_packet* r_packet_;
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\97L\8cø\82©\82Ç\82¤\82©
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
};
//}}}
//{{{ PictureData
ReferenceWrapper<Rectangle<float>> texcoord_ref_;
typedef std::shared_ptr<PictureData> ptr;
rendering_packet* r_packet_;
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\97L\8cø\82©\82Ç\82¤\82©
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
};
//}}}
//{{{ vertex_buffer_obj
std::shared_ptr<vertex_buffer_with_texture> vb_;
typedef std::shared_ptr<vertex_buffer_obj> ptr;
rendering_packet* r_packet_;
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\97L\8cø\82©\82Ç\82¤\82©
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
};
//}}}
//{{{ BoardData
ReferenceWrapper<Color4f> color_ref_;
ReferenceWrapper<Rectangle<float>> texcoord_ref_;
typedef std::shared_ptr<BoardData> ptr;
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\97L\8cø\82©\82Ç\82¤\82©
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
};
//}}}
//{{{ ParticlegenData
mof::particlegen::ptr particlegen_;
ReferenceWrapper<Matrix3D> position_ref_;
typedef std::shared_ptr<ParticlegenData> ptr;
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\97L\8cø\82©\82Ç\82¤\82©
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
};
//}}}
//{{{ SolidData
ReferenceWrapper<Matrix3D> size_ref_;
ReferenceWrapper<Matrix3D> rotate_ref_;
typedef std::shared_ptr<SolidData> ptr;
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\97L\8cø\82©\82Ç\82¤\82©
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
};
//}}}
//{{{ CameraData
{
std::shared_ptr<Light> light_;
mof::tstring type_;
+ unsigned int thread_id_;//!< \83R\83\8b\81[\83`\83\93\82ÌID
typedef std::shared_ptr<light_obj> ptr;
};
std::shared_ptr<mof::StaticSoundBuffer> sound_;
};
//}}}
+//{{{ StreamSoundData
+ struct StreamSoundData
+ {
+ std::shared_ptr<mof::StreamSoundBuffer> sound_;
+ // TODO tween
+ };
+//}}}
//{{{ SoundSourceData
struct SoundSourceData
{
//{{{ binders *
int message_create(const tstring& title, const tstring& style, int priority)
{
- return lua_state::instance().command_set()->message_create(title, unpack_style(style), priority);
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return lua_state::instance().command_set()->message_create(thread_id, title, unpack_style(style), priority);
}
int message_next(int id, const tstring& text){ return lua_state::instance().command_set()->message_next(id, text); }
void wait_for_key(mof::InputReceiver::Key key)
lua_pop(l , n);
if (items.empty()) items.push_back("no items");
- int id = lua_state::instance().command_set()->menu_create(title, items, unpack_style(style), priority);
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ int id = lua_state::instance().command_set()->menu_create(thread_id, title, items, unpack_style(style), priority);
lua_pushnumber(l, id);
return 1;
}
int menu_select(int id){ return lua_state::instance().command_set()->menu_select(id); }
int sound_create(const mof::tstring& filepath){ return lua_state::instance().command_set()->sound_create(mof::tstring(filepath)); }
void sound_play(int id){ return lua_state::instance().command_set()->sound_play(id); }
+ int music_create(const mof::tstring& filepath){ return lua_state::instance().command_set()->music_create(mof::tstring(filepath)); }
+ void music_play(int id){ return lua_state::instance().command_set()->music_play(id); }
+ void music_pause(int id){ return lua_state::instance().command_set()->music_pause(id); }
//{{{ load_game_data
int load_game_data(lua_State* l)
{
}
//}}}
- int picture_create(const mof::tstring& filepath, int priority){ return lua_state::instance().command_set()->picture_create(filepath, priority); }
+ int picture_create(const mof::tstring& filepath, int priority)
+ {
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return lua_state::instance().command_set()->picture_create(thread_id, filepath, priority);
+ }
int camera_create(){ return lua_state::instance().command_set()->camera_create(); }
void glue_print_debug(const mof::tstring& text){ return lua_state::instance().command_set()->print_debug(text); }
- int particlegen_create(){ return lua_state::instance().command_set()->particlegen_create(); }
- int solid_create(const mof::tstring& path, int priority){ return lua_state::instance().command_set()->solid_create(path, priority); }
+ int particlegen_create()
+ {
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return lua_state::instance().command_set()->particlegen_create(thread_id);
+ }
+ int solid_create(const mof::tstring& path, int priority)
+ {
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return lua_state::instance().command_set()->solid_create(thread_id, path, priority);
+ }
//{{{ object_set_behavior
int object_set_behavior(lua_State* l)
{
seq_parser<Rectangle<float>> parser;
lua_state::instance().command_set()->set_texture_coord_tween(id, target, parser.parse(l, 3));
}
-
-
-
-
- else {
+ else
+ {
throw std::logic_error("unknown target:" + target);
}
+ lua_settop(l, 0);
return 0;
}
//}}}
lua_State* th = lua_tothread(l , 1);
lua_pop(l, n);
size_t th_id = lua_state::instance().invoke(th);
- //lua_state::instance().set_target_thread_id(th_id);
lua_pushnumber(l, th_id);
return 1;
}
//}}}
+ //{{{ stop
+ int glue_routine_stop(lua_State* l)
+ {
+ int n = lua_gettop(l);
+ if (!lua_isnumber(l , 1)) throw std::runtime_error("invalid call");
+ int thread_id = lua_tonumber(l , 1);
+ lua_pop(l, n);
+ lua_state::instance().stop(thread_id);
+ return 0;
+ }
+ //}}}
int show(int id, const tstring& class_path){ return lua_state::instance().command_set()->show(id, class_path); }
int hide(int id, const tstring& class_path){ return lua_state::instance().command_set()->hide(id, class_path); }
void dispose(int id, const tstring& class_path){ lua_state::instance().command_set()->dispose(id, class_path); }
void get_property(int id, const tstring& class_path){ lua_state::instance().command_set()->dispose(id, class_path); }
int glue_put_element(mof::script::CommandSet::ElementType type, int x, int y) {return lua_state::instance().command_set()->put_element(type, x, y);}
void glue_world_sleep() {lua_state::instance().command_set()->world_sleep();}
- int glue_board_create(const mof::tstring& filepath, int priority, const mof::tstring& style){ return lua_state::instance().command_set()->board_create(filepath, unpack_style(style), priority); }
- int glue_land_region_create(int x, int y, int priority){ return lua_state::instance().command_set()->land_region_create(x, y, priority); }
- int glue_light_create(const tstring& class_path){ return lua_state::instance().command_set()->light_create(class_path); }
+ void glue_set_enable(int id, bool is_enable, const tstring& class_path) {lua_state::instance().command_set()->set_enable(id, is_enable, class_path);}
+ int glue_board_create(const mof::tstring& filepath, int priority, const mof::tstring& style)
+ {
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return lua_state::instance().command_set()->board_create(thread_id, filepath, unpack_style(style), priority);
+ }
+ int glue_land_region_create(int x, int y, int priority)
+ {
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return lua_state::instance().command_set()->land_region_create(thread_id, x, y, priority);
+ }
+ int glue_light_create(const tstring& class_path){
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return lua_state::instance().command_set()->light_create(thread_id, class_path);
+ }
void glue_set_light(int id, int light_id){ lua_state::instance().command_set()->set_light(id, light_id); }
void glue_solid_joints_solid(int id1, const tstring& joint_type, int id2){ lua_state::instance().command_set()->joint(id1, "solid", joint_type, id2, "solid"); }
void glue_board_joints_solid(int id1, const tstring& joint_type, int id2){ lua_state::instance().command_set()->joint(id1, "board", joint_type, id2, "solid"); }
+ void glue_quit(){ lua_state::instance().command_set()->quit(); }
//{{{ get_properties
int get_properties(lua_State* l)
{
lua_State* l_;
std::shared_ptr<mof::script::CommandSet> commands_;
callback_invoke_t callback_invoke_;
+ callback_stop_t callback_stop_;
size_t thread_id_;
Impl()
lua_state::~lua_state(){}
//}}} destructor
//{{{ bind *
- void lua_state::bind(std::shared_ptr<mof::script::CommandSet> commands, const callback_invoke_t& callback_invoke)
+ void lua_state::bind
+ (
+ std::shared_ptr<mof::script::CommandSet> commands,
+ const callback_invoke_t& callback_invoke,
+ const callback_stop_t& callback_stop
+ )
{
impl_->commands_ = commands;
impl_->callback_invoke_ = callback_invoke;
+ impl_->callback_stop_ = callback_stop;
luabind::module(impl_->l_)[luabind::def("messageNewImpl", &message_create)];
luabind::module(impl_->l_)[luabind::def("messageNextImpl", &message_next)];
luabind::module(impl_->l_)[luabind::def("waitFrameImpl", &wait_frame)];
luabind::module(impl_->l_)[luabind::def("menuSelectImpl", &menu_select)];
luabind::module(impl_->l_)[luabind::def("soundCreateImpl", &sound_create)];
luabind::module(impl_->l_)[luabind::def("mof_sound_play", &sound_play)];
+ luabind::module(impl_->l_)[luabind::def("musicCreateImpl", &music_create)];
+ luabind::module(impl_->l_)[luabind::def("mof_music_play", &music_play)];
+ luabind::module(impl_->l_)[luabind::def("mof_music_pause", &music_pause)];
lua_register(impl_->l_, "loadGameDataImpl", &load_game_data);
lua_register(impl_->l_, "mof_save_game_data", &glue_save_game_data);
luabind::module(impl_->l_)[luabind::def("mof_print_debug", &glue_print_debug)];
luabind::module(impl_->l_)[luabind::def("mof_land_region_create", &glue_land_region_create)];
lua_register(impl_->l_, "objectGetPropertiesImpl", &get_properties);
lua_register(impl_->l_, "mof_invoke", &glue_invoke);
+ lua_register(impl_->l_, "mof_routine_stop", &glue_routine_stop);
luabind::module(impl_->l_)[luabind::def("mof_board_create", &glue_board_create)];
luabind::module(impl_->l_)[luabind::def("mof_light_create", &glue_light_create)];
luabind::module(impl_->l_)[luabind::def("mof_set_light", &glue_set_light)];
luabind::module(impl_->l_)[luabind::def("mof_solid_joints_solid", &glue_solid_joints_solid)];
luabind::module(impl_->l_)[luabind::def("mof_board_joints_solid", &glue_board_joints_solid)];
+ luabind::module(impl_->l_)[luabind::def("mof_quit", &glue_quit)];
+ luabind::module(impl_->l_)[luabind::def("mof_obj_enable", &glue_set_enable)];
}
//}}}
//{{{ raw_lua
//{{{ invoke
size_t lua_state::invoke(lua_State* th)
{
- return impl_->callback_invoke_(th);
+ unsigned int thread_id = lua_state::instance().get_target_thread_id();
+ return impl_->callback_invoke_(th, thread_id);
+ }
+//}}}
+//{{{ stop
+ void lua_state::stop(unsigned int thread_id)
+ {
+ impl_->callback_stop_(thread_id);
}
//}}}
//{{{ command_set
{
public:
~lua_state();
- typedef boost::function<size_t (lua_State*)> callback_invoke_t;
- void bind(std::shared_ptr<mof::script::CommandSet> commands, const callback_invoke_t& callback_invoke);
+ typedef boost::function<size_t (lua_State*, unsigned int)> callback_invoke_t;
+ typedef boost::function<void (size_t)> callback_stop_t;
+
+ void bind
+ (
+ std::shared_ptr<mof::script::CommandSet> commands,
+ const callback_invoke_t& callback_invoke,
+ const callback_stop_t& callback_stop
+ );
+
lua_State* raw_lua() const;
std::shared_ptr<mof::script::CommandSet>& const command_set() const;
size_t invoke(lua_State* th);
+ void stop(size_t thread_id);
static lua_state& instance();
void set_target_thread_id(size_t id);
size_t get_target_thread_id() const;
int sub_priority_;// priority\82ª\93\99\82µ\82¯\82ê\82Î\81A\82±\82¿\82ç\82Å\94»\92è\82·\82é
float z_order_; // \8f¬\82³\82¢\92ö\90æ\82É\95`\89æ\82³\82ê\82é
bool z_buffer_; // Z\83o\83b\83t\83@\82ð\8eg\82¤\82©\82Ç\82¤\82©
+ bool is_enable_;//!< \83I\83u\83W\83F\83N\83g\82ª\8dX\90V\82³\82ê\82é\82©\82Ç\82¤\82©
public:
typedef boost::intrusive::set_member_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>> queue_hook_t;
float z_order = 0
)
: drawable_(drawable), priority_(priority), sub_priority_(0),
- z_buffer_(z_buffer), z_order_(z_order)
+ z_buffer_(z_buffer), z_order_(z_order), is_enable_(true)
{
// sub priority\8cv\8eZ
if (!z_buffer_) {
// Z\83\\81[\83g
return z_order_ < packet.z_order_;
}
+
+ inline bool& enable()
+ {
+ return is_enable_;
+ }
+ inline const bool& enable() const
+ {
+ return is_enable_;
+ }
inline void draw() const
{
+ if(!is_enable_)
+ {
+ // \97L\8cø\82Å\82È\82¢\83I\83u\83W\83F\83N\83g\82Í\95`\89æ\82³\82ê\82È\82¢
+ return;
+ }
+
// Z\83o\83b\83t\83@\82ð\8eg\82¤\82©\82Ç\82¤\82©
if (z_buffer_) GraphicsDevice::setZBuffer(true);
else GraphicsDevice::setZBuffer(false);
virtual bool initialize() = 0;
virtual bool play(bool looping) = 0;
+ virtual void pause() = 0;
virtual void stop() = 0;
virtual bool is_playing() const;
virtual void update();
#include "mof/sound/StaticSoundBuffer.hpp"
#include "mof/sound/DirectSoundDevice.hpp"
#include "mof/ConsoleIO.hpp"
+#include <cassert>
mof::StaticSoundBuffer::StaticSoundBuffer
(
return true;
}
+void mof::StaticSoundBuffer::pause(){
+ // TODO Pause
+ getSoundBuffer()->Stop();
+}
+
void mof::StaticSoundBuffer::stop(){
getSoundBuffer()->Stop();
}
virtual ~StaticSoundBuffer(void);
virtual bool initialize();
virtual bool play(bool looping);
+ virtual void pause();
virtual void stop();
std::unique_ptr<StaticSoundBuffer> duplicate();
};
LPDIRECTSOUNDNOTIFY8 pSoundNotify,
SoundFile* pResource
)
-: mof::SoundBuffer(pDevice, pBuffer , pResource)
+: mof::SoundBuffer(pDevice, pBuffer , pResource), initialized_(false)
{
m_pSoundNotify = pSoundNotify;
m_pSoundNotify->AddRef();
mof::StreamSoundBuffer::~StreamSoundBuffer(void)
{
//boost::mutex::scoped_lock lock(m_pLoadingFunction->getMutex()); TODO これ付けてるとエラーになる
- getSoundBuffer()->Stop();
- m_pLoadingThread->join();
- delete m_pLoadingThread;
- delete m_pLoadingFunction;
+ if(initialized_)
+ {
+ getSoundBuffer()->Stop();
+ m_pLoadingThread->join();
+ delete m_pLoadingThread;
+ delete m_pLoadingFunction;
+ }
m_pSoundNotify->Release();
}
bool mof::StreamSoundBuffer::initialize(){
+ /*
m_pLoadingFunction = new StreamingSoundLoader( getSoundBuffer() , m_pSoundNotify , getResource() );
m_pLoadingFunction->initialize();
//m_pLoadingFunction->CopyBlock(0);
m_pLoadingThread = new boost::thread( boost::ref<StreamingSoundLoader>(*m_pLoadingFunction) );
+ */
return true;
}
bool mof::StreamSoundBuffer::play(bool looping){
+
+ m_pLoadingFunction = new StreamingSoundLoader( getSoundBuffer() , m_pSoundNotify , getResource() );
+ m_pLoadingFunction->initialize();
+ //m_pLoadingFunction->CopyBlock(0);
+ m_pLoadingThread = new boost::thread( boost::ref<StreamingSoundLoader>(*m_pLoadingFunction) );
+ initialized_ = true;
+
boost::mutex::scoped_lock lock(m_pLoadingFunction->getMutex());
HRESULT hr = getSoundBuffer()->Play( 0 , 0 , (looping)?DSBPLAY_LOOPING : 0);
return true;
}
-void mof::StreamSoundBuffer::stop(){
+void mof::StreamSoundBuffer::pause(){
+ //TODO 途中から再生
+
+
//boost::mutex::scoped_lock lock(m_pLoadingFunction->GetMutex());
getSoundBuffer()->Stop();
getSoundBuffer()->SetCurrentPosition(0);
//}catch(exception e){DEBUG_PRINT(_T("dd"));}
delete m_pLoadingThread;
delete m_pLoadingFunction;
- m_pLoadingFunction = new StreamingSoundLoader( getSoundBuffer() , m_pSoundNotify , getResource() );
- m_pLoadingFunction->initialize();
- //m_pLoadingFunction->CopyBlock(0);
- m_pLoadingThread = new boost::thread( boost::ref<StreamingSoundLoader>(*m_pLoadingFunction) );
+
+ initialized_ = false;
}
+void mof::StreamSoundBuffer::stop(){
+ //boost::mutex::scoped_lock lock(m_pLoadingFunction->GetMutex());
+ getSoundBuffer()->Stop();
+ getSoundBuffer()->SetCurrentPosition(0);
+ getResource()->resetFile();
+ //try{
+ m_pLoadingThread->join();
+ //}catch(exception e){DEBUG_PRINT(_T("dd"));}
+ delete m_pLoadingThread;
+ delete m_pLoadingFunction;
+
+ initialized_ = false;
+}
LPDIRECTSOUNDNOTIFY8 m_pSoundNotify;
boost::thread* m_pLoadingThread;
StreamingSoundLoader* m_pLoadingFunction;
+ bool initialized_;
public:
StreamSoundBuffer(std::shared_ptr<mof::sound::DirectSoundDevice> pDevice, LPDIRECTSOUNDBUFFER8 pBuffer , LPDIRECTSOUNDNOTIFY8 pSoundNotify , SoundFile* pResource);
virtual ~StreamSoundBuffer(void);
virtual bool initialize();
virtual bool play(bool looping);
+ virtual void pause();
virtual void stop();
};
}
else {
- tmp = m_pImpl->pContainer = pContentView;
+ tmp = m_pImpl->pContainer = make_shared<ClippingView>(pContentView);
}
{
--- /dev/null
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0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
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+1
--{{{ make_text
function make_text(snd_no, frame, mes)
- --if snd_no < 17 then return end
- local t = text('', '<layout w="800" xalign="center">' .. mes .. '</layout>',
+ local priority = 10000
+ local t = text('', '<layout w="800" xalign="center">' .. mes .. '</layout>', priority,
'view=no-content-bg', FeedTween:new(0, 0.93, 1, 0.1))
wait_frame(30)
sound('voice/sn' .. snd_no .. '.wav')
--}}}
--{{{ section1
function section1()
- invoke(world_menu)
-
- wait_frame(10)
-
- make_text(1, 200, '\82Ü\82¸\81A\82±\82ê\82ª\83\8f\81[\83\8b\83h\89æ\96Ê\82Å\82·\81B')
- make_text(2, 400, '\83\8f\81[\83\8b\83h\82Í6X6\82Ì<col code="aaff00">\83G\83\8a\83A</col>\82Å\8d\\90¬\82³\82ê\82Ä\82¨\82è\81A\8ae\83G\83\8a\83A\82É\83G\83\8c\83\81\83\93\83g\82ð\94z\92u\82Å\82«\82Ü\82·\81B')
-
- wait_frame(0)
-
- make_text(3, 400, '\83G\83\8c\83\81\83\93\83g\82Í\90X\82Ì\83G\83\8c\83\81\83\93\83g\81A\91å\92n\82Ì\83G\83\8c\83\81\83\93\83g\81A\90\85\82Ì\83G\83\8c\83\81\83\93\83g\82Ì3\8eí\97Þ\82ª\82 \82è\82Ü\82·\81B')
- make_text(4, 200, '\90\85\82Ì\83G\83\8c\83\81\83\93\83g\82Í\88ê\93x\82È\82\82»\82¤\82Æ\8dl\82¦\82½\82Ì\82Å\82·\82ª\81A')
- make_text(5, 300, '\90X\82Æ\8eR\81A\97¼\95û\82ð\94\90¶\82³\82¹\82é\82½\82ß\82Ì\83G\83\8c\83\81\83\93\83g\82Æ\82µ\82Ä\8ec\82µ\82Ü\82µ\82½\81B')
-
- wait_frame(0)
-
- make_text(6, 1000, '\82»\82ê\82Å\82Í\81A\82¢\82\82Â\82©\92u\82¢\82Ä\82Ý\82Ü\82·\81B')
-
- wait_frame(0)
-
- make_text(7, 300, '\83G\83\8c\83\81\83\93\83g\82Í\92u\82¢\82½\82¾\82¯\82Å\82Í\81A\82»\82Ì\8cø\89Ê\82ð\94\8aö\82µ\82Ü\82¹\82ñ\81B')
- make_text(8, 400, '\83\8f\81[\83\8b\83h\82É\89e\8b¿\82ð\97^\82¦\82é\82É\82Í<col code="aaff00">\83X\83\8a\81[\83v</col>\82ð\8ds\82Á\82Ä\81A\94N\8c\8e\82ð\8co\89ß\82³\82¹\82é\95K\97v\82ª\82 \82è\82Ü\82·\81B')
- make_text(9, 400, '\8eå\90l\8cö\82Å\82 \82é\83\8a\81[\83X\82Í\90l\8aÔ\82Å\82Í\82È\82¢\82Ì\82Å\81A\83X\83\8a\81[\83v\82ð\8ds\82Á\82Ä\81A\93÷\91Ì\82ð\8dÄ\8d\\92z\82·\82é\82±\82Æ\82Å\81A')
- make_text(10, 200, '\94¼\89i\8bv\93I\82É\90¶\82«\82ç\82ê\82Ü\82·\81B')
- make_text(11, 300, '\82±\82Ì\83X\83\8a\81[\83v\82Å\96°\82Á\82Ä\82¢\82é\8aÔ\82É\83G\83\8c\83\81\83\93\83g\82Ì\8cø\89Ê\82ª\95ú\8fo\82³\82ê\81A')
- make_text(12, 300, '\82ä\82Á\82\82è\82Æ\90X\82â\8eR\82ª\82Å\82«\82é\82Æ\82¢\82¤\90Ý\92è\82Å\82·\81B')
- make_text(13, 300, '\83X\83\8a\81[\83v\82É\82Í\91¼\82É\82à\82¢\82\82Â\82©\88Ó\96¡\8d\87\82¢\82ª\82 \82è\82Ü\82·\82ª\81A')
- make_text(14, 300, '\96¢\8eÀ\91\95\82È\82Ì\82Å\81A\82Ü\82½\8d¡\93x\90à\96¾\82µ\82Ü\82·\81B')
-
- wait_frame(0)
- invoke(world_menu)
- wait_frame(20)
-
- make_text(15, 300, '\83X\83\8a\81[\83v\82ð\8ds\82¤\82Æ\81A\82±\82ñ\82È\95\97\82É\83G\83\8a\83A\82É\95Ï\89»\82ª\8c»\82ê\82Ü\82·\81B')
- make_text(16, 400, '\90X\82â\8eR\82ª\82Å\82«\82½\83G\83\8a\83A\82É\82Í\81A\93à\95\94\82Å<col code="aaff00">\8eí\91°\92l</col>\82ª\8a\84\82è\90U\82ç\82ê\82Ü\82·\81B')
- make_text(17, 300, '\8eí\91°\92l\82ª\88ê\92è\88È\8fã\82É\82È\82é\82Æ\81A\82»\82Ì\83G\83\8a\83A\82É\92¬\82ª\82Å\82«\82Ü\82·\81B')
- make_text(18, 300, '\96{\8dì\82Å\82Í\82±\82ê\82ð<col code="aaff00">\83\89\83\93\83h</col>\82Æ\8cÄ\82ñ\82Å\82¢\82Ü\82·\81B')
-
- wait_frame(0)
-
- make_text(19, 400, '\83\89\83\93\83h\82Å\82Í\81A\8dÅ\91å\82R\82Â\82Ì<col code="aaff00">\83T\81[\83r\83X</col>\82Æ\81A<col code="aaff00">\83}\81[\83P\83b\83g</col>\82Æ\82¢\82¤\83R\83}\83\93\83h\82ª\91I\91ð\82Å\82«\82Ü\82·\81B')
- make_text(20, 400, '\82Ç\82Ì\83T\81[\83r\83X\82ª\8c»\82ê\82é\82©\82Í\81A\83\89\83\93\83h\82Ì\8eí\91°\92l\82É\82æ\82Á\82Ä\95Ï\82í\82è\82Ü\82·\81B')
+ wait_frame(200)
- wait_frame(0)
+ make_text(0, 200, '\82Ç\82¤\82à\81A\82¨\8bv\82µ\82Ô\82è\82Å\82·\81B\82¨\82Á\82¬\81[\82Å\82·\81B')
+ make_text(1, 400, '\82Æ\82¤\82Æ\82¤\8eÐ\89ï\90l\82É\82È\82Á\82Ä\82µ\82Ü\82¢\82Ü\82µ\82½\82ª\81A\8d¡\8cã\82à\88ê\95à\88ê\95à\81A\8am\8eÀ\82É\90i\82ß\82Ä\82¢\82«\82Ü\82·\82æ\81I')
+ wait_frame(50)
+ make_text(2, 300, '\82³\82Ä\8d¡\89ñ\82Í\82²\97\97\82Ì\92Ê\82è\81A\83^\83C\83g\83\8b\89æ\96Ê\82Ì\91å\98g\82ð\8dì\82Á\82Ä\82Ý\82Ü\82µ\82½\81B')
+ make_text(3, 300, '\82 \82ç\82©\82¶\82ß\97p\88Ó\82µ\82½\83\8f\81[\83\8b\83h\82ð\82\82é\82\82é\89ñ\93]\82³\82¹\82Ä\82¢\82Ü\82·\81B')
+ make_text(4, 350, '\8dÅ\8fI\93I\82É\82Í\95¡\90\94\8eí\97Þ\82Ì\83\8f\81[\83\8b\83h\82ª\83\89\83\93\83_\83\80\82Å\90Ø\82è\91Ö\82í\82é\82æ\82¤\82É\82·\82é\82Â\82à\82è\82Å\82·\81B')
- make_text(21, 300, '\8d¡\89ñ\82Í\8dz\8eR\82Ì\91\95\94õ\93X\82Æ\82¢\82¤\83T\81[\83r\83X\82ª\8fo\8c»\82µ\82Ü\82µ\82½\81B')
- make_text(22, 300, '\82±\82±\82Å\82Í\83\8a\81[\83X\82Ì\95\90\8aí\82â\81A\96h\8bï\82ð\94\83\82¤\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B')
- make_text(23, 300, '\8c»\8dÝ\82Í\8f¤\95i\83\8a\83X\83g\82ð\95\\8e¦\82·\82é\82Æ\82±\82ë\82Ü\82Å\82ª\8eÀ\91\95\82Å\82«\82Ä\82¢\82Ü\82·\81B')
-end
---}}}
---{{{ section2
-function section2()
- invoke(world_menu)
+ wait_frame(300)
- wait_frame(10)
+ make_text(5, 300, '\83\8f\81[\83\8b\83h\89æ\96Ê\82Í\91O\89ñ\82©\82ç\83O\83\89\83t\83B\83b\83N\82ð\82©\82È\82è\8dì\82è\82±\82ñ\82Å\82 \82è\82Ü\82·\81B')
+ make_text(6, 200, '\82Ü\82½\81A\83\89\83\93\83h\96¼\82ð\89\8f\8eæ\82è\82µ\82Ä\8c©\82â\82·\82\82µ\82½\82è\81c')
+ make_text(7, 430, '\83\89\83\93\83h\82Ì\8bK\96Í\82ð\91å\82Ü\82©\82É\95\\82·\83A\83C\83R\83\93\82ð\95\\8e¦\82µ\82½\82è\82·\82é\82È\82Ç\81AUI\82à\89ü\91P\82µ\82Ä\82 \82è\82Ü\82·\81B')
+ wait_frame(100)
+ make_text(8, 380, '\81c\8e\9f\82Í\83G\83\8c\83\81\83\93\83g\82Ì\94z\92u\83G\83t\83F\83N\83g\82à\81A\82¿\82á\82ñ\82Æ\82µ\82½\82à\82Ì\82É\8d·\82µ\91Ö\82¦\82Ü\82¹\82ñ\82Æ\82Ë\81B')
+ make_text(9, 20, 'ÌËË')
- make_text(24, 200, '\8e\9f\82É\81A\83\89\83\93\83h\82Ì\8c\8b\8d\87\82É\82Â\82¢\82Ä\90à\96¾\82µ\82Ü\82·\81B')
- make_text(25, 400, '\8eí\91°\92l\82ª\88ê\92è\88È\8fã\82É\82È\82é\82Æ\83\89\83\93\83h\82ª\94\90¶\82·\82é\82±\82Æ\82Í\81A\90æ\82Ù\82Ç\90à\96¾\82µ\82½\82Æ\82¨\82è\82Å\82·\81B')
- make_text(26, 300, '\82Q\82Â\88È\8fã\82Ì\83\89\83\93\83h\82ª\82Å\82«\82é\8fð\8c\8f\82ð\96\9e\82½\82µ\82½\83G\83\8a\83A\82ª\97×\90Ú\82µ\82Ä\82¢\82½\8fê\8d\87\81A')
- make_text(27, 300, '\82»\82ê\82ç\82Ì\83\89\83\93\83h\82ª\8c\8b\8d\87\82µ\82Ä\81A\82Ð\82Æ\82Â\82Ì\83\89\83\93\83h\82Æ\82È\82è\82Ü\82·\81B')
- make_text(28, 400, '\8c\8b\8d\87\8cã\82Ì\83\89\83\93\83h\82Í\81A\8c³\82Ì\83\89\83\93\83h\82Ì\8eí\91°\92l\82ð\91«\82µ\8d\87\82í\82¹\82Ä\82Å\82«\82é\83T\81[\83r\83X\82ð\82à\82¿\82Ü\82·\81B')
- make_text(29, 200, '\82±\82ê\82ª<col code="aaff00">\83\89\83\93\83h\82Ì\8c\8b\8d\87</col>\82Å\82·\81B')
+ wait_frame(200)
- invoke(world_menu)
- wait_frame(20)
+ make_text(10, 200, '\82¿\82È\82Ý\82É\81A\83\81\83j\83\85\81[\89æ\96Ê\82Í\8d¡\82±\82¤\82È\82Á\82Ä\82Ü\82·\81B')
+ make_text(11, 400, '\97¬\90Î\82É\90F\81X\8fd\82È\82è\82·\82¬\82Ä\8c©\82Ã\82ç\82¢\82Ì\82Å\81A\94w\8ci\89æ\91\9c\82ð\97p\88Ó\82µ\82½\82¢\82Æ\8ev\82Á\82Ä\82¢\82Ü\82·\81B')
- make_text(30, 400, '\83\89\83\93\83h\82ð\82Ç\82ñ\82Ç\82ñ\8c\8b\8d\87\82µ\82Ä\82¢\82\82Æ\81A\82æ\82è<col code="aaff00">\83O\83\8c\81[\83h</col>\82Ì\8d\82\82¢\83T\81[\83r\83X\82ª\8fo\8c»\82µ\81A')
- make_text(31, 200, '\82»\82ê\82¾\82¯\8b\97Í\82È\83A\83C\83e\83\80\82È\82Ç\82ª\94\83\82¦\82Ü\82·\81B')
- make_text(32, 200, '\82½\82¾\82µ\81A\8c\8b\8d\87\8cã\82à\83\89\83\93\83h\82Ì\83T\81[\83r\83X\82Í\82R\82Â\82Ü\82Å\82Å\82·\81B')
- make_text(33, 400, '\83T\81[\83r\83X\82Ì\8eí\97Þ\82Í\91S\95\94\82Å6\8eí\97Þ\82Å\82·\82Ì\82Å\81A\88Å\89_\82É\82·\82×\82Ä\82Ì\83\89\83\93\83h\82ð\8c\8b\8d\87\82³\82¹\82Ä\82µ\82Ü\82¤\82Æ\81A')
- make_text(34, 200, '\8fê\8d\87\82É\82æ\82Á\82Ä\82Í\95s\97\98\82É\82È\82Á\82Ä\82µ\82Ü\82¢\82Ü\82·\81B')
- make_text(35, 400, '\96Ü\98_\81A\82Ç\82¤\82·\82é\82©\82Í\83v\83\8c\83C\83\84\81[\82Ì\97V\82Ñ\95û\8e\9f\91æ\82Å\82·\81B\83\86\81[\83U\81[\82ª\82Ç\82ñ\82È\83\8f\81[\83\8b\83h\82ð\8dì\82Á\82Ä\82à')
- make_text(36, 400, '\82»\82ê\82È\82è\82É\81A\83\81\83\8a\83b\83g\81A\83f\83\81\83\8a\83b\83g\82Ì\82 \82é\83Q\81[\83\80\90«\82ð\8eÀ\8c»\82µ\82½\82¢\82Å\82·\82Ë\81B\93ï\82µ\82¢\82Å\82·\82ª\81B')
-
+ --make_text(0, 100, '')
end
--}}}
---{{{ section3
-function section3()
- local yukkuri = Picture:new('file.image/yukkuri.png')
- local height_table = {100, 95, 70, 30, 5, 0, 5, 30, 70, 95+26, 100+52, 95+26, 70, 30, 5, 0, 5, 30, 70, 95+26, 100+52, 100}
- local pos_tween = {}
- local size_tween = {[80] = {256, 256}, [100] = {256, 204}, [120] = {256, 256}, [180] = {256, 256}, [200] = {256, 204}, [210] = {256, 256}}
- for idx, val in ipairs(height_table) do
- pos_tween[(idx - 1) * 10] = {700 - idx * 10, 40 + val}
- end
- yukkuri:set_tween('position2', pos_tween)
- yukkuri:set_tween('size2', size_tween)
-
- wait_frame(200)
+--{{{ section2
+function section2()
+ local m = Music:new('music/ClosedPage.ogg')
+ m:play()
- local mes = Message:new('\82¨\82Á\82¬\81[', nil)
- local tw_init = ExtensionTween:new()
- tw_init(mes)
- wait_frame(mes:show())
+ local size = load_game_data('system.client_region')[1]
+ local filter = Picture:new('file.image/fill.png', 0)
+ filter:set_tween('position2', {[0] = {0, 0}})
+ filter:set_tween('size2', {[0] = {size.width, size.height}})
+ filter:set_tween('color', {[0] = {1, 0.2, 0.2, 0.22}})
- next_message(mes, 37, '\82±\82ñ\82É\82¿\82Í\81A\82¨\82Á\82¬\81[\82Å\82·\81B')
- next_message(mes, 38, '\82Ü\82¸\8dÅ\8f\89\82É\82¨\92m\82ç\82¹\82Å\82·\81B<nl/>\82±\82Ì\83Q\81[\83\80\82Ì\83^\83C\83g\83\8b\82ð\8c\88\92è\82µ\82Ü\82µ\82½\81B<nl/><col code="aaff00">\81u\8dÄ\90¢\82Ì\83T\83N\83V\81[\83h\81v</col>\82Æ\96½\96¼\82µ\82æ\82¤\82Æ\8ev\82¢\82Ü\82·\81B')
- next_message(mes, 39, '\8dÄ\90¢\82Ì\83T\83N\83V\81[\83h\82Æ\82Í\81A<nl/>\82±\82ê\82Ü\82Å\81u\8dÄ\90¶\82Ì\8eg\8eÒ\81v\82Æ\8cÄ\82ñ\82Å\82«\82½\82Ì\82ð\92u\82«\8a·\82¦\82½\82à\82Ì\82Å\81A<nl/>\82Â\82Ü\82è\8eå\90l\8cö\83\8a\81[\83X\82Ì\82±\82Æ\82Å\82·\81B')
- next_message(mes, 40, '\8dÄ\90¢\82Í\81u\90¢\8aE\82ð\8dÄ\90¶\81v\82·\82é\82Æ\82¢\82¤\88Ó\96¡\82Ì\91¢\8cê\82Å\81A<nl/>\83T\83N\83V\81[\83h\82Í\8dç\82\81{SEED\82©\82ç\82Â\82\82Á\82½\81A\82±\82ê\82Ü\82½\91¢\8cê\82Å\82·\81B')
- next_message(mes, 41, '\91Ê\9f\97\8e\82©\82æ\81I\82Æ\8ev\82í\82ê\82é\82©\82à\82µ\82ê\82Ü\82¹\82ñ\82Ë\81B<nl/>\8eÀ\8dÛ\82»\82Ì\82Æ\82¨\82è\82Å\82·\81B\82Å\82à\81A\89p\92P\8cê\82Ìsucceed\82É\82Í<nl/>\81u\8eó\82¯\8cp\82®\81v\82Æ\82¢\82¤\88Ó\96¡\82ª\82 \82Á\82Ä\81A<nl/>\88ê\89\9e\81A\82±\82ê\82Í\83V\83i\83\8a\83I\93I\82É\82à\8d\87\92v\82µ\82Ü\82·\81B')
- next_message(mes, 42, '\82Ü\82\9f\81A\82»\82Ì\83V\83i\83\8a\83I\82Ípart9\82Å\8fq\82×\82½\82Æ\82¨\82è\81A<nl/>\82¨\91 \93ü\82è\82É\82È\82è\82Ü\82µ\82½\82¯\82Ç\82Ë\81I')
- wait_frame(mes:hide())
-
- wait_frame(20)
-
- wait_frame(mes:next("\82³\82Ä\81A\82»\82ê\82Å\82Í\90i\92»\93à\97e\82É\82Â\82¢\82Ä\82Å\82·\81B"))
- wait_frame(mes:show())
- sound('voice/sn43.wav')
- wait_for_key(KEY_Z)
- next_message(mes, 44, "\8d¡\89ñ\82Í\81Apart1\82âpart6\82Å\90à\96¾\82µ\82½<nl/>\81u\8dÄ\90¢\83V\83X\83e\83\80\81v\82ð\8eÀ\91\95\82µ\82Ü\82µ\82½\81B<nl/>\82Í\82¶\82ß\82Ä\82Ì\95û\82Í\81A\90æ\82É\82±\82ê\82ç\82Ì\93®\89æ\82ð\8c©\82Ä\82¨\82¢\82½\95û\82ª<nl/>\97\9d\89ð\82µ\82â\82·\82¢\82©\82à\82µ\82ê\82Ü\82¹\82ñ\81B<nl/>\82½\82¾\81A\82±\82Ì\93®\89æ\82Å\82à\82 \82é\92ö\93x\82Í\90à\96¾\82µ\82Ä\82¢\82\82Â\82à\82è\82Å\82·\81B")
- next_message(mes, 45, "\82»\82ê\82Å\82Í\83Q\81[\83\80\89æ\96Ê\82ð\82Ç\82¤\82¼")
-end
---}}}
---{{{ section4
-function section4()
- local yukkuri = Picture:new('file.image/yukkuri.png')
+ local yukkuri = Picture:new('file.image/yukkuri.png', 100)
yukkuri:set_tween('position2', {[0] = {500, 140}})
- local mes = Message:new('\82¨\82Á\82¬\81[', nil)
+ local mes = Message:new('\82¨\82Á\82¬\81[', nil, 200)
local tw_init = ExtensionTween:new()
tw_init(mes)
wait_frame(mes:show())
- next_message(mes, 46, '\81E\81E\81E\82Æ\82¢\82¤\8a´\82¶\82Å\82·\81B\8c\8b\8d\\82·\82·\82ñ\82¾\82Å\82µ\82å\81H')
- next_message(mes, 47, '\8d¡\89ñ\82Í\83\8f\81[\83\8b\83h\83}\83b\83v\8aÖ\98A\82ð\8eÀ\91\95\82µ\82Ü\82µ\82½\82ª\81A<nl/>\82±\82ê\82Æ\81A\82±\82ê\82Ü\82Å\82É\8fÐ\89î\82µ\82½\83_\83\93\83W\83\87\83\93\83}\83b\83v\82Æ\83o\83g\83\8b\81A\82»\82ê\82Æ<nl/>\83\81\83C\83\93\83\81\83j\83\85\81[\82Æ\82ð\8cq\82¬\8d\87\82í\82¹\82Ä\81A\8cã\81A\8d×\82©\82¢\82Æ\82±\82ë\82ð<nl/>\8eÀ\91\95\82·\82ê\82Î\81A\82â\82Á\82Æ\97V\82×\82é\82æ\82¤\82É\82È\82è\82»\82¤\82Å\82·\81B')
- next_message(mes, 48, '\93®\89æ\82Ì\93à\97e\82Í\88È\8fã\82Å\82·\81B<nl/>\82±\82Ì\8cã\81A\83A\83\93\83P\81[\83g\82ð\90Ý\82¯\82Ä\82¢\82Ü\82·\82Ì\82Å\81A<nl/>\90¥\94ñ\82²\8b¦\97Í\82\82¾\82³\82¢\81B<nl/>')
- next_message(mes, 49, '\82»\82ê\82Å\82Í\8aF\82³\82ñ\81A\82æ\82¢\82¨\94N\82ð\81I')
+ next_message(mes, 12, '\8d¡\89ñ\82Ì\8dX\90V\82Å\96Ú\82É\8c©\82¦\82é\82Æ\82±\82ë\82Í\88È\8fã\82Å\82·\81B\92Z\82¢\82Å\82·\82Ë\81B')
+ next_message(mes, 13, '\93à\95\94\8eÀ\91\95\82Ì\8fC\90³\82Æ\82µ\82Ä\82Í\81A<nl/>\82±\82Ì\91¼\82É\83\81\83j\83\85\81[\82Ì\83X\83N\83\8d\81[\83\8b\8b@\94\\82Æ\82©\81A<nl/>\83X\83N\83\8a\83v\83g\82Ì\95À\8ds\8eÀ\8ds\82Ì\8ed\91g\82Ý\82Æ\82©\81A<nl/>\83I\83u\83W\83F\83N\83g\82ð\8ew\92è\82µ\82½\97D\90æ\93x\8f\87\82É\83\\81[\83g\82µ\82Ä<nl/>\95`\89æ\82·\82é\8b@\94\\82Ì\8eÀ\91\95\82Æ\82©\82ð\82â\82è\82Ü\82µ\82½\81B')
+ next_message(mes, 14, '\8dÅ\8cã\82Ì\82Í\82Þ\82µ\82ë<nl/>\82Ü\82¾\82»\82±\82â\82Á\82Ä\82È\82©\82Á\82½\82ñ\82©\81[\82¢\82Á\82Ä\8a´\82¶\82Å\82·\82Ë\81B')
+
+ next_message(mes, 15, '\8e\9f\89ñ\82Ì\8dX\90V\82Å\82Í\81A\82¢\82æ\82¢\82æ\83_\83\93\83W\83\87\83\93\82â\90í\93¬\82Ì\8eÀ\91\95\82ð\81E\81E\81E<nl/>\82Æ\82¢\82¢\82½\82¢\82Æ\82±\82ë\82Å\82·\82ª\81A\82»\82Ì\91O\82É\83\8f\83\93\83N\83b\83V\83\87\83\93\92u\82¢\82Ä\90æ\82É<nl/>\82¢\82\82Â\82©\8aJ\94\97p\83c\81[\83\8b\82ð\8dì\82Á\82Ä\82µ\82Ü\82¤\82×\82«\82©\82È\82Æ\8ev\82Á\82Ä\82¢\82Ü\82·\81B')
+ next_message(mes, 16, '\82½\82¾\82µ\91å\92ï\82ÍPupSQLite\82Å\82È\82ñ\82Æ\82©\82È\82é\82Ì\82Å\81A<nl/>\96{\93\96\82É\95K\97v\82È\82à\82Ì\82É\8di\82Á\82Ä\8aJ\94\82·\82é\82Â\82à\82è\82Å\82·\81B')
+ next_message(mes, 17, '\82»\82ê\82Å\82Í\8e\9f\89ñ\82à\82¨\8ay\82µ\82Ý\82É\81I')
wait_frame(mes:hide())
end
--}}}
---{{{ part10
-function part10()
- section4()
+--{{{ part11
+function part11()
+ section2()
end
--}}}
sound('sound/put_element.wav')
end
--}}}
+--{{{ transition
+function transition(span1, span2, priority)
+ local size = load_game_data('system.client_region')[1]
+ local filter = Picture:new('file.image/fill.png', priority)
+ filter:set_tween('position2', {[0] = {0, 0}})
+ filter:set_tween('size2', {[0] = {size.width, size.height}})
+ filter:set_tween('color', {[0] = {0, 0, 0, 0}, [span1] = {1, 0, 0, 0},
+ [span1 + 30] = {1, 0, 0, 0}, [span1 + 30 + span2] = {0, 0, 0, 0}})
+ wait_frame( span1 + span2 + 30 )
+ filter:dispose()
+
+end
+--}}}
require('script/moflib')
require('script/common')
require('script/world_menu')
+require('script/title')
+require('script/douga')
function main()
+ title()
+
while true do
world_menu()
end
KEY_ESCAPE = 31
KEY_ANY = 32
--}}}
+--{{{ quit
+function quit()
+ mof_quit()
+ coroutine.yield()
+end
+
+--\82±\82±\82Ì\83L\81[\92è\90\94\82ÍInputReceiver\82Æ\93¯\8aú\82µ\82Ä\82¢\82È\82¯\82ê\82Î\82È\82ç\82È\82¢
+KEY_UP = 1
+KEY_DOWN = 2
+KEY_LEFT = 3
+KEY_RIGHT = 4
+KEY_A = 5
+KEY_B = 6
+KEY_C = 7
+KEY_D = 8
+KEY_E = 9
+KEY_F = 10
+KEY_G = 11
+KEY_H = 12
+KEY_I = 13
+KEY_J = 14
+KEY_K = 15
+KEY_L = 16
+KEY_M = 17
+KEY_N = 18
+KEY_O = 19
+KEY_P = 20
+KEY_Q = 21
+KEY_R = 22
+KEY_S = 23
+KEY_T = 24
+KEY_U = 25
+KEY_V = 26
+KEY_W = 27
+KEY_X = 28
+KEY_Y = 29
+KEY_Z = 30
+KEY_ESCAPE = 31
+KEY_ANY = 32
+--}}}
--{{{ sound
function sound(filepath)
local obj = Sound:new(filepath)
end
--}}}
--}}}
+--{{{ music
+--{{{ new
+Music = {}
+function Music:new(filepath)
+ local id = musicCreateImpl(filepath)
+ local obj = {}
+ obj.id_ = id
+ setmetatable(obj, {__index = Music})
+ return obj
+end
+--}}}
+--{{{ set_tween
+function Music:set_tween(target, stream)
+ objectSetBehaviorImpl(self.id_, 'music.' .. target, stream, 0)
+end
+--}}}
+--{{{ play
+function Music:play()
+ mof_music_play(self.id_)
+end
+--}}}
+--{{{ pause
+function Music:pause()
+ mof_music_pause(self.id_)
+end
+--}}}
+--{{{ dispose
+function Music:dispose()
+ disposeImpl(self.id_, 'music')
+end
+--}}}
+--}}}
--{{{ load_game_data
function load_game_data(resource_path)
return loadGameDataImpl(resource_path)
return 'message'
end
--}}}
+--{{{ enable
+function Message:enable(is_enable)
+ return mof_obj_enable(self.id_, is_enable, 'message')
+end
+--}}}
--{{{ dispose
function Message:dispose(text)
return disposeImpl(self.id_, 'message')
return 'question'
end
--}}}
+--{{{ enable
+function Question:enable(is_enable)
+ return mof_obj_enable(self.id_, is_enable, 'menu')
+end
+--}}}
--{{{ dispose
function Question:dispose()
return disposeImpl(self.id_, 'menu')
return 'picture'
end
--}}}
+--{{{ enable
+function Picture:enable(is_enable)
+ return mof_obj_enable(self.id_, is_enable, 'picture')
+end
+--}}}
--{{{ dispose
function Picture:dispose()
return disposeImpl(self.id_, 'picture')
return 'board'
end
--}}}
+--{{{ enable
+function Board:enable(is_enable)
+ return mof_obj_enable(self.id_, is_enable, 'board')
+end
+--}}}
--{{{ dispose
function Board:dispose()
return disposeImpl(self.id_, 'board')
return 'particlegen'
end
--}}}
+--{{{ enable
+function Particlegen:enable(is_enable)
+ return mof_obj_enable(self.id_, is_enable, 'particlegen')
+end
+--}}}
--{{{ dispose
function Particlegen:dispose()
return disposeImpl(self.id_, 'particlegen')
return 'solid'
end
--}}}
+--{{{ enable
+function Solid:enable(is_enable)
+ return mof_obj_enable(self.id_, is_enable, 'solid')
+end
+--}}}
--{{{ dispose
function Solid:dispose()
return disposeImpl(self.id_, 'solid')
--}}}
--}}}
--{{{ invoke
+Routine = {}
+ThreadTable = {} -- \88Ó\90}\82µ\82È\82¢\83K\83x\81[\83W\83R\83\8c\83N\83V\83\87\83\93\82ð\96h\82®\82½\82ß\82Ì\83e\81[\83u\83\8b
function invoke(func, ...)
- local co = coroutine.create(function (...)
+ local co = coroutine.create(function (id, ...)
coroutine.yield()-- \88ø\90\94\82ð\93n\82µ\82Ä\82·\82®yield\82·\82é
func(...)
+ -- C\91¤\82É\8fI\97¹\82ð\92Ê\92m\82·\82é
+ mof_routine_stop(id)
+ table.remove(ThreadTable, id)
end)
local thread_id = mof_invoke(co)
- coroutine.resume(co, ...)
- return thread_id
+ coroutine.resume(co, thread_id, ...)
+ local obj = {}
+ obj.id_ = thread_id
+ ThreadTable[thread_id] = co -- \88Ó\90}\82µ\82È\82¢\83K\83x\83R\83\8c\91Î\8dô
+ setmetatable(obj, {__index = Routine})
+ return obj
end
+
+function Routine:stop()
+ mof_routine_stop(self.id_)
+ table.remove(ThreadTable, self.id_)
+end
+
--}}}
--{{{ put_element
function put_element(element_type, x, y)
+-- ワールドシーン関連
PRIORITY_WORLD_SCENE_BACKGROUND = 0 -- 背景とワールドマップ
PRIORITY_WORLD_SCENE_LAND_REGION = 50 --
-PRIORITY_WORLD_SCENE_ELEMENT_EFFECT = 80 --
PRIORITY_WORLD_SCENE_AREA_PICTURE = 100 --
PRIORITY_WORLD_SCENE_CHARACTER = 110 --
PRIORITY_WORLD_SCENE_CURSOR = 100 --
PRIORITY_WORLD_SCENE_LAND_NAME = 200 --
PRIORITY_WORLD_SCENE_MENU = 300 --
+PRIORITY_WORLD_SCENE_ELEMENT_EFFECT = 400 --
-- メニューシーン関連
PRIORITY_MENU_SCENE_BACKGROUND = 1000
PRIORITY_MENU_SCENE_MENU = 1300
PRIORITY_MENU_DESCRIPTION = 1300 -- アイテム等の説明欄画面
+-- タイトルシーン関連
+PRIORITY_TITLE_SCENE_BACKGROUND = 0 -- 背景
+PRIORITY_TITLE_SCENE_WORLD = 100 -- ワールド
+PRIORITY_TITLE_SCENE_TRANSITION = 1001
+PRIORITY_TITLE_SCENE_LOGO = 1000 -- ロゴ
+PRIORITY_TITLE_SCENE_FILTER = 999
+PRIORITY_TITLE_SCENE_MENU = 1000
+
--- /dev/null
+require('script/moflib')
+require('script/common')
+require('script/stage_menu')
+require('script/main_menu')
+require('script/land_menu')
+require('script/effect')
+
+--{{{ title_question
+function title_question(title, items, priority, style, initializer, ignore_cancel, callback_move_cursor, callback_select)
+ if ignore_cancel == nil then ignore_cancel = false end
+ local disables = {}
+ if not is_empty(style) then
+ -- \83I\83v\83V\83\87\83\93\89ð\90Í
+ local s = {split(style, ';')}
+ for idx, ss in ipairs(s) do
+ local n, v = split(ss, '=')
+ if n == 'disable' then
+ disables = {split(v, ',')}
+ break
+ end
+ end
+ end
+ local obj = Question:new(title, items, priority, style)
+ if initializer ~= nil then initializer(obj) end
+ local frame = obj:show()
+ wait_frame(frame)
+ while true do
+ local old_index = obj:get_current()
+ local key = get_key()
+
+ if key == KEY_UP then obj:move_cursor_up()
+ elseif key == KEY_DOWN then obj:move_cursor_down()
+ elseif key == KEY_LEFT then obj:move_cursor_left()
+ elseif key == KEY_RIGHT then obj:move_cursor_right()
+ elseif key == KEY_X and ignore_cancel == false then
+ sound("sound/cancel.wav")-- \83L\83\83\83\93\83Z\83\8b\89¹
+ frame = obj:hide()
+ wait_frame(frame)
+ obj:dispose()
+ return 0 --\83L\83\83\83\93\83Z\83\8b
+ elseif key == KEY_Z then
+ if not find(disables, tostring(old_index)) then -- disable\82È\82ç\96³\8e\8b\82·\82é
+ sound("sound/warp.wav")-- \8c\88\92è\89¹
+ frame = obj:select()
+ wait_frame(frame)
+ local continue = true
+ if callback_select ~= nil then continue = callback_select(old_index) end
+ if continue then
+ -- \83E\83B\83\93\83h\83E\82ð\95Â\82¶\82é\82Æ\82«\82Ì\8f\88\97\9d
+
+ -- \88Ã\93]
+ invoke(transition, 100, 100, PRIORITY_TITLE_SCENE_TRANSITION)
+ wait_frame( 100 )
+ obj:dispose()
+ return old_index + 1 --0 \82Í\83L\83\83\83\93\83Z\83\8b\8e\9e\82Ì\93®\82«
+ end
+ end
+ end
+ local index = obj:get_current()
+ if index ~= old_index and callback_move_cursor ~= nil then callback_move_cursor(index) end
+ end
+end
+--}}}
+--{{{ make_land_scale_level
+function make_land_scale_level( land_scale )
+ if land_scale > 9 then
+ return 2
+ elseif land_scale > 4 then
+ return 1
+ else
+ return 0
+ end
+end
+--}}}
+--{{{ area_menu
+function area_menu(world)
+ local cursor_x = 0
+ local cursor_y = 0
+
+ local s = Solid:new('file.model/area_cursor.x', PRIORITY_WORLD_SCENE_CURSOR)
+ joint(s, 'distance', world)-- \83J\81[\83\\83\8b\82Í\83\8f\81[\83\8b\83h\82Ì\93®\82«\82É\92Ç\8f]\82·\82é
+
+ local area_info = text('', ' ', PRIORITY_WORLD_SCENE_MENU, 'view=no-title-bg', FeedTween:new(0.05, 0.05, 0.70, 0.15))
+
+ local area = load_game_data('gamedata.area_profile.' .. cursor_x .. '.' .. cursor_y)
+ local area_pic = update_area(s, cursor_x, cursor_y, area_info, area[1], nil)
+ wait_frame(30)
+ local region = nil-- \83\89\83\93\83h\82ª\91¶\8dÝ\82·\82é\8fê\8d\87\82Ì\82Ýland region\82ð\95\\8e¦\82·\82é
+ if area[1].land_flag == '1' then
+ region = land_region_create(cursor_x, cursor_y, PRIORITY_WORLD_SCENE_LAND_REGION)
+ end
+
+ while true do
+ local skip = false
+ local k = get_key()
+ if k == KEY_X then
+ sound('sound/cancel.wav')
+ break
+ elseif k == KEY_Z then
+ sound('sound/decide.wav')
+ if area[1].forest_flag == '1' then
+ forest_already_located()
+ elseif area[1].earth_flag == '1' then
+ earth_already_located()
+ elseif area[1].water_flag == '1' then
+ water_already_located()
+ elseif area[1].capital_flag == '1' then
+ enter_land(area[1], cursor_x, cursor_y)
+ else
+ element_menu(area[1], cursor_x, cursor_y, s)
+ area = load_game_data('gamedata.area_profile.' .. cursor_x .. '.' .. cursor_y)-- \83G\83\8a\83A\8fî\95ñ\8dX\90V
+ end
+ skip = true
+ elseif k == KEY_UP and cursor_y > 0 then cursor_y = cursor_y - 1
+ elseif k == KEY_DOWN and cursor_y < 5 then cursor_y = cursor_y + 1
+ elseif k == KEY_LEFT and cursor_x > 0 then cursor_x = cursor_x - 1
+ elseif k == KEY_RIGHT and cursor_x < 5 then cursor_x = cursor_x + 1
+ else skip = true end
+
+ if not skip then
+ sound('sound/select.wav')
+ area = load_game_data('gamedata.area_profile.' .. cursor_x .. '.' .. cursor_y)
+ area_pic = update_area(s, cursor_x, cursor_y, area_info, area[1], area_pic)
+ if region then
+ region:dispose()
+ region = nil
+ end
+ if area[1].land_flag == '1' then region = land_region_create(cursor_x, cursor_y, PRIORITY_WORLD_SCENE_LAND_REGION) end
+ end
+ end
+ s:dispose()
+ area_info:dispose()
+ area_pic:dispose()
+ if region then region:dispose() end
+end
+--}}}
+--{{{ title
+function title()
+ -- \94w\8ci\82Ì\83Z\83b\83g\83A\83b\83v
+ local size = load_game_data('system.client_region')[1]
+ local bg = Picture:new('file.image/fill.png', PRIORITY_TITLE_SCENE_BACKGROUND)
+ bg:set_tween('position2', {[0] = {0, 0}})
+ bg:set_tween('size2', {[0] = {size.width, size.height}})
+ bg:set_tween('color', {[0] = {0.1, 0.1, 0.1}})
+
+ -- \83t\83B\83\8b\83^\82Ì\83Z\83b\83g\83A\83b\83v
+ local size = load_game_data('system.client_region')[1]
+ local filter = Picture:new('file.image/fill.png', PRIORITY_TITLE_SCENE_FILTER)
+ filter:set_tween('position2', {[0] = {0, 0}})
+ filter:set_tween('size2', {[0] = {size.width, size.height}})
+ filter:set_tween('color', {[0] = {1, 0, 0, 0}, [100] = {1, 0, 0, 0}, [130] = {0, 0 , 0, 0}})
+
+ -- \83\8d\83S\82Ì\95\\8e¦
+ local logos = {}
+ title1( logos )
+
+ wait_frame(30)
+
+ -- TODO volume\90§\8cä
+ local bgm = Music:new('music/ClosedPage.ogg')
+ bgm:play()
+
+ wait_frame(60)
+
+ local world_routine = invoke(show_world_consecutively)
+
+ wait_frame(30)
+
+ local answer = title2()
+
+ if answer == 3 then
+ -- exit game
+ quit()
+ end
+
+ -- \8cã\8en\96\96
+ world_routine:stop()
+ filter:dispose()
+ bg:dispose()
+ bgm:dispose()
+ for i, v in pairs(logos)
+ do
+ v:dispose()
+ end
+
+ -- 1 \82È\82ç New Game
+ -- 2 \82È\82ç Continue
+ -- 3 \82È\82ç Exit
+ return answer
+
+ end
+--}}}
+--{{{ title1
+function title1(logos)
+
+ local positions = {
+ {0, 0}, -- \8dÄ
+ {100, 38}, -- \90¢
+ {183, 0}, -- \82Ì
+ {270, 25}, -- \83T
+ {365, 5}, -- \83N
+ {450, 0}, -- \83V
+ {525, 8}, -- \81[
+ {610, 20}, -- \83h
+ }
+
+ local visible = {1, 1, 1, 1}
+ local invisible = {0, 1, 1, 1}
+ local span = 3
+ for i = 1, 8
+ do
+ local logo = Picture:new('file.image/title/logo' .. i .. '.png', PRIORITY_TITLE_SCENE_LOGO)
+ logo:set_tween('position2', {[0] = {positions[i][1] -15, positions[i][2]}})
+ logo:set_tween('color',
+ {
+ [0] = invisible, [i * span] = invisible, [i * span + 1] = visible,
+ [(i + 1) * span] = visible, [(i + 1) * span + 1] = invisible,
+ [50] = invisible, [51] = visible
+ })
+ table.insert(logos, logo)
+ end
+
+
+end
+--}}}
+--{{{ title2
+function title2()
+
+ local items = {
+ '<layout w="130" h="28" xalign="center" yalign="center">New Game</layout>',
+ '<layout w="130" h="28" xalign="center" yalign="center"><col name="gray">Continue</col></layout>',
+ '<layout w="130" h="28" xalign="center" yalign="center">Exit</layout>',
+ }
+
+ local answer = 0
+ local handler = function (index)
+ if index == 0 then
+ -- new game
+ return true
+ elseif index == 1 then
+ -- continue
+ return false
+ elseif index == 2 then
+ -- exit
+ return true
+ end
+ return false
+ end
+
+ answer = title_question('', items, PRIORITY_TITLE_SCENE_MENU, 'disable=1', ExtensionTween:new(), true, nil, handler )
+
+ -- 1 \82È\82ç New Game
+ -- 2 \82È\82ç Continue
+ -- 3 \82È\82ç Exit
+ return answer
+end
+--}}}
+--{{{ show_world_consecutively
+function show_world_consecutively()
+ while true do
+ local routine = invoke(show_world)
+ wait_frame(1500)
+ invoke(transition, 100, 100, PRIORITY_TITLE_SCENE_FILTER)
+ wait_frame(100)
+ routine:stop() -- show_world \82Í\8fI\97¹\82µ\82È\82¢\82Ì\82Å\96¾\8e¦\93I\82Éstop
+ end
+end
+--}}}
+--{{{ show_world
+function show_world()
+ local camera = Camera:new()
+ camera:set_tween('eye', {[0] = {0, 1.4, -1.8}})
+ camera:set_tween('lookat', {[0] = {0, 0, 0}})
+
+ local s = Solid:new('world', PRIORITY_TITLE_SCENE_WORLD)
+ local earth = Solid:new('file.model/world.x', PRIORITY_TITLE_SCENE_WORLD)
+ joint(earth, 'distance', s)
+
+ s:set_tween('rotate3', {['loop'] = {0, 7000}, [0] = {0, 0, 0}, [7000] = {0, 6.28, 0}})
+ local world_light = Light:new('directional')
+ world_light:set_tween('position3',
+ {
+ ['loop'] = {0, 2400},
+ [0] = {1, -0.1, 0},
+ [600] = {0, -0.1, -1},
+ [1200] = {-1, -0.1, 0},
+ [1800] = {0, -0.1, -1},
+ [2400] = {1, -0.1, 0},
+ })
+ world_light:set_tween('ambient.color', {[0] = {0.5, 0.5, 0.9}})
+ world_light:set_tween('diffuse.color', {[0] = {1, 1, 1}})
+ s:set_light(world_light)
+
+ local land_names = {}
+ local land_icons = {}
+
+ for i = 0, 5 do
+ for j = 0, 5 do
+ local area = load_game_data('gamedata.area_profile.' .. i .. '.' .. j)
+ if area[1].capital_flag == '1' then
+ local name = area[1].name
+ name = '<col code="000011"><font name="Vinque" size="22" edge="1"><layout w="50" xalign="center">' .. name .. '</layout></font></col>'
+ local land_scale_level = make_land_scale_level( tonumber(area[1].land_scale) );
+
+ -- \83\89\83\93\83h\96¼
+ local b = Board:new(name, PRIORITY_WORLD_SCENE_LAND_NAME, 'z-buffer=disable')
+ b:set_tween('position3', {[0] = {0.2 * i - 0.5, 0.1, -0.2 * j + 0.5}})
+ b:set_tween('size3', {[0] = {1.4, 1.4, 1.4}})
+ joint(b, 'distance', s)
+ table.insert(land_names, b)
+
+ -- \83\89\83\93\83h\83A\83C\83R\83\93
+ local icon = Board:new('file.image/land_icon.png', PRIORITY_WORLD_SCENE_LAND_NAME -1, 'z-buffer=disable')
+ icon:set_tween('position3', {[0] = {0.2 * i - 0.5, 0.01, -0.2 * j + 0.5}})
+ icon:set_tween('size3', {[0] = {0.2, 0.2, 0.2}})
+
+ local u = land_scale_level % 4;
+ local v = math.floor(land_scale_level / 4);
+ icon:set_tween('texcoord', {[0] = { u * 0.25, v * 0.25, (u + 1) * 0.25, (v + 1) * 0.25}})
+ joint(icon, 'distance', s)
+ table.insert(land_icons, icon)
+ end
+ end
+ end
+
+
+ while true do
+ wait_frame(1000)
+ end
+end
+function show_world_()
+ local camera = Camera:new()
+ camera:set_tween('eye', {[0] = {0, 1.4, -1.8}})
+ camera:set_tween('lookat', {[0] = {0, 0, 0}})
+
+ local s = Solid:new('world', PRIORITY_TITLE_SCENE_WORLD)
+ local earth = Solid:new('file.model/world.x', PRIORITY_TITLE_SCENE_WORLD)
+ joint(earth, 'distance', s)
+
+ s:set_tween('rotate3', {['loop'] = {0, 7000}, [0] = {0, 0, 0}, [7000] = {0, 6.28, 0}})
+ local world_light = Light:new('directional')
+ world_light:set_tween('position3',
+ {
+ ['loop'] = {0, 2400},
+ [0] = {1, -0.1, 0},
+ [600] = {0, -0.1, -1},
+ [1200] = {-1, -0.1, 0},
+ [1800] = {0, -0.1, -1},
+ [2400] = {1, -0.1, 0},
+ })
+ world_light:set_tween('ambient.color', {[0] = {0.5, 0.5, 0.9}})
+ world_light:set_tween('diffuse.color', {[0] = {1, 1, 1}})
+ s:set_light(world_light)
+
+ local land_names = {}
+ local land_icons = {}
+
+ for i = 0, 5 do
+ for j = 0, 5 do
+ local area = load_game_data('gamedata.area_profile.' .. i .. '.' .. j)
+ if area[1].capital_flag == '1' then
+ local name = area[1].name
+ name = '<col code="000011"><font name="Vinque" size="22" edge="1"><layout w="50" xalign="center">' .. name .. '</layout></font></col>'
+ local land_scale_level = make_land_scale_level( tonumber(area[1].land_scale) );
+
+ -- \83\89\83\93\83h\96¼
+ local b = Board:new(name, PRIORITY_WORLD_SCENE_LAND_NAME, 'z-buffer=disable')
+ b:set_tween('position3', {[0] = {0.2 * i - 0.5, 0.1, -0.2 * j + 0.5}})
+ b:set_tween('size3', {[0] = {1.4, 1.4, 1.4}})
+ joint(b, 'distance', s)
+ table.insert(land_names, b)
+
+ -- \83\89\83\93\83h\83A\83C\83R\83\93
+ local icon = Board:new('file.image/land_icon.png', PRIORITY_WORLD_SCENE_LAND_NAME -1, 'z-buffer=disable')
+ icon:set_tween('position3', {[0] = {0.2 * i - 0.5, 0.01, -0.2 * j + 0.5}})
+ icon:set_tween('size3', {[0] = {0.2, 0.2, 0.2}})
+
+ local u = land_scale_level % 4;
+ local v = math.floor(land_scale_level / 4);
+ icon:set_tween('texcoord', {[0] = { u * 0.25, v * 0.25, (u + 1) * 0.25, (v + 1) * 0.25}})
+ joint(icon, 'distance', s)
+ table.insert(land_icons, icon)
+ end
+ end
+ end
+
+ -- \83v\83\8d\83O\83\89\83\80\96{\91Ì\82Édispose\82ð\8cÄ\82Î\82¹\82é
+ while true do
+ wait_frame(1000)
+ end
+end
+--}}}
--}}}
--{{{ world_menu
function world_menu()
+ local bgm = Music:new('music/EGG_home.ogg')
+ bgm:play()
local bg_space = Solid:new('file.model/space.x', PRIORITY_WORLD_SCENE_BACKGROUND)
bg_space:set_tween('position3', {[0] = {0, -1.4, -9}})
local camera = Camera:new()
camera:set_tween('eye', {[0] = {0, 1.4, -1.8}})
camera:set_tween('lookat', {[0] = {0, 0, 0}})
- wait_frame(1)
local s = Solid:new('world', PRIORITY_WORLD_SCENE_BACKGROUND)
local earth = Solid:new('file.model/world.x', PRIORITY_WORLD_SCENE_BACKGROUND)
joint(earth, 'distance', s)
- -- TODO
- s:set_tween('rotate3', {['loop'] = {0, 7000}, [0] = {0, 0, 0}, [7000] = {0, 6.28, 0}})
local world_light = Light:new('directional')
world_light:set_tween('position3',
{
bg_space:dispose()
world_light:dispose()
saisei:dispose()
+ bgm:dispose()
end
local answer = 0
finalizer()
return
end
-
end
-
finalizer()
end
--}}}
//{{{ draw
void my_scene::draw() const
{
- /*
- mof::Rectangle<int> cr = mof::GraphicsDevice::getClientRegion();
- mof::VertexXYZRHWC vertices[] =
- {
- mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(0 , 0 , 0)) ,
- mof::VertexXYZRHWC(mof::Vector2D(cr.getWidth() , 0) , mof::createColor(0 , 0 , 0)) ,
- mof::VertexXYZRHWC(mof::Vector2D(0 , cr.getHeight()) , mof::createColor(130 , 130 , 130)) ,
- mof::VertexXYZRHWC(mof::Vector2D(cr.getWidth() , cr.getHeight()) , mof::createColor(130 , 130 , 130))
- };
- */
- /*
- mof::VertexXYZRHWC vertices[] =
- {
- mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(50 , 50 , 120)) ,
- mof::VertexXYZRHWC(mof::Vector2D(cr.getWidth() , 0) , mof::createColor(50 , 50 , 120)) ,
- mof::VertexXYZRHWC(mof::Vector2D(0 , cr.getHeight()) , mof::createColor(0 , 0 , 60)) ,
- mof::VertexXYZRHWC(mof::Vector2D(cr.getWidth() , cr.getHeight()) , mof::createColor(0 , 0 , 60))
- };
- */
-
- //mof::GraphicsDevice::setTexture(NULL);
- //mof::GraphicsDevice::drawVertexArray(vertices[0] , vertices[3] , mof::PRIMITIVE_TYPE_TRIANGLESTRIP );
- mof::GraphicsDevice::clearZBuffer();
-
pimpl_->environment_->draw();
}
//}}}
#include "Settings.hpp"
+
+
+
int main(int argc, char** argv)
{
+#if defined(DEBUG) | defined(_DEBUG)
+ _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
+#endif
std::vector<mof::tstring> args(argv, argv + argc);
-
::Settings settings;
int result = ::LoadSettings(&settings);
try {
}
//}}}
//{{{ land_region_create
- int MyEnvironment::land_region_create(int x, int y, int priority)
+ int MyEnvironment::land_region_create(unsigned int thread_id, int x, int y, int priority)
{
auto vertices = impl_->world_->make_land_region_vertices(x, y);
auto texture = ::getTextureResourceManager(::SYSTEM)->getResource("image/element.png");
- return vertex_buffer_create(vertices->front(), vertices->back(), texture, priority);
+ return vertex_buffer_create(thread_id, vertices->front(), vertices->back(), texture, priority);
}
//}}}
//{{{ save_profile
int y
);
- virtual int land_region_create(int x, int y, int priority);
+ virtual int land_region_create(unsigned int thread_id, int x, int y, int priority);
virtual void world_sleep();