-#include "BattlerWindow.h"\r
-#include "MyWindow.h"\r
-#include "mof/GraphicsDevice.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include <sstream>\r
-#include <iomanip>\r
-\r
-et::BattlerWindow::BattlerWindow( mof::TextureManager* pTextureManager , et::BattlerFacade* pBattler )\r
-: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame1.png")))\r
-{\r
- m_pTextureManager = pTextureManager;\r
- m_pBattler = pBattler;\r
-\r
- add(new et::MyWindow(mof::Sprite::createSpriteFromText(m_pBattler->getParameter().name , 12) , m_pTextureManager));\r
- m_pContent = new et::MyWindow(mof::Sprite::createSpriteFromText( _T(""), 12) , m_pTextureManager);\r
- resetView();\r
- add(m_pContent);\r
- setMargin(4);\r
- m_timeStamp = pBattler->getTimeStamp();\r
-\r
- //\94w\8ci\90F\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setColor(0 , mof::createColor(127 , 255 , 255 , 255));\r
- this->setAnimation( 0 , mof::AnimationResource(pAnimation));\r
- setVisible(true);\r
-}\r
-\r
-et::BattlerWindow::~BattlerWindow(void)\r
-{\r
- \r
-}\r
-\r
-bool et::BattlerWindow::draw(){\r
- if(!m_pBattler->getParameter().alive)return false;\r
- mof::Vector2D position = mof::GraphicsDevice::getInstance()->to2DPosition(m_pBattler->getPosition());\r
- position.x -= 32;\r
- position.y += 0;\r
- setPosition(position);\r
- return MyFrame::draw();\r
-}\r
-\r
-bool et::BattlerWindow::update(){\r
- if(m_pBattler->getTimeStamp() != m_timeStamp){\r
- m_timeStamp = m_pBattler->getTimeStamp();\r
- resetView();\r
- }\r
- return et::MyFrame::update();\r
- \r
-}\r
-\r
-void et::BattlerWindow::resetView(){\r
- std::basic_ostringstream<TCHAR> stream;\r
- if(m_pBattler->getType() != et::IDEAL){//\90_\97ì\82ÍHP\95\\8e¦\82Í\82È\82¢\r
- stream << _T("HP:") << std::setw(4) << m_pBattler->getParameter().hp << _T("/") << std::setw(4) << m_pBattler->getParameter().maxHp ;\r
- }\r
- stream << _T(" AP:") << m_pBattler->getParameter().actionPoint;\r
- m_pContent->setContent(mof::Sprite::createSpriteFromText(stream.str() , 12));\r
+#include "BattlerWindow.h"
+#include "MyWindow.h"
+#include "mof/GraphicsDevice.h"
+#include "mof/KeyFrameAnimation.h"
+#include <sstream>
+#include <iomanip>
+
+et::BattlerWindow::BattlerWindow( mof::TextureManager* pTextureManager , et::BattlerFacade* pBattler )
+: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame1.png")))
+{
+ m_pTextureManager = pTextureManager;
+ m_pBattler = pBattler;
+
+ add(new et::MyWindow(mof::Sprite::createSpriteFromText(m_pBattler->getParameter().name , 12) , m_pTextureManager));
+ m_pContent = new et::MyWindow(mof::Sprite::createSpriteFromText( _T(""), 12) , m_pTextureManager);
+ resetView();
+ add(m_pContent);
+ setMargin(4);
+ m_timeStamp = pBattler->getTimeStamp();
+
+ //\94w\8ci\90F
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setColor(0 , mof::createColor(127 , 255 , 255 , 255));
+ this->setAnimation( 0 , mof::AnimationResource(pAnimation));
+ setVisible(true);
+}
+
+et::BattlerWindow::~BattlerWindow(void)
+{
+
+}
+
+bool et::BattlerWindow::draw(){
+ if(!m_pBattler->getParameter().alive)return false;
+ mof::Vector2D position = mof::GraphicsDevice::getInstance()->to2DPosition(m_pBattler->getPosition());
+ position.x -= 32;
+ position.y += 0;
+ setPosition(position);
+ return MyFrame::draw();
+}
+
+bool et::BattlerWindow::update(){
+ if(m_pBattler->getTimeStamp() != m_timeStamp){
+ m_timeStamp = m_pBattler->getTimeStamp();
+ resetView();
+ }
+ return et::MyFrame::update();
+
+}
+
+void et::BattlerWindow::resetView(){
+ std::basic_ostringstream<TCHAR> stream;
+ if(m_pBattler->getType() != et::IDEAL){//\90_\97ì\82ÍHP\95\\8e¦\82Í\82È\82¢
+ stream << _T("HP:") << std::setw(4) << m_pBattler->getParameter().hp << _T("/") << std::setw(4) << m_pBattler->getParameter().maxHp ;
+ }
+ stream << _T(" AP:") << m_pBattler->getParameter().actionPoint;
+ m_pContent->setContent(mof::Sprite::createSpriteFromText(stream.str() , 12));
}
\ No newline at end of file
-#pragma once\r
-#include "MyFrame.h"\r
-#include "MyWindow.h"\r
-#include "BattlerFacade.h"\r
-\r
-namespace et{\r
-\r
- class BattlerWindow : public MyFrame\r
- { \r
- mof::TextureManager* m_pTextureManager;\r
- et::BattlerFacade* m_pBattler;\r
- MyWindow* m_pContent;\r
- int m_timeStamp;\r
-\r
- void resetView();\r
- public:\r
- BattlerWindow( mof::TextureManager* pTextureManager , et::BattlerFacade* pBattler );\r
- virtual ~BattlerWindow(void);\r
- virtual bool draw();\r
- virtual bool update();\r
- };\r
-\r
-}\r
+#pragma once
+#include "MyFrame.h"
+#include "MyWindow.h"
+#include "BattlerFacade.h"
+
+namespace et{
+
+ class BattlerWindow : public MyFrame
+ {
+ mof::TextureManager* m_pTextureManager;
+ et::BattlerFacade* m_pBattler;
+ MyWindow* m_pContent;
+ int m_timeStamp;
+
+ void resetView();
+ public:
+ BattlerWindow( mof::TextureManager* pTextureManager , et::BattlerFacade* pBattler );
+ virtual ~BattlerWindow(void);
+ virtual bool draw();
+ virtual bool update();
+ };
+
+}
-#include "CharacterBoard.hpp"\r
-#include "mof/Matrix3D.hpp"\r
-#include "mof/ConsoleIO.hpp"\r
-#include "mof/KeyFrameAnimation.hpp"\r
-#include "mof/RotationAnimation3D.hpp"\r
-#include "mof/TranslationAnimation3D.hpp"\r
-#include "mof/ScalingAnimation3D.hpp"\r
-#include "mof/Constant.hpp"\r
-#include "mof/CascadingAnimation.hpp"\r
-#include "mof/LoopAnimation.hpp"\r
-#include "mof/Interpolation.hpp"\r
-#include "mof/Font.hpp"\r
-#include "mof/Vector2D.hpp"\r
-#include "mof/utilities.hpp"\r
-#include <vector>\r
-\r
-\r
-struct ::CharacterBoard::Impl{\r
- std::vector<mof::Board*> list;\r
- mof::Animation<mof::Matrix3D>::Handler worldMatrix;\r
- mof::FrameNumber frame;\r
-\r
- Impl()\r
- : frame(0) ,\r
- worldMatrix(mof::makeConstantHandler(mof::Matrix3D::createIdentity())) \r
- {\r
- }\r
-\r
- ~Impl(){\r
- for(std::vector<mof::Board*>::iterator itr = list.begin() ;\r
- itr != list.end() ;\r
- ++itr ){\r
- delete *itr;\r
- }\r
- \r
- }\r
-};\r
-\r
-::CharacterBoard::CharacterBoard( const mof::tstring& text)\r
-: m_pImpl(new Impl())\r
-{\r
- \r
-\r
- mof::Board* pBoard;\r
- pBoard = new mof::Board();\r
- pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.3f , 0.3f , 1)));\r
- m_pImpl->list.push_back(pBoard);\r
-\r
- pBoard = new mof::Board();\r
- pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.6f , 0.6f , 1)));\r
- m_pImpl->list.push_back(pBoard);\r
-\r
- mof::Font font(mof::Font::MS_GOTHIC , 70);\r
- std::shared_ptr<mof::PixelMap> pPixelMap( font.createText(text) );\r
- mof::Vector2D sizeVec(pPixelMap->shape()[0] , pPixelMap->shape()[1]);\r
- std::shared_ptr<mof::Texture> pTexture(new mof::Texture( pPixelMap));\r
- float endX = static_cast<float>(pPixelMap->shape()[0]) / pTexture->getWidth();\r
- float endY = static_cast<float>(pPixelMap->shape()[1]) / pTexture->getHeight();\r
-\r
- pBoard = new mof::Board();\r
- pBoard->setColor(mof::makeConstantHandler(mof::Color4f(1 , 1 , 1)));\r
- pBoard->setTexture(pTexture);\r
- pBoard->setTextureCoordinates(mof::Rectangle<float>(0 , 0 , endX , endY));\r
- m_pImpl->list.push_back(pBoard);\r
-}\r
-\r
-::CharacterBoard::~CharacterBoard(){\r
-\r
-}\r
-\r
-void ::CharacterBoard::setFrameNumber(mof::FrameNumber frame){\r
- m_pImpl->frame = frame;\r
- for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;\r
- itr != m_pImpl->list.end() ;\r
- ++itr ){\r
- (*itr)->setFrameNumber(frame);\r
- }\r
-}\r
-\r
-\r
-void ::CharacterBoard::nextFrame(){\r
- setFrameNumber(m_pImpl->frame + 1);\r
-}\r
-\r
-\r
-void ::CharacterBoard::prevFrame(){\r
- if(m_pImpl->frame > 0)setFrameNumber(m_pImpl->frame - 1);\r
-}\r
-\r
-\r
-void ::CharacterBoard::update(){\r
- m_pImpl->frame++;\r
- for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;\r
- itr != m_pImpl->list.end() ;\r
- ++itr ){\r
- (*itr)->update();\r
- }\r
-}\r
-\r
-\r
-void ::CharacterBoard::setWorldMatrix(const mof::Animation<mof::Matrix3D>::Handler& handler){\r
- m_pImpl->worldMatrix = handler;\r
- std::vector<mof::Animation<mof::Matrix3D>::Handler> handlers;\r
- handlers.push_back( mof::makeConstantHandler(\r
- mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0))\r
- ));\r
- handlers.push_back( handler);\r
- \r
- \r
- m_pImpl->list.at(0)->setWorldMatrix(\r
- mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())\r
- )\r
- );\r
-\r
- handlers.clear();\r
- handlers.push_back( mof::makeConstantHandler(\r
- mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0.01f))\r
- ));\r
- handlers.push_back(mof::makeConstantHandler(\r
- mof::Matrix3D::createRotation(mof::Vector3D(0 , mof::deg2rad(180) , 0))\r
- ));\r
- handlers.push_back(handler);\r
-\r
- m_pImpl->list.at(1)->setWorldMatrix(\r
- mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())\r
- )\r
- );\r
-\r
- handlers.clear();\r
- handlers.push_back( mof::makeConstantHandler(\r
- mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , -0.01f))\r
- ));\r
- handlers.push_back( handler);\r
- \r
- \r
- m_pImpl->list.at(2)->setWorldMatrix(\r
- mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())\r
- )\r
- );\r
- \r
-}\r
-\r
-\r
-mof::Matrix3D CharacterBoard::getWorldMatrix() const{\r
- return m_pImpl->worldMatrix->getValue(m_pImpl->frame);\r
-}\r
-\r
-mof::Vector3D CharacterBoard::getPosition() const{\r
- mof::Matrix3D m = getWorldMatrix();\r
- return mof::Vector3D(m.at(3 , 0) , m.at(3 , 1) , m.at(3 , 2));\r
-}\r
-\r
-void ::CharacterBoard::append(std::list<mof::Board*>& list_){\r
- list_.insert(list_.begin() , m_pImpl->list.begin(), m_pImpl->list.end());\r
- \r
-}\r
-\r
-void ::CharacterBoard::setFinishColor(mof::FrameNumber delay , mof::FrameNumber interval){\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.3f , 0.3f , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(1 , 1 , 1) )\r
- };\r
- m_pImpl->list.at(0)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- }\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(1 , 1 , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.3f , 0.3f , 1) )\r
- };\r
- m_pImpl->list.at(2)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- } \r
-\r
-}\r
-\r
-\r
-void ::CharacterBoard::setPartColor(mof::FrameNumber delay , mof::FrameNumber interval){\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )\r
- };\r
- m_pImpl->list.at(0)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- }\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )\r
- };\r
- m_pImpl->list.at(1)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- }\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.8f , 0.5f , 0.2f) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.8f , 0.5f , 0.2f) )\r
- };\r
- m_pImpl->list.at(2)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- } \r
-\r
-}\r
+#include "CharacterBoard.hpp"
+#include "mof/Matrix3D.hpp"
+#include "mof/ConsoleIO.hpp"
+#include "mof/KeyFrameAnimation.hpp"
+#include "mof/RotationAnimation3D.hpp"
+#include "mof/TranslationAnimation3D.hpp"
+#include "mof/ScalingAnimation3D.hpp"
+#include "mof/Constant.hpp"
+#include "mof/CascadingAnimation.hpp"
+#include "mof/LoopAnimation.hpp"
+#include "mof/Interpolation.hpp"
+#include "mof/Font.hpp"
+#include "mof/Vector2D.hpp"
+#include "mof/utilities.hpp"
+#include <vector>
+
+
+struct ::CharacterBoard::Impl{
+ std::vector<mof::Board*> list;
+ mof::Animation<mof::Matrix3D>::Handler worldMatrix;
+ mof::FrameNumber frame;
+
+ Impl()
+ : frame(0) ,
+ worldMatrix(mof::makeConstantHandler(mof::Matrix3D::createIdentity()))
+ {
+ }
+
+ ~Impl(){
+ for(std::vector<mof::Board*>::iterator itr = list.begin() ;
+ itr != list.end() ;
+ ++itr ){
+ delete *itr;
+ }
+
+ }
+};
+
+::CharacterBoard::CharacterBoard( const mof::tstring& text)
+: m_pImpl(new Impl())
+{
+
+
+ mof::Board* pBoard;
+ pBoard = new mof::Board();
+ pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.3f , 0.3f , 1)));
+ m_pImpl->list.push_back(pBoard);
+
+ pBoard = new mof::Board();
+ pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.6f , 0.6f , 1)));
+ m_pImpl->list.push_back(pBoard);
+
+ mof::Font font(mof::Font::MS_GOTHIC , 70);
+ std::shared_ptr<mof::PixelMap> pPixelMap( font.createText(text) );
+ mof::Vector2D sizeVec(pPixelMap->shape()[0] , pPixelMap->shape()[1]);
+ std::shared_ptr<mof::Texture> pTexture(new mof::Texture( pPixelMap));
+ float endX = static_cast<float>(pPixelMap->shape()[0]) / pTexture->getWidth();
+ float endY = static_cast<float>(pPixelMap->shape()[1]) / pTexture->getHeight();
+
+ pBoard = new mof::Board();
+ pBoard->setColor(mof::makeConstantHandler(mof::Color4f(1 , 1 , 1)));
+ pBoard->setTexture(pTexture);
+ pBoard->setTextureCoordinates(mof::Rectangle<float>(0 , 0 , endX , endY));
+ m_pImpl->list.push_back(pBoard);
+}
+
+::CharacterBoard::~CharacterBoard(){
+
+}
+
+void ::CharacterBoard::setFrameNumber(mof::FrameNumber frame){
+ m_pImpl->frame = frame;
+ for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;
+ itr != m_pImpl->list.end() ;
+ ++itr ){
+ (*itr)->setFrameNumber(frame);
+ }
+}
+
+
+void ::CharacterBoard::nextFrame(){
+ setFrameNumber(m_pImpl->frame + 1);
+}
+
+
+void ::CharacterBoard::prevFrame(){
+ if(m_pImpl->frame > 0)setFrameNumber(m_pImpl->frame - 1);
+}
+
+
+void ::CharacterBoard::update(){
+ m_pImpl->frame++;
+ for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;
+ itr != m_pImpl->list.end() ;
+ ++itr ){
+ (*itr)->update();
+ }
+}
+
+
+void ::CharacterBoard::setWorldMatrix(const mof::Animation<mof::Matrix3D>::Handler& handler){
+ m_pImpl->worldMatrix = handler;
+ std::vector<mof::Animation<mof::Matrix3D>::Handler> handlers;
+ handlers.push_back( mof::makeConstantHandler(
+ mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0))
+ ));
+ handlers.push_back( handler);
+
+
+ m_pImpl->list.at(0)->setWorldMatrix(
+ mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())
+ )
+ );
+
+ handlers.clear();
+ handlers.push_back( mof::makeConstantHandler(
+ mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0.01f))
+ ));
+ handlers.push_back(mof::makeConstantHandler(
+ mof::Matrix3D::createRotation(mof::Vector3D(0 , mof::deg2rad(180) , 0))
+ ));
+ handlers.push_back(handler);
+
+ m_pImpl->list.at(1)->setWorldMatrix(
+ mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())
+ )
+ );
+
+ handlers.clear();
+ handlers.push_back( mof::makeConstantHandler(
+ mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , -0.01f))
+ ));
+ handlers.push_back( handler);
+
+
+ m_pImpl->list.at(2)->setWorldMatrix(
+ mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())
+ )
+ );
+
+}
+
+
+mof::Matrix3D CharacterBoard::getWorldMatrix() const{
+ return m_pImpl->worldMatrix->getValue(m_pImpl->frame);
+}
+
+mof::Vector3D CharacterBoard::getPosition() const{
+ mof::Matrix3D m = getWorldMatrix();
+ return mof::Vector3D(m.at(3 , 0) , m.at(3 , 1) , m.at(3 , 2));
+}
+
+void ::CharacterBoard::append(std::list<mof::Board*>& list_){
+ list_.insert(list_.begin() , m_pImpl->list.begin(), m_pImpl->list.end());
+
+}
+
+void ::CharacterBoard::setFinishColor(mof::FrameNumber delay , mof::FrameNumber interval){
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.3f , 0.3f , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(1 , 1 , 1) )
+ };
+ m_pImpl->list.at(0)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(1 , 1 , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.3f , 0.3f , 1) )
+ };
+ m_pImpl->list.at(2)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+}
+
+
+void ::CharacterBoard::setPartColor(mof::FrameNumber delay , mof::FrameNumber interval){
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )
+ };
+ m_pImpl->list.at(0)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )
+ };
+ m_pImpl->list.at(1)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.8f , 0.5f , 0.2f) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.8f , 0.5f , 0.2f) )
+ };
+ m_pImpl->list.at(2)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+}
-#include "CharacterBoard.hpp"\r
-#include "mof/Matrix3D.hpp"\r
-#include "mof/ConsoleIO.hpp"\r
-#include "mof/KeyFrameAnimation.hpp"\r
-#include "mof/RotationAnimation3D.hpp"\r
-#include "mof/TranslationAnimation3D.hpp"\r
-#include "mof/ScalingAnimation3D.hpp"\r
-#include "mof/Constant.hpp"\r
-#include "mof/CascadingAnimation.hpp"\r
-#include "mof/LoopAnimation.hpp"\r
-#include "mof/Interpolation.hpp"\r
-#include "mof/Font.hpp"\r
-#include "mof/Vector2D.hpp"\r
-#include <vector>\r
-\r
-\r
-struct ::CharacterBoard::Impl{\r
- std::vector<mof::Board*> list;\r
- mof::Animation<mof::Matrix3D>::Handler worldMatrix;\r
- mof::FrameNumber frame;\r
-\r
- Impl()\r
- : frame(0) ,\r
- worldMatrix(mof::makeConstantHandler(mof::Matrix3D::createIdentity())) \r
- {\r
- }\r
-\r
- ~Impl(){\r
- for(std::vector<mof::Board*>::iterator itr = list.begin() ;\r
- itr != list.end() ;\r
- ++itr ){\r
- delete *itr;\r
- }\r
- \r
- }\r
-};\r
-\r
-::CharacterBoard::CharacterBoard( const mof::tstring& text)\r
-: m_pImpl(new Impl())\r
-{\r
- \r
-\r
- mof::Board* pBoard;\r
- pBoard = new mof::Board();\r
- pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.3f , 0.3f , 1)));\r
- m_pImpl->list.push_back(pBoard);\r
-\r
- pBoard = new mof::Board();\r
- pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.6f , 0.6f , 1)));\r
- m_pImpl->list.push_back(pBoard);\r
-\r
- mof::Font font(mof::Font::MS_GOTHIC , 70);\r
- boost::shared_ptr<mof::PixelMap> pPixelMap( font.createText(text) );\r
- mof::Vector2D sizeVec(pPixelMap->shape()[0] , pPixelMap->shape()[1]);\r
- boost::shared_ptr<mof::Texture> pTexture(new mof::Texture( pPixelMap));\r
- float endX = static_cast<float>(pPixelMap->shape()[0]) / pTexture->getWidth();\r
- float endY = static_cast<float>(pPixelMap->shape()[1]) / pTexture->getHeight();\r
-\r
- pBoard = new mof::Board();\r
- pBoard->setColor(mof::makeConstantHandler(mof::Color4f(1 , 1 , 1)));\r
- pBoard->setTexture(pTexture);\r
- pBoard->setTextureCoordinates(mof::Rectangle<float>(0 , 0 , endX , endY));\r
- m_pImpl->list.push_back(pBoard);\r
-}\r
-\r
-::CharacterBoard::~CharacterBoard(){\r
-\r
-}\r
-\r
-void ::CharacterBoard::setFrameNumber(mof::FrameNumber frame){\r
- m_pImpl->frame = frame;\r
- for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;\r
- itr != m_pImpl->list.end() ;\r
- ++itr ){\r
- (*itr)->setFrameNumber(frame);\r
- }\r
-}\r
-\r
-\r
-void ::CharacterBoard::nextFrame(){\r
- setFrameNumber(m_pImpl->frame + 1);\r
-}\r
-\r
-\r
-void ::CharacterBoard::prevFrame(){\r
- if(m_pImpl->frame > 0)setFrameNumber(m_pImpl->frame - 1);\r
-}\r
-\r
-\r
-void ::CharacterBoard::update(){\r
- m_pImpl->frame++;\r
- for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;\r
- itr != m_pImpl->list.end() ;\r
- ++itr ){\r
- (*itr)->update();\r
- }\r
-}\r
-\r
-\r
-void ::CharacterBoard::setWorldMatrix(const mof::Animation<mof::Matrix3D>::Handler& handler){\r
- m_pImpl->worldMatrix = handler;\r
- std::vector<mof::Animation<mof::Matrix3D>::Handler> handlers;\r
- handlers.push_back( mof::makeConstantHandler(\r
- mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0))\r
- ));\r
- handlers.push_back( handler);\r
- \r
- \r
- m_pImpl->list.at(0)->setWorldMatrix(\r
- mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())\r
- )\r
- );\r
-\r
- handlers.clear();\r
- handlers.push_back( mof::makeConstantHandler(\r
- mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0.01f))\r
- ));\r
- handlers.push_back(mof::makeConstantHandler(\r
- mof::Matrix3D::createRotation(mof::Vector3D(0 , mof::deg2rad(180) , 0))\r
- ));\r
- handlers.push_back(handler);\r
-\r
- m_pImpl->list.at(1)->setWorldMatrix(\r
- mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())\r
- )\r
- );\r
-\r
- handlers.clear();\r
- handlers.push_back( mof::makeConstantHandler(\r
- mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , -0.01f))\r
- ));\r
- handlers.push_back( handler);\r
- \r
- \r
- m_pImpl->list.at(2)->setWorldMatrix(\r
- mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())\r
- )\r
- );\r
- \r
-}\r
-\r
-\r
-mof::Matrix3D CharacterBoard::getWorldMatrix() const{\r
- return m_pImpl->worldMatrix->getValue(m_pImpl->frame);\r
-}\r
-\r
-mof::Vector3D CharacterBoard::getPosition() const{\r
- mof::Matrix3D m = getWorldMatrix();\r
- return mof::Vector3D(m.at(3 , 0) , m.at(3 , 1) , m.at(3 , 2));\r
-}\r
-\r
-void ::CharacterBoard::append(std::list<mof::Board*>& list_){\r
- list_.insert(list_.begin() , m_pImpl->list.begin(), m_pImpl->list.end());\r
- \r
-}\r
-\r
-void ::CharacterBoard::setFinishColor(mof::FrameNumber delay , mof::FrameNumber interval){\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.3f , 0.3f , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(1 , 1 , 1) )\r
- };\r
- m_pImpl->list.at(0)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- }\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(1 , 1 , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.3f , 0.3f , 1) )\r
- };\r
- m_pImpl->list.at(2)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- } \r
-\r
-}\r
-\r
-\r
-void ::CharacterBoard::setPartColor(mof::FrameNumber delay , mof::FrameNumber interval){\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )\r
- };\r
- m_pImpl->list.at(0)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- }\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )\r
- };\r
- m_pImpl->list.at(1)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- }\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.8f , 0.5f , 0.2f) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.8f , 0.5f , 0.2f) )\r
- };\r
- m_pImpl->list.at(2)->setColor(\r
- mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))\r
- );\r
- } \r
-\r
-}\r
+#include "CharacterBoard.hpp"
+#include "mof/Matrix3D.hpp"
+#include "mof/ConsoleIO.hpp"
+#include "mof/KeyFrameAnimation.hpp"
+#include "mof/RotationAnimation3D.hpp"
+#include "mof/TranslationAnimation3D.hpp"
+#include "mof/ScalingAnimation3D.hpp"
+#include "mof/Constant.hpp"
+#include "mof/CascadingAnimation.hpp"
+#include "mof/LoopAnimation.hpp"
+#include "mof/Interpolation.hpp"
+#include "mof/Font.hpp"
+#include "mof/Vector2D.hpp"
+#include <vector>
+
+
+struct ::CharacterBoard::Impl{
+ std::vector<mof::Board*> list;
+ mof::Animation<mof::Matrix3D>::Handler worldMatrix;
+ mof::FrameNumber frame;
+
+ Impl()
+ : frame(0) ,
+ worldMatrix(mof::makeConstantHandler(mof::Matrix3D::createIdentity()))
+ {
+ }
+
+ ~Impl(){
+ for(std::vector<mof::Board*>::iterator itr = list.begin() ;
+ itr != list.end() ;
+ ++itr ){
+ delete *itr;
+ }
+
+ }
+};
+
+::CharacterBoard::CharacterBoard( const mof::tstring& text)
+: m_pImpl(new Impl())
+{
+
+
+ mof::Board* pBoard;
+ pBoard = new mof::Board();
+ pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.3f , 0.3f , 1)));
+ m_pImpl->list.push_back(pBoard);
+
+ pBoard = new mof::Board();
+ pBoard->setColor(mof::makeConstantHandler(mof::Color4f(0.6f , 0.6f , 1)));
+ m_pImpl->list.push_back(pBoard);
+
+ mof::Font font(mof::Font::MS_GOTHIC , 70);
+ boost::shared_ptr<mof::PixelMap> pPixelMap( font.createText(text) );
+ mof::Vector2D sizeVec(pPixelMap->shape()[0] , pPixelMap->shape()[1]);
+ boost::shared_ptr<mof::Texture> pTexture(new mof::Texture( pPixelMap));
+ float endX = static_cast<float>(pPixelMap->shape()[0]) / pTexture->getWidth();
+ float endY = static_cast<float>(pPixelMap->shape()[1]) / pTexture->getHeight();
+
+ pBoard = new mof::Board();
+ pBoard->setColor(mof::makeConstantHandler(mof::Color4f(1 , 1 , 1)));
+ pBoard->setTexture(pTexture);
+ pBoard->setTextureCoordinates(mof::Rectangle<float>(0 , 0 , endX , endY));
+ m_pImpl->list.push_back(pBoard);
+}
+
+::CharacterBoard::~CharacterBoard(){
+
+}
+
+void ::CharacterBoard::setFrameNumber(mof::FrameNumber frame){
+ m_pImpl->frame = frame;
+ for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;
+ itr != m_pImpl->list.end() ;
+ ++itr ){
+ (*itr)->setFrameNumber(frame);
+ }
+}
+
+
+void ::CharacterBoard::nextFrame(){
+ setFrameNumber(m_pImpl->frame + 1);
+}
+
+
+void ::CharacterBoard::prevFrame(){
+ if(m_pImpl->frame > 0)setFrameNumber(m_pImpl->frame - 1);
+}
+
+
+void ::CharacterBoard::update(){
+ m_pImpl->frame++;
+ for(std::vector<mof::Board*>::iterator itr = m_pImpl->list.begin() ;
+ itr != m_pImpl->list.end() ;
+ ++itr ){
+ (*itr)->update();
+ }
+}
+
+
+void ::CharacterBoard::setWorldMatrix(const mof::Animation<mof::Matrix3D>::Handler& handler){
+ m_pImpl->worldMatrix = handler;
+ std::vector<mof::Animation<mof::Matrix3D>::Handler> handlers;
+ handlers.push_back( mof::makeConstantHandler(
+ mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0))
+ ));
+ handlers.push_back( handler);
+
+
+ m_pImpl->list.at(0)->setWorldMatrix(
+ mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())
+ )
+ );
+
+ handlers.clear();
+ handlers.push_back( mof::makeConstantHandler(
+ mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , 0.01f))
+ ));
+ handlers.push_back(mof::makeConstantHandler(
+ mof::Matrix3D::createRotation(mof::Vector3D(0 , mof::deg2rad(180) , 0))
+ ));
+ handlers.push_back(handler);
+
+ m_pImpl->list.at(1)->setWorldMatrix(
+ mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())
+ )
+ );
+
+ handlers.clear();
+ handlers.push_back( mof::makeConstantHandler(
+ mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0.5f , -0.01f))
+ ));
+ handlers.push_back( handler);
+
+
+ m_pImpl->list.at(2)->setWorldMatrix(
+ mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlers.front() , handlers.back())
+ )
+ );
+
+}
+
+
+mof::Matrix3D CharacterBoard::getWorldMatrix() const{
+ return m_pImpl->worldMatrix->getValue(m_pImpl->frame);
+}
+
+mof::Vector3D CharacterBoard::getPosition() const{
+ mof::Matrix3D m = getWorldMatrix();
+ return mof::Vector3D(m.at(3 , 0) , m.at(3 , 1) , m.at(3 , 2));
+}
+
+void ::CharacterBoard::append(std::list<mof::Board*>& list_){
+ list_.insert(list_.begin() , m_pImpl->list.begin(), m_pImpl->list.end());
+
+}
+
+void ::CharacterBoard::setFinishColor(mof::FrameNumber delay , mof::FrameNumber interval){
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.3f , 0.3f , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(1 , 1 , 1) )
+ };
+ m_pImpl->list.at(0)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(1 , 1 , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.3f , 0.3f , 1) )
+ };
+ m_pImpl->list.at(2)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+}
+
+
+void ::CharacterBoard::setPartColor(mof::FrameNumber delay , mof::FrameNumber interval){
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )
+ };
+ m_pImpl->list.at(0)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0 , 1 , 1 , 1) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0 , 1 , 1 , 1) )
+ };
+ m_pImpl->list.at(1)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( delay , mof::Color4f(0.8f , 0.5f , 0.2f) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( delay + interval , mof::Color4f(0.8f , 0.5f , 0.2f) )
+ };
+ m_pImpl->list.at(2)->setColor(
+ mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]))
+ );
+ }
+
+}
-#ifndef CHARACTER_BOARD_HPP\r
-#define CHARACTER_BOARD_HPP\r
-#include <boost/scoped_ptr.hpp>\r
-#include "mof/Component3D.hpp"\r
-#include <list>\r
-#include "mof/Board.hpp"\r
-#include "mof/AnimationPlayer.hpp"\r
-\r
-\r
-class CharacterBoard : public mof::AnimationPlayer\r
-{\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
-public:\r
- CharacterBoard( const mof::tstring& text);\r
- virtual ~CharacterBoard();\r
-\r
- virtual void setFrameNumber(mof::FrameNumber frame);\r
- virtual void nextFrame();\r
- virtual void prevFrame();\r
-\r
- virtual void update();\r
- \r
-\r
- void setWorldMatrix(const mof::Animation<mof::Matrix3D>::Handler& handler);\r
- mof::Matrix3D getWorldMatrix() const;\r
- mof::Vector3D getPosition() const;\r
- void append(std::list<mof::Board*>& list);\r
-\r
- void setFinishColor(mof::FrameNumber delay , mof::FrameNumber interval);\r
- void setPartColor(mof::FrameNumber delay , mof::FrameNumber interval);\r
-};\r
-\r
-\r
+#ifndef CHARACTER_BOARD_HPP
+#define CHARACTER_BOARD_HPP
+#include <boost/scoped_ptr.hpp>
+#include "mof/Component3D.hpp"
+#include <list>
+#include "mof/Board.hpp"
+#include "mof/AnimationPlayer.hpp"
+
+
+class CharacterBoard : public mof::AnimationPlayer
+{
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+public:
+ CharacterBoard( const mof::tstring& text);
+ virtual ~CharacterBoard();
+
+ virtual void setFrameNumber(mof::FrameNumber frame);
+ virtual void nextFrame();
+ virtual void prevFrame();
+
+ virtual void update();
+
+
+ void setWorldMatrix(const mof::Animation<mof::Matrix3D>::Handler& handler);
+ mof::Matrix3D getWorldMatrix() const;
+ mof::Vector3D getPosition() const;
+ void append(std::list<mof::Board*>& list);
+
+ void setFinishColor(mof::FrameNumber delay , mof::FrameNumber interval);
+ void setPartColor(mof::FrameNumber delay , mof::FrameNumber interval);
+};
+
+
#endif
\ No newline at end of file
-#include "CommandMenu.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MyWindow.h"\r
-#include "FightingMenu.h"\r
-#include "BattlerGroup.h"\r
-#include "BattlerFacade.h"\r
-#include "BattleData.h"\r
-\r
-et::CommandMenu::CommandMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )\r
-: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )\r
-{\r
- m_pBattleData = pBattleData;\r
- m_pSelector = NULL;\r
- m_pTextureManager = pTextureManager;\r
- std::vector<mof::Window*> selectables;\r
-\r
- mof::Window* pSelectable = NULL;\r
- addSelectableTextItem(this , selectables , _T("\82½\82½\82©\82¤") , 16);\r
- addSelectableTextItem(this , selectables , _T("\82½\82¢\82«") , 16);\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\82É\82°\82é") , 16);\r
- pSelectable->setAvailable(false);\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\83I\81[\83g") , 16);\r
- pSelectable->setAvailable(false);\r
- m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());\r
- setVisible(true);\r
-}\r
-\r
-et::CommandMenu::~CommandMenu(void)\r
-{\r
- delete m_pSelector;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-void et::CommandMenu::setVisible(bool visible){\r
- et::MyFrame::setVisible(visible);\r
- if(visible){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(-200 ,370));\r
- pAnimation->setPosition(15 , mof::Vector2D(10 , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(10 , 370));\r
- pAnimation->setPosition(15 , mof::Vector2D(-200 , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
-}\r
-\r
-et::MyFrame* et::CommandMenu::performAction(){\r
- \r
- switch(getSelectionModel()->getSelectingIndex()){\r
- case 0 : //\82½\82½\82©\82¤\r
- setVisible(false);\r
- return new FightingMenu(m_pTextureManager , m_pBattleData);\r
- case 1 : //\82½\82¢\82«\r
- {\r
- et::BattleAction action;\r
- action.type = et::BattleAction::WAIT;\r
- m_pBattleData->setBattleAction(action);\r
- return this;\r
- }\r
- case 2 : //\82É\82°\82é\r
- return this;\r
- case 3 : //\83I\81[\83g\r
- return this;\r
- default :\r
- DEBUG_PRINT("\96¢\92è\8b`\82Ì\83A\83N\83V\83\87\83\93\82ª\97v\8b\81\82³\82ê\82Ü\82µ\82½");\r
- return NULL;\r
- }\r
-}\r
-\r
-\r
-\r
-mof::Window* et::CommandMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){\r
- mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);\r
- pOwner->add(pSelectable);\r
- selectables.push_back(pSelectable);\r
- return pSelectable;\r
+#include "CommandMenu.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MyWindow.h"
+#include "FightingMenu.h"
+#include "BattlerGroup.h"
+#include "BattlerFacade.h"
+#include "BattleData.h"
+
+et::CommandMenu::CommandMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )
+: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )
+{
+ m_pBattleData = pBattleData;
+ m_pSelector = NULL;
+ m_pTextureManager = pTextureManager;
+ std::vector<mof::Window*> selectables;
+
+ mof::Window* pSelectable = NULL;
+ addSelectableTextItem(this , selectables , _T("\82½\82½\82©\82¤") , 16);
+ addSelectableTextItem(this , selectables , _T("\82½\82¢\82«") , 16);
+ pSelectable = addSelectableTextItem(this , selectables , _T("\82É\82°\82é") , 16);
+ pSelectable->setAvailable(false);
+ pSelectable = addSelectableTextItem(this , selectables , _T("\83I\81[\83g") , 16);
+ pSelectable->setAvailable(false);
+ m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());
+ setVisible(true);
+}
+
+et::CommandMenu::~CommandMenu(void)
+{
+ delete m_pSelector;
+}
+
+
+
+
+
+void et::CommandMenu::setVisible(bool visible){
+ et::MyFrame::setVisible(visible);
+ if(visible){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(-200 ,370));
+ pAnimation->setPosition(15 , mof::Vector2D(10 , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(10 , 370));
+ pAnimation->setPosition(15 , mof::Vector2D(-200 , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+}
+
+et::MyFrame* et::CommandMenu::performAction(){
+
+ switch(getSelectionModel()->getSelectingIndex()){
+ case 0 : //\82½\82½\82©\82¤
+ setVisible(false);
+ return new FightingMenu(m_pTextureManager , m_pBattleData);
+ case 1 : //\82½\82¢\82«
+ {
+ et::BattleAction action;
+ action.type = et::BattleAction::WAIT;
+ m_pBattleData->setBattleAction(action);
+ return this;
+ }
+ case 2 : //\82É\82°\82é
+ return this;
+ case 3 : //\83I\81[\83g
+ return this;
+ default :
+ DEBUG_PRINT("\96¢\92è\8b`\82Ì\83A\83N\83V\83\87\83\93\82ª\97v\8b\81\82³\82ê\82Ü\82µ\82½");
+ return NULL;
+ }
+}
+
+
+
+mof::Window* et::CommandMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){
+ mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);
+ pOwner->add(pSelectable);
+ selectables.push_back(pSelectable);
+ return pSelectable;
}
\ No newline at end of file
-#pragma once\r
-#include "MyFrame.h"\r
-#include "mof/Texture.h"\r
-\r
-namespace et{\r
- class BattleData;\r
-\r
- class CommandMenu : public MyFrame\r
- {\r
- mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);\r
- \r
- mof::SelectionModel* m_pSelector;\r
- mof::TextureManager* m_pTextureManager;\r
- et::BattleData* m_pBattleData;\r
- public:\r
- CommandMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);\r
- virtual ~CommandMenu(void);\r
- virtual void setVisible(bool visible);\r
- virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}\r
- virtual MyFrame* performAction();\r
- };\r
-\r
-\r
+#pragma once
+#include "MyFrame.h"
+#include "mof/Texture.h"
+
+namespace et{
+ class BattleData;
+
+ class CommandMenu : public MyFrame
+ {
+ mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);
+
+ mof::SelectionModel* m_pSelector;
+ mof::TextureManager* m_pTextureManager;
+ et::BattleData* m_pBattleData;
+ public:
+ CommandMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);
+ virtual ~CommandMenu(void);
+ virtual void setVisible(bool visible);
+ virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}
+ virtual MyFrame* performAction();
+ };
+
+
}
\ No newline at end of file
-#pragma once\r
-\r
-#include "mof/TextureResource.h"\r
-#include "mof/MeshResource.h"\r
-#include "mof/DataRow.h"\r
-\r
-\r
-namespace et{\r
- struct Common{\r
- mof::TextureManager* m_pTextureManager;\r
- mof::MeshManager* m_pMeshManager;\r
- mof::DataResourceManager* m_pDataResourceManager;\r
-\r
- Common(mof::TextureManager* pTextureManager , mof::MeshManager* pMeshManager , mof::DataResourceManager* pDataResourceManager){\r
- m_pTextureManager = pTextureManager;\r
- m_pMeshManager = pMeshManager;\r
- m_pDataResourceManager = pDataResourceManager;\r
- }\r
- };\r
-\r
+#pragma once
+
+#include "mof/TextureResource.h"
+#include "mof/MeshResource.h"
+#include "mof/DataRow.h"
+
+
+namespace et{
+ struct Common{
+ mof::TextureManager* m_pTextureManager;
+ mof::MeshManager* m_pMeshManager;
+ mof::DataResourceManager* m_pDataResourceManager;
+
+ Common(mof::TextureManager* pTextureManager , mof::MeshManager* pMeshManager , mof::DataResourceManager* pDataResourceManager){
+ m_pTextureManager = pTextureManager;
+ m_pMeshManager = pMeshManager;
+ m_pDataResourceManager = pDataResourceManager;
+ }
+ };
+
}
\ No newline at end of file
-#include "DataBasedAction.h"\r
-#include "BattlerFacade.h"\r
-#include "mof/DataBasedAnimation.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-\r
-et::DataBasedAction::DataBasedAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , mof::DataRow& actionRow , int category)\r
-: et::Action(pBattler , pTarget , actionRow.getIntegerData(_T("Cost")) )\r
-{\r
- m_actionRow = actionRow;\r
- m_category = category;\r
-}\r
-\r
-et::DataBasedAction::~DataBasedAction(void)\r
-{\r
-}\r
-\r
-\r
-\r
-int et::DataBasedAction::doActionTo(et::BattlerFacade* pTarget){\r
- float correction = (float)m_actionRow.getIntegerData(_T("Coefficient")) / 100.0;\r
- float totalPower = (float)m_pBattler->getParameter().attack;\r
- int damage = (int)totalPower - pTarget->getParameter().diffence;\r
- if(m_pBattler->getParameter().critical)damage = (int)totalPower;\r
- if(pTarget->getParameter().guard)damage *= 0.5;//\83K\81[\83h\92\86\82È\82Ç\83_\83\81\81[\83W\82ª\94¼\95ª\82É\r
- if(damage < 0)damage = 0;\r
- int effect = -damage;\r
-\r
- et::BattlerParameter parameter = pTarget->getParameter();\r
- if(parameter.hp <= damage){\r
- parameter.hp = 0;\r
- parameter.alive = false;\r
- }\r
- else parameter.hp -= damage;\r
- parameter.dActionPoint += 1;\r
- pTarget->setParameter(parameter);\r
- return effect;\r
-}\r
-\r
-mof::AnimationResource et::DataBasedAction::createApproachAnimation(){\r
- mof::Vector3D targetPosition = getTargetList().front()->getPosition();\r
- targetPosition.x += (m_pBattler->getType() == et::ENEMY ? -1 : 1 )* (isDirectAttack() ? 0.2f : 0.5f);\r
- return m_pBattler->setMovingAnimation(targetPosition , 15);\r
-}\r
-\r
-\r
-mof::AnimationResource et::DataBasedAction::createExecuteAnimation(){\r
- return m_pBattler->setCastAnimation(m_category);\r
-}\r
-\r
-mof::tstring et::DataBasedAction::getActionMessage(){\r
- mof::tstring message = m_actionRow.getData(_T("Message"));\r
- if(message == _T("novalue"))return mof::tstring();\r
- else return message;\r
-}\r
-\r
-\r
-bool et::DataBasedAction::isDirectAttack(){\r
- return (m_category < 2);\r
-}\r
-\r
-\r
-mof::GraphicsSchedule* et::DataBasedAction::createEffect(et::Common& common){\r
- mof::tstring effect = m_actionRow.getData(_T("Effect"));\r
- /*if(effect == _T("Inherit")){\r
- //\83\82\83\93\83X\83^\81[\83^\83C\83v\82©\82ç\88ø\82«\8cp\82®\r
- }*/\r
- mof::DataResource effectTable = common.m_pDataResourceManager->getResource(effect);\r
-\r
- mof::GraphicsSchedule* pSchedule = new mof::GraphicsSchedule();\r
-\r
- for(int i = 0 ; i < effectTable->getNumberOfRows() ; i++){\r
- mof::DataRow effectRow = mof::DataRow(effectTable , i);\r
-\r
- //---\83\82\81[\83V\83\87\83\93\82Ì\8d\\90¬\r
- mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();\r
- \r
- mof::KeyFrameAnimation* pCommonAnimation = new mof::KeyFrameAnimation();\r
- mof::Vector3D targetPosition = getTargetList().front()->getPosition();\r
- mof::Vector3D basePosition = m_pBattler->getGraphicsObject()->getPosition();\r
- //\83X\83P\81[\83\8b\82ð\8cv\8eZ\r
- mof::Vector3D scale = targetPosition - basePosition;\r
- scale.y = 1.0;\r
- pCommonAnimation->setPosition(0 , basePosition);\r
- mof::AnimationResource resource(pCommonAnimation);\r
-\r
- mof::tstring motionName(effectRow.getData(_T("Motion")));\r
- mof::DataBasedAnimation* pMotionAnimation = new mof::DataBasedAnimation(motionName.c_str() , scale);\r
- pCascadeAnimation->setElement(0 , mof::AnimationResource(pMotionAnimation));\r
- \r
- \r
- pCascadeAnimation->setElement(1 , resource);\r
- mof::AnimationResource animation(pCascadeAnimation);\r
-\r
- //---\83I\83u\83W\83F\83N\83g\82Ì\8d\\90¬\r
- mof::tstring className(effectRow.getData(_T("Class")));\r
-\r
- mof::tstring textureName(effectRow.getData(_T("Texture")));\r
- if(textureName == _T(""))textureName = _T("null");\r
- mof::TextureResource texture = common.m_pTextureManager->getResource(textureName.c_str());\r
-\r
- if(className == _T("Billboard")){\r
- //\83r\83\8b\83{\81[\83h\r
- mof::GraphicsObject* pModel = new mof::Billboard(mof::Billboard::Y_FIXED , texture);\r
- pModel->setAnimation(0 , animation);\r
- pSchedule->add(effectRow.getIntegerData(_T("Delay")) , mof::GraphicsModelPtr(pModel) , animation);\r
- }\r
- else {\r
- //\83\81\83b\83V\83\85(className\82ªPath)\r
- mof::MeshResource pModel = common.m_pMeshManager->getResource(className.c_str());\r
- pModel->setTexture(0 , texture);\r
- pModel->setAnimation(0 , animation);\r
- pSchedule->add(effectRow.getIntegerData(_T("Delay")) , mof::GraphicsModelPtr(pModel) , animation);\r
- }\r
- \r
- }\r
- \r
- \r
- return pSchedule;\r
-\r
+#include "DataBasedAction.h"
+#include "BattlerFacade.h"
+#include "mof/DataBasedAnimation.h"
+#include "mof/KeyFrameAnimation.h"
+
+et::DataBasedAction::DataBasedAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , mof::DataRow& actionRow , int category)
+: et::Action(pBattler , pTarget , actionRow.getIntegerData(_T("Cost")) )
+{
+ m_actionRow = actionRow;
+ m_category = category;
+}
+
+et::DataBasedAction::~DataBasedAction(void)
+{
+}
+
+
+
+int et::DataBasedAction::doActionTo(et::BattlerFacade* pTarget){
+ float correction = (float)m_actionRow.getIntegerData(_T("Coefficient")) / 100.0;
+ float totalPower = (float)m_pBattler->getParameter().attack;
+ int damage = (int)totalPower - pTarget->getParameter().diffence;
+ if(m_pBattler->getParameter().critical)damage = (int)totalPower;
+ if(pTarget->getParameter().guard)damage *= 0.5;//\83K\81[\83h\92\86\82È\82Ç\83_\83\81\81[\83W\82ª\94¼\95ª\82É
+ if(damage < 0)damage = 0;
+ int effect = -damage;
+
+ et::BattlerParameter parameter = pTarget->getParameter();
+ if(parameter.hp <= damage){
+ parameter.hp = 0;
+ parameter.alive = false;
+ }
+ else parameter.hp -= damage;
+ parameter.dActionPoint += 1;
+ pTarget->setParameter(parameter);
+ return effect;
+}
+
+mof::AnimationResource et::DataBasedAction::createApproachAnimation(){
+ mof::Vector3D targetPosition = getTargetList().front()->getPosition();
+ targetPosition.x += (m_pBattler->getType() == et::ENEMY ? -1 : 1 )* (isDirectAttack() ? 0.2f : 0.5f);
+ return m_pBattler->setMovingAnimation(targetPosition , 15);
+}
+
+
+mof::AnimationResource et::DataBasedAction::createExecuteAnimation(){
+ return m_pBattler->setCastAnimation(m_category);
+}
+
+mof::tstring et::DataBasedAction::getActionMessage(){
+ mof::tstring message = m_actionRow.getData(_T("Message"));
+ if(message == _T("novalue"))return mof::tstring();
+ else return message;
+}
+
+
+bool et::DataBasedAction::isDirectAttack(){
+ return (m_category < 2);
+}
+
+
+mof::GraphicsSchedule* et::DataBasedAction::createEffect(et::Common& common){
+ mof::tstring effect = m_actionRow.getData(_T("Effect"));
+ /*if(effect == _T("Inherit")){
+ //\83\82\83\93\83X\83^\81[\83^\83C\83v\82©\82ç\88ø\82«\8cp\82®
+ }*/
+ mof::DataResource effectTable = common.m_pDataResourceManager->getResource(effect);
+
+ mof::GraphicsSchedule* pSchedule = new mof::GraphicsSchedule();
+
+ for(int i = 0 ; i < effectTable->getNumberOfRows() ; i++){
+ mof::DataRow effectRow = mof::DataRow(effectTable , i);
+
+ //---\83\82\81[\83V\83\87\83\93\82Ì\8d\\90¬
+ mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();
+
+ mof::KeyFrameAnimation* pCommonAnimation = new mof::KeyFrameAnimation();
+ mof::Vector3D targetPosition = getTargetList().front()->getPosition();
+ mof::Vector3D basePosition = m_pBattler->getGraphicsObject()->getPosition();
+ //\83X\83P\81[\83\8b\82ð\8cv\8eZ
+ mof::Vector3D scale = targetPosition - basePosition;
+ scale.y = 1.0;
+ pCommonAnimation->setPosition(0 , basePosition);
+ mof::AnimationResource resource(pCommonAnimation);
+
+ mof::tstring motionName(effectRow.getData(_T("Motion")));
+ mof::DataBasedAnimation* pMotionAnimation = new mof::DataBasedAnimation(motionName.c_str() , scale);
+ pCascadeAnimation->setElement(0 , mof::AnimationResource(pMotionAnimation));
+
+
+ pCascadeAnimation->setElement(1 , resource);
+ mof::AnimationResource animation(pCascadeAnimation);
+
+ //---\83I\83u\83W\83F\83N\83g\82Ì\8d\\90¬
+ mof::tstring className(effectRow.getData(_T("Class")));
+
+ mof::tstring textureName(effectRow.getData(_T("Texture")));
+ if(textureName == _T(""))textureName = _T("null");
+ mof::TextureResource texture = common.m_pTextureManager->getResource(textureName.c_str());
+
+ if(className == _T("Billboard")){
+ //\83r\83\8b\83{\81[\83h
+ mof::GraphicsObject* pModel = new mof::Billboard(mof::Billboard::Y_FIXED , texture);
+ pModel->setAnimation(0 , animation);
+ pSchedule->add(effectRow.getIntegerData(_T("Delay")) , mof::GraphicsModelPtr(pModel) , animation);
+ }
+ else {
+ //\83\81\83b\83V\83\85(className\82ªPath)
+ mof::MeshResource pModel = common.m_pMeshManager->getResource(className.c_str());
+ pModel->setTexture(0 , texture);
+ pModel->setAnimation(0 , animation);
+ pSchedule->add(effectRow.getIntegerData(_T("Delay")) , mof::GraphicsModelPtr(pModel) , animation);
+ }
+
+ }
+
+
+ return pSchedule;
+
}
\ No newline at end of file
-#pragma once\r
-#include "Action.h"\r
-#include "mof/DataRow.h"\r
-\r
-namespace et{\r
- class DataBasedAction : public Action\r
- {\r
- mof::DataRow m_actionRow;\r
- int m_category;\r
- public:\r
- DataBasedAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , mof::DataRow& actionRow , int category);\r
- virtual ~DataBasedAction(void);\r
- virtual int doActionTo(et::BattlerFacade* pTarget);\r
- virtual mof::AnimationResource createApproachAnimation();\r
- virtual mof::AnimationResource createExecuteAnimation();\r
- virtual mof::tstring getActionMessage();\r
- virtual bool isDirectAttack();\r
- virtual mof::GraphicsSchedule* createEffect(et::Common& common);\r
- };\r
-\r
-\r
+#pragma once
+#include "Action.h"
+#include "mof/DataRow.h"
+
+namespace et{
+ class DataBasedAction : public Action
+ {
+ mof::DataRow m_actionRow;
+ int m_category;
+ public:
+ DataBasedAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , mof::DataRow& actionRow , int category);
+ virtual ~DataBasedAction(void);
+ virtual int doActionTo(et::BattlerFacade* pTarget);
+ virtual mof::AnimationResource createApproachAnimation();
+ virtual mof::AnimationResource createExecuteAnimation();
+ virtual mof::tstring getActionMessage();
+ virtual bool isDirectAttack();
+ virtual mof::GraphicsSchedule* createEffect(et::Common& common);
+ };
+
+
}
\ No newline at end of file
-#include "DataBasedBattler.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "mof/DataBasedAnimation.h"\r
-#include <sstream>\r
-#include "NormalAI.h"\r
-//#include "AttackerAI.h"\r
-\r
-et::DataBasedBattler::DataBasedBattler(const TCHAR* pName , mof::DataResourceManager* pDataResourceManager , mof::TextureManager* pTextureManager , TCHAR serialCode)\r
-: BattlerFacade(et::ENEMY)\r
-{\r
- m_pDataResourceManager = pDataResourceManager;\r
- mof::DataResource resource = m_pDataResourceManager->getResource(_T("data/monster.csv"));\r
- m_targetRow = mof::DataRow(resource , pName);\r
- m_pAI = NULL;\r
-\r
- std::basic_ostringstream<TCHAR> stream;\r
- stream << m_targetRow.getData( _T("Name")) << serialCode;\r
- BattlerParameter parameter;\r
- parameter.hp = m_targetRow.getIntegerData(_T("Hp"));\r
- parameter.maxHp = parameter.hp;\r
- parameter.attack = m_targetRow.getIntegerData(_T("Offense"));\r
- parameter.diffence = m_targetRow.getIntegerData(_T("Defense"));\r
- parameter.name = stream.str();\r
- parameter.speed = m_targetRow.getIntegerData(_T("Speed"));\r
- parameter.actionPoint = 3;\r
- parameter.dActionPoint = 0;\r
- setParameter(parameter);\r
- \r
- mof::DataResource typeResource = m_pDataResourceManager->getResource(_T("data/monster.type.csv"));\r
- m_typeRow = mof::DataRow(typeResource , m_targetRow.getData(_T("Type")).c_str());\r
- std::basic_ostringstream<TCHAR> stream2;\r
- stream2 << _T("image/") << m_typeRow.getData(_T("Image"));\r
- m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(stream2.str()));\r
- \r
-\r
- updateAI(m_targetRow.getData(_T("AI")).c_str());\r
- \r
-\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setScale(0 , mof::Vector3D(0.3f , 0.3f , 0.3f));\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- getGraphicsObject()->setAnimation( 0 , mof::AnimationResource(pAnimation));\r
- \r
-}\r
-\r
-et::DataBasedBattler::~DataBasedBattler(void)\r
-{\r
- \r
-}\r
-\r
-\r
-void et::DataBasedBattler::updateAI(const TCHAR* const pName){\r
- delete m_pAI;\r
-\r
- //AI\83I\83u\83W\83F\83N\83g\82ð\82Â\82\82é\r
- mof::tstring ai = m_targetRow.getData(_T("AI"));\r
- if(ai == _T("\83U\83R\83^\83C\83v"))m_pAI = new NormalAI(m_pDataResourceManager);\r
- else if(ai == _T("\83A\83^\83b\83J\81["))m_pAI = new NormalAI(m_pDataResourceManager);\r
-}\r
-\r
-\r
-mof::AnimationResource et::DataBasedBattler::setMovingAnimation(mof::Vector3D& goal , int nFrame){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setPosition(nFrame-1 , goal);\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
-}\r
-\r
-mof::AnimationResource et::DataBasedBattler::setAidlingAnimation(mof::Vector3D& position ){\r
- if(!getParameter().alive){\r
- //\89½\82à\95\\8e¦\82µ\82È\82¢\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);\r
- pAnimation->setPosition(0 , position);\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(1 , 1 , 1 , 1));\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- }\r
- else if(getParameter().guard && getType() == et::HERO){\r
- //\83K\81[\83h\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);\r
- pAnimation->setPosition(0 , position);\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 64*2 , 64 , 64*3));\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- }\r
- else {\r
- mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();\r
- {\r
- mof::KeyFrameAnimation* pBaseAnimation = new mof::KeyFrameAnimation(true);\r
- pBaseAnimation->setPosition(0 , mof::Vector3D(position));\r
- pCascadeAnimation->setElement(0 , mof::AnimationResource(pBaseAnimation));\r
- }\r
-\r
- pCascadeAnimation->setElement(1 , mof::AnimationResource(\r
- new mof::DataBasedAnimation(m_typeRow.getData(_T("AidlingMotion")).c_str() , true)));\r
-\r
- mof::AnimationResource resource(pCascadeAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- }\r
-}\r
-\r
-mof::AnimationResource et::DataBasedBattler::setCastAnimation(int category){\r
- \r
- const TCHAR* const table[] = {_T("DirectAttack1Motion") , _T("DirectAttack2Motion") , \r
- _T("SpecialAttack1Motion") , _T("SpecialAttack2Motion")};\r
-\r
- mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();\r
- {\r
- mof::KeyFrameAnimation* pBaseAnimation = new mof::KeyFrameAnimation();\r
- pBaseAnimation->setPosition(0 , mof::Vector3D(getPosition()));\r
- //pBaseAnimation->setFinalKey(20);\r
- pCascadeAnimation->setElement(0 , mof::AnimationResource(pBaseAnimation));\r
- }\r
- pCascadeAnimation->setElement(1 , mof::AnimationResource(\r
- new mof::DataBasedAnimation(m_typeRow.getData(table[category] ).c_str() )));\r
- mof::AnimationResource resource(pCascadeAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- \r
-}\r
-\r
-mof::AnimationResource et::DataBasedBattler::setDamagedAnimation(int level){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- if(level == 0){\r
- //\92Ê\8fí\r
- mof::Vector3D backPosition = getPosition();\r
- backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setPosition(10 , backPosition);\r
- pAnimation->setPosition(40 , backPosition);\r
- pAnimation->setPosition(60 , getPosition());\r
- \r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(16 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(26 , mof::Line2D(0 , 0 , 64 , 64));\r
- \r
- }\r
- else if(level == 1){\r
- //\8e\80\96S\r
- /*if(getType() == et::HERO){\r
- //\83C\83G\83A\83A\83A\83A\83A\r
- mof::Vector3D backPosition = getPosition();\r
- backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setPosition(10 , backPosition);\r
- pAnimation->setPosition(20 , backPosition);\r
- backPosition.y += 0.4;\r
- pAnimation->setPosition(100 , backPosition);\r
- \r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(14 , mof::Line2D(64*3 , 64 , 256 , 64*2));\r
- pAnimation->setTextureRectangle(150 , mof::Line2D(64*3 , 64 , 256 , 64*2));\r
- }\r
- else{*/\r
- mof::Vector3D backPosition = getPosition();\r
- backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setPosition(10 , backPosition);\r
- \r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(25 , mof::Line2D(1 , 1 , 1 , 1));\r
- //}\r
- }\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
-}\r
-\r
-\r
-et::Action* et::DataBasedBattler::createAction(BattlerGroup* pGroup ) {\r
- return m_pAI->createAction(this , pGroup);\r
-}\r
-\r
+#include "DataBasedBattler.h"
+#include "mof/KeyFrameAnimation.h"
+#include "mof/DataBasedAnimation.h"
+#include <sstream>
+#include "NormalAI.h"
+//#include "AttackerAI.h"
+
+et::DataBasedBattler::DataBasedBattler(const TCHAR* pName , mof::DataResourceManager* pDataResourceManager , mof::TextureManager* pTextureManager , TCHAR serialCode)
+: BattlerFacade(et::ENEMY)
+{
+ m_pDataResourceManager = pDataResourceManager;
+ mof::DataResource resource = m_pDataResourceManager->getResource(_T("data/monster.csv"));
+ m_targetRow = mof::DataRow(resource , pName);
+ m_pAI = NULL;
+
+ std::basic_ostringstream<TCHAR> stream;
+ stream << m_targetRow.getData( _T("Name")) << serialCode;
+ BattlerParameter parameter;
+ parameter.hp = m_targetRow.getIntegerData(_T("Hp"));
+ parameter.maxHp = parameter.hp;
+ parameter.attack = m_targetRow.getIntegerData(_T("Offense"));
+ parameter.diffence = m_targetRow.getIntegerData(_T("Defense"));
+ parameter.name = stream.str();
+ parameter.speed = m_targetRow.getIntegerData(_T("Speed"));
+ parameter.actionPoint = 3;
+ parameter.dActionPoint = 0;
+ setParameter(parameter);
+
+ mof::DataResource typeResource = m_pDataResourceManager->getResource(_T("data/monster.type.csv"));
+ m_typeRow = mof::DataRow(typeResource , m_targetRow.getData(_T("Type")).c_str());
+ std::basic_ostringstream<TCHAR> stream2;
+ stream2 << _T("image/") << m_typeRow.getData(_T("Image"));
+ m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(stream2.str()));
+
+
+ updateAI(m_targetRow.getData(_T("AI")).c_str());
+
+
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setScale(0 , mof::Vector3D(0.3f , 0.3f , 0.3f));
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ getGraphicsObject()->setAnimation( 0 , mof::AnimationResource(pAnimation));
+
+}
+
+et::DataBasedBattler::~DataBasedBattler(void)
+{
+
+}
+
+
+void et::DataBasedBattler::updateAI(const TCHAR* const pName){
+ delete m_pAI;
+
+ //AI\83I\83u\83W\83F\83N\83g\82ð\82Â\82\82é
+ mof::tstring ai = m_targetRow.getData(_T("AI"));
+ if(ai == _T("\83U\83R\83^\83C\83v"))m_pAI = new NormalAI(m_pDataResourceManager);
+ else if(ai == _T("\83A\83^\83b\83J\81["))m_pAI = new NormalAI(m_pDataResourceManager);
+}
+
+
+mof::AnimationResource et::DataBasedBattler::setMovingAnimation(mof::Vector3D& goal , int nFrame){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setPosition(nFrame-1 , goal);
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+}
+
+mof::AnimationResource et::DataBasedBattler::setAidlingAnimation(mof::Vector3D& position ){
+ if(!getParameter().alive){
+ //\89½\82à\95\\8e¦\82µ\82È\82¢
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);
+ pAnimation->setPosition(0 , position);
+ pAnimation->setTextureRectangle(0 , mof::Line2D(1 , 1 , 1 , 1));
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+ }
+ else if(getParameter().guard && getType() == et::HERO){
+ //\83K\81[\83h
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);
+ pAnimation->setPosition(0 , position);
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 64*2 , 64 , 64*3));
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+ }
+ else {
+ mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();
+ {
+ mof::KeyFrameAnimation* pBaseAnimation = new mof::KeyFrameAnimation(true);
+ pBaseAnimation->setPosition(0 , mof::Vector3D(position));
+ pCascadeAnimation->setElement(0 , mof::AnimationResource(pBaseAnimation));
+ }
+
+ pCascadeAnimation->setElement(1 , mof::AnimationResource(
+ new mof::DataBasedAnimation(m_typeRow.getData(_T("AidlingMotion")).c_str() , true)));
+
+ mof::AnimationResource resource(pCascadeAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+ }
+}
+
+mof::AnimationResource et::DataBasedBattler::setCastAnimation(int category){
+
+ const TCHAR* const table[] = {_T("DirectAttack1Motion") , _T("DirectAttack2Motion") ,
+ _T("SpecialAttack1Motion") , _T("SpecialAttack2Motion")};
+
+ mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();
+ {
+ mof::KeyFrameAnimation* pBaseAnimation = new mof::KeyFrameAnimation();
+ pBaseAnimation->setPosition(0 , mof::Vector3D(getPosition()));
+ //pBaseAnimation->setFinalKey(20);
+ pCascadeAnimation->setElement(0 , mof::AnimationResource(pBaseAnimation));
+ }
+ pCascadeAnimation->setElement(1 , mof::AnimationResource(
+ new mof::DataBasedAnimation(m_typeRow.getData(table[category] ).c_str() )));
+ mof::AnimationResource resource(pCascadeAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+
+}
+
+mof::AnimationResource et::DataBasedBattler::setDamagedAnimation(int level){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ if(level == 0){
+ //\92Ê\8fí
+ mof::Vector3D backPosition = getPosition();
+ backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setPosition(10 , backPosition);
+ pAnimation->setPosition(40 , backPosition);
+ pAnimation->setPosition(60 , getPosition());
+
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(16 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(26 , mof::Line2D(0 , 0 , 64 , 64));
+
+ }
+ else if(level == 1){
+ //\8e\80\96S
+ /*if(getType() == et::HERO){
+ //\83C\83G\83A\83A\83A\83A\83A
+ mof::Vector3D backPosition = getPosition();
+ backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setPosition(10 , backPosition);
+ pAnimation->setPosition(20 , backPosition);
+ backPosition.y += 0.4;
+ pAnimation->setPosition(100 , backPosition);
+
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(14 , mof::Line2D(64*3 , 64 , 256 , 64*2));
+ pAnimation->setTextureRectangle(150 , mof::Line2D(64*3 , 64 , 256 , 64*2));
+ }
+ else{*/
+ mof::Vector3D backPosition = getPosition();
+ backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setPosition(10 , backPosition);
+
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(25 , mof::Line2D(1 , 1 , 1 , 1));
+ //}
+ }
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+}
+
+
+et::Action* et::DataBasedBattler::createAction(BattlerGroup* pGroup ) {
+ return m_pAI->createAction(this , pGroup);
+}
+
-#pragma once\r
-#include "BattlerFacade.h"\r
-#include "mof/DataTable.h"\r
-#include "mof/DataRow.h"\r
-\r
-namespace et{\r
- class BattleAI;\r
- class DataBasedBattler : public BattlerFacade\r
- {\r
- mof::DataResourceManager* m_pDataResourceManager;\r
- mof::DataRow m_targetRow;\r
- mof::DataRow m_typeRow;\r
- BattleAI* m_pAI;\r
-\r
- void updateAI(const TCHAR* const name);\r
- public:\r
- DataBasedBattler(const TCHAR* pName , mof::DataResourceManager* pDataResourceManager , mof::TextureManager* pTextureManager, TCHAR serialCode);\r
- virtual ~DataBasedBattler(void);\r
-\r
- virtual mof::AnimationResource setMovingAnimation(mof::Vector3D& goal , int nFrame);\r
- virtual mof::AnimationResource setAidlingAnimation(mof::Vector3D& position);\r
- virtual mof::AnimationResource setCastAnimation(int category);\r
- virtual mof::AnimationResource setDamagedAnimation(int level);\r
- virtual Action* createAction(BattlerGroup* pGroup );\r
- mof::DataRow getDataRow(){return m_targetRow;}\r
- \r
- };\r
-\r
-}\r
+#pragma once
+#include "BattlerFacade.h"
+#include "mof/DataTable.h"
+#include "mof/DataRow.h"
+
+namespace et{
+ class BattleAI;
+ class DataBasedBattler : public BattlerFacade
+ {
+ mof::DataResourceManager* m_pDataResourceManager;
+ mof::DataRow m_targetRow;
+ mof::DataRow m_typeRow;
+ BattleAI* m_pAI;
+
+ void updateAI(const TCHAR* const name);
+ public:
+ DataBasedBattler(const TCHAR* pName , mof::DataResourceManager* pDataResourceManager , mof::TextureManager* pTextureManager, TCHAR serialCode);
+ virtual ~DataBasedBattler(void);
+
+ virtual mof::AnimationResource setMovingAnimation(mof::Vector3D& goal , int nFrame);
+ virtual mof::AnimationResource setAidlingAnimation(mof::Vector3D& position);
+ virtual mof::AnimationResource setCastAnimation(int category);
+ virtual mof::AnimationResource setDamagedAnimation(int level);
+ virtual Action* createAction(BattlerGroup* pGroup );
+ mof::DataRow getDataRow(){return m_targetRow;}
+
+ };
+
+}
-#include "Demo1.hpp"\r
-#include "configure.hpp"\r
-#include "MyInstructionSet.hpp"\r
-#include "mof/Interpreter.hpp"\r
-#include "mof/EventScheduler.hpp"\r
-#include "mof/mofInput.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include "mof/Application.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/widgets.hpp"\r
-#include "mof/Font.hpp"\r
-#include "resource.hpp"\r
-#include <mof/streams.hpp>\r
-#include <mof/FactoryMethod.hpp>\r
-#include <boost/bind.hpp> \r
-#include <boost/make_shared.hpp> \r
-#include "widget/createMenuView.hpp"\r
-#include "widget/createFrame.hpp"\r
-\r
-using namespace mof::widget;\r
-using namespace boost;\r
-\r
-namespace\r
-{\r
- \r
- boost::shared_ptr<mof::InputReceiver> m_pInputReceiver;\r
- mof::EventScheduler m_scheduler;\r
- Frame* m_pView;\r
- shared_ptr<Menu> m_pWidget;\r
-}\r
- \r
-namespace Demo1\r
-{\r
-\r
- void initialize()\r
- {\r
-\r
-\r
- {\r
- mof::widget::MenuItem menuItems[] = {\r
- mof::widget::MenuItem\r
- (\r
- ::createMenuView(_T("\83L\81[\83{\81[\83h\82Ì\81ª\81«\82Å\81A")) \r
- ) ,\r
- mof::widget::MenuItem\r
- (\r
- ::createMenuView(_T("\91I\91ð\8e\88\82ð\95Ï\8dX\82Å\82«\82Ü\82·\81B")) \r
- ) ,\r
- mof::widget::MenuItem\r
- (\r
- ::createMenuView(_T("\83t\83H\81[\83J\83X\82³\82ê\82½\91I\91ð\8e\88\82Í\83A\83j\83\81\81[\83V\83\87\83\93\82ª\81A"))\r
- ) ,\r
- mof::widget::MenuItem\r
- (\r
- ::createMenuView(_T("\83A\81[\83N\83X\83\8c\83C\83\84\81[ +128")) \r
- ) ,\r
-\r
-\r
- };\r
- m_pWidget = make_shared<Menu>( menuItems[0] , mof::lastOf( menuItems ) );\r
-\r
- m_pView = \r
- createFrame\r
- (\r
- _T("\91I\91ð\83\81\83j\83\85\81[\82Ì\83f\83\82") ,\r
- _T("image/frame0.png") ,\r
- _T("image/frame3.png") ,\r
- m_pWidget->getView()\r
- ).release();\r
- }\r
- \r
- {\r
- m_pView->getView()->getPositionStream() << mof::makeConstantHandler( mof::Vector2D(100, 100) );\r
- }\r
-\r
- m_pView->show();\r
-\r
- m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());\r
- \r
- mof::GraphicsDevice::lightEnable(false);\r
- mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);\r
-\r
- \r
-\r
- //---input event\82Ì\90Ý\92è\r
- m_scheduler.addEvent\r
- (\r
- new mof::KeyPressedEventCondition( mof::InputReceiver::ESCAPE , m_pInputReceiver ) , \r
- &mof::Application::quit \r
- );\r
- m_scheduler.addEvent\r
- (\r
- new mof::KeyPressedEventCondition( mof::InputReceiver::UP , m_pInputReceiver ) , \r
- boost::bind( &Menu::up , m_pWidget ) \r
- );\r
- m_scheduler.addEvent\r
- (\r
- new mof::KeyPressedEventCondition( mof::InputReceiver::DOWN , m_pInputReceiver ) , \r
- boost::bind( &Menu::down , m_pWidget ) \r
- );\r
- m_scheduler.addEvent\r
- (\r
- new mof::KeyPressedEventCondition( mof::InputReceiver::LEFT , m_pInputReceiver ) , \r
- boost::bind( &Menu::left , m_pWidget ) \r
- );\r
- m_scheduler.addEvent\r
- (\r
- new mof::KeyPressedEventCondition( mof::InputReceiver::RIGHT , m_pInputReceiver ) , \r
- boost::bind( &Menu::right , m_pWidget ) \r
- );\r
-\r
-\r
- }\r
-\r
- void finalize( )\r
- {\r
- mof::safe_delete( m_pView );\r
- }\r
- \r
- \r
-\r
- void update()\r
- {\r
- m_scheduler.update();\r
- m_pInputReceiver->update();\r
- m_pView->update( );\r
- }\r
-\r
- void draw()\r
- {\r
- mof::VertexXYZRHWC vertices[] = \r
- {\r
- mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(0 , 0 , 127)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(640 , 0) , mof::createColor(0 , 0 , 127)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(0 , 480) , mof::createColor(0 , 0 , 0)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(640 , 480) , mof::createColor(0 , 0 , 0))\r
- };\r
- mof::GraphicsDevice::setTexture(NULL);\r
- mof::GraphicsDevice::drawVertexArray(vertices[0] , vertices[3] , mof::PRIMITIVE_TYPE_TRIANGLESTRIP );\r
- \r
- m_pView->getView()->draw( );\r
- }\r
-\r
-} // namespace Demo1\r
-\r
-\r
+#include "Demo1.hpp"
+#include "configure.hpp"
+#include "MyInstructionSet.hpp"
+#include "mof/Interpreter.hpp"
+#include "mof/EventScheduler.hpp"
+#include "mof/mofInput.hpp"
+#include "mof/mofGraphics.hpp"
+#include "mof/Application.hpp"
+#include "mof/utilities.hpp"
+#include "mof/widgets.hpp"
+#include "mof/Font.hpp"
+#include "resource.hpp"
+#include <mof/streams.hpp>
+#include <mof/FactoryMethod.hpp>
+#include <boost/bind.hpp>
+#include <boost/make_shared.hpp>
+#include "widget/createMenuView.hpp"
+#include "widget/createFrame.hpp"
+
+using namespace mof::widget;
+using namespace boost;
+
+namespace
+{
+
+ boost::shared_ptr<mof::InputReceiver> m_pInputReceiver;
+ mof::EventScheduler m_scheduler;
+ Frame* m_pView;
+ shared_ptr<Menu> m_pWidget;
+}
+
+namespace Demo1
+{
+
+ void initialize()
+ {
+
+
+ {
+ mof::widget::MenuItem menuItems[] = {
+ mof::widget::MenuItem
+ (
+ ::createMenuView(_T("\83L\81[\83{\81[\83h\82Ì\81ª\81«\82Å\81A"))
+ ) ,
+ mof::widget::MenuItem
+ (
+ ::createMenuView(_T("\91I\91ð\8e\88\82ð\95Ï\8dX\82Å\82«\82Ü\82·\81B"))
+ ) ,
+ mof::widget::MenuItem
+ (
+ ::createMenuView(_T("\83t\83H\81[\83J\83X\82³\82ê\82½\91I\91ð\8e\88\82Í\83A\83j\83\81\81[\83V\83\87\83\93\82ª\81A"))
+ ) ,
+ mof::widget::MenuItem
+ (
+ ::createMenuView(_T("\83A\81[\83N\83X\83\8c\83C\83\84\81[ +128"))
+ ) ,
+
+
+ };
+ m_pWidget = make_shared<Menu>( menuItems[0] , mof::lastOf( menuItems ) );
+
+ m_pView =
+ createFrame
+ (
+ _T("\91I\91ð\83\81\83j\83\85\81[\82Ì\83f\83\82") ,
+ _T("image/frame0.png") ,
+ _T("image/frame3.png") ,
+ m_pWidget->getView()
+ ).release();
+ }
+
+ {
+ m_pView->getView()->getPositionStream() << mof::makeConstantHandler( mof::Vector2D(100, 100) );
+ }
+
+ m_pView->show();
+
+ m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());
+
+ mof::GraphicsDevice::lightEnable(false);
+ mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);
+
+
+
+ //---input event\82Ì\90Ý\92è
+ m_scheduler.addEvent
+ (
+ new mof::KeyPressedEventCondition( mof::InputReceiver::ESCAPE , m_pInputReceiver ) ,
+ &mof::Application::quit
+ );
+ m_scheduler.addEvent
+ (
+ new mof::KeyPressedEventCondition( mof::InputReceiver::UP , m_pInputReceiver ) ,
+ boost::bind( &Menu::up , m_pWidget )
+ );
+ m_scheduler.addEvent
+ (
+ new mof::KeyPressedEventCondition( mof::InputReceiver::DOWN , m_pInputReceiver ) ,
+ boost::bind( &Menu::down , m_pWidget )
+ );
+ m_scheduler.addEvent
+ (
+ new mof::KeyPressedEventCondition( mof::InputReceiver::LEFT , m_pInputReceiver ) ,
+ boost::bind( &Menu::left , m_pWidget )
+ );
+ m_scheduler.addEvent
+ (
+ new mof::KeyPressedEventCondition( mof::InputReceiver::RIGHT , m_pInputReceiver ) ,
+ boost::bind( &Menu::right , m_pWidget )
+ );
+
+
+ }
+
+ void finalize( )
+ {
+ mof::safe_delete( m_pView );
+ }
+
+
+
+ void update()
+ {
+ m_scheduler.update();
+ m_pInputReceiver->update();
+ m_pView->update( );
+ }
+
+ void draw()
+ {
+ mof::VertexXYZRHWC vertices[] =
+ {
+ mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(0 , 0 , 127)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(640 , 0) , mof::createColor(0 , 0 , 127)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(0 , 480) , mof::createColor(0 , 0 , 0)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(640 , 480) , mof::createColor(0 , 0 , 0))
+ };
+ mof::GraphicsDevice::setTexture(NULL);
+ mof::GraphicsDevice::drawVertexArray(vertices[0] , vertices[3] , mof::PRIMITIVE_TYPE_TRIANGLESTRIP );
+
+ m_pView->getView()->draw( );
+ }
+
+} // namespace Demo1
+
+
-#pragma once\r
-\r
-namespace Demo2\r
-{\r
- void initialize( );\r
- void finalize( );\r
- void update( );\r
- void draw( );\r
-}\r
+#pragma once
+
+namespace Demo2
+{
+ void initialize( );
+ void finalize( );
+ void update( );
+ void draw( );
+}
-#include "Demo2.hpp"\r
-#include "configure.hpp"\r
-#include "MyInstructionSet.hpp"\r
-#include "mof/Interpreter.hpp"\r
-#include "mof/EventScheduler.hpp"\r
-#include "mof/mofInput.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include "mof/Application.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/widgets.hpp"\r
-#include "mof/Font.hpp"\r
-#include "resource.hpp"\r
-#include <mof/streams.hpp>\r
-#include <mof/FactoryMethod.hpp>\r
-#include <boost/bind.hpp> \r
-#include <boost/make_shared.hpp> \r
-#include "widget/createMenuView.hpp"\r
-#include "widget/createFrame.hpp"\r
-\r
-using namespace mof::widget;\r
-using namespace boost;\r
-\r
-namespace\r
-{\r
- \r
- boost::shared_ptr<mof::InputReceiver> m_pInputReceiver;\r
- mof::EventScheduler m_scheduler;\r
- Frame* m_pView;\r
-}\r
- \r
-namespace Demo2\r
-{\r
-\r
- void initialize()\r
- {\r
-\r
-\r
- {\r
- shared_ptr<Message> pWidget =\r
- make_shared<Message>\r
- (\r
- make_shared<TextCompiler>\r
- (\r
- mof::Font(FONT_NAME_UME , 18)\r
-\r
- )\r
- ); \r
-\r
- pWidget->addPage("\83E\83B\83\93\83h\83E\83V\83X\83e\83\80\82Ì\83f\83\82\82Å\82·\81B<nl/>\95¶\8e\9a\97ñ\82Ì\92·\82³\82É\89\9e\82¶\82Ä\83E\83B\83\93\83h\83E\83T\83C\83Y\82ª\8e©\93®\82Å\8c\88\82Ü\82è\82Ü\82·\81B");\r
-\r
- m_pView = \r
- createFrame\r
- (\r
- _T("My Demo") ,\r
- _T("image/frame0.png") ,\r
- _T("image/frame3.png") ,\r
- pWidget->getView()\r
- ).release();\r
- }\r
-\r
- {\r
- mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =\r
- {\r
- mof::makeKeyFrame( 0 , mof::Vector2D( 0 , 50 ) ) ,\r
- mof::makeKeyFrame( 300 , mof::Vector2D( 150 , 200 ) ) ,\r
- };\r
- m_pView->getView()->getPositionStream() << mof::makeKeyFrameAnimationHandler( keyFrames[0] , mof::lastOf( keyFrames ) );\r
- }\r
- m_pView->show();\r
-\r
- m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());\r
- \r
- mof::GraphicsDevice::lightEnable(false);\r
- mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);\r
-\r
- }\r
-\r
- void finalize( )\r
- {\r
- mof::safe_delete( m_pView );\r
- }\r
- \r
- \r
-\r
- void update()\r
- {\r
- m_scheduler.update();\r
- m_pInputReceiver->update();\r
- m_pView->update( );\r
- \r
- }\r
-\r
- void draw()\r
- {\r
- mof::VertexXYZRHWC vertices[] = \r
- {\r
- mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(0 , 0 , 127)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(640 , 0) , mof::createColor(0 , 0 , 127)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(0 , 480) , mof::createColor(0 , 0 , 0)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(640 , 480) , mof::createColor(0 , 0 , 0))\r
- };\r
- mof::GraphicsDevice::setTexture(NULL);\r
- mof::GraphicsDevice::drawVertexArray(vertices[0] , vertices[3] , mof::PRIMITIVE_TYPE_TRIANGLESTRIP );\r
- \r
- m_pView->getView()->draw( );\r
- }\r
-\r
-} // namespace Demo2\r
-\r
-\r
+#include "Demo2.hpp"
+#include "configure.hpp"
+#include "MyInstructionSet.hpp"
+#include "mof/Interpreter.hpp"
+#include "mof/EventScheduler.hpp"
+#include "mof/mofInput.hpp"
+#include "mof/mofGraphics.hpp"
+#include "mof/Application.hpp"
+#include "mof/utilities.hpp"
+#include "mof/widgets.hpp"
+#include "mof/Font.hpp"
+#include "resource.hpp"
+#include <mof/streams.hpp>
+#include <mof/FactoryMethod.hpp>
+#include <boost/bind.hpp>
+#include <boost/make_shared.hpp>
+#include "widget/createMenuView.hpp"
+#include "widget/createFrame.hpp"
+
+using namespace mof::widget;
+using namespace boost;
+
+namespace
+{
+
+ boost::shared_ptr<mof::InputReceiver> m_pInputReceiver;
+ mof::EventScheduler m_scheduler;
+ Frame* m_pView;
+}
+
+namespace Demo2
+{
+
+ void initialize()
+ {
+
+
+ {
+ shared_ptr<Message> pWidget =
+ make_shared<Message>
+ (
+ make_shared<TextCompiler>
+ (
+ mof::Font(FONT_NAME_UME , 18)
+
+ )
+ );
+
+ pWidget->addPage("\83E\83B\83\93\83h\83E\83V\83X\83e\83\80\82Ì\83f\83\82\82Å\82·\81B<nl/>\95¶\8e\9a\97ñ\82Ì\92·\82³\82É\89\9e\82¶\82Ä\83E\83B\83\93\83h\83E\83T\83C\83Y\82ª\8e©\93®\82Å\8c\88\82Ü\82è\82Ü\82·\81B");
+
+ m_pView =
+ createFrame
+ (
+ _T("My Demo") ,
+ _T("image/frame0.png") ,
+ _T("image/frame3.png") ,
+ pWidget->getView()
+ ).release();
+ }
+
+ {
+ mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =
+ {
+ mof::makeKeyFrame( 0 , mof::Vector2D( 0 , 50 ) ) ,
+ mof::makeKeyFrame( 300 , mof::Vector2D( 150 , 200 ) ) ,
+ };
+ m_pView->getView()->getPositionStream() << mof::makeKeyFrameAnimationHandler( keyFrames[0] , mof::lastOf( keyFrames ) );
+ }
+ m_pView->show();
+
+ m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());
+
+ mof::GraphicsDevice::lightEnable(false);
+ mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);
+
+ }
+
+ void finalize( )
+ {
+ mof::safe_delete( m_pView );
+ }
+
+
+
+ void update()
+ {
+ m_scheduler.update();
+ m_pInputReceiver->update();
+ m_pView->update( );
+
+ }
+
+ void draw()
+ {
+ mof::VertexXYZRHWC vertices[] =
+ {
+ mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(0 , 0 , 127)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(640 , 0) , mof::createColor(0 , 0 , 127)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(0 , 480) , mof::createColor(0 , 0 , 0)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(640 , 480) , mof::createColor(0 , 0 , 0))
+ };
+ mof::GraphicsDevice::setTexture(NULL);
+ mof::GraphicsDevice::drawVertexArray(vertices[0] , vertices[3] , mof::PRIMITIVE_TYPE_TRIANGLESTRIP );
+
+ m_pView->getView()->draw( );
+ }
+
+} // namespace Demo2
+
+
-#pragma once\r
-\r
-namespace Demo1\r
-{\r
- void initialize( );\r
- void finalize( );\r
- void update( );\r
- void draw( );\r
-}\r
+#pragma once
+
+namespace Demo1
+{
+ void initialize( );
+ void finalize( );
+ void update( );
+ void draw( );
+}
-#include "Demo2.hpp"\r
-#include "configure.hpp"\r
-#include "MyInstructionSet.hpp"\r
-#include "mof/Interpreter.hpp"\r
-#include "mof/EventScheduler.hpp"\r
-#include "mof/mofInput.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include "mof/Application.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/widgets.hpp"\r
-#include <mof/Texture.hpp>\r
-#include "mof/Font.hpp"\r
-#include "resource.hpp"\r
-#include <mof/streams.hpp>\r
-#include <mof/FactoryMethod.hpp>\r
-#include <boost/bind.hpp> \r
-#include <boost/make_shared.hpp> \r
-#include "widget/createMenuView.hpp"\r
-#include "widget/createFrame.hpp"\r
-#include <mof/ConsoleIO.hpp>\r
-#include <mof/FactoryMethod.hpp>\r
-\r
-using namespace mof::widget;\r
-using namespace boost;\r
-\r
-namespace\r
-{\r
- \r
- boost::shared_ptr<mof::InputReceiver> m_pInputReceiver;\r
- mof::EventScheduler m_scheduler;\r
- Frame* m_pView;\r
-}\r
- \r
-namespace Demo3\r
-{\r
-//{{{ initialize\r
- void initialize()\r
- {\r
-\r
-\r
- {\r
- shared_ptr<Message> pWidget =\r
- make_shared<Message>\r
- (\r
- make_shared<TextCompiler>\r
- (\r
- mof::Font(FONT_NAME_UME, 18)\r
-\r
- )\r
- ); \r
-\r
- //pWidget->addPage("\81@");\r
- pWidget->addPage("\83E\83B\83\93\83h\83E\82Ì\83A\83j\83\81\81[\83V\83\87\83\93\82Í\8aO\95\94\82©\82ç\90Ý\92è\82Å\82«\82Ü\82·\81B<nl />\82±\82ê\82Í\83L\83\83\83\89\83N\83^\81[\82Ì\83Z\83\8a\83t\95\\8e¦\82ð\91z\92è\82µ\82½\83A\83j\83\81\81[\83V\83\87\83\93");\r
-\r
- m_pView = \r
- createFrame\r
- (\r
- _T("\81@") ,\r
- _T("image/frame0.png") ,\r
- _T("image/frame3.png") ,\r
- pWidget->getView()\r
- ).release();\r
- }\r
-\r
- {\r
- mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =\r
- {\r
- mof::makeKeyFrame(0, mof::Vector2D(250, 50)),\r
- mof::makeKeyFrame(15, mof::Vector2D(0 , 50)),\r
- mof::makeKeyFrame(20, mof::Vector2D(0, 0)),\r
- };\r
- m_pView->getView()->getPositionStream() \r
- << mof::makeConstantHandler(mof::Vector2D(30, 60))\r
- << mof::makeKeyFrameAnimationHandler( keyFrames[0], mof::lastOf( keyFrames ) );\r
- }\r
- {\r
- mof::Vector2D base = m_pView->getView()->getSizeStream().value();\r
- mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =\r
- {\r
- mof::makeKeyFrame(0, mof::Vector2D(50, 50) - base ) ,\r
- mof::makeKeyFrame(15, mof::Vector2D(550, 50) - base ) ,\r
- mof::makeKeyFrame(20, mof::Vector2D(550, 150) - base ) ,\r
- };\r
- m_pView->getView()->getSizeStream() << mof::makeKeyFrameAnimationHandler( keyFrames[0] , mof::lastOf( keyFrames ) );\r
- }\r
-\r
- m_pView->show();\r
-\r
- m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());\r
- \r
- mof::GraphicsDevice::lightEnable(false);\r
- mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);\r
-\r
- }\r
-//}}}\r
-/* \r
-//{{{ initialize\r
- void initialize()\r
- {\r
- {\r
- using namespace mof::widget;\r
- \r
- boost::shared_ptr<WidgetView> contents[] = \r
- {\r
- boost::make_shared<RectangleView>(mof::Vector2D(32, 64), mof::createColor(255, 0, 0)), \r
- boost::make_shared<RectangleView>(mof::Vector2D(24, 64), mof::createColor(0, 255, 0)), \r
- boost::make_shared<RectangleView>(mof::Vector2D(12, 80), mof::createColor(0, 0, 255)), \r
- };\r
-\r
- boost::shared_ptr<mof::widget::Container> container = \r
- make_shared<mof::widget::Container>\r
- (\r
- contents[0],\r
- mof::lastOf(contents), \r
- mof::makeFactoryMethod<GridLayout>(GridLayout::VERTICAL, 0, 10)\r
- );\r
- \r
- \r
- //boost::shared_ptr<WidgetView> container = \r
- // boost::make_shared<RectangleView>(mof::Vector2D(32, 64), mof::createColor(255, 0, 0));\r
-\r
- m_pView = \r
- createFrame\r
- (\r
- _T("My Demo") ,\r
- _T("image/frame0.png") ,\r
- _T("image/frame3.png") ,\r
- container\r
- ).release();\r
- }\r
-\r
- {\r
- mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =\r
- {\r
- mof::makeKeyFrame(0, mof::Vector2D(250, 50)),\r
- mof::makeKeyFrame(50, mof::Vector2D(0 , 50)),\r
- mof::makeKeyFrame(60, mof::Vector2D(0, 0)),\r
- };\r
- m_pView->getView()->getPositionStream() \r
- << mof::makeConstantHandler(mof::Vector2D(30, 60))\r
- << mof::makeKeyFrameAnimationHandler( keyFrames[0], mof::lastOf( keyFrames ) );\r
- }\r
- {\r
- mof::Vector2D base = m_pView->getView()->getPreferredSize();\r
- mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =\r
- {\r
- //mof::makeKeyFrame(0, mof::Vector2D(50, 50) - base ) ,\r
- //mof::makeKeyFrame(50, mof::Vector2D(550, 50) - base ) ,\r
- //mof::makeKeyFrame(60, mof::Vector2D(550, 150) - base ) ,\r
- mof::makeKeyFrame(0, mof::Vector2D(0,0) ) ,\r
- mof::makeKeyFrame(30, mof::Vector2D(0,100) ) ,\r
- mof::makeKeyFrame(50, mof::Vector2D(0, -200) ) ,\r
- };\r
- m_pView->getView()->getSizeStream() \r
- << \r
- boost::make_shared<mof::Loop<mof::Vector2D>>\r
- (\r
- mof::makeKeyFrameAnimationHandler(keyFrames[0] , mof::lastOf( keyFrames )),\r
- 100\r
- );\r
- }\r
-\r
- m_pView->show();\r
-\r
- m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());\r
- \r
- mof::GraphicsDevice::lightEnable(false);\r
- mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);\r
-\r
- }\r
-*/ \r
-//}}}\r
-\r
- void finalize( )\r
- {\r
- mof::safe_delete( m_pView );\r
- }\r
- \r
- \r
-\r
- void update()\r
- {\r
- m_scheduler.update();\r
- m_pInputReceiver->update();\r
- m_pView->update( );\r
- \r
- }\r
-\r
- void draw()\r
- {\r
- mof::VertexXYZRHWC vertices[] = \r
- {\r
- mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(0 , 0 , 127)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(640 , 0) , mof::createColor(0 , 0 , 127)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(0 , 480) , mof::createColor(0 , 0 , 0)) ,\r
- mof::VertexXYZRHWC(mof::Vector2D(640 , 480) , mof::createColor(0 , 0 , 0))\r
- };\r
- mof::GraphicsDevice::setTexture(NULL);\r
- mof::GraphicsDevice::drawVertexArray(vertices[0] , vertices[3] , mof::PRIMITIVE_TYPE_TRIANGLESTRIP );\r
- \r
- m_pView->getView()->draw( );\r
- }\r
-\r
-} // namespace Demo2\r
-\r
-\r
+#include "Demo2.hpp"
+#include "configure.hpp"
+#include "MyInstructionSet.hpp"
+#include "mof/Interpreter.hpp"
+#include "mof/EventScheduler.hpp"
+#include "mof/mofInput.hpp"
+#include "mof/mofGraphics.hpp"
+#include "mof/Application.hpp"
+#include "mof/utilities.hpp"
+#include "mof/widgets.hpp"
+#include <mof/Texture.hpp>
+#include "mof/Font.hpp"
+#include "resource.hpp"
+#include <mof/streams.hpp>
+#include <mof/FactoryMethod.hpp>
+#include <boost/bind.hpp>
+#include <boost/make_shared.hpp>
+#include "widget/createMenuView.hpp"
+#include "widget/createFrame.hpp"
+#include <mof/ConsoleIO.hpp>
+#include <mof/FactoryMethod.hpp>
+
+using namespace mof::widget;
+using namespace boost;
+
+namespace
+{
+
+ boost::shared_ptr<mof::InputReceiver> m_pInputReceiver;
+ mof::EventScheduler m_scheduler;
+ Frame* m_pView;
+}
+
+namespace Demo3
+{
+//{{{ initialize
+ void initialize()
+ {
+
+
+ {
+ shared_ptr<Message> pWidget =
+ make_shared<Message>
+ (
+ make_shared<TextCompiler>
+ (
+ mof::Font(FONT_NAME_UME, 18)
+
+ )
+ );
+
+ //pWidget->addPage("\81@");
+ pWidget->addPage("\83E\83B\83\93\83h\83E\82Ì\83A\83j\83\81\81[\83V\83\87\83\93\82Í\8aO\95\94\82©\82ç\90Ý\92è\82Å\82«\82Ü\82·\81B<nl />\82±\82ê\82Í\83L\83\83\83\89\83N\83^\81[\82Ì\83Z\83\8a\83t\95\\8e¦\82ð\91z\92è\82µ\82½\83A\83j\83\81\81[\83V\83\87\83\93");
+
+ m_pView =
+ createFrame
+ (
+ _T("\81@") ,
+ _T("image/frame0.png") ,
+ _T("image/frame3.png") ,
+ pWidget->getView()
+ ).release();
+ }
+
+ {
+ mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =
+ {
+ mof::makeKeyFrame(0, mof::Vector2D(250, 50)),
+ mof::makeKeyFrame(15, mof::Vector2D(0 , 50)),
+ mof::makeKeyFrame(20, mof::Vector2D(0, 0)),
+ };
+ m_pView->getView()->getPositionStream()
+ << mof::makeConstantHandler(mof::Vector2D(30, 60))
+ << mof::makeKeyFrameAnimationHandler( keyFrames[0], mof::lastOf( keyFrames ) );
+ }
+ {
+ mof::Vector2D base = m_pView->getView()->getSizeStream().value();
+ mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =
+ {
+ mof::makeKeyFrame(0, mof::Vector2D(50, 50) - base ) ,
+ mof::makeKeyFrame(15, mof::Vector2D(550, 50) - base ) ,
+ mof::makeKeyFrame(20, mof::Vector2D(550, 150) - base ) ,
+ };
+ m_pView->getView()->getSizeStream() << mof::makeKeyFrameAnimationHandler( keyFrames[0] , mof::lastOf( keyFrames ) );
+ }
+
+ m_pView->show();
+
+ m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());
+
+ mof::GraphicsDevice::lightEnable(false);
+ mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);
+
+ }
+//}}}
+/*
+//{{{ initialize
+ void initialize()
+ {
+ {
+ using namespace mof::widget;
+
+ boost::shared_ptr<WidgetView> contents[] =
+ {
+ boost::make_shared<RectangleView>(mof::Vector2D(32, 64), mof::createColor(255, 0, 0)),
+ boost::make_shared<RectangleView>(mof::Vector2D(24, 64), mof::createColor(0, 255, 0)),
+ boost::make_shared<RectangleView>(mof::Vector2D(12, 80), mof::createColor(0, 0, 255)),
+ };
+
+ boost::shared_ptr<mof::widget::Container> container =
+ make_shared<mof::widget::Container>
+ (
+ contents[0],
+ mof::lastOf(contents),
+ mof::makeFactoryMethod<GridLayout>(GridLayout::VERTICAL, 0, 10)
+ );
+
+
+ //boost::shared_ptr<WidgetView> container =
+ // boost::make_shared<RectangleView>(mof::Vector2D(32, 64), mof::createColor(255, 0, 0));
+
+ m_pView =
+ createFrame
+ (
+ _T("My Demo") ,
+ _T("image/frame0.png") ,
+ _T("image/frame3.png") ,
+ container
+ ).release();
+ }
+
+ {
+ mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =
+ {
+ mof::makeKeyFrame(0, mof::Vector2D(250, 50)),
+ mof::makeKeyFrame(50, mof::Vector2D(0 , 50)),
+ mof::makeKeyFrame(60, mof::Vector2D(0, 0)),
+ };
+ m_pView->getView()->getPositionStream()
+ << mof::makeConstantHandler(mof::Vector2D(30, 60))
+ << mof::makeKeyFrameAnimationHandler( keyFrames[0], mof::lastOf( keyFrames ) );
+ }
+ {
+ mof::Vector2D base = m_pView->getView()->getPreferredSize();
+ mof::KeyFrameAnimation< mof::Vector2D >::KeyFrame keyFrames[] =
+ {
+ //mof::makeKeyFrame(0, mof::Vector2D(50, 50) - base ) ,
+ //mof::makeKeyFrame(50, mof::Vector2D(550, 50) - base ) ,
+ //mof::makeKeyFrame(60, mof::Vector2D(550, 150) - base ) ,
+ mof::makeKeyFrame(0, mof::Vector2D(0,0) ) ,
+ mof::makeKeyFrame(30, mof::Vector2D(0,100) ) ,
+ mof::makeKeyFrame(50, mof::Vector2D(0, -200) ) ,
+ };
+ m_pView->getView()->getSizeStream()
+ <<
+ boost::make_shared<mof::Loop<mof::Vector2D>>
+ (
+ mof::makeKeyFrameAnimationHandler(keyFrames[0] , mof::lastOf( keyFrames )),
+ 100
+ );
+ }
+
+ m_pView->show();
+
+ m_pInputReceiver = boost::shared_ptr<mof::InputReceiver>(mof::InputDevice::getInputReceiver());
+
+ mof::GraphicsDevice::lightEnable(false);
+ mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);
+
+ }
+*/
+//}}}
+
+ void finalize( )
+ {
+ mof::safe_delete( m_pView );
+ }
+
+
+
+ void update()
+ {
+ m_scheduler.update();
+ m_pInputReceiver->update();
+ m_pView->update( );
+
+ }
+
+ void draw()
+ {
+ mof::VertexXYZRHWC vertices[] =
+ {
+ mof::VertexXYZRHWC(mof::Vector2D(0 , 0) , mof::createColor(0 , 0 , 127)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(640 , 0) , mof::createColor(0 , 0 , 127)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(0 , 480) , mof::createColor(0 , 0 , 0)) ,
+ mof::VertexXYZRHWC(mof::Vector2D(640 , 480) , mof::createColor(0 , 0 , 0))
+ };
+ mof::GraphicsDevice::setTexture(NULL);
+ mof::GraphicsDevice::drawVertexArray(vertices[0] , vertices[3] , mof::PRIMITIVE_TYPE_TRIANGLESTRIP );
+
+ m_pView->getView()->draw( );
+ }
+
+} // namespace Demo2
+
+
-#pragma once\r
-\r
-namespace Demo2\r
-{\r
- void initialize( );\r
- void finalize( );\r
- void update( );\r
- void draw( );\r
-}\r
+#pragma once
+
+namespace Demo2
+{
+ void initialize( );
+ void finalize( );
+ void update( );
+ void draw( );
+}
-#include "DungeonBuilder.h"\r
-#include "mof/SoftVertexBufferImpl.h"\r
-#include "mof/HardVertexBufferImpl.h"\r
-\r
-\r
-et::DungeonBuilder::DungeonBuilder(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale)\r
-: MapBuilder(pTextureManager , scale , map.getWidth() , map.getHeight() ) , m_map(map) \r
-{\r
- m_blockWidth = map.getWidth();\r
- m_blockHeight = map.getHeight();\r
-}\r
-\r
-et::DungeonBuilder::~DungeonBuilder(void)\r
-{\r
-}\r
-\r
-void et::DungeonBuilder::setBlockSize(int width , int height){\r
- m_blockWidth = width;\r
- m_blockHeight = height;\r
-}\r
-\r
-\r
-\r
-et::DungeonBuffer* et::DungeonBuilder::createBlock(int _x , int _y){\r
-\r
- int beginX = _x * m_blockWidth;\r
- int endX = (_x+1) * m_blockWidth;\r
- if(endX > m_map.getWidth())endX = m_map.getWidth();\r
- int beginY = _y * m_blockHeight;\r
- int endY = (_y+1) * m_blockHeight;\r
- if(endY > m_map.getHeight())endY = m_map.getHeight();\r
-\r
- std::vector<et::VertexTypeDungeon> vertices;\r
- \r
- for(int x = beginX ; x < endX ; x++){\r
- for(int y = beginY ; y < endY ; y++){\r
- addParts(vertices , x , y);\r
- }\r
- }\r
-\r
- return new mof::SoftVertexBuffer<et::VertexTypeDungeon>(et::DungeonBuffer::PRIMITIVE_TYPE_TRIANGLELIST , vertices);\r
-}\r
-\r
-\r
+#include "DungeonBuilder.h"
+#include "mof/SoftVertexBufferImpl.h"
+#include "mof/HardVertexBufferImpl.h"
+
+
+et::DungeonBuilder::DungeonBuilder(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale)
+: MapBuilder(pTextureManager , scale , map.getWidth() , map.getHeight() ) , m_map(map)
+{
+ m_blockWidth = map.getWidth();
+ m_blockHeight = map.getHeight();
+}
+
+et::DungeonBuilder::~DungeonBuilder(void)
+{
+}
+
+void et::DungeonBuilder::setBlockSize(int width , int height){
+ m_blockWidth = width;
+ m_blockHeight = height;
+}
+
+
+
+et::DungeonBuffer* et::DungeonBuilder::createBlock(int _x , int _y){
+
+ int beginX = _x * m_blockWidth;
+ int endX = (_x+1) * m_blockWidth;
+ if(endX > m_map.getWidth())endX = m_map.getWidth();
+ int beginY = _y * m_blockHeight;
+ int endY = (_y+1) * m_blockHeight;
+ if(endY > m_map.getHeight())endY = m_map.getHeight();
+
+ std::vector<et::VertexTypeDungeon> vertices;
+
+ for(int x = beginX ; x < endX ; x++){
+ for(int y = beginY ; y < endY ; y++){
+ addParts(vertices , x , y);
+ }
+ }
+
+ return new mof::SoftVertexBuffer<et::VertexTypeDungeon>(et::DungeonBuffer::PRIMITIVE_TYPE_TRIANGLELIST , vertices);
+}
+
+
-#pragma once\r
-#include "mof/PixelMap.h"\r
-#include "MapBuilder.h"\r
-\r
-\r
-namespace et{\r
- typedef VertexTypeMap VertexTypeDungeon;\r
- typedef MapBuffer DungeonBuffer;\r
- class DungeonBuilder : public MapBuilder\r
- {\r
- mof::PixelMap m_map;\r
- int m_blockWidth , m_blockHeight;\r
- protected :\r
- mof::PixelMap& getMap(){return m_map;}\r
- public:\r
- DungeonBuilder(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale);\r
- virtual ~DungeonBuilder(void);\r
- void setBlockSize(int width , int height);\r
- DungeonBuffer* createBlock(int x , int y);\r
- mof::Color getMapImageColor(int x , int y){return m_map.get(x , y);}\r
- };\r
-\r
-\r
+#pragma once
+#include "mof/PixelMap.h"
+#include "MapBuilder.h"
+
+
+namespace et{
+ typedef VertexTypeMap VertexTypeDungeon;
+ typedef MapBuffer DungeonBuffer;
+ class DungeonBuilder : public MapBuilder
+ {
+ mof::PixelMap m_map;
+ int m_blockWidth , m_blockHeight;
+ protected :
+ mof::PixelMap& getMap(){return m_map;}
+ public:
+ DungeonBuilder(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale);
+ virtual ~DungeonBuilder(void);
+ void setBlockSize(int width , int height);
+ DungeonBuffer* createBlock(int x , int y);
+ mof::Color getMapImageColor(int x , int y){return m_map.get(x , y);}
+ };
+
+
};
\ No newline at end of file
-#include "DungeonBuilderA.h"\r
-#include "MapImageColor.h"\r
-\r
-et::DungeonBuilderA::DungeonBuilderA(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale)\r
-: et::DungeonBuilder(map , pTextureManager , scale)\r
-{\r
-}\r
-\r
-et::DungeonBuilderA::~DungeonBuilderA(void)\r
-{\r
-}\r
-\r
-void et::DungeonBuilderA::addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y){\r
- mof::PixelMap map = getMap();\r
- const float SCALE = getScale();\r
- et::VertexTypeDungeon vertex;\r
- vertex.y = 0.0f;\r
- float t = 0.0001f;//\83e\83N\83X\83`\83\83\8b«\8aE\95â\90³\r
- vertex.color = mof::createColor(255 , 255 , 255);\r
- float tableX[]={ 0.0f , SCALE , SCALE , SCALE , 0.0f , 0.0f};\r
- float tableZ[]={ 0.0f , 0.0f , -SCALE , -SCALE , -SCALE , 0.0f};\r
- float tableTU[]={ 0.25f+t , 0.5f-t , 0.5f-t , 0.5f-t , 0.25f+t , 0.25f+t};\r
- float tableTV[]={ 0.0f+t, 0.0f+t , 0.25f-t , 0.25f-t , 0.25f-t , 0.0f+t};\r
-\r
-\r
- if(et::isWalkableColor(map.get(x , y))){\r
- for(int i = 0 ; i < 6 ; i++){\r
- vertex.x = tableX[i] + SCALE * x;\r
- vertex.z = tableZ[i] - SCALE * y;\r
- vertex.tu = tableTU[i];\r
- vertex.tv = tableTV[i];\r
- vertices.push_back(vertex);\r
- }\r
- return;\r
- }\r
- else if(map.get(x , y) == mof::createColor( 255 , 0 , 0)){\r
- \r
- for(int i = 0 ; i < 6 ; i++){\r
- vertex.x = tableX[i] + SCALE * x;\r
- vertex.y = SCALE;\r
- vertex.z = tableZ[i] - 0.3f * y;\r
- vertex.tu = tableTU[i] -0.25f;\r
- vertex.tv = tableTV[i];\r
- vertices.push_back(vertex);\r
- }\r
-\r
- //\95Ç\82ð\92Ç\89Á\r
- if(y > 0 && map.get(x , y-1) != mof::createColor(255 , 0 , 0)){\r
- //\8fã\95û\8cü\82É\95Ç\r
- for(int i = 0 ; i < 6 ; i++){\r
- vertex.x = tableX[i] + SCALE * x;\r
- vertex.y = tableZ[i] +SCALE;\r
- vertex.z = - SCALE * y;\r
- vertex.tu = tableTU[i] - 0.25f;\r
- vertex.tv = tableTV[i];\r
- vertices.push_back(vertex);\r
- }\r
- }\r
- if(y < map.getHeight() && map.get(x , y+1) != mof::createColor(255 , 0 , 0)){\r
- //\89º\95û\8cü\82É\95Ç\r
- for(int i = 0 ; i < 6 ; i++){\r
- vertex.x = tableX[i] + SCALE * x;\r
- vertex.y = tableZ[i] + SCALE;\r
- vertex.z = - SCALE * (y+1);\r
- if(et::isWalkableColor(map.get(x , y+1)))vertex.tu = tableTU[i] + 0.5f;\r
- else vertex.tu = tableTU[i] - 0.25f;\r
- vertex.tv = tableTV[i];\r
- vertices.push_back(vertex);\r
- }\r
- }\r
- if(x > 0 && map.get(x-1 , y) != mof::createColor(255 , 0 , 0)){\r
- //\8d¶\95û\8cü\82É\95Ç\r
- for(int i = 0 ; i < 6 ; i++){\r
- vertex.x = SCALE * x;\r
- vertex.y = tableZ[5-i] + SCALE;\r
- vertex.z = -SCALE * (y+1) + tableX[5-i];\r
- if(et::isWalkableColor(map.get(x-1 , y)))vertex.tu = tableTU[5-i] + 0.5f;\r
- else vertex.tu = tableTU[5-i] - 0.25f;\r
- vertex.tv = tableTV[5-i];\r
- vertices.push_back(vertex);\r
- }\r
- }\r
- if(x < map.getWidth() && map.get(x+1 , y) != mof::createColor(255 , 0 , 0)){\r
- //\89E\95û\8cü\82É\95Ç\r
- for(int i = 0 ; i < 6 ; i++){\r
- vertex.x = SCALE * (x+1);\r
- vertex.y = tableZ[i] + SCALE;\r
- vertex.z = -SCALE * (y+1) + tableX[i];\r
- if(et::isWalkableColor(map.get(x+1 , y)))vertex.tu = tableTU[i] + 0.5f;\r
- else vertex.tu = tableTU[i] - 0.25f;\r
- vertex.tv = tableTV[i];\r
- vertices.push_back(vertex);\r
- }\r
- } \r
- }\r
- else return;\r
-\r
- \r
+#include "DungeonBuilderA.h"
+#include "MapImageColor.h"
+
+et::DungeonBuilderA::DungeonBuilderA(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale)
+: et::DungeonBuilder(map , pTextureManager , scale)
+{
+}
+
+et::DungeonBuilderA::~DungeonBuilderA(void)
+{
+}
+
+void et::DungeonBuilderA::addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y){
+ mof::PixelMap map = getMap();
+ const float SCALE = getScale();
+ et::VertexTypeDungeon vertex;
+ vertex.y = 0.0f;
+ float t = 0.0001f;//\83e\83N\83X\83`\83\83\8b«\8aE\95â\90³
+ vertex.color = mof::createColor(255 , 255 , 255);
+ float tableX[]={ 0.0f , SCALE , SCALE , SCALE , 0.0f , 0.0f};
+ float tableZ[]={ 0.0f , 0.0f , -SCALE , -SCALE , -SCALE , 0.0f};
+ float tableTU[]={ 0.25f+t , 0.5f-t , 0.5f-t , 0.5f-t , 0.25f+t , 0.25f+t};
+ float tableTV[]={ 0.0f+t, 0.0f+t , 0.25f-t , 0.25f-t , 0.25f-t , 0.0f+t};
+
+
+ if(et::isWalkableColor(map.get(x , y))){
+ for(int i = 0 ; i < 6 ; i++){
+ vertex.x = tableX[i] + SCALE * x;
+ vertex.z = tableZ[i] - SCALE * y;
+ vertex.tu = tableTU[i];
+ vertex.tv = tableTV[i];
+ vertices.push_back(vertex);
+ }
+ return;
+ }
+ else if(map.get(x , y) == mof::createColor( 255 , 0 , 0)){
+
+ for(int i = 0 ; i < 6 ; i++){
+ vertex.x = tableX[i] + SCALE * x;
+ vertex.y = SCALE;
+ vertex.z = tableZ[i] - 0.3f * y;
+ vertex.tu = tableTU[i] -0.25f;
+ vertex.tv = tableTV[i];
+ vertices.push_back(vertex);
+ }
+
+ //\95Ç\82ð\92Ç\89Á
+ if(y > 0 && map.get(x , y-1) != mof::createColor(255 , 0 , 0)){
+ //\8fã\95û\8cü\82É\95Ç
+ for(int i = 0 ; i < 6 ; i++){
+ vertex.x = tableX[i] + SCALE * x;
+ vertex.y = tableZ[i] +SCALE;
+ vertex.z = - SCALE * y;
+ vertex.tu = tableTU[i] - 0.25f;
+ vertex.tv = tableTV[i];
+ vertices.push_back(vertex);
+ }
+ }
+ if(y < map.getHeight() && map.get(x , y+1) != mof::createColor(255 , 0 , 0)){
+ //\89º\95û\8cü\82É\95Ç
+ for(int i = 0 ; i < 6 ; i++){
+ vertex.x = tableX[i] + SCALE * x;
+ vertex.y = tableZ[i] + SCALE;
+ vertex.z = - SCALE * (y+1);
+ if(et::isWalkableColor(map.get(x , y+1)))vertex.tu = tableTU[i] + 0.5f;
+ else vertex.tu = tableTU[i] - 0.25f;
+ vertex.tv = tableTV[i];
+ vertices.push_back(vertex);
+ }
+ }
+ if(x > 0 && map.get(x-1 , y) != mof::createColor(255 , 0 , 0)){
+ //\8d¶\95û\8cü\82É\95Ç
+ for(int i = 0 ; i < 6 ; i++){
+ vertex.x = SCALE * x;
+ vertex.y = tableZ[5-i] + SCALE;
+ vertex.z = -SCALE * (y+1) + tableX[5-i];
+ if(et::isWalkableColor(map.get(x-1 , y)))vertex.tu = tableTU[5-i] + 0.5f;
+ else vertex.tu = tableTU[5-i] - 0.25f;
+ vertex.tv = tableTV[5-i];
+ vertices.push_back(vertex);
+ }
+ }
+ if(x < map.getWidth() && map.get(x+1 , y) != mof::createColor(255 , 0 , 0)){
+ //\89E\95û\8cü\82É\95Ç
+ for(int i = 0 ; i < 6 ; i++){
+ vertex.x = SCALE * (x+1);
+ vertex.y = tableZ[i] + SCALE;
+ vertex.z = -SCALE * (y+1) + tableX[i];
+ if(et::isWalkableColor(map.get(x+1 , y)))vertex.tu = tableTU[i] + 0.5f;
+ else vertex.tu = tableTU[i] - 0.25f;
+ vertex.tv = tableTV[i];
+ vertices.push_back(vertex);
+ }
+ }
+ }
+ else return;
+
+
}
\ No newline at end of file
-#pragma once\r
-#include "DungeonBuilder.h"\r
-\r
-namespace et{\r
-\r
- class DungeonBuilderA :\r
- public DungeonBuilder\r
- {\r
- protected:\r
- \r
- virtual void addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y);\r
- public:\r
- DungeonBuilderA(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale);\r
- virtual ~DungeonBuilderA(void);\r
- };\r
-\r
- \r
-\r
-\r
+#pragma once
+#include "DungeonBuilder.h"
+
+namespace et{
+
+ class DungeonBuilderA :
+ public DungeonBuilder
+ {
+ protected:
+
+ virtual void addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y);
+ public:
+ DungeonBuilderA(mof::PixelMap& map , mof::TextureManager* pTextureManager , float scale);
+ virtual ~DungeonBuilderA(void);
+ };
+
+
+
+
};
\ No newline at end of file
-#include "FightingMenu.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MyWindow.h"\r
-#include "TargetMenu.h"\r
-#include "IdealMenu.h"\r
-#include "UsingBattleItemMenu.h"\r
-#include "ItemMenu.h"\r
-#include "BattlerGroup.h"\r
-#include "BattlerFacade.h"\r
-\r
-et::FightingMenu::FightingMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )\r
-: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )\r
-{\r
- m_pBattleData = pBattleData;\r
-\r
- m_pSelector = NULL;\r
- m_pTextureManager = pTextureManager;\r
- std::vector<mof::Window*> selectables;\r
-\r
- mof::Window* pSelectable = NULL;\r
- et::BattlerFacade* pHero = m_pBattleData->getBattlerGroup()->getHeroBattler();\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\82±\82¤\82°\82«(AP-3)") , 16);\r
- if(pHero->getParameter().actionPoint < 3)pSelectable->setAvailable(false);\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\90_\97ì(AP-5)") , 16);\r
- if(pHero->getParameter().actionPoint < 5)pSelectable->setAvailable(false);\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\83A\83C\83e\83\80(AP-2)") , 16);\r
- if(pHero->getParameter().actionPoint < 2)pSelectable->setAvailable(false);\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\82Ú\82¤\82¬\82å(AP-1)") , 16);\r
- if(pHero->getParameter().actionPoint < 1)pSelectable->setAvailable(false);\r
- m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());\r
- setVisible(true);\r
-}\r
-\r
-et::FightingMenu::~FightingMenu(void)\r
-{\r
- delete m_pSelector;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-void et::FightingMenu::setVisible(bool visible){\r
- et::MyFrame::setVisible(visible);\r
- if(visible){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(-200 ,370));\r
- pAnimation->setPosition(15 , mof::Vector2D(10 , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(10 , 370));\r
- pAnimation->setPosition(15 , mof::Vector2D(-200 , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
-}\r
-\r
-et::MyFrame* et::FightingMenu::performAction(){\r
- \r
- switch(getSelectionModel()->getSelectingIndex()){\r
- case 0 : //\82±\82¤\82°\82«\r
- {\r
- et::BattleAction action;\r
- action.type = et::BattleAction::ATTACK_WEAPON;\r
- return new TargetMenu(m_pTextureManager , m_pBattleData , action , 160);\r
- }\r
- case 1 : //\82µ\82ñ\82ê\82¢\r
- return new IdealMenu(m_pTextureManager , m_pBattleData);\r
- case 2 : //\83A\83C\83e\83\80\r
- {\r
- et::ItemOperatorFactory* pOperationMenuFactory = new UsingBattleItemMenuFactory(m_pTextureManager , m_pBattleData);\r
- return new et::ItemMenu( m_pTextureManager , m_pBattleData->getItemList() , pOperationMenuFactory);\r
- }\r
- case 3 : //\82Ú\82¤\82¬\82å\r
- {\r
- et::BattleAction action;\r
- action.type = et::BattleAction::GUARD;\r
- //\83K\81[\83h\8fó\91Ô\82É\r
- et::BattlerParameter parameter = m_pBattleData->getBattlerGroup()->getHeroBattler()->getParameter();\r
- parameter.guard = true;\r
- parameter.dActionPoint -= 1;\r
- m_pBattleData->getBattlerGroup()->getHeroBattler()->setParameter(parameter);\r
- m_pBattleData->setBattleAction(action);\r
- return this;\r
- }\r
- default :\r
- DEBUG_PRINT("\96¢\92è\8b`\82Ì\83A\83N\83V\83\87\83\93\82ª\97v\8b\81\82³\82ê\82Ü\82µ\82½");\r
- return NULL;\r
- }\r
-}\r
-\r
-\r
-\r
-mof::Window* et::FightingMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){\r
- mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);\r
- pOwner->add(pSelectable);\r
- selectables.push_back(pSelectable);\r
- return pSelectable;\r
+#include "FightingMenu.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MyWindow.h"
+#include "TargetMenu.h"
+#include "IdealMenu.h"
+#include "UsingBattleItemMenu.h"
+#include "ItemMenu.h"
+#include "BattlerGroup.h"
+#include "BattlerFacade.h"
+
+et::FightingMenu::FightingMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )
+: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )
+{
+ m_pBattleData = pBattleData;
+
+ m_pSelector = NULL;
+ m_pTextureManager = pTextureManager;
+ std::vector<mof::Window*> selectables;
+
+ mof::Window* pSelectable = NULL;
+ et::BattlerFacade* pHero = m_pBattleData->getBattlerGroup()->getHeroBattler();
+ pSelectable = addSelectableTextItem(this , selectables , _T("\82±\82¤\82°\82«(AP-3)") , 16);
+ if(pHero->getParameter().actionPoint < 3)pSelectable->setAvailable(false);
+ pSelectable = addSelectableTextItem(this , selectables , _T("\90_\97ì(AP-5)") , 16);
+ if(pHero->getParameter().actionPoint < 5)pSelectable->setAvailable(false);
+ pSelectable = addSelectableTextItem(this , selectables , _T("\83A\83C\83e\83\80(AP-2)") , 16);
+ if(pHero->getParameter().actionPoint < 2)pSelectable->setAvailable(false);
+ pSelectable = addSelectableTextItem(this , selectables , _T("\82Ú\82¤\82¬\82å(AP-1)") , 16);
+ if(pHero->getParameter().actionPoint < 1)pSelectable->setAvailable(false);
+ m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());
+ setVisible(true);
+}
+
+et::FightingMenu::~FightingMenu(void)
+{
+ delete m_pSelector;
+}
+
+
+
+
+
+void et::FightingMenu::setVisible(bool visible){
+ et::MyFrame::setVisible(visible);
+ if(visible){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(-200 ,370));
+ pAnimation->setPosition(15 , mof::Vector2D(10 , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(10 , 370));
+ pAnimation->setPosition(15 , mof::Vector2D(-200 , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+}
+
+et::MyFrame* et::FightingMenu::performAction(){
+
+ switch(getSelectionModel()->getSelectingIndex()){
+ case 0 : //\82±\82¤\82°\82«
+ {
+ et::BattleAction action;
+ action.type = et::BattleAction::ATTACK_WEAPON;
+ return new TargetMenu(m_pTextureManager , m_pBattleData , action , 160);
+ }
+ case 1 : //\82µ\82ñ\82ê\82¢
+ return new IdealMenu(m_pTextureManager , m_pBattleData);
+ case 2 : //\83A\83C\83e\83\80
+ {
+ et::ItemOperatorFactory* pOperationMenuFactory = new UsingBattleItemMenuFactory(m_pTextureManager , m_pBattleData);
+ return new et::ItemMenu( m_pTextureManager , m_pBattleData->getItemList() , pOperationMenuFactory);
+ }
+ case 3 : //\82Ú\82¤\82¬\82å
+ {
+ et::BattleAction action;
+ action.type = et::BattleAction::GUARD;
+ //\83K\81[\83h\8fó\91Ô\82É
+ et::BattlerParameter parameter = m_pBattleData->getBattlerGroup()->getHeroBattler()->getParameter();
+ parameter.guard = true;
+ parameter.dActionPoint -= 1;
+ m_pBattleData->getBattlerGroup()->getHeroBattler()->setParameter(parameter);
+ m_pBattleData->setBattleAction(action);
+ return this;
+ }
+ default :
+ DEBUG_PRINT("\96¢\92è\8b`\82Ì\83A\83N\83V\83\87\83\93\82ª\97v\8b\81\82³\82ê\82Ü\82µ\82½");
+ return NULL;
+ }
+}
+
+
+
+mof::Window* et::FightingMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){
+ mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);
+ pOwner->add(pSelectable);
+ selectables.push_back(pSelectable);
+ return pSelectable;
}
\ No newline at end of file
-#pragma once\r
-#include "MyFrame.h"\r
-#include "mof/Texture.h"\r
-#include "BattleData.h"\r
-\r
-namespace et{\r
-\r
- class FightingMenu : public MyFrame\r
- {\r
- mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);\r
- \r
- mof::SelectionModel* m_pSelector;\r
- mof::TextureManager* m_pTextureManager;\r
- et::BattleData* m_pBattleData;\r
- public:\r
- FightingMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);\r
- virtual ~FightingMenu(void);\r
- virtual void setVisible(bool visible);\r
- virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}\r
- virtual MyFrame* performAction();\r
- };\r
-\r
-\r
+#pragma once
+#include "MyFrame.h"
+#include "mof/Texture.h"
+#include "BattleData.h"
+
+namespace et{
+
+ class FightingMenu : public MyFrame
+ {
+ mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);
+
+ mof::SelectionModel* m_pSelector;
+ mof::TextureManager* m_pTextureManager;
+ et::BattleData* m_pBattleData;
+ public:
+ FightingMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);
+ virtual ~FightingMenu(void);
+ virtual void setVisible(bool visible);
+ virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}
+ virtual MyFrame* performAction();
+ };
+
+
};
\ No newline at end of file
-#include "FixedBattler.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "AttackAction.h"\r
-#include "SpecialAction.h"\r
-#include "BattlerGroup.h"\r
-#include "GameData.h"\r
-#include "AttackAction.h"\r
-#include "SpecialAction.h"\r
-\r
-et::FixedBattler::FixedBattler(BattlerType type , et::BattlerParameter& parameter , mof::TextureManager* pTextureManager , et::GameData* pGameData)\r
-: BattlerFacade(type) , m_pGameData(pGameData)\r
-{\r
- m_command.type = et::BattleAction::NONE;\r
- setParameter(parameter);\r
- \r
- if(getType() == et::HERO){\r
- m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(_T("image/hero0.png")));\r
- }\r
- else if(getType() == et::ENEMY){\r
- m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(_T("image/hd.png")));\r
- }\r
- else if(getType() == et::IDEAL){\r
- m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(_T("image/ideal.png")));\r
- }\r
-\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setScale(0 , mof::Vector3D(0.3f , 0.3f , 0.3f));\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- getGraphicsObject()->setAnimation( 0 , mof::AnimationResource(pAnimation));\r
- \r
- \r
-}\r
-\r
-\r
-\r
-\r
-mof::AnimationResource et::FixedBattler::setMovingAnimation(mof::Vector3D& goal , int nFrame){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setPosition(nFrame-1 , goal);\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
-}\r
-\r
-mof::AnimationResource et::FixedBattler::setAidlingAnimation(mof::Vector3D& position ){\r
- if(!getParameter().alive){\r
- //\89½\82à\95\\8e¦\82µ\82È\82¢\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);\r
- pAnimation->setPosition(0 , position);\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(1 , 1 , 1 , 1));\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- }\r
- else if(getParameter().guard && getType() == et::HERO){\r
- //\83K\81[\83h\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);\r
- pAnimation->setPosition(0 , position);\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 64*2 , 64 , 64*3));\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);\r
- pAnimation->setPosition(0 , position);\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- pAnimation->setTextureRectangle(15 , mof::Line2D(0 , 64 , 64 , 64*2));\r
- pAnimation->setTextureRectangle(30-1 , mof::Line2D(0 , 0 , 64 , 64));\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- }\r
-}\r
-\r
-mof::AnimationResource et::FixedBattler::setCastAnimation(int category){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- \r
- if(category == 0){\r
- //\92Ê\8fí\8dU\8c\82\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(64 , 0 , 128 , 64));\r
- pAnimation->setTextureRectangle(10 , mof::Line2D(64 , 64 , 128 , 64*2));\r
- pAnimation->setTextureRectangle(20 , mof::Line2D(64 , 128 , 128 , 64*3));\r
- pAnimation->setFinalKey(20);\r
- }\r
- else if(category == 1){\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setTextureRectangle(0 , mof::Line2D(64*2 , 0 , 64*3 , 64));\r
- pAnimation->setTextureRectangle(40 , mof::Line2D(0 , 0 , 64 , 64));\r
- pAnimation->setFinalKey(20);\r
- }\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
- \r
-}\r
-\r
-mof::AnimationResource et::FixedBattler::setDamagedAnimation(int level){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- if(level == 0){\r
- //\92Ê\8fí\r
- mof::Vector3D backPosition = getPosition();\r
- backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setPosition(10 , backPosition);\r
- pAnimation->setPosition(40 , backPosition);\r
- pAnimation->setPosition(60 , getPosition());\r
- \r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(16 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(26 , mof::Line2D(0 , 0 , 64 , 64));\r
- \r
- }\r
- else if(level == 1){\r
- //\8e\80\96S\r
- \r
- mof::Vector3D backPosition = getPosition();\r
- backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;\r
- pAnimation->setPosition(0 , getPosition());\r
- pAnimation->setPosition(10 , backPosition);\r
- \r
- pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));\r
- pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));\r
- pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));\r
- pAnimation->setTextureRectangle(25 , mof::Line2D(1 , 1 , 1 , 1));\r
- \r
- }\r
- mof::AnimationResource resource(pAnimation);\r
- getGraphicsObject()->setAnimation( 1 , resource);\r
- return resource;\r
-}\r
-\r
-void et::FixedBattler::setBattleCommand(BattleAction& action){\r
- m_command = action;\r
-}\r
-\r
-et::Action* et::FixedBattler::createAction(BattlerGroup* pGroup ){\r
- \r
- if(m_command.type == et::BattleAction::ATTACK_WEAPON){\r
- return new AttackAction(this , m_command.pTarget , 3);\r
- }\r
- else if(m_command.type == et::BattleAction::WAIT || m_command.type == et::BattleAction::GUARD){\r
- return NULL;\r
- }\r
- else if(m_command.type == et::BattleAction::CAST){\r
- et::BattlerFacade* pIdeal = pGroup->getIdealBattlerAt(m_command.idealIndex);\r
- et::BattlerParameter parameter = pIdeal->getParameter();\r
- parameter.dActionPoint -= 5;\r
- pIdeal->setParameter(parameter);\r
- std::vector<et::BattlerFacade*> targetList;\r
- if(m_command.pTarget != NULL)targetList.push_back(m_command.pTarget);\r
- else targetList = pGroup->getEnemyBattlerListAlive();\r
- \r
- //\93Á\8eê\8bZ\82Ì\8eí\97Þ\82ð\93¾\82é\r
- return new SpecialAction(this , targetList , 5 , m_command.idealIndex);\r
- }\r
- else if(m_command.type == et::BattleAction::USE_ITEM){\r
- //\83A\83C\83e\83\80\82ð\82È\82\82·\r
- std::list<et::ItemData> &refList = m_pGameData->getBattleItemList();\r
- for(std::list<et::ItemData>::iterator itr = refList.begin() ; itr != refList.end() ; ++itr){\r
- if(m_command.pTargetItem == &(*itr)){\r
- refList.erase(itr);\r
- break;\r
- }\r
- }\r
- std::vector<et::BattlerFacade*> targetList;\r
- if(m_command.pTarget != NULL)targetList.push_back(m_command.pTarget);\r
- else targetList = pGroup->getEnemyBattlerListAlive();\r
-\r
- //\93Á\8eê\8bZ\82Ì\8eí\97Þ\82ð\93¾\82é\r
- return new SpecialAction(this , targetList , 2 , 3);\r
- }\r
- else return NULL;\r
-}\r
-/*et::Action* et::FixedBattler::createNextAction(std::list<BattlerFacade*>& enemy , std::list<BattlerFacade*>& ally){\r
-//if(pBattler->getParameter().actionPoint >= 3)return new AttackAction(pBattler , getHeroBattler() , 3 , 1.0f);\r
- //else return NULL;\r
- return NULL;\r
+#include "FixedBattler.h"
+#include "mof/KeyFrameAnimation.h"
+#include "AttackAction.h"
+#include "SpecialAction.h"
+#include "BattlerGroup.h"
+#include "GameData.h"
+#include "AttackAction.h"
+#include "SpecialAction.h"
+
+et::FixedBattler::FixedBattler(BattlerType type , et::BattlerParameter& parameter , mof::TextureManager* pTextureManager , et::GameData* pGameData)
+: BattlerFacade(type) , m_pGameData(pGameData)
+{
+ m_command.type = et::BattleAction::NONE;
+ setParameter(parameter);
+
+ if(getType() == et::HERO){
+ m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(_T("image/hero0.png")));
+ }
+ else if(getType() == et::ENEMY){
+ m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(_T("image/hd.png")));
+ }
+ else if(getType() == et::IDEAL){
+ m_pGraphicsObject = new mof::Billboard(mof::Billboard::Y_FIXED , pTextureManager->getResource(_T("image/ideal.png")));
+ }
+
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setScale(0 , mof::Vector3D(0.3f , 0.3f , 0.3f));
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ getGraphicsObject()->setAnimation( 0 , mof::AnimationResource(pAnimation));
+
+
+}
+
+
+
+
+mof::AnimationResource et::FixedBattler::setMovingAnimation(mof::Vector3D& goal , int nFrame){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setPosition(nFrame-1 , goal);
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+}
+
+mof::AnimationResource et::FixedBattler::setAidlingAnimation(mof::Vector3D& position ){
+ if(!getParameter().alive){
+ //\89½\82à\95\\8e¦\82µ\82È\82¢
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);
+ pAnimation->setPosition(0 , position);
+ pAnimation->setTextureRectangle(0 , mof::Line2D(1 , 1 , 1 , 1));
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+ }
+ else if(getParameter().guard && getType() == et::HERO){
+ //\83K\81[\83h
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);
+ pAnimation->setPosition(0 , position);
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 64*2 , 64 , 64*3));
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);
+ pAnimation->setPosition(0 , position);
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ pAnimation->setTextureRectangle(15 , mof::Line2D(0 , 64 , 64 , 64*2));
+ pAnimation->setTextureRectangle(30-1 , mof::Line2D(0 , 0 , 64 , 64));
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+ }
+}
+
+mof::AnimationResource et::FixedBattler::setCastAnimation(int category){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+
+ if(category == 0){
+ //\92Ê\8fí\8dU\8c\82
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setTextureRectangle(0 , mof::Line2D(64 , 0 , 128 , 64));
+ pAnimation->setTextureRectangle(10 , mof::Line2D(64 , 64 , 128 , 64*2));
+ pAnimation->setTextureRectangle(20 , mof::Line2D(64 , 128 , 128 , 64*3));
+ pAnimation->setFinalKey(20);
+ }
+ else if(category == 1){
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setTextureRectangle(0 , mof::Line2D(64*2 , 0 , 64*3 , 64));
+ pAnimation->setTextureRectangle(40 , mof::Line2D(0 , 0 , 64 , 64));
+ pAnimation->setFinalKey(20);
+ }
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+
+}
+
+mof::AnimationResource et::FixedBattler::setDamagedAnimation(int level){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ if(level == 0){
+ //\92Ê\8fí
+ mof::Vector3D backPosition = getPosition();
+ backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setPosition(10 , backPosition);
+ pAnimation->setPosition(40 , backPosition);
+ pAnimation->setPosition(60 , getPosition());
+
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(16 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(26 , mof::Line2D(0 , 0 , 64 , 64));
+
+ }
+ else if(level == 1){
+ //\8e\80\96S
+
+ mof::Vector3D backPosition = getPosition();
+ backPosition.x += (getType() == et::ENEMY)? -0.1f : 0.1f;
+ pAnimation->setPosition(0 , getPosition());
+ pAnimation->setPosition(10 , backPosition);
+
+ pAnimation->setTextureRectangle(0 , mof::Line2D(0 , 0 , 64 , 64));
+ pAnimation->setTextureRectangle(8 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(10 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(12 , mof::Line2D(64*3 , 0 , 256 , 64));
+ pAnimation->setTextureRectangle(14 , mof::Line2D(1 , 1 , 1 , 1));
+ pAnimation->setTextureRectangle(25 , mof::Line2D(1 , 1 , 1 , 1));
+
+ }
+ mof::AnimationResource resource(pAnimation);
+ getGraphicsObject()->setAnimation( 1 , resource);
+ return resource;
+}
+
+void et::FixedBattler::setBattleCommand(BattleAction& action){
+ m_command = action;
+}
+
+et::Action* et::FixedBattler::createAction(BattlerGroup* pGroup ){
+
+ if(m_command.type == et::BattleAction::ATTACK_WEAPON){
+ return new AttackAction(this , m_command.pTarget , 3);
+ }
+ else if(m_command.type == et::BattleAction::WAIT || m_command.type == et::BattleAction::GUARD){
+ return NULL;
+ }
+ else if(m_command.type == et::BattleAction::CAST){
+ et::BattlerFacade* pIdeal = pGroup->getIdealBattlerAt(m_command.idealIndex);
+ et::BattlerParameter parameter = pIdeal->getParameter();
+ parameter.dActionPoint -= 5;
+ pIdeal->setParameter(parameter);
+ std::vector<et::BattlerFacade*> targetList;
+ if(m_command.pTarget != NULL)targetList.push_back(m_command.pTarget);
+ else targetList = pGroup->getEnemyBattlerListAlive();
+
+ //\93Á\8eê\8bZ\82Ì\8eí\97Þ\82ð\93¾\82é
+ return new SpecialAction(this , targetList , 5 , m_command.idealIndex);
+ }
+ else if(m_command.type == et::BattleAction::USE_ITEM){
+ //\83A\83C\83e\83\80\82ð\82È\82\82·
+ std::list<et::ItemData> &refList = m_pGameData->getBattleItemList();
+ for(std::list<et::ItemData>::iterator itr = refList.begin() ; itr != refList.end() ; ++itr){
+ if(m_command.pTargetItem == &(*itr)){
+ refList.erase(itr);
+ break;
+ }
+ }
+ std::vector<et::BattlerFacade*> targetList;
+ if(m_command.pTarget != NULL)targetList.push_back(m_command.pTarget);
+ else targetList = pGroup->getEnemyBattlerListAlive();
+
+ //\93Á\8eê\8bZ\82Ì\8eí\97Þ\82ð\93¾\82é
+ return new SpecialAction(this , targetList , 2 , 3);
+ }
+ else return NULL;
+}
+/*et::Action* et::FixedBattler::createNextAction(std::list<BattlerFacade*>& enemy , std::list<BattlerFacade*>& ally){
+//if(pBattler->getParameter().actionPoint >= 3)return new AttackAction(pBattler , getHeroBattler() , 3 , 1.0f);
+ //else return NULL;
+ return NULL;
}*/
\ No newline at end of file
-#pragma once\r
-#include "BattlerFacade.h"\r
-#include "BattlerType.h"\r
-#include "BattleData.h"\r
-\r
-namespace et{\r
- class Action;\r
- class GameData;\r
-\r
- class FixedBattler : public BattlerFacade\r
- {\r
- GameData* m_pGameData;\r
- BattleAction m_command;\r
- public:\r
-\r
- FixedBattler(BattlerType type , et::BattlerParameter& parameter , mof::TextureManager* pTextureManager , GameData* pGameData = NULL);\r
- \r
- virtual mof::AnimationResource setMovingAnimation(mof::Vector3D& goal , int nFrame);\r
- virtual mof::AnimationResource setAidlingAnimation(mof::Vector3D& position);\r
- virtual mof::AnimationResource setCastAnimation(int category);\r
- virtual mof::AnimationResource setDamagedAnimation(int level);\r
- virtual Action* createAction(BattlerGroup* pGroup ) ;\r
-\r
- void setBattleCommand(BattleAction& action);\r
- };\r
-\r
-\r
-}\r
-\r
+#pragma once
+#include "BattlerFacade.h"
+#include "BattlerType.h"
+#include "BattleData.h"
+
+namespace et{
+ class Action;
+ class GameData;
+
+ class FixedBattler : public BattlerFacade
+ {
+ GameData* m_pGameData;
+ BattleAction m_command;
+ public:
+
+ FixedBattler(BattlerType type , et::BattlerParameter& parameter , mof::TextureManager* pTextureManager , GameData* pGameData = NULL);
+
+ virtual mof::AnimationResource setMovingAnimation(mof::Vector3D& goal , int nFrame);
+ virtual mof::AnimationResource setAidlingAnimation(mof::Vector3D& position);
+ virtual mof::AnimationResource setCastAnimation(int category);
+ virtual mof::AnimationResource setDamagedAnimation(int level);
+ virtual Action* createAction(BattlerGroup* pGroup ) ;
+
+ void setBattleCommand(BattleAction& action);
+ };
+
+
+}
+
-#include "GameData.h"\r
-#include <iostream>\r
-\r
-\r
-et::GameData::GameData(void)\r
-{\r
- m_battleItemList.push_back(et::ItemData(_T("\82¢\82Ì\82¿\82Ì\89Ê\8eÀ") , _T("") , 20 , et::ItemData::POTION));\r
-}\r
-\r
-et::GameData::~GameData(void)\r
-{\r
- \r
-}\r
-\r
-\r
-et::World* et::GameData::createWorld(){\r
- return new et::World(m_regenerationHistory);\r
-}\r
+#include "GameData.h"
+#include <iostream>
+
+
+et::GameData::GameData(void)
+{
+ m_battleItemList.push_back(et::ItemData(_T("\82¢\82Ì\82¿\82Ì\89Ê\8eÀ") , _T("") , 20 , et::ItemData::POTION));
+}
+
+et::GameData::~GameData(void)
+{
+
+}
+
+
+et::World* et::GameData::createWorld(){
+ return new et::World(m_regenerationHistory);
+}
-#pragma once\r
-#include "Area.h"\r
-#include "World.h"\r
-#include "mof/Vector2D.h"\r
-#include <vector>\r
-#include <list>\r
-#include "ItemData.h"\r
-\r
-\r
-\r
-namespace et{\r
- \r
- class GameData\r
- {\r
- std::vector<RegenerationEvent> m_regenerationHistory;\r
- std::list<et::ItemData> m_battleItemList;\r
- public:\r
- GameData(void);\r
- virtual ~GameData(void);\r
-\r
- et::World* createWorld();\r
- void addRegenerationEvent(RegenerationEvent& event){m_regenerationHistory.push_back(event);}\r
- std::list<et::ItemData>& getBattleItemList(){return m_battleItemList;}\r
-\r
- };\r
-\r
-\r
+#pragma once
+#include "Area.h"
+#include "World.h"
+#include "mof/Vector2D.h"
+#include <vector>
+#include <list>
+#include "ItemData.h"
+
+
+
+namespace et{
+
+ class GameData
+ {
+ std::vector<RegenerationEvent> m_regenerationHistory;
+ std::list<et::ItemData> m_battleItemList;
+ public:
+ GameData(void);
+ virtual ~GameData(void);
+
+ et::World* createWorld();
+ void addRegenerationEvent(RegenerationEvent& event){m_regenerationHistory.push_back(event);}
+ std::list<et::ItemData>& getBattleItemList(){return m_battleItemList;}
+
+ };
+
+
};
\ No newline at end of file
-#include "GameScene.h"\r
-\r
-\r
-\r
-\r
-\r
-et::GameScene::GameScene(void)\r
-: mof::AbstractScene()\r
-{\r
- m_pCapturer = NULL;\r
- m_pGameData = NULL;\r
- m_pInputReceiver = NULL;\r
- m_pMeshManager = NULL;\r
- m_pTextureManager = NULL;\r
- m_pDataResourceManager = NULL;\r
-}\r
-\r
-et::GameScene::~GameScene(void)\r
-{\r
-}\r
-\r
-\r
-\r
-void et::GameScene::setMeshManager(mof::MeshManager* pMeshManager){\r
- m_pMeshManager = pMeshManager;\r
-\r
-}\r
-\r
-void et::GameScene::setTextureManager(mof::TextureManager* pTextureManager){\r
- m_pTextureManager = pTextureManager;\r
-\r
-}\r
-\r
-void et::GameScene::setDataResourceManager(mof::DataResourceManager* pDataResourceManager){\r
- m_pDataResourceManager = pDataResourceManager;\r
-}\r
-\r
-void et::GameScene::setCapturer(mof::Capturer* pCapturer){\r
- m_pCapturer = pCapturer;\r
-}\r
- \r
-\r
-void et::GameScene::setGameData(GameData* pGameData){\r
- m_pGameData = pGameData;\r
-}\r
-\r
- \r
-void et::GameScene::setInputReceiver(mof::InputReceiver* pInputReceiver){\r
- m_pInputReceiver = pInputReceiver;\r
-\r
-}\r
-\r
+#include "GameScene.h"
+
+
+
+
+
+et::GameScene::GameScene(void)
+: mof::AbstractScene()
+{
+ m_pCapturer = NULL;
+ m_pGameData = NULL;
+ m_pInputReceiver = NULL;
+ m_pMeshManager = NULL;
+ m_pTextureManager = NULL;
+ m_pDataResourceManager = NULL;
+}
+
+et::GameScene::~GameScene(void)
+{
+}
+
+
+
+void et::GameScene::setMeshManager(mof::MeshManager* pMeshManager){
+ m_pMeshManager = pMeshManager;
+
+}
+
+void et::GameScene::setTextureManager(mof::TextureManager* pTextureManager){
+ m_pTextureManager = pTextureManager;
+
+}
+
+void et::GameScene::setDataResourceManager(mof::DataResourceManager* pDataResourceManager){
+ m_pDataResourceManager = pDataResourceManager;
+}
+
+void et::GameScene::setCapturer(mof::Capturer* pCapturer){
+ m_pCapturer = pCapturer;
+}
+
+
+void et::GameScene::setGameData(GameData* pGameData){
+ m_pGameData = pGameData;
+}
+
+
+void et::GameScene::setInputReceiver(mof::InputReceiver* pInputReceiver){
+ m_pInputReceiver = pInputReceiver;
+
+}
+
-#pragma once\r
-#include "mof/AbstractScene.h"\r
-#include "mof/Graphics.h"\r
-#include "mof/InputReceiver.h"\r
-#include "GameData.h"\r
-#include "mof/Capturer.h"\r
-#include "mof/DataTable.h"\r
-\r
-namespace et{\r
- class GameScene :\r
- public mof::AbstractScene\r
- {\r
- protected:\r
- mof::Capturer* m_pCapturer;\r
- GameData* m_pGameData;\r
- mof::InputReceiver* m_pInputReceiver;\r
- mof::MeshManager* m_pMeshManager;\r
- mof::TextureManager* m_pTextureManager;\r
- mof::DataResourceManager* m_pDataResourceManager;\r
- public:\r
- GameScene(void);\r
- virtual ~GameScene(void);\r
-\r
- void setMeshManager(mof::MeshManager* pMeshManager);\r
- void setTextureManager(mof::TextureManager* pTextureManager);\r
- void setGameData(GameData* pGameData);\r
- void setCapturer(mof::Capturer* pCapturer);\r
- void setInputReceiver(mof::InputReceiver* pInputReceiver);\r
- void setDataResourceManager(mof::DataResourceManager* pDataResourceManager);\r
- };\r
-\r
-\r
+#pragma once
+#include "mof/AbstractScene.h"
+#include "mof/Graphics.h"
+#include "mof/InputReceiver.h"
+#include "GameData.h"
+#include "mof/Capturer.h"
+#include "mof/DataTable.h"
+
+namespace et{
+ class GameScene :
+ public mof::AbstractScene
+ {
+ protected:
+ mof::Capturer* m_pCapturer;
+ GameData* m_pGameData;
+ mof::InputReceiver* m_pInputReceiver;
+ mof::MeshManager* m_pMeshManager;
+ mof::TextureManager* m_pTextureManager;
+ mof::DataResourceManager* m_pDataResourceManager;
+ public:
+ GameScene(void);
+ virtual ~GameScene(void);
+
+ void setMeshManager(mof::MeshManager* pMeshManager);
+ void setTextureManager(mof::TextureManager* pTextureManager);
+ void setGameData(GameData* pGameData);
+ void setCapturer(mof::Capturer* pCapturer);
+ void setInputReceiver(mof::InputReceiver* pInputReceiver);
+ void setDataResourceManager(mof::DataResourceManager* pDataResourceManager);
+ };
+
+
};
\ No newline at end of file
-#include "IdealMenu.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MyWindow.h"\r
-#include "TargetMenu.h"\r
-#include "BattlerGroup.h"\r
-#include "BattlerFacade.h"\r
-\r
-\r
-mof::Window* et::IdealMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){\r
- mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);\r
- pOwner->add(pSelectable);\r
- selectables.push_back(pSelectable);\r
- return pSelectable;\r
-}\r
-\r
-et::IdealMenu::IdealMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )\r
-: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )\r
-{\r
- m_pBattleData = pBattleData;\r
-\r
- m_pSelector = NULL;\r
- m_pTextureManager = pTextureManager;\r
- std::vector<mof::Window*> selectables;\r
-\r
- mof::Window* pSelectable = NULL;\r
- //\90_\97ì\82Ì\83\8a\83X\83g\8dì\90¬\r
- for(std::vector<et::BattlerFacade*>::const_iterator itr = m_pBattleData->getBattlerGroup()->getBattlerList().begin() ;\r
- itr != m_pBattleData->getBattlerGroup()->getBattlerList().end() ; ++itr){\r
- if((*itr)->getType() != et::IDEAL || !(*itr)->getParameter().alive)continue;\r
- pSelectable = addSelectableTextItem(this , selectables , (TCHAR*)(*itr)->getParameter().name.c_str() , 16);\r
- if((*itr)->getParameter().actionPoint < 5)pSelectable->setAvailable(false);\r
- \r
- }\r
- m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());\r
- setVisible(true);\r
-}\r
-\r
-et::IdealMenu::~IdealMenu(void)\r
-{\r
- delete m_pSelector;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-void et::IdealMenu::setVisible(bool visible){\r
- et::MyFrame::setVisible(visible);\r
- if(visible){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(160 ,500));\r
- pAnimation->setPosition(10 , mof::Vector2D(160 , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(160 , 370));\r
- pAnimation->setPosition(10 , mof::Vector2D(160 , 500));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
-}\r
-\r
-et::MyFrame* et::IdealMenu::performAction(){\r
- int index = getSelectionModel()->getSelectingIndex();\r
- et::BattleAction action;\r
- action.type = et::BattleAction::CAST;\r
- int cntIdeal = 0;\r
- for(std::vector<et::BattlerFacade*>::const_iterator itr = m_pBattleData->getBattlerGroup()->getBattlerList().begin() ;\r
- itr != m_pBattleData->getBattlerGroup()->getBattlerList().end() ; ++itr){\r
- if((*itr)->getType() != et::IDEAL || !(*itr)->getParameter().alive)continue;\r
- else if(index == cntIdeal++)action.idealIndex = index;\r
- }\r
- \r
- if(action.idealIndex == 0)return new et::TargetMenu(m_pTextureManager , m_pBattleData , action , 300);//\92P\91Ì\r
- else if(action.idealIndex == 1){\r
- action.pTarget = NULL;\r
- m_pBattleData->setBattleAction(action);\r
- return this;\r
- }\r
- else if(action.idealIndex == 2){\r
- action.pTarget = m_pBattleData->getBattlerGroup()->getHeroBattler();\r
- m_pBattleData->setBattleAction(action);\r
- return this;\r
- }\r
-}\r
-\r
-\r
+#include "IdealMenu.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MyWindow.h"
+#include "TargetMenu.h"
+#include "BattlerGroup.h"
+#include "BattlerFacade.h"
+
+
+mof::Window* et::IdealMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){
+ mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);
+ pOwner->add(pSelectable);
+ selectables.push_back(pSelectable);
+ return pSelectable;
+}
+
+et::IdealMenu::IdealMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )
+: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )
+{
+ m_pBattleData = pBattleData;
+
+ m_pSelector = NULL;
+ m_pTextureManager = pTextureManager;
+ std::vector<mof::Window*> selectables;
+
+ mof::Window* pSelectable = NULL;
+ //\90_\97ì\82Ì\83\8a\83X\83g\8dì\90¬
+ for(std::vector<et::BattlerFacade*>::const_iterator itr = m_pBattleData->getBattlerGroup()->getBattlerList().begin() ;
+ itr != m_pBattleData->getBattlerGroup()->getBattlerList().end() ; ++itr){
+ if((*itr)->getType() != et::IDEAL || !(*itr)->getParameter().alive)continue;
+ pSelectable = addSelectableTextItem(this , selectables , (TCHAR*)(*itr)->getParameter().name.c_str() , 16);
+ if((*itr)->getParameter().actionPoint < 5)pSelectable->setAvailable(false);
+
+ }
+ m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());
+ setVisible(true);
+}
+
+et::IdealMenu::~IdealMenu(void)
+{
+ delete m_pSelector;
+}
+
+
+
+
+
+void et::IdealMenu::setVisible(bool visible){
+ et::MyFrame::setVisible(visible);
+ if(visible){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(160 ,500));
+ pAnimation->setPosition(10 , mof::Vector2D(160 , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(160 , 370));
+ pAnimation->setPosition(10 , mof::Vector2D(160 , 500));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+}
+
+et::MyFrame* et::IdealMenu::performAction(){
+ int index = getSelectionModel()->getSelectingIndex();
+ et::BattleAction action;
+ action.type = et::BattleAction::CAST;
+ int cntIdeal = 0;
+ for(std::vector<et::BattlerFacade*>::const_iterator itr = m_pBattleData->getBattlerGroup()->getBattlerList().begin() ;
+ itr != m_pBattleData->getBattlerGroup()->getBattlerList().end() ; ++itr){
+ if((*itr)->getType() != et::IDEAL || !(*itr)->getParameter().alive)continue;
+ else if(index == cntIdeal++)action.idealIndex = index;
+ }
+
+ if(action.idealIndex == 0)return new et::TargetMenu(m_pTextureManager , m_pBattleData , action , 300);//\92P\91Ì
+ else if(action.idealIndex == 1){
+ action.pTarget = NULL;
+ m_pBattleData->setBattleAction(action);
+ return this;
+ }
+ else if(action.idealIndex == 2){
+ action.pTarget = m_pBattleData->getBattlerGroup()->getHeroBattler();
+ m_pBattleData->setBattleAction(action);
+ return this;
+ }
+}
+
+
-#pragma once\r
-#include "MyFrame.h"\r
-#include "mof/Texture.h"\r
-#include "BattleData.h"\r
-\r
-namespace et{\r
-\r
- class IdealMenu : public MyFrame\r
- {\r
- mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);\r
- \r
- mof::SelectionModel* m_pSelector;\r
- mof::TextureManager* m_pTextureManager;\r
- et::BattleData* m_pBattleData;\r
- \r
- public:\r
- IdealMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);\r
- virtual ~IdealMenu(void);\r
- virtual void setVisible(bool visible);\r
- virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}\r
- virtual MyFrame* performAction();\r
- };\r
-\r
-\r
+#pragma once
+#include "MyFrame.h"
+#include "mof/Texture.h"
+#include "BattleData.h"
+
+namespace et{
+
+ class IdealMenu : public MyFrame
+ {
+ mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);
+
+ mof::SelectionModel* m_pSelector;
+ mof::TextureManager* m_pTextureManager;
+ et::BattleData* m_pBattleData;
+
+ public:
+ IdealMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);
+ virtual ~IdealMenu(void);
+ virtual void setVisible(bool visible);
+ virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}
+ virtual MyFrame* performAction();
+ };
+
+
};
\ No newline at end of file
-#include "InputSymbolController.h"\r
-\r
-\r
-et::InputSymbolController::InputSymbolController(mof::InputReceiver* pInput)\r
-: SymbolController()\r
-{\r
- m_pInput = pInput;\r
-}\r
-\r
-et::InputSymbolController::~InputSymbolController(void)\r
-{\r
-}\r
-\r
-void et::InputSymbolController::move(Symbol* pSymbol){\r
-\r
-\r
- mof::Vector3D nextPosition = pSymbol->getPosition();\r
- //\82Æ\82è\82 \82¦\82¸\88Ú\93®\82³\82¹\82Ä\82Ý\82Ä\81A\95Ç\82ª\82«\82½\82ç\90Ã\8e~\82³\82¹\82é\r
- if(m_pInput->checkKeyState(mof::InputReceiver::UP)){\r
- nextPosition.z += 0.15f;\r
- pSymbol->move(et::Symbol::UP , nextPosition , 6);\r
- }\r
- else if(m_pInput->checkKeyState(mof::InputReceiver::DOWN)){\r
- nextPosition.z -= 0.15f;\r
- pSymbol->move(et::Symbol::DOWN , nextPosition , 6);\r
- }\r
- else if(m_pInput->checkKeyState(mof::InputReceiver::LEFT)){\r
- nextPosition.x -= 0.15f;\r
- pSymbol->move(et::Symbol::LEFT , nextPosition , 6);\r
- }\r
- else if(m_pInput->checkKeyState(mof::InputReceiver::RIGHT)){\r
- nextPosition.x += 0.15f;\r
- pSymbol->move(et::Symbol::RIGHT , nextPosition , 6);\r
- }\r
-}\r
+#include "InputSymbolController.h"
+
+
+et::InputSymbolController::InputSymbolController(mof::InputReceiver* pInput)
+: SymbolController()
+{
+ m_pInput = pInput;
+}
+
+et::InputSymbolController::~InputSymbolController(void)
+{
+}
+
+void et::InputSymbolController::move(Symbol* pSymbol){
+
+
+ mof::Vector3D nextPosition = pSymbol->getPosition();
+ //\82Æ\82è\82 \82¦\82¸\88Ú\93®\82³\82¹\82Ä\82Ý\82Ä\81A\95Ç\82ª\82«\82½\82ç\90Ã\8e~\82³\82¹\82é
+ if(m_pInput->checkKeyState(mof::InputReceiver::UP)){
+ nextPosition.z += 0.15f;
+ pSymbol->move(et::Symbol::UP , nextPosition , 6);
+ }
+ else if(m_pInput->checkKeyState(mof::InputReceiver::DOWN)){
+ nextPosition.z -= 0.15f;
+ pSymbol->move(et::Symbol::DOWN , nextPosition , 6);
+ }
+ else if(m_pInput->checkKeyState(mof::InputReceiver::LEFT)){
+ nextPosition.x -= 0.15f;
+ pSymbol->move(et::Symbol::LEFT , nextPosition , 6);
+ }
+ else if(m_pInput->checkKeyState(mof::InputReceiver::RIGHT)){
+ nextPosition.x += 0.15f;
+ pSymbol->move(et::Symbol::RIGHT , nextPosition , 6);
+ }
+}
-#pragma once\r
-#include "SymbolController.h"\r
-#include "mof/InputReceiver.h"\r
-\r
-namespace et{\r
- class InputSymbolController : public SymbolController\r
- {\r
- mof::InputReceiver* m_pInput;\r
- virtual void move(Symbol* pSymbol);\r
- public:\r
- InputSymbolController(mof::InputReceiver* pInput);\r
- virtual ~InputSymbolController(void);\r
- \r
- };\r
-\r
-\r
+#pragma once
+#include "SymbolController.h"
+#include "mof/InputReceiver.h"
+
+namespace et{
+ class InputSymbolController : public SymbolController
+ {
+ mof::InputReceiver* m_pInput;
+ virtual void move(Symbol* pSymbol);
+ public:
+ InputSymbolController(mof::InputReceiver* pInput);
+ virtual ~InputSymbolController(void);
+
+ };
+
+
}
\ No newline at end of file
-#pragma once\r
-#include "mof/tstring.h"\r
-\r
-namespace et{\r
- struct ItemData\r
- {\r
- enum ItemType{\r
- POTION , ARMS\r
- };\r
- \r
- mof::tstring name;\r
- mof::tstring explanation;\r
- int effect;\r
- ItemType type;\r
- \r
- ItemData()\r
- : name(_T("")) , explanation(_T("")) , effect(0) , type(ItemData::POTION)\r
- { \r
-\r
- }\r
-\r
- ItemData(const TCHAR* _name , const TCHAR* _explanation , const int _effect , ItemType _type)\r
- : name(_name) , explanation(_explanation) , effect(_effect) , type(_type)\r
- { \r
-\r
- }\r
-\r
- \r
- };\r
-\r
-\r
+#pragma once
+#include "mof/tstring.h"
+
+namespace et{
+ struct ItemData
+ {
+ enum ItemType{
+ POTION , ARMS
+ };
+
+ mof::tstring name;
+ mof::tstring explanation;
+ int effect;
+ ItemType type;
+
+ ItemData()
+ : name(_T("")) , explanation(_T("")) , effect(0) , type(ItemData::POTION)
+ {
+
+ }
+
+ ItemData(const TCHAR* _name , const TCHAR* _explanation , const int _effect , ItemType _type)
+ : name(_name) , explanation(_explanation) , effect(_effect) , type(_type)
+ {
+
+ }
+
+
+ };
+
+
}
\ No newline at end of file
-#include "ItemMenu.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MyWindow.h"\r
-#include "TargetMenu.h"\r
-\r
-\r
-\r
-mof::Window* et::ItemMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){\r
- mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);\r
- pOwner->add(pSelectable);\r
- selectables.push_back(pSelectable);\r
- return pSelectable;\r
-}\r
-\r
-et::ItemMenu::ItemMenu( mof::TextureManager* pTextureManager , std::list<et::ItemData>& itemDataList , et::ItemOperatorFactory* pNextMenuFactory )\r
-: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) ) , m_itemDataList(itemDataList)\r
-{\r
- setColumn(2);\r
- setPaddingX(10);\r
- setPaddingY(5);\r
- /*for(std::list<et::ItemData&>::iterator itr = itemDataList.begin() ; itr != itemDataList.end() ; ++itr){\r
- m_itemDataList.push_back(*itr);\r
- }*/\r
- m_pNextMenuFactory = pNextMenuFactory;\r
-\r
- m_pSelector = NULL;\r
- m_pTextureManager = pTextureManager;\r
- std::vector<mof::Window*> selectables;\r
-\r
- mof::Window* pSelectable = NULL;\r
- //\83A\83C\83e\83\80\82Ì\83\8a\83X\83g\8dì\90¬\r
- for(std::list<et::ItemData>::iterator itr = itemDataList.begin() ; itr != itemDataList.end() ; ++itr){\r
- pSelectable = addSelectableTextItem(this , selectables , (TCHAR*)(*itr).name.c_str() , 16);\r
- }\r
-\r
- if(selectables.size() == 0){\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\81@\81@\81@\81@\81@\81@\81@\81@") , 16);\r
- pSelectable->setAvailable(false);\r
- }\r
- if(selectables.size() % 2 != 0){//\97v\8fC\90³\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\81@\81@\81@\81@\81@\81@\81@\81@") , 16);\r
- pSelectable->setAvailable(false);\r
- }\r
- m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource() , 2);\r
- setVisible(true);\r
-}\r
-\r
-et::ItemMenu::~ItemMenu(void)\r
-{\r
- delete m_pSelector;\r
- delete m_pNextMenuFactory;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-void et::ItemMenu::setVisible(bool visible){\r
- et::MyFrame::setVisible(visible);\r
- if(visible){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(160 ,500));\r
- pAnimation->setPosition(10 , mof::Vector2D(160 , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(160 , 370));\r
- pAnimation->setPosition(10 , mof::Vector2D(160 , 500));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
-}\r
-\r
-et::MyFrame* et::ItemMenu::performAction(){\r
- if(m_itemDataList.empty())return this;\r
- int index = getSelectionModel()->getSelectingIndex();\r
- \r
- et::ItemOperationMenu* pOperationMenu = m_pNextMenuFactory->create();\r
- int i = 0;\r
- for(std::list<et::ItemData>::iterator itr = m_itemDataList.begin() ; itr != m_itemDataList.end() ; ++itr , ++i){\r
- if(i == index)pOperationMenu->setTargetItem(&(*itr));\r
-\r
- }\r
- return pOperationMenu;\r
-}\r
-\r
-\r
+#include "ItemMenu.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MyWindow.h"
+#include "TargetMenu.h"
+
+
+
+mof::Window* et::ItemMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){
+ mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);
+ pOwner->add(pSelectable);
+ selectables.push_back(pSelectable);
+ return pSelectable;
+}
+
+et::ItemMenu::ItemMenu( mof::TextureManager* pTextureManager , std::list<et::ItemData>& itemDataList , et::ItemOperatorFactory* pNextMenuFactory )
+: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) ) , m_itemDataList(itemDataList)
+{
+ setColumn(2);
+ setPaddingX(10);
+ setPaddingY(5);
+ /*for(std::list<et::ItemData&>::iterator itr = itemDataList.begin() ; itr != itemDataList.end() ; ++itr){
+ m_itemDataList.push_back(*itr);
+ }*/
+ m_pNextMenuFactory = pNextMenuFactory;
+
+ m_pSelector = NULL;
+ m_pTextureManager = pTextureManager;
+ std::vector<mof::Window*> selectables;
+
+ mof::Window* pSelectable = NULL;
+ //\83A\83C\83e\83\80\82Ì\83\8a\83X\83g\8dì\90¬
+ for(std::list<et::ItemData>::iterator itr = itemDataList.begin() ; itr != itemDataList.end() ; ++itr){
+ pSelectable = addSelectableTextItem(this , selectables , (TCHAR*)(*itr).name.c_str() , 16);
+ }
+
+ if(selectables.size() == 0){
+ pSelectable = addSelectableTextItem(this , selectables , _T("\81@\81@\81@\81@\81@\81@\81@\81@") , 16);
+ pSelectable->setAvailable(false);
+ }
+ if(selectables.size() % 2 != 0){//\97v\8fC\90³
+ pSelectable = addSelectableTextItem(this , selectables , _T("\81@\81@\81@\81@\81@\81@\81@\81@") , 16);
+ pSelectable->setAvailable(false);
+ }
+ m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource() , 2);
+ setVisible(true);
+}
+
+et::ItemMenu::~ItemMenu(void)
+{
+ delete m_pSelector;
+ delete m_pNextMenuFactory;
+}
+
+
+
+
+
+void et::ItemMenu::setVisible(bool visible){
+ et::MyFrame::setVisible(visible);
+ if(visible){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(160 ,500));
+ pAnimation->setPosition(10 , mof::Vector2D(160 , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(160 , 370));
+ pAnimation->setPosition(10 , mof::Vector2D(160 , 500));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+}
+
+et::MyFrame* et::ItemMenu::performAction(){
+ if(m_itemDataList.empty())return this;
+ int index = getSelectionModel()->getSelectingIndex();
+
+ et::ItemOperationMenu* pOperationMenu = m_pNextMenuFactory->create();
+ int i = 0;
+ for(std::list<et::ItemData>::iterator itr = m_itemDataList.begin() ; itr != m_itemDataList.end() ; ++itr , ++i){
+ if(i == index)pOperationMenu->setTargetItem(&(*itr));
+
+ }
+ return pOperationMenu;
+}
+
+
-#pragma once\r
-#include "MyFrame.h"\r
-#include "mof/Texture.h"\r
-#include "ItemOperationMenu.h"\r
-\r
-namespace et{\r
-\r
- class ItemMenu : public MyFrame\r
- {\r
- mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);\r
- \r
- mof::SelectionModel* m_pSelector;\r
- mof::TextureManager* m_pTextureManager;\r
- \r
- std::list<et::ItemData>& m_itemDataList;\r
- et::ItemOperatorFactory* m_pNextMenuFactory;\r
- public:\r
- ItemMenu(mof::TextureManager* pTextureManager , std::list<et::ItemData>& itemDataList , et::ItemOperatorFactory* pNextMenuFactory);\r
- virtual ~ItemMenu(void);\r
- virtual void setVisible(bool visible);\r
- virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}\r
- virtual MyFrame* performAction();\r
- };\r
-\r
-\r
+#pragma once
+#include "MyFrame.h"
+#include "mof/Texture.h"
+#include "ItemOperationMenu.h"
+
+namespace et{
+
+ class ItemMenu : public MyFrame
+ {
+ mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);
+
+ mof::SelectionModel* m_pSelector;
+ mof::TextureManager* m_pTextureManager;
+
+ std::list<et::ItemData>& m_itemDataList;
+ et::ItemOperatorFactory* m_pNextMenuFactory;
+ public:
+ ItemMenu(mof::TextureManager* pTextureManager , std::list<et::ItemData>& itemDataList , et::ItemOperatorFactory* pNextMenuFactory);
+ virtual ~ItemMenu(void);
+ virtual void setVisible(bool visible);
+ virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}
+ virtual MyFrame* performAction();
+ };
+
+
};
\ No newline at end of file
-#pragma once\r
-#include "MyFrame.h"\r
-#include "mof/Texture.h"\r
-#include "ItemData.h"\r
-\r
-namespace et{\r
-\r
-\r
- class ItemOperationMenu : public MyFrame\r
- {\r
- protected:\r
- et::ItemData* m_pItemData;\r
- \r
- public:\r
- ItemOperationMenu(mof::TextureResource& pTexture )\r
- : MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTexture) , m_pItemData(NULL){\r
- }\r
- void setTargetItem(et::ItemData* pItemData){m_pItemData = pItemData;}\r
- virtual ~ItemOperationMenu(void){;}\r
- };\r
-\r
- class ItemOperatorFactory{\r
- public:\r
- virtual ~ItemOperatorFactory(){;}\r
- virtual ItemOperationMenu* create() = 0;\r
- };\r
-\r
+#pragma once
+#include "MyFrame.h"
+#include "mof/Texture.h"
+#include "ItemData.h"
+
+namespace et{
+
+
+ class ItemOperationMenu : public MyFrame
+ {
+ protected:
+ et::ItemData* m_pItemData;
+
+ public:
+ ItemOperationMenu(mof::TextureResource& pTexture )
+ : MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTexture) , m_pItemData(NULL){
+ }
+ void setTargetItem(et::ItemData* pItemData){m_pItemData = pItemData;}
+ virtual ~ItemOperationMenu(void){;}
+ };
+
+ class ItemOperatorFactory{
+ public:
+ virtual ~ItemOperatorFactory(){;}
+ virtual ItemOperationMenu* create() = 0;
+ };
+
};
\ No newline at end of file
-#include "MapBuilder.h"\r
-#include "mof/SoftVertexBufferImpl.h"\r
-#include "mof/HardVertexBufferImpl.h"\r
-\r
-\r
-\r
-et::MapBuilder::MapBuilder( mof::TextureManager* pTextureManager , float scale , int width , int height)\r
-: m_scale(scale) , m_pTextureManager(pTextureManager) , m_width(width) , m_height(height)\r
-{\r
- \r
-}\r
-\r
-et::MapBuilder::~MapBuilder(void)\r
-{\r
-}\r
-\r
-\r
-\r
-et::MapBuffer* et::MapBuilder::create(){\r
-\r
-\r
- std::vector<et::VertexTypeMap> vertices;\r
- \r
- for(int x = 0 ; x < m_width ; x++){\r
- for(int y = 0 ; y < m_height ; y++){\r
- addParts(vertices , x , y);\r
- }\r
- }\r
-\r
- return new mof::SoftVertexBuffer<et::VertexTypeMap>(et::MapBuffer::PRIMITIVE_TYPE_TRIANGLELIST , vertices);\r
-}\r
-\r
-\r
-float et::MapBuilder::getScale(){\r
- return m_scale;\r
+#include "MapBuilder.h"
+#include "mof/SoftVertexBufferImpl.h"
+#include "mof/HardVertexBufferImpl.h"
+
+
+
+et::MapBuilder::MapBuilder( mof::TextureManager* pTextureManager , float scale , int width , int height)
+: m_scale(scale) , m_pTextureManager(pTextureManager) , m_width(width) , m_height(height)
+{
+
+}
+
+et::MapBuilder::~MapBuilder(void)
+{
+}
+
+
+
+et::MapBuffer* et::MapBuilder::create(){
+
+
+ std::vector<et::VertexTypeMap> vertices;
+
+ for(int x = 0 ; x < m_width ; x++){
+ for(int y = 0 ; y < m_height ; y++){
+ addParts(vertices , x , y);
+ }
+ }
+
+ return new mof::SoftVertexBuffer<et::VertexTypeMap>(et::MapBuffer::PRIMITIVE_TYPE_TRIANGLELIST , vertices);
+}
+
+
+float et::MapBuilder::getScale(){
+ return m_scale;
}
\ No newline at end of file
-#pragma once\r
-#include <vector>\r
-#include "mof/Graphics.h"\r
-\r
-\r
-namespace et{\r
- typedef mof::VertexXYZCUV VertexTypeMap;\r
- typedef mof::VertexBuffer<VertexTypeMap> MapBuffer;\r
- class MapBuilder\r
- {\r
- \r
- float m_scale;\r
- int m_width;\r
- int m_height;\r
- \r
- protected :\r
- mof::TextureManager* m_pTextureManager;\r
- virtual void addParts(std::vector<VertexTypeMap>& vertices , int x , int y) = 0;\r
- public:\r
- MapBuilder( mof::TextureManager* pTextureManager , float scale , int width , int height);\r
- virtual ~MapBuilder(void);\r
- MapBuffer* create();\r
- float getScale();\r
-\r
- int getWidth(){return m_width;}\r
- int getHeight(){return m_height;}\r
- };\r
-\r
-\r
+#pragma once
+#include <vector>
+#include "mof/Graphics.h"
+
+
+namespace et{
+ typedef mof::VertexXYZCUV VertexTypeMap;
+ typedef mof::VertexBuffer<VertexTypeMap> MapBuffer;
+ class MapBuilder
+ {
+
+ float m_scale;
+ int m_width;
+ int m_height;
+
+ protected :
+ mof::TextureManager* m_pTextureManager;
+ virtual void addParts(std::vector<VertexTypeMap>& vertices , int x , int y) = 0;
+ public:
+ MapBuilder( mof::TextureManager* pTextureManager , float scale , int width , int height);
+ virtual ~MapBuilder(void);
+ MapBuffer* create();
+ float getScale();
+
+ int getWidth(){return m_width;}
+ int getHeight(){return m_height;}
+ };
+
+
};
\ No newline at end of file
-#pragma once\r
-#include "mof/Color.h"\r
-\r
-namespace et{\r
-\r
- bool inline isWalkableColor(mof::Color color){\r
- if(color == mof::createColor(255 , 255 , 255) ||\r
- color == mof::createColor(0 , 255 , 0))return true;\r
- else return false;\r
- }\r
-\r
- \r
-\r
+#pragma once
+#include "mof/Color.h"
+
+namespace et{
+
+ bool inline isWalkableColor(mof::Color color){
+ if(color == mof::createColor(255 , 255 , 255) ||
+ color == mof::createColor(0 , 255 , 0))return true;
+ else return false;
+ }
+
+
+
};
\ No newline at end of file
-#pragma once\r
-#include <boost/function/function0.hpp>\r
-#include <boost/shared_ptr.hpp>\r
-#include "mof/MenuView.hpp"\r
-#include "mof/MenuItemInfo.hpp"\r
-\r
-namespace mof{\r
-\r
- class LayoutManager;\r
- class WidgetView;\r
-\r
- class Menu : boost::noncopyable{\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- public:\r
- \r
- typedef boost::function0<void> Action;\r
- struct MenuItem{\r
- MenuView* pView;\r
- Action action;\r
- };\r
-\r
- Menu( \r
- mof::WidgetView* pBackgroundView ,\r
- const tstring& front , const tstring& back , \r
- );\r
- ~Menu();\r
- FrameNumber show(bool imidiately = false);\r
- FrameNumber hide(bool imidiately = false);\r
- void up();\r
- void down();\r
- void left();\r
- void right();\r
- void performAction() const;\r
- void draw() const;\r
- void update();\r
-\r
- };\r
-}\r
+#pragma once
+#include <boost/function/function0.hpp>
+#include <boost/shared_ptr.hpp>
+#include "mof/MenuView.hpp"
+#include "mof/MenuItemInfo.hpp"
+
+namespace mof{
+
+ class LayoutManager;
+ class WidgetView;
+
+ class Menu : boost::noncopyable{
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+ public:
+
+ typedef boost::function0<void> Action;
+ struct MenuItem{
+ MenuView* pView;
+ Action action;
+ };
+
+ Menu(
+ mof::WidgetView* pBackgroundView ,
+ const tstring& front , const tstring& back ,
+ );
+ ~Menu();
+ FrameNumber show(bool imidiately = false);
+ FrameNumber hide(bool imidiately = false);
+ void up();
+ void down();
+ void left();
+ void right();
+ void performAction() const;
+ void draw() const;
+ void update();
+
+ };
+}
-#pragma once\r
-#include "mof/tstring.hpp"\r
-\r
-namespace mof{\r
- \r
- struct MenuItemInfo{\r
- int id;\r
- mof::tstring caption;\r
- };\r
-\r
- \r
-}\r
+#pragma once
+#include "mof/tstring.hpp"
+
+namespace mof{
+
+ struct MenuItemInfo{
+ int id;
+ mof::tstring caption;
+ };
+
+
+}
-#pragma once\r
-#include "mof/tstring.hpp"\r
-\r
-namespace mof{\r
- \r
- struct MenuItemInfo{\r
- int id;\r
- mof::tstring caption;\r
- };\r
-\r
- \r
+#pragma once
+#include "mof/tstring.hpp"
+
+namespace mof{
+
+ struct MenuItemInfo{
+ int id;
+ mof::tstring caption;
+ };
+
+
}
\ No newline at end of file
-#pragma once\r
-#include <boost/scoped_ptr.hpp>\r
-#include <boost/utility.hpp>\r
-#include "mof/tstring.hpp"\r
-#include "mof/Animation.hpp"\r
-#include "mof/Matrix2D.hpp"\r
-#include "mof/Rectangle.hpp"\r
-\r
-namespace mof{\r
-\r
- struct MenuItemInfo;\r
- struct Vector2D;\r
- class Effect;\r
-\r
- struct MenuState{\r
- mof::Animation<mof::Matrix2D>::Handler worldTransform;\r
- };\r
-\r
- class MenuView : boost::noncopyable{\r
- public:\r
- virtual ~MenuView(){}\r
- virtual mof::Rectangle<int> initialize() = 0;\r
- virtual void show() = 0;\r
- virtual void close() = 0;\r
- virtual void focus() = 0;\r
- virtual void blur() = 0;\r
- virtual void setPosition(\r
- const mof::Animation<mof::Matrix2D>::Handler& handler \r
- ) = 0;\r
- virtual const mof::Effect* getEffect() const = 0;\r
- virtual void update() = 0;\r
- \r
- \r
- };\r
-\r
-\r
-}\r
+#pragma once
+#include <boost/scoped_ptr.hpp>
+#include <boost/utility.hpp>
+#include "mof/tstring.hpp"
+#include "mof/Animation.hpp"
+#include "mof/Matrix2D.hpp"
+#include "mof/Rectangle.hpp"
+
+namespace mof{
+
+ struct MenuItemInfo;
+ struct Vector2D;
+ class Effect;
+
+ struct MenuState{
+ mof::Animation<mof::Matrix2D>::Handler worldTransform;
+ };
+
+ class MenuView : boost::noncopyable{
+ public:
+ virtual ~MenuView(){}
+ virtual mof::Rectangle<int> initialize() = 0;
+ virtual void show() = 0;
+ virtual void close() = 0;
+ virtual void focus() = 0;
+ virtual void blur() = 0;
+ virtual void setPosition(
+ const mof::Animation<mof::Matrix2D>::Handler& handler
+ ) = 0;
+ virtual const mof::Effect* getEffect() const = 0;
+ virtual void update() = 0;
+
+
+ };
+
+
+}
-#pragma once\r
-#include <mof/widgets/WidgetView.hpp>\r
-\r
-namespace mof{\r
- \r
-\r
- class MenuWidget \r
- {\r
- public:\r
- virtual ~MenuWidget(){}\r
- virtual FrameNumber show(bool imidiately = false) = 0;\r
- virtual FrameNumber hide(bool imidiately = false) = 0;\r
- virtual const WidgetView& getView() const = 0;\r
- virtual WidgetView& getView() = 0;\r
- virtual void update() = 0;\r
- \r
- virtual void up() = 0;\r
- virtual void down() = 0;\r
- virtual void left() = 0;\r
- virtual void right() = 0;\r
- virtual void performAction() const = 0;\r
-\r
- };\r
-\r
-}\r
-/*\r
-#pragma once\r
-#include <boost/function/function0.hpp>\r
-#include <boost/shared_ptr.hpp>\r
-#include "mof/MenuView.hpp"\r
-#include "mof/MenuItemInfo.hpp"\r
-\r
-namespace mof{\r
-\r
- class LayoutManager;\r
- class WidgetView;\r
-\r
- class Menu : boost::noncopyable{\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- public:\r
- \r
- typedef boost::function0<void> Action;\r
- struct MenuItem{\r
- MenuView* pView;\r
- Action action;\r
- };\r
-\r
- Menu( \r
- mof::WidgetView* pBackgroundView ,\r
- const tstring& front , const tstring& back , \r
- );\r
- ~Menu();\r
- FrameNumber show(bool imidiately = false);\r
- FrameNumber hide(bool imidiately = false);\r
- void up();\r
- void down();\r
- void left();\r
- void right();\r
- void performAction() const;\r
- void draw() const;\r
- void update();\r
-\r
- };\r
-}\r
-\r
-*/\r
+#pragma once
+#include <mof/widgets/WidgetView.hpp>
+
+namespace mof{
+
+
+ class MenuWidget
+ {
+ public:
+ virtual ~MenuWidget(){}
+ virtual FrameNumber show(bool imidiately = false) = 0;
+ virtual FrameNumber hide(bool imidiately = false) = 0;
+ virtual const WidgetView& getView() const = 0;
+ virtual WidgetView& getView() = 0;
+ virtual void update() = 0;
+
+ virtual void up() = 0;
+ virtual void down() = 0;
+ virtual void left() = 0;
+ virtual void right() = 0;
+ virtual void performAction() const = 0;
+
+ };
+
+}
+/*
+#pragma once
+#include <boost/function/function0.hpp>
+#include <boost/shared_ptr.hpp>
+#include "mof/MenuView.hpp"
+#include "mof/MenuItemInfo.hpp"
+
+namespace mof{
+
+ class LayoutManager;
+ class WidgetView;
+
+ class Menu : boost::noncopyable{
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+ public:
+
+ typedef boost::function0<void> Action;
+ struct MenuItem{
+ MenuView* pView;
+ Action action;
+ };
+
+ Menu(
+ mof::WidgetView* pBackgroundView ,
+ const tstring& front , const tstring& back ,
+ );
+ ~Menu();
+ FrameNumber show(bool imidiately = false);
+ FrameNumber hide(bool imidiately = false);
+ void up();
+ void down();
+ void left();
+ void right();
+ void performAction() const;
+ void draw() const;
+ void update();
+
+ };
+}
+
+*/
-#pragma once\r
-#include <mof/widgets/WidgetView.hpp>\r
-\r
-namespace mof{\r
- \r
-\r
- class MenuWidget \r
- {\r
- public:\r
- virtual ~MenuWidget(){}\r
- virtual FrameNumber show(bool imidiately = false) = 0;\r
- virtual FrameNumber hide(bool imidiately = false) = 0;\r
- virtual const WidgetView& getView() const = 0;\r
- virtual WidgetView& getView() = 0;\r
- virtual void update() = 0;\r
- \r
- virtual void up();\r
- virtual void down();\r
- virtual void left();\r
- virtual void right();\r
- virtual void performAction() const;\r
-\r
- };\r
-\r
-}\r
-/*\r
-#pragma once\r
-#include <boost/function/function0.hpp>\r
-#include <boost/shared_ptr.hpp>\r
-#include "mof/MenuView.hpp"\r
-#include "mof/MenuItemInfo.hpp"\r
-\r
-namespace mof{\r
-\r
- class LayoutManager;\r
- class WidgetView;\r
-\r
- class Menu : boost::noncopyable{\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- public:\r
- \r
- typedef boost::function0<void> Action;\r
- struct MenuItem{\r
- MenuView* pView;\r
- Action action;\r
- };\r
-\r
- Menu( \r
- mof::WidgetView* pBackgroundView ,\r
- const tstring& front , const tstring& back , \r
- );\r
- ~Menu();\r
- FrameNumber show(bool imidiately = false);\r
- FrameNumber hide(bool imidiately = false);\r
- void up();\r
- void down();\r
- void left();\r
- void right();\r
- void performAction() const;\r
- void draw() const;\r
- void update();\r
-\r
- };\r
-}\r
-\r
-*/\r
+#pragma once
+#include <mof/widgets/WidgetView.hpp>
+
+namespace mof{
+
+
+ class MenuWidget
+ {
+ public:
+ virtual ~MenuWidget(){}
+ virtual FrameNumber show(bool imidiately = false) = 0;
+ virtual FrameNumber hide(bool imidiately = false) = 0;
+ virtual const WidgetView& getView() const = 0;
+ virtual WidgetView& getView() = 0;
+ virtual void update() = 0;
+
+ virtual void up();
+ virtual void down();
+ virtual void left();
+ virtual void right();
+ virtual void performAction() const;
+
+ };
+
+}
+/*
+#pragma once
+#include <boost/function/function0.hpp>
+#include <boost/shared_ptr.hpp>
+#include "mof/MenuView.hpp"
+#include "mof/MenuItemInfo.hpp"
+
+namespace mof{
+
+ class LayoutManager;
+ class WidgetView;
+
+ class Menu : boost::noncopyable{
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+ public:
+
+ typedef boost::function0<void> Action;
+ struct MenuItem{
+ MenuView* pView;
+ Action action;
+ };
+
+ Menu(
+ mof::WidgetView* pBackgroundView ,
+ const tstring& front , const tstring& back ,
+ );
+ ~Menu();
+ FrameNumber show(bool imidiately = false);
+ FrameNumber hide(bool imidiately = false);
+ void up();
+ void down();
+ void left();
+ void right();
+ void performAction() const;
+ void draw() const;
+ void update();
+
+ };
+}
+
+*/
-#include "MyInstructionSet.hpp"\r
-//#include "mof/ImageTileWidgetView.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/LayoutManager.hpp"\r
-#include "mof/Deleter.hpp"\r
-#include "mof/mofInput.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include <boost/bind.hpp>\r
-#include "mof/EventScheduler.hpp"\r
-#include <list>\r
-#include "mof/ConsoleIO.hpp"\r
-#include "mof/widgets.hpp"\r
-\r
-struct MyInstructionSet::Impl\r
-{\r
- std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;\r
- mof::EventScheduler scheduler;\r
- std::list<std::shared_ptr<mof::MessageWidget> > messages;\r
- \r
- Impl()\r
- {\r
- }\r
- \r
- ~Impl()\r
- {\r
- }\r
- \r
- \r
-};\r
-\r
-MyInstructionSet::MyInstructionSet( )\r
-: m_pImpl(new Impl() )\r
-{\r
-}\r
-\r
-\r
-MyInstructionSet::~MyInstructionSet( )\r
-{\r
-}\r
-//{{{ createMessageWidget\r
-std::shared_ptr<mof::MessageWidget>\r
-MyInstructionSet::createMessageWidget( ) \r
-{\r
- mof::LayoutManager* pLayout = new mof::LayoutManager( mof::LayoutManager::HORIZONTAL , 1);\r
- mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") );\r
- \r
- \r
- std::shared_ptr<mof::MessageWidget> p\r
- (\r
- new mof::MessageWidget\r
- (\r
- pBackgroundView ,\r
- mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout\r
- )\r
- );\r
- \r
- m_pImpl->messages.push_back(p);\r
- return p;\r
- \r
-}\r
-//}}}\r
-//{{{ addMessageWidgetPage\r
-int\r
-MyInstructionSet::addMessageWidgetPage\r
-( \r
- std::shared_ptr<mof::MessageWidget>& message , \r
- const mof::tstring &title , \r
- const mof::tstring &text\r
-) \r
-{\r
- mof::PageRequest page(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );\r
- message->addPage( page );\r
- return 30;// TODO \83y\81[\83W\8aJ\82\82Ì\82É\82©\82©\82é\8e\9e\8aÔ \r
-}\r
-//}}}\r
-\r
-void MyInstructionSet::inactive( std::shared_ptr<mof::MessageWidget>& message ) \r
-{ \r
-\r
- /*mof::Deleter<mof::MessageWidget> del(message);\r
- \r
- m_pImpl->inactiveResources.push_back(del.getWeak());\r
- m_pImpl->scheduler.addEvent( 40 , del );*/\r
- //m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );\r
-}\r
-\r
-void MyInstructionSet::update( )\r
-{\r
- m_pImpl->scheduler.update( );\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->update();\r
- }\r
-}\r
- \r
-void MyInstructionSet::draw() const\r
-{\r
- foreach(std::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )\r
- {\r
- resource->draw();\r
- }\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->draw();\r
- }\r
-}\r
-\r
- \r
+#include "MyInstructionSet.hpp"
+//#include "mof/ImageTileWidgetView.hpp"
+#include "mof/utilities.hpp"
+#include "mof/LayoutManager.hpp"
+#include "mof/Deleter.hpp"
+#include "mof/mofInput.hpp"
+#include "mof/mofGraphics.hpp"
+#include <boost/bind.hpp>
+#include "mof/EventScheduler.hpp"
+#include <list>
+#include "mof/ConsoleIO.hpp"
+#include "mof/widgets.hpp"
+
+struct MyInstructionSet::Impl
+{
+ std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;
+ mof::EventScheduler scheduler;
+ std::list<std::shared_ptr<mof::MessageWidget> > messages;
+
+ Impl()
+ {
+ }
+
+ ~Impl()
+ {
+ }
+
+
+};
+
+MyInstructionSet::MyInstructionSet( )
+: m_pImpl(new Impl() )
+{
+}
+
+
+MyInstructionSet::~MyInstructionSet( )
+{
+}
+//{{{ createMessageWidget
+std::shared_ptr<mof::MessageWidget>
+MyInstructionSet::createMessageWidget( )
+{
+ mof::LayoutManager* pLayout = new mof::LayoutManager( mof::LayoutManager::HORIZONTAL , 1);
+ mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") );
+
+
+ std::shared_ptr<mof::MessageWidget> p
+ (
+ new mof::MessageWidget
+ (
+ pBackgroundView ,
+ mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout
+ )
+ );
+
+ m_pImpl->messages.push_back(p);
+ return p;
+
+}
+//}}}
+//{{{ addMessageWidgetPage
+int
+MyInstructionSet::addMessageWidgetPage
+(
+ std::shared_ptr<mof::MessageWidget>& message ,
+ const mof::tstring &title ,
+ const mof::tstring &text
+)
+{
+ mof::PageRequest page(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );
+ message->addPage( page );
+ return 30;// TODO \83y\81[\83W\8aJ\82\82Ì\82É\82©\82©\82é\8e\9e\8aÔ
+}
+//}}}
+
+void MyInstructionSet::inactive( std::shared_ptr<mof::MessageWidget>& message )
+{
+
+ /*mof::Deleter<mof::MessageWidget> del(message);
+
+ m_pImpl->inactiveResources.push_back(del.getWeak());
+ m_pImpl->scheduler.addEvent( 40 , del );*/
+ //m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );
+}
+
+void MyInstructionSet::update( )
+{
+ m_pImpl->scheduler.update( );
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->update();
+ }
+}
+
+void MyInstructionSet::draw() const
+{
+ foreach(std::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )
+ {
+ resource->draw();
+ }
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->draw();
+ }
+}
+
+
-#include "MyInstructionSet.hpp"\r
-#include "mof/ImageTileWidgetView.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/LayoutManager.hpp"\r
-#include "mof/Deleter.hpp"\r
-#include "mof/mofInput.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include <boost/bind.hpp>\r
-#include "mof/EventScheduler.hpp"\r
-#include <list>\r
-#include "mof/ConsoleIO.hpp"\r
-#include "mof/widgets.hpp"\r
-\r
-struct MyInstructionSet::Impl\r
-{\r
- std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;\r
- mof::EventScheduler scheduler;\r
- std::list<boost::shared_ptr<mof::MessageWidget> > messages;\r
- \r
- Impl()\r
- {\r
- }\r
- \r
- ~Impl()\r
- {\r
- }\r
- \r
- \r
-};\r
-\r
-MyInstructionSet::MyInstructionSet( )\r
-: m_pImpl(new Impl() )\r
-{\r
-}\r
-\r
-\r
-MyInstructionSet::~MyInstructionSet( )\r
-{\r
-}\r
-//{{{ createMessageWidget\r
-boost::shared_ptr<mof::MessageWidget>\r
-MyInstructionSet::createMessageWidget( ) \r
-{\r
- mof::LayoutManager* pLayout = new mof::LayoutManager( mof::LayoutManager::HORIZONTAL , 1);\r
- mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") );\r
- \r
- \r
- boost::shared_ptr<mof::MessageWidget> p\r
- (\r
- new mof::MessageWidget\r
- (\r
- pBackgroundView ,\r
- mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout\r
- )\r
- );\r
- \r
- m_pImpl->messages.push_back(p);\r
- return p;\r
- \r
-}\r
-//}}}\r
-//{{{ addMessageWidgetPage\r
-int\r
-MyInstructionSet::addMessageWidgetPage\r
-( \r
- boost::shared_ptr<mof::MessageWidget>& message , \r
- const mof::tstring &title , \r
- const mof::tstring &text\r
-) \r
-{\r
- mof::PageRequest page(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );\r
- message->addPage( page );\r
- return 30;// TODO \83y\81[\83W\8aJ\82\82Ì\82É\82©\82©\82é\8e\9e\8aÔ \r
-}\r
-//}}}\r
-\r
-void MyInstructionSet::inactive( boost::shared_ptr<mof::MessageWidget>& message ) \r
-{ \r
-\r
- /*mof::Deleter<mof::MessageWidget> del(message);\r
- \r
- m_pImpl->inactiveResources.push_back(del.getWeak());\r
- m_pImpl->scheduler.addEvent( 40 , del );*/\r
- //m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );\r
-}\r
-\r
-void MyInstructionSet::update( )\r
-{\r
- m_pImpl->scheduler.update( );\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->update();\r
- }\r
-}\r
- \r
-void MyInstructionSet::draw() const\r
-{\r
- foreach(boost::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )\r
- {\r
- resource->draw();\r
- }\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->draw();\r
- }\r
-}\r
-\r
- \r
+#include "MyInstructionSet.hpp"
+#include "mof/ImageTileWidgetView.hpp"
+#include "mof/utilities.hpp"
+#include "mof/LayoutManager.hpp"
+#include "mof/Deleter.hpp"
+#include "mof/mofInput.hpp"
+#include "mof/mofGraphics.hpp"
+#include <boost/bind.hpp>
+#include "mof/EventScheduler.hpp"
+#include <list>
+#include "mof/ConsoleIO.hpp"
+#include "mof/widgets.hpp"
+
+struct MyInstructionSet::Impl
+{
+ std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;
+ mof::EventScheduler scheduler;
+ std::list<boost::shared_ptr<mof::MessageWidget> > messages;
+
+ Impl()
+ {
+ }
+
+ ~Impl()
+ {
+ }
+
+
+};
+
+MyInstructionSet::MyInstructionSet( )
+: m_pImpl(new Impl() )
+{
+}
+
+
+MyInstructionSet::~MyInstructionSet( )
+{
+}
+//{{{ createMessageWidget
+boost::shared_ptr<mof::MessageWidget>
+MyInstructionSet::createMessageWidget( )
+{
+ mof::LayoutManager* pLayout = new mof::LayoutManager( mof::LayoutManager::HORIZONTAL , 1);
+ mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") );
+
+
+ boost::shared_ptr<mof::MessageWidget> p
+ (
+ new mof::MessageWidget
+ (
+ pBackgroundView ,
+ mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout
+ )
+ );
+
+ m_pImpl->messages.push_back(p);
+ return p;
+
+}
+//}}}
+//{{{ addMessageWidgetPage
+int
+MyInstructionSet::addMessageWidgetPage
+(
+ boost::shared_ptr<mof::MessageWidget>& message ,
+ const mof::tstring &title ,
+ const mof::tstring &text
+)
+{
+ mof::PageRequest page(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );
+ message->addPage( page );
+ return 30;// TODO \83y\81[\83W\8aJ\82\82Ì\82É\82©\82©\82é\8e\9e\8aÔ
+}
+//}}}
+
+void MyInstructionSet::inactive( boost::shared_ptr<mof::MessageWidget>& message )
+{
+
+ /*mof::Deleter<mof::MessageWidget> del(message);
+
+ m_pImpl->inactiveResources.push_back(del.getWeak());
+ m_pImpl->scheduler.addEvent( 40 , del );*/
+ //m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );
+}
+
+void MyInstructionSet::update( )
+{
+ m_pImpl->scheduler.update( );
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->update();
+ }
+}
+
+void MyInstructionSet::draw() const
+{
+ foreach(boost::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )
+ {
+ resource->draw();
+ }
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->draw();
+ }
+}
+
+
-#pragma once\r
-#include "mof/InstructionSet.hpp"\r
-#include <boost/scoped_ptr.hpp>\r
-\r
- \r
-class MyInstructionSet : public mof::InstructionSet\r
-{\r
- \r
-public:\r
- \r
- virtual boost::shared_ptr<mof::MessageWidget> createMessageWidget( );\r
- \r
- virtual int addMessageWidgetPage\r
- ( \r
- boost::shared_ptr<mof::MessageWidget>& message ,\r
- const mof::tstring& title ,\r
- const mof::tstring& text \r
- );\r
- \r
- virtual void inactive( boost::shared_ptr<mof::MessageWidget>& message );\r
-\r
- MyInstructionSet( );\r
- virtual ~MyInstructionSet();\r
- \r
- void update();\r
- void draw() const;\r
- \r
-private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- \r
-};\r
-\r
+#pragma once
+#include "mof/InstructionSet.hpp"
+#include <boost/scoped_ptr.hpp>
+
+
+class MyInstructionSet : public mof::InstructionSet
+{
+
+public:
+
+ virtual boost::shared_ptr<mof::MessageWidget> createMessageWidget( );
+
+ virtual int addMessageWidgetPage
+ (
+ boost::shared_ptr<mof::MessageWidget>& message ,
+ const mof::tstring& title ,
+ const mof::tstring& text
+ );
+
+ virtual void inactive( boost::shared_ptr<mof::MessageWidget>& message );
+
+ MyInstructionSet( );
+ virtual ~MyInstructionSet();
+
+ void update();
+ void draw() const;
+
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+
+};
+
-#pragma once\r
-#include "mof/InstructionSet.hpp"\r
-#include <boost/scoped_ptr.hpp>\r
-\r
- \r
-class MyInstructionSet : public mof::InstructionSet\r
-{\r
- \r
- private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- \r
- virtual boost::shared_ptr<mof::MessageWidget> createMessageWidget( );\r
- \r
- virtual int addMessageWidgetPage\r
- ( \r
- boost::shared_ptr<mof::MessageWidget>& message ,\r
- const mof::tstring& title ,\r
- const mof::tstring& text \r
- );\r
- \r
- virtual void inactive( boost::shared_ptr<mof::MessageWidget>& message );\r
-\r
-public:\r
- MyInstructionSet( );\r
- virtual ~MyInstructionSet();\r
- \r
- void update();\r
- void draw() const;\r
- \r
-};\r
-\r
+#pragma once
+#include "mof/InstructionSet.hpp"
+#include <boost/scoped_ptr.hpp>
+
+
+class MyInstructionSet : public mof::InstructionSet
+{
+
+ private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+
+ virtual boost::shared_ptr<mof::MessageWidget> createMessageWidget( );
+
+ virtual int addMessageWidgetPage
+ (
+ boost::shared_ptr<mof::MessageWidget>& message ,
+ const mof::tstring& title ,
+ const mof::tstring& text
+ );
+
+ virtual void inactive( boost::shared_ptr<mof::MessageWidget>& message );
+
+public:
+ MyInstructionSet( );
+ virtual ~MyInstructionSet();
+
+ void update();
+ void draw() const;
+
+};
+
-#include "MyInterpreter.hpp"\r
-#include "mof/ImageTileWidgetView.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/LayoutManager.hpp"\r
-#include "mof/Deleter.hpp"\r
-#include "mof/mofInput.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include <boost/bind.hpp>\r
-#include "mof/EventScheduler.hpp"\r
-#include <list>\r
-#include "mof/ConsoleIO.hpp"\r
-\r
-struct MyInterpreter::Impl\r
-{\r
- std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;\r
- mof::EventScheduler scheduler;\r
- std::list<boost::shared_ptr<mof::MessageWidget> > messages;\r
- \r
- Impl()\r
- {\r
- }\r
- \r
- ~Impl()\r
- {\r
- }\r
- \r
- \r
-};\r
-\r
-MyInterpreter::MyInterpreter( )\r
-: m_pImpl(new Impl() )\r
-{\r
-}\r
-\r
-\r
-MyInterpreter::~MyInterpreter()\r
-{\r
-}\r
-\r
-boost::shared_ptr<mof::MessageWidget>\r
-MyInterpreter::createMessageWidget(const mof::tstring &title, const mof::tstring &text) \r
-{\r
- mof::LayoutManager* pLayout = new mof::LayoutManager(10 , 35 , mof::LayoutManager::HORIZONTAL , 1);\r
- mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") , title);\r
- \r
- std::vector<mof::MessageWidget::Page> pages;\r
- \r
- //foreach(const mof::tstring& text , text)\r
- //{\r
- mof::MessageWidget::Page tmp(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );\r
- pages.push_back(tmp);\r
- //}\r
- \r
- boost::shared_ptr<mof::MessageWidget> p\r
- (\r
- new mof::MessageWidget\r
- (\r
- pBackgroundView ,\r
- pages.front() , pages.back() , mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout\r
- )\r
- );\r
- \r
- m_pImpl->messages.push_back(p);\r
- return p;\r
- \r
-}\r
-\r
-void MyInterpreter::inactive( boost::shared_ptr<mof::MessageWidget>& message ) \r
-{ \r
-\r
- mof::Deleter<mof::MessageWidget> del(message);\r
- \r
- m_pImpl->inactiveResources.push_back(del.getWeak());\r
- m_pImpl->scheduler.addEvent( 40 , del );\r
- m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );\r
-}\r
-\r
-void MyInterpreter::update()\r
-{\r
- m_pImpl->scheduler.update();\r
- Interpreter::update();\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->update();\r
- }\r
-}\r
- \r
-void MyInterpreter::draw() const\r
-{\r
- foreach(boost::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )\r
- {\r
- resource->draw();\r
- }\r
- foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)\r
- {\r
- if(resource.lock())resource.lock()->draw();\r
- }\r
-}\r
- \r
+#include "MyInterpreter.hpp"
+#include "mof/ImageTileWidgetView.hpp"
+#include "mof/utilities.hpp"
+#include "mof/LayoutManager.hpp"
+#include "mof/Deleter.hpp"
+#include "mof/mofInput.hpp"
+#include "mof/mofGraphics.hpp"
+#include <boost/bind.hpp>
+#include "mof/EventScheduler.hpp"
+#include <list>
+#include "mof/ConsoleIO.hpp"
+
+struct MyInterpreter::Impl
+{
+ std::list<boost::weak_ptr<mof::MessageWidget> > inactiveResources;
+ mof::EventScheduler scheduler;
+ std::list<boost::shared_ptr<mof::MessageWidget> > messages;
+
+ Impl()
+ {
+ }
+
+ ~Impl()
+ {
+ }
+
+
+};
+
+MyInterpreter::MyInterpreter( )
+: m_pImpl(new Impl() )
+{
+}
+
+
+MyInterpreter::~MyInterpreter()
+{
+}
+
+boost::shared_ptr<mof::MessageWidget>
+MyInterpreter::createMessageWidget(const mof::tstring &title, const mof::tstring &text)
+{
+ mof::LayoutManager* pLayout = new mof::LayoutManager(10 , 35 , mof::LayoutManager::HORIZONTAL , 1);
+ mof::WidgetView* pBackgroundView = new mof::ImageTileWidgetView( _T("image/frame0.png") , title);
+
+ std::vector<mof::MessageWidget::Page> pages;
+
+ //foreach(const mof::tstring& text , text)
+ //{
+ mof::MessageWidget::Page tmp(text , mof::Font(_T("\94~UI\83S\83V\83b\83N") , 25) );
+ pages.push_back(tmp);
+ //}
+
+ boost::shared_ptr<mof::MessageWidget> p
+ (
+ new mof::MessageWidget
+ (
+ pBackgroundView ,
+ pages.front() , pages.back() , mof::Rectangle<int>(70+20 , 300 , 570+20 , 450) , pLayout
+ )
+ );
+
+ m_pImpl->messages.push_back(p);
+ return p;
+
+}
+
+void MyInterpreter::inactive( boost::shared_ptr<mof::MessageWidget>& message )
+{
+
+ mof::Deleter<mof::MessageWidget> del(message);
+
+ m_pImpl->inactiveResources.push_back(del.getWeak());
+ m_pImpl->scheduler.addEvent( 40 , del );
+ m_pImpl->scheduler.addEvent( 40 , boost::bind( &mof::Interpreter::doNextCommand , this ) );
+}
+
+void MyInterpreter::update()
+{
+ m_pImpl->scheduler.update();
+ Interpreter::update();
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->update();
+ }
+}
+
+void MyInterpreter::draw() const
+{
+ foreach(boost::shared_ptr<mof::MessageWidget>& resource , m_pImpl->messages )
+ {
+ resource->draw();
+ }
+ foreach(boost::weak_ptr<mof::MessageWidget>& resource , m_pImpl->inactiveResources)
+ {
+ if(resource.lock())resource.lock()->draw();
+ }
+}
+
-#pragma once\r
-#include "mof/InstructionSet.hpp"\r
-\r
-\r
- \r
-class MyInstructionSet : public mof::InstructionSet\r
-{\r
- \r
-public:\r
- MyInstructionSet( const boost::shared_ptr<mof::InputReceiver> & pInput );\r
- virtual ~MyInterpreter();\r
- \r
- \r
- virtual boost::shared_ptr<mof::MessageWidget> \r
- createMessageWidget( const mof::tstring& title , const mof::tstring& text );\r
- \r
- virtual void inactive( boost::shared_ptr<mof::MessageWidget>& message );\r
- \r
-private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
-};\r
-\r
+#pragma once
+#include "mof/InstructionSet.hpp"
+
+
+
+class MyInstructionSet : public mof::InstructionSet
+{
+
+public:
+ MyInstructionSet( const boost::shared_ptr<mof::InputReceiver> & pInput );
+ virtual ~MyInterpreter();
+
+
+ virtual boost::shared_ptr<mof::MessageWidget>
+ createMessageWidget( const mof::tstring& title , const mof::tstring& text );
+
+ virtual void inactive( boost::shared_ptr<mof::MessageWidget>& message );
+
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+};
+
-#include "NormalAI.h"\r
-#include "AttackAction.h"\r
-#include <vector>\r
-#include "BattlerGroup.h"\r
-#include "DataBasedBattler.h"\r
-#include "DataBasedAction.h"\r
-\r
-et::NormalAI::NormalAI(mof::DataResourceManager* pDataResourceManager)\r
-: BattleAI(pDataResourceManager)\r
-{\r
-}\r
-\r
-et::NormalAI::~NormalAI(){\r
-\r
-}\r
-\r
-\r
-et::Action* et::NormalAI::createAction(DataBasedBattler* pOwn , BattlerGroup* pGroup){\r
- mof::DataRow targetRow = pOwn->getDataRow();\r
- //\91I\91ð\89Â\94\\82È\83A\83N\83V\83\87\83\93\82Ì\92\86\82Å\8dÅ\82à\8aú\91Ò\92l\82Ì\8d\82\82¢\82à\82Ì\82ð\91I\82Ô\r
- mof::DataResource monsterAction = m_pDataResourceManager->getResource(_T("data/monster.action.csv"));\r
- const TCHAR* const table[] = {_T("DirectAttack1") , _T("DirectAttack2") , _T("SpecialAttack1") , _T("SpecialAttack1")};\r
- int ap = pOwn->getParameter().actionPoint;\r
- \r
- int coefficient = -1;\r
- int selectedIndex = -1;\r
- mof::DataRow selectedAction;\r
- mof::DataRow targetAction;\r
-\r
- for(int i = 0 ; i < sizeof(table)/sizeof(table[0]) ; i++){\r
- mof::tstring action = targetRow.getData(table[i]);\r
- if(action == _T(""))continue;\r
- targetAction = mof::DataRow(monsterAction , action.c_str());\r
- \r
- int cost = targetAction.getIntegerData( _T("Cost"));\r
- if(ap >= cost){\r
- int tmpCoefficient = targetAction.getIntegerData( _T("Coefficient"));\r
- if(coefficient < tmpCoefficient){\r
- //\91I\91ð\83A\83N\83V\83\87\83\93\82ð\8dX\90V\r
- coefficient = tmpCoefficient;\r
- selectedIndex = i;\r
- selectedAction = targetAction;\r
- }\r
- \r
- }\r
- }\r
- if(selectedIndex == -1)return NULL;\r
-\r
- return new DataBasedAction(pOwn , pGroup->getHeroBattler() , selectedAction , selectedIndex);\r
-}\r
-\r
-/*\r
-et::Action* et::NormalAI::createAction(DataBasedBattler* pOwn , BattlerGroup* pGroup){\r
- mof::DataRow targetRow = pOwn->getDataRow();\r
-\r
- //\91I\91ð\89Â\94\\82È\83A\83N\83V\83\87\83\93\82Ì\92\86\82©\82ç\83\89\83\93\83_\83\80\82Å\91I\82Ô\r
- mof::DataResource monsterAction = m_pDataResourceManager->getResource(_T("data/monster.action.csv"));\r
- const TCHAR* const table[] = {_T("DirectAttack1") , _T("DirectAttack2") , _T("SpecialAttack1") , _T("SpecialAttack1")};\r
- int ap = pOwn->getParameter().actionPoint;\r
- \r
- mof::DataRow targetAction;\r
-\r
- std::vector<int> selectableList;\r
-\r
- for(int i = 0 ; i < sizeof(table)/sizeof(table[0]) ; i++){\r
- mof::tstring action = targetRow.getData(table[i]);\r
- if(action == _T(""))continue;\r
- targetAction = mof::DataRow(monsterAction , action.c_str());\r
- \r
- int cost = targetAction.getIntegerData( _T("Cost"));\r
- DEBUG_PRINT(cost);\r
- if(ap >= cost)selectableList.push_back(i);\r
- }\r
- if(selectableList.size() == 0)return NULL;\r
-\r
- int selectedIndex = rand() % selectableList.size();\r
- return new DataBasedAction(pOwn , pGroup->getHeroBattler() , \r
- mof::DataRow(monsterAction , targetRow.getData(table[selectedIndex]).c_str()) , selectedIndex);\r
+#include "NormalAI.h"
+#include "AttackAction.h"
+#include <vector>
+#include "BattlerGroup.h"
+#include "DataBasedBattler.h"
+#include "DataBasedAction.h"
+
+et::NormalAI::NormalAI(mof::DataResourceManager* pDataResourceManager)
+: BattleAI(pDataResourceManager)
+{
+}
+
+et::NormalAI::~NormalAI(){
+
+}
+
+
+et::Action* et::NormalAI::createAction(DataBasedBattler* pOwn , BattlerGroup* pGroup){
+ mof::DataRow targetRow = pOwn->getDataRow();
+ //\91I\91ð\89Â\94\\82È\83A\83N\83V\83\87\83\93\82Ì\92\86\82Å\8dÅ\82à\8aú\91Ò\92l\82Ì\8d\82\82¢\82à\82Ì\82ð\91I\82Ô
+ mof::DataResource monsterAction = m_pDataResourceManager->getResource(_T("data/monster.action.csv"));
+ const TCHAR* const table[] = {_T("DirectAttack1") , _T("DirectAttack2") , _T("SpecialAttack1") , _T("SpecialAttack1")};
+ int ap = pOwn->getParameter().actionPoint;
+
+ int coefficient = -1;
+ int selectedIndex = -1;
+ mof::DataRow selectedAction;
+ mof::DataRow targetAction;
+
+ for(int i = 0 ; i < sizeof(table)/sizeof(table[0]) ; i++){
+ mof::tstring action = targetRow.getData(table[i]);
+ if(action == _T(""))continue;
+ targetAction = mof::DataRow(monsterAction , action.c_str());
+
+ int cost = targetAction.getIntegerData( _T("Cost"));
+ if(ap >= cost){
+ int tmpCoefficient = targetAction.getIntegerData( _T("Coefficient"));
+ if(coefficient < tmpCoefficient){
+ //\91I\91ð\83A\83N\83V\83\87\83\93\82ð\8dX\90V
+ coefficient = tmpCoefficient;
+ selectedIndex = i;
+ selectedAction = targetAction;
+ }
+
+ }
+ }
+ if(selectedIndex == -1)return NULL;
+
+ return new DataBasedAction(pOwn , pGroup->getHeroBattler() , selectedAction , selectedIndex);
+}
+
+/*
+et::Action* et::NormalAI::createAction(DataBasedBattler* pOwn , BattlerGroup* pGroup){
+ mof::DataRow targetRow = pOwn->getDataRow();
+
+ //\91I\91ð\89Â\94\\82È\83A\83N\83V\83\87\83\93\82Ì\92\86\82©\82ç\83\89\83\93\83_\83\80\82Å\91I\82Ô
+ mof::DataResource monsterAction = m_pDataResourceManager->getResource(_T("data/monster.action.csv"));
+ const TCHAR* const table[] = {_T("DirectAttack1") , _T("DirectAttack2") , _T("SpecialAttack1") , _T("SpecialAttack1")};
+ int ap = pOwn->getParameter().actionPoint;
+
+ mof::DataRow targetAction;
+
+ std::vector<int> selectableList;
+
+ for(int i = 0 ; i < sizeof(table)/sizeof(table[0]) ; i++){
+ mof::tstring action = targetRow.getData(table[i]);
+ if(action == _T(""))continue;
+ targetAction = mof::DataRow(monsterAction , action.c_str());
+
+ int cost = targetAction.getIntegerData( _T("Cost"));
+ DEBUG_PRINT(cost);
+ if(ap >= cost)selectableList.push_back(i);
+ }
+ if(selectableList.size() == 0)return NULL;
+
+ int selectedIndex = rand() % selectableList.size();
+ return new DataBasedAction(pOwn , pGroup->getHeroBattler() ,
+ mof::DataRow(monsterAction , targetRow.getData(table[selectedIndex]).c_str()) , selectedIndex);
}*/
\ No newline at end of file
-#pragma once\r
-#include "BattleAI.h"\r
-\r
-namespace et{\r
- class Action;\r
- \r
-\r
- class NormalAI : public BattleAI\r
- {\r
- protected:\r
- \r
- public:\r
- NormalAI(mof::DataResourceManager* pDataResoourceManager);\r
- ~NormalAI();\r
- virtual Action* createAction(DataBasedBattler* pOwn , BattlerGroup* pGroup);\r
- };\r
-\r
-}\r
+#pragma once
+#include "BattleAI.h"
+
+namespace et{
+ class Action;
+
+
+ class NormalAI : public BattleAI
+ {
+ protected:
+
+ public:
+ NormalAI(mof::DataResourceManager* pDataResoourceManager);
+ ~NormalAI();
+ virtual Action* createAction(DataBasedBattler* pOwn , BattlerGroup* pGroup);
+ };
+
+}
-#include "RandomSymbolController.h"\r
-#include <stdlib.h>\r
-\r
-\r
-et::RandomSymbolController::RandomSymbolController(void)\r
-{\r
-}\r
-\r
-et::RandomSymbolController::~RandomSymbolController(void)\r
-{\r
-}\r
-\r
-void et::RandomSymbolController::move(Symbol* pSymbol){\r
-\r
- \r
- if(rand()%5)return;\r
- mof::Vector3D nextPosition = pSymbol->getPosition();\r
- int direction = rand()%4;\r
-\r
- switch(direction){\r
- case 0:\r
- nextPosition.z += 0.15f;\r
- pSymbol->move(et::Symbol::UP , nextPosition , 6);\r
- break;\r
- case 1:\r
- nextPosition.z -= 0.15f;\r
- pSymbol->move(et::Symbol::DOWN , nextPosition , 6);\r
- break;\r
- case 2:\r
- nextPosition.x -= 0.15f;\r
- pSymbol->move(et::Symbol::LEFT , nextPosition , 6);\r
- break;\r
- case 3:\r
- nextPosition.x += 0.15f;\r
- pSymbol->move(et::Symbol::RIGHT , nextPosition , 6);\r
- break;\r
- }\r
-}\r
+#include "RandomSymbolController.h"
+#include <stdlib.h>
+
+
+et::RandomSymbolController::RandomSymbolController(void)
+{
+}
+
+et::RandomSymbolController::~RandomSymbolController(void)
+{
+}
+
+void et::RandomSymbolController::move(Symbol* pSymbol){
+
+
+ if(rand()%5)return;
+ mof::Vector3D nextPosition = pSymbol->getPosition();
+ int direction = rand()%4;
+
+ switch(direction){
+ case 0:
+ nextPosition.z += 0.15f;
+ pSymbol->move(et::Symbol::UP , nextPosition , 6);
+ break;
+ case 1:
+ nextPosition.z -= 0.15f;
+ pSymbol->move(et::Symbol::DOWN , nextPosition , 6);
+ break;
+ case 2:
+ nextPosition.x -= 0.15f;
+ pSymbol->move(et::Symbol::LEFT , nextPosition , 6);
+ break;
+ case 3:
+ nextPosition.x += 0.15f;
+ pSymbol->move(et::Symbol::RIGHT , nextPosition , 6);
+ break;
+ }
+}
-#pragma once\r
-#include "SymbolController.h"\r
-\r
-namespace et{\r
- class RandomSymbolController : public SymbolController\r
- {\r
- virtual void move(Symbol* pSymbol);\r
- public:\r
- RandomSymbolController(void);\r
- virtual ~RandomSymbolController(void);\r
- };\r
-\r
-}\r
+#pragma once
+#include "SymbolController.h"
+
+namespace et{
+ class RandomSymbolController : public SymbolController
+ {
+ virtual void move(Symbol* pSymbol);
+ public:
+ RandomSymbolController(void);
+ virtual ~RandomSymbolController(void);
+ };
+
+}
-#include "SpecialAction.h"\r
-#include "BattlerFacade.h"\r
-#include "mof/DataRow.h"\r
-#include "mof/DataBasedAnimation.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-\r
-\r
-et::SpecialAction::SpecialAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , int cost , int skillID)\r
-: Action(pBattler , pTarget , cost)\r
-{\r
- m_skillID = skillID;\r
-}\r
-\r
-et::SpecialAction::SpecialAction(et::BattlerFacade* pBattler , std::vector<et::BattlerFacade*>& targetList , int cost , int skillID)\r
-: Action(pBattler , targetList , cost)\r
-{\r
- m_skillID = skillID;\r
-}\r
-\r
-et::SpecialAction::~SpecialAction(void)\r
-{\r
-}\r
-\r
-\r
-int et::SpecialAction::doActionTo(et::BattlerFacade* pTarget){\r
- float totalPower;\r
- switch(m_skillID){\r
- case 0 : totalPower = -40;\r
- break;\r
- case 1 : totalPower = -20;\r
- break;\r
- case 2 : totalPower = 60;\r
- break;\r
- default : totalPower = 100;\r
- }\r
- \r
- int damage = (int)-totalPower;\r
- if(pTarget->getParameter().guard)damage *= 0.5;//\83K\81[\83h\92\86\82È\82Ç\83_\83\81\81[\83W\82ª\94¼\95ª\82É\r
- int effect = -damage;\r
-\r
- et::BattlerParameter parameter = pTarget->getParameter();\r
- if(parameter.hp <= damage){\r
- parameter.hp = 0;\r
- parameter.alive = false;\r
- }\r
- else parameter.hp -= damage;\r
- if(parameter.hp > parameter.maxHp)parameter.hp = parameter.maxHp;\r
- parameter.dActionPoint += 1;\r
- pTarget->setParameter(parameter);\r
- return effect;\r
-}\r
-\r
-mof::AnimationResource et::SpecialAction::createApproachAnimation(){\r
- mof::Vector3D targetPosition = m_pBattler->getPosition();\r
- targetPosition.x += (m_pBattler->getType() == et::ENEMY)? 0.2f : -0.2f;\r
- return m_pBattler->setMovingAnimation(targetPosition , 15);\r
-}\r
-\r
-mof::AnimationResource et::SpecialAction::createExecuteAnimation(){\r
- return m_pBattler->setCastAnimation(1);\r
-}\r
-\r
-\r
-\r
-mof::GraphicsSchedule* et::SpecialAction::createEffect(et::Common& common){\r
- \r
- mof::DataResource effectTable;\r
- switch(m_skillID){\r
- case 0 : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/flame.csv"));\r
- break;\r
- case 1 : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/flame.csv"));\r
- break;\r
- case 2 : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/shock.csv"));\r
- break;\r
- default : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/shock.csv"));\r
- }\r
-\r
- mof::GraphicsSchedule* pSchedule = new mof::GraphicsSchedule();\r
-\r
- for(int i = 0 ; i < effectTable->getNumberOfRows() ; i++){\r
- mof::DataRow effectRow = mof::DataRow(effectTable , i);\r
- std::vector<et::BattlerFacade*> targetList = getTargetList();\r
- for(std::vector<et::BattlerFacade*>::iterator itr = targetList.begin() ; itr != targetList.end() ; ++itr){\r
- //---\83\82\81[\83V\83\87\83\93\82Ì\8d\\90¬\r
- mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();\r
- \r
- mof::KeyFrameAnimation* pCommonAnimation = new mof::KeyFrameAnimation();\r
- mof::Vector3D targetPosition = (*itr)->getPosition();\r
- mof::Vector3D basePosition = m_pBattler->getGraphicsObject()->getPosition();\r
- //\83X\83P\81[\83\8b\82ð\8cv\8eZ\r
- mof::Vector3D scale = targetPosition - basePosition;\r
- scale.y = 1.0;\r
- pCommonAnimation->setPosition(0 , basePosition);\r
- mof::AnimationResource resource(pCommonAnimation);\r
-\r
- mof::tstring motionName(effectRow.getData(_T("Motion")));\r
- mof::DataBasedAnimation* pMotionAnimation = new mof::DataBasedAnimation(motionName.c_str() , scale);\r
- pCascadeAnimation->setElement(0 , mof::AnimationResource(pMotionAnimation));\r
- \r
- pCascadeAnimation->setElement(1 , resource);\r
- mof::AnimationResource animation(pCascadeAnimation);\r
-\r
- //---\83I\83u\83W\83F\83N\83g\82Ì\8d\\90¬\r
- mof::tstring className(effectRow.getData(_T("Class")));\r
-\r
- mof::tstring textureName(effectRow.getData(_T("Texture")));\r
- if(textureName == _T(""))textureName = _T("null");\r
- mof::TextureResource texture = common.m_pTextureManager->getResource(textureName.c_str());\r
-\r
- if(className == _T("Billboard")){\r
- //\83r\83\8b\83{\81[\83h\r
- mof::GraphicsObject* pModel = new mof::Billboard(mof::Billboard::Y_FIXED , texture);\r
- pModel->setAnimation(0 , animation);\r
- pSchedule->add(20 , mof::GraphicsModelPtr(pModel) , animation);\r
- }\r
- else {\r
- //\83\81\83b\83V\83\85(className\82ªPath)\r
- mof::MeshResource pModel = common.m_pMeshManager->getResource(className.c_str());\r
- pModel->setTexture(0 , texture);\r
- pModel->setAnimation(0 , animation);\r
- pSchedule->add(20 , mof::GraphicsModelPtr(pModel) , animation);\r
- }\r
- }\r
- \r
- }\r
- \r
- \r
- return pSchedule;\r
-}\r
-\r
-mof::tstring et::SpecialAction::getActionMessage(){\r
- switch(m_skillID){\r
- case 0 : return mof::tstring(_T("\83A\83T\83\8b\83g\83t\83\8c\83C\83\80"));\r
- case 1 : return mof::tstring(_T("\83C\83O\83j\83b\83V\83\87\83\93"));\r
- case 2 : return mof::tstring(_T("\83q\81[\83\8a\83\93\83O"));\r
- default : return mof::tstring(_T("\82¢\82Ì\82¿\82Ì\89Ê\8eÀ"));\r
- }\r
-\r
+#include "SpecialAction.h"
+#include "BattlerFacade.h"
+#include "mof/DataRow.h"
+#include "mof/DataBasedAnimation.h"
+#include "mof/KeyFrameAnimation.h"
+
+
+et::SpecialAction::SpecialAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , int cost , int skillID)
+: Action(pBattler , pTarget , cost)
+{
+ m_skillID = skillID;
+}
+
+et::SpecialAction::SpecialAction(et::BattlerFacade* pBattler , std::vector<et::BattlerFacade*>& targetList , int cost , int skillID)
+: Action(pBattler , targetList , cost)
+{
+ m_skillID = skillID;
+}
+
+et::SpecialAction::~SpecialAction(void)
+{
+}
+
+
+int et::SpecialAction::doActionTo(et::BattlerFacade* pTarget){
+ float totalPower;
+ switch(m_skillID){
+ case 0 : totalPower = -40;
+ break;
+ case 1 : totalPower = -20;
+ break;
+ case 2 : totalPower = 60;
+ break;
+ default : totalPower = 100;
+ }
+
+ int damage = (int)-totalPower;
+ if(pTarget->getParameter().guard)damage *= 0.5;//\83K\81[\83h\92\86\82È\82Ç\83_\83\81\81[\83W\82ª\94¼\95ª\82É
+ int effect = -damage;
+
+ et::BattlerParameter parameter = pTarget->getParameter();
+ if(parameter.hp <= damage){
+ parameter.hp = 0;
+ parameter.alive = false;
+ }
+ else parameter.hp -= damage;
+ if(parameter.hp > parameter.maxHp)parameter.hp = parameter.maxHp;
+ parameter.dActionPoint += 1;
+ pTarget->setParameter(parameter);
+ return effect;
+}
+
+mof::AnimationResource et::SpecialAction::createApproachAnimation(){
+ mof::Vector3D targetPosition = m_pBattler->getPosition();
+ targetPosition.x += (m_pBattler->getType() == et::ENEMY)? 0.2f : -0.2f;
+ return m_pBattler->setMovingAnimation(targetPosition , 15);
+}
+
+mof::AnimationResource et::SpecialAction::createExecuteAnimation(){
+ return m_pBattler->setCastAnimation(1);
+}
+
+
+
+mof::GraphicsSchedule* et::SpecialAction::createEffect(et::Common& common){
+
+ mof::DataResource effectTable;
+ switch(m_skillID){
+ case 0 : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/flame.csv"));
+ break;
+ case 1 : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/flame.csv"));
+ break;
+ case 2 : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/shock.csv"));
+ break;
+ default : effectTable = common.m_pDataResourceManager->getResource(_T("data/effect/shock.csv"));
+ }
+
+ mof::GraphicsSchedule* pSchedule = new mof::GraphicsSchedule();
+
+ for(int i = 0 ; i < effectTable->getNumberOfRows() ; i++){
+ mof::DataRow effectRow = mof::DataRow(effectTable , i);
+ std::vector<et::BattlerFacade*> targetList = getTargetList();
+ for(std::vector<et::BattlerFacade*>::iterator itr = targetList.begin() ; itr != targetList.end() ; ++itr){
+ //---\83\82\81[\83V\83\87\83\93\82Ì\8d\\90¬
+ mof::CascadeAnimation* pCascadeAnimation = new mof::CascadeAnimation();
+
+ mof::KeyFrameAnimation* pCommonAnimation = new mof::KeyFrameAnimation();
+ mof::Vector3D targetPosition = (*itr)->getPosition();
+ mof::Vector3D basePosition = m_pBattler->getGraphicsObject()->getPosition();
+ //\83X\83P\81[\83\8b\82ð\8cv\8eZ
+ mof::Vector3D scale = targetPosition - basePosition;
+ scale.y = 1.0;
+ pCommonAnimation->setPosition(0 , basePosition);
+ mof::AnimationResource resource(pCommonAnimation);
+
+ mof::tstring motionName(effectRow.getData(_T("Motion")));
+ mof::DataBasedAnimation* pMotionAnimation = new mof::DataBasedAnimation(motionName.c_str() , scale);
+ pCascadeAnimation->setElement(0 , mof::AnimationResource(pMotionAnimation));
+
+ pCascadeAnimation->setElement(1 , resource);
+ mof::AnimationResource animation(pCascadeAnimation);
+
+ //---\83I\83u\83W\83F\83N\83g\82Ì\8d\\90¬
+ mof::tstring className(effectRow.getData(_T("Class")));
+
+ mof::tstring textureName(effectRow.getData(_T("Texture")));
+ if(textureName == _T(""))textureName = _T("null");
+ mof::TextureResource texture = common.m_pTextureManager->getResource(textureName.c_str());
+
+ if(className == _T("Billboard")){
+ //\83r\83\8b\83{\81[\83h
+ mof::GraphicsObject* pModel = new mof::Billboard(mof::Billboard::Y_FIXED , texture);
+ pModel->setAnimation(0 , animation);
+ pSchedule->add(20 , mof::GraphicsModelPtr(pModel) , animation);
+ }
+ else {
+ //\83\81\83b\83V\83\85(className\82ªPath)
+ mof::MeshResource pModel = common.m_pMeshManager->getResource(className.c_str());
+ pModel->setTexture(0 , texture);
+ pModel->setAnimation(0 , animation);
+ pSchedule->add(20 , mof::GraphicsModelPtr(pModel) , animation);
+ }
+ }
+
+ }
+
+
+ return pSchedule;
+}
+
+mof::tstring et::SpecialAction::getActionMessage(){
+ switch(m_skillID){
+ case 0 : return mof::tstring(_T("\83A\83T\83\8b\83g\83t\83\8c\83C\83\80"));
+ case 1 : return mof::tstring(_T("\83C\83O\83j\83b\83V\83\87\83\93"));
+ case 2 : return mof::tstring(_T("\83q\81[\83\8a\83\93\83O"));
+ default : return mof::tstring(_T("\82¢\82Ì\82¿\82Ì\89Ê\8eÀ"));
+ }
+
}
\ No newline at end of file
-#pragma once\r
-#include "Action.h"\r
-\r
-\r
-namespace et{\r
- class SpecialAction : public Action\r
- {\r
- int m_skillID;\r
- public:\r
- SpecialAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , int cost , int skillID);\r
- SpecialAction(et::BattlerFacade* pBattler , std::vector<et::BattlerFacade*>& targetList , int cost , int skillID);\r
- virtual ~SpecialAction(void);\r
- virtual int doActionTo(et::BattlerFacade* pTarget);\r
- virtual mof::AnimationResource createApproachAnimation();\r
- virtual mof::AnimationResource createExecuteAnimation();\r
- virtual mof::tstring getActionMessage();\r
-\r
- virtual mof::GraphicsSchedule* createEffect(et::Common& common);\r
- };\r
-\r
-\r
+#pragma once
+#include "Action.h"
+
+
+namespace et{
+ class SpecialAction : public Action
+ {
+ int m_skillID;
+ public:
+ SpecialAction(et::BattlerFacade* pBattler , et::BattlerFacade* pTarget , int cost , int skillID);
+ SpecialAction(et::BattlerFacade* pBattler , std::vector<et::BattlerFacade*>& targetList , int cost , int skillID);
+ virtual ~SpecialAction(void);
+ virtual int doActionTo(et::BattlerFacade* pTarget);
+ virtual mof::AnimationResource createApproachAnimation();
+ virtual mof::AnimationResource createExecuteAnimation();
+ virtual mof::tstring getActionMessage();
+
+ virtual mof::GraphicsSchedule* createEffect(et::Common& common);
+ };
+
+
}
\ No newline at end of file
-#include "StageScene.h"\r
-#include "mof/GraphicsDevice.h"\r
-#include "mof/AmbientLight.h"\r
-#include "mof/InputDevice.h"\r
-#include "mof/ConsoleIO.h"\r
-#include <math.h>\r
-#include "mof/System.h"\r
-#include "DungeonBuilderA.h"\r
-#include "mof/AmbientLight.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MapImageColor.h"\r
-#include "mof/Sprite.h"\r
-\r
-/*inline int roundUpCast(float f){\r
- if(f - (float)((int)f) > 0.0f)return (int)f + 1;\r
- else return (int)f;\r
-}*/\r
-\r
-et::StageScene::StageScene()\r
-: et::GameScene() , m_blockWidth(16) , m_blockHeight(16)\r
-//, m_symbolScale(mof::Matrix3D::createScaling(0.2f , 0.4f , 0.2f))\r
-{\r
-\r
- m_pMiniMap = NULL;\r
- m_pMapBlocks = new mof::VertexBuffer<mof::VertexXYZCUV>*[m_blockWidth * m_blockHeight];\r
- for(int x = 0 ; x < m_blockWidth ; x++){\r
- for(int y = 0 ; y < m_blockHeight ; y++)m_pMapBlocks[y * m_blockWidth + x] = NULL;\r
- }\r
- m_pCamera = NULL;\r
- m_pSymbolManager = NULL;\r
- m_pInputReceiver = NULL;\r
- m_pMapBuilder = NULL;\r
-\r
- m_pHero = NULL;\r
- m_pHeroController = NULL;\r
- m_pTest = mof::Sprite::createSpriteFromText(_T("\81u\82Ü\82à\82Ì\81B\81v") , 32);\r
- \r
-}\r
-\r
-et::StageScene::~StageScene(void)\r
-{\r
- \r
- delete m_pMiniMap;\r
- for(int x = 0 ; x < m_blockWidth ; x++){\r
- for(int y = 0 ; y < m_blockHeight ; y++)delete m_pMapBlocks[y * m_blockWidth + x];\r
- }\r
- delete[] m_pMapBlocks;\r
- delete m_pCamera;\r
- //delete m_pHero;\r
- //delete m_pHeroController;\r
- //delete m_pInputReceiver;\r
- delete m_pSymbolManager;\r
- delete m_pMapBuilder;\r
- delete m_pTest;\r
- \r
-}\r
-\r
-\r
-bool et::StageScene::initialize(){\r
- \r
- //m_pInputReceiver = mof::InputDevice::getInstance()->getInputReceiver();\r
-\r
- mof::TextureResource pTexture( new mof::Texture(mof::tstring(_T("image/map.png"))));\r
- std::shared_ptr<mof::PixelMap>map = pTexture->getPixelMap();\r
- \r
-\r
- //\83_\83\93\83W\83\87\83\93\83}\83b\83v\8dì\90¬\r
- m_pMapBuilder = new et::DungeonBuilderA(*(map.get()) , m_pTextureManager , 0.3f);\r
- m_pMapBuilder->setBlockSize(16 , 16);\r
- for(int x = 0 ; x < m_blockWidth ; x++){\r
- for(int y = 0 ; y < m_blockHeight ; y++)m_pMapBlocks[y * m_blockWidth + x] = m_pMapBuilder->createBlock(x , y);\r
- }\r
- m_pCamera = new mof::Camera(mof::Vector3D(0.0f , 0.7f*2 , -1.0f*2) , mof::Vector3D(0.0f , 0.0f , 0.0f) , mof::Vector3D(0.0f , 1.0f , 0.0f));\r
- m_pCamera->reflect();\r
-\r
- //mof::AmbientLight(mof::createColor(255 , 255 , 255)).reflect();\r
- mof::GraphicsDevice::getInstance()->setProjectionTransform(0.01f , 50.0f);\r
-\r
- m_pTexture = m_pTextureManager->getResource(_T("image/maptip0.png"));\r
-\r
- //\83V\83\93\83{\83\8b\82Ì\8dì\90¬\r
- m_pSymbolManager = new et::SymbolManager(m_pTextureManager , m_pMapBuilder);\r
- mof::Billboard* pBillboard = new mof::Billboard(mof::Billboard::Y_FIXED , m_pTextureManager->getResource(_T("image/chara.png")));\r
- pBillboard->setTextureRectangle(mof::Line2D(0 , 0 ,32 , 64));\r
- m_pHero = new et::Symbol( pBillboard , mof::Vector3D(0.2f , 0.4f , 0.2f));\r
- \r
- //m_pHeroController = new et::RandomSymbolController();\r
- m_pHeroController = new et::InputSymbolController(m_pInputReceiver);\r
- m_pHeroController->add(m_pHero);\r
- m_pSymbolManager->add(m_pHeroController);\r
-\r
- \r
-\r
- //\83~\83j\83}\83b\83v\82Ì\8dì\90¬\r
- const int tWidth = pTexture->getWidth();\r
- const int tHeight = pTexture->getHeight();\r
- for(int x = 0 ; x < tWidth ; x++){\r
- for(int y = 0 ; y < tHeight ; y++){\r
- if(map->get(x , y) == mof::createColor(0 , 255 , 0)){\r
- //\8eå\90l\8cö\88Ê\92u\82Æ\91å\82«\82³\82ð\90Ý\92è\r
- mof::Vector3D position(((float)x+0.5f) * m_pMapBuilder->getScale() , 0.0f , (-(float)y+0.5f) * m_pMapBuilder->getScale());\r
- m_pHero->setPosition(position , et::Symbol::DOWN );//\90Ã\8e~\82³\82¹\82é\r
- m_pHero->update();\r
- }\r
- if(et::isWalkableColor(map->get(x , y)) ){\r
- mof::Color color = mof::createColor(55 , 50 , 255);\r
- map->set(x , y , color);\r
- }\r
- else{\r
- mof::Color color = mof::createColor(100 , 0 , 0 , 255);\r
- map->set(x , y , color);\r
- }\r
- }\r
- }\r
- pTexture = mof::TextureResource(new mof::Texture(mof::tstring(_T("")) , *(map.get())));\r
- m_pMiniMap = new mof::Sprite(mof::Line2D(32 , 32 , tWidth*2 +32, tHeight*2 + 32) , mof::Line2D(0 , 0 , tWidth , tHeight) , pTexture);\r
- \r
- //\93G\83V\83\93\83{\83\8b\94z\92u\r
- for(int i = 0 ; i < 100 ; i++)m_pSymbolManager->create();\r
-\r
-\r
- return true;\r
-}\r
- \r
-bool et::StageScene::draw(){\r
- //m_pCapturer->capture();\r
- mof::GraphicsDevice* pDevice = mof::GraphicsDevice::getInstance();\r
- pDevice->clearRenderTarget(mof::createColor(27 , 27 , 27));//27\r
- pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_BASIC);\r
- pDevice->setZBuffer(true);\r
- pDevice->clearZBuffer();\r
- pDevice->setLight(false);\r
-\r
- \r
- m_pTexture->setTextureToDevice();\r
- for(int x = 0 ; x < m_blockWidth ; x++){\r
- for(int y = 0 ; y < m_blockHeight ; y++){\r
- //\95K\97v\82È\83u\83\8d\83b\83N\82Ì\82Ý\95`\89æ\82·\82é(Direct3D\82Ì\83N\83\8a\83b\83s\83\93\83O\82É\94C\82¹\82é)\r
- \r
- //if(x == blockPos.x && y == blockPos.y)\r
- m_pMapBlocks[y * m_blockWidth + x]->draw(mof::Matrix3D());\r
- }\r
- }\r
- \r
- \r
- m_pSymbolManager->draw();\r
- m_pMiniMap->draw();\r
-\r
- //\83V\83\93\83{\83\8b\88Ê\92u\83|\83C\83\93\83g\82Ì\95`\89æ\r
- std::vector<et::Symbol*>* pList = m_pSymbolManager->getSymbolList();\r
- for(int i = 0 ; i < pList->size() ; i++){\r
- mof::Vector3D pos3D = pList->at(i)->getPosition();\r
- mof::Vector2D pos2D(pos3D.x / m_pMapBuilder->getScale() , -pos3D.z / m_pMapBuilder->getScale());\r
- pos2D.x = 32 + pos2D.x * 2;\r
- pos2D.y = 32 + pos2D.y * 2;\r
- mof::Sprite point(mof::Line2D(pos2D.x , pos2D.y , pos2D.x + 2 , pos2D.y + 2),\r
- mof::Line2D(0 , 0 , 1 , 1) , m_pTextureManager->getResource(_T("null")));\r
- if(pList->at(i) != m_pHero)point.setCornerColor(mof::createColor(255 , 0 , 0));\r
- point.draw();\r
- }\r
-\r
- m_pTest->draw();\r
- return true;\r
-}\r
-\r
-\r
-bool et::StageScene::update(){\r
- \r
- m_pSymbolManager->update();\r
-\r
- std::vector<et::Symbol*> touchedList = m_pSymbolManager->testCollision(m_pHero);\r
- m_pTest->setPosition(mof::Vector2D(650 , 50));\r
- for(int i = 0 ; i < touchedList.size() ; i++){\r
- if(touchedList.at(i) == m_pHero)continue;\r
- //\90í\93¬\93Ë\93ü\81`\r
- m_pTest->setPosition(mof::Vector2D(400 , 50));\r
- }\r
- \r
- m_pCamera->setWorldTransform(mof::Matrix3D::createTranslation(m_pHero->getPosition()));//\8eå\90l\8cö\83V\83\93\83{\83\8b\82Ì\88Ê\92u\82ª\83J\83\81\83\89\82Ì\88Ê\92u\r
- m_pCamera->reflect();\r
- \r
- mof::Billboard::updateBillboardDirection(m_pCamera);\r
-\r
-\r
- return true;\r
-}\r
-\r
-\r
+#include "StageScene.h"
+#include "mof/GraphicsDevice.h"
+#include "mof/AmbientLight.h"
+#include "mof/InputDevice.h"
+#include "mof/ConsoleIO.h"
+#include <math.h>
+#include "mof/System.h"
+#include "DungeonBuilderA.h"
+#include "mof/AmbientLight.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MapImageColor.h"
+#include "mof/Sprite.h"
+
+/*inline int roundUpCast(float f){
+ if(f - (float)((int)f) > 0.0f)return (int)f + 1;
+ else return (int)f;
+}*/
+
+et::StageScene::StageScene()
+: et::GameScene() , m_blockWidth(16) , m_blockHeight(16)
+//, m_symbolScale(mof::Matrix3D::createScaling(0.2f , 0.4f , 0.2f))
+{
+
+ m_pMiniMap = NULL;
+ m_pMapBlocks = new mof::VertexBuffer<mof::VertexXYZCUV>*[m_blockWidth * m_blockHeight];
+ for(int x = 0 ; x < m_blockWidth ; x++){
+ for(int y = 0 ; y < m_blockHeight ; y++)m_pMapBlocks[y * m_blockWidth + x] = NULL;
+ }
+ m_pCamera = NULL;
+ m_pSymbolManager = NULL;
+ m_pInputReceiver = NULL;
+ m_pMapBuilder = NULL;
+
+ m_pHero = NULL;
+ m_pHeroController = NULL;
+ m_pTest = mof::Sprite::createSpriteFromText(_T("\81u\82Ü\82à\82Ì\81B\81v") , 32);
+
+}
+
+et::StageScene::~StageScene(void)
+{
+
+ delete m_pMiniMap;
+ for(int x = 0 ; x < m_blockWidth ; x++){
+ for(int y = 0 ; y < m_blockHeight ; y++)delete m_pMapBlocks[y * m_blockWidth + x];
+ }
+ delete[] m_pMapBlocks;
+ delete m_pCamera;
+ //delete m_pHero;
+ //delete m_pHeroController;
+ //delete m_pInputReceiver;
+ delete m_pSymbolManager;
+ delete m_pMapBuilder;
+ delete m_pTest;
+
+}
+
+
+bool et::StageScene::initialize(){
+
+ //m_pInputReceiver = mof::InputDevice::getInstance()->getInputReceiver();
+
+ mof::TextureResource pTexture( new mof::Texture(mof::tstring(_T("image/map.png"))));
+ std::shared_ptr<mof::PixelMap>map = pTexture->getPixelMap();
+
+
+ //\83_\83\93\83W\83\87\83\93\83}\83b\83v\8dì\90¬
+ m_pMapBuilder = new et::DungeonBuilderA(*(map.get()) , m_pTextureManager , 0.3f);
+ m_pMapBuilder->setBlockSize(16 , 16);
+ for(int x = 0 ; x < m_blockWidth ; x++){
+ for(int y = 0 ; y < m_blockHeight ; y++)m_pMapBlocks[y * m_blockWidth + x] = m_pMapBuilder->createBlock(x , y);
+ }
+ m_pCamera = new mof::Camera(mof::Vector3D(0.0f , 0.7f*2 , -1.0f*2) , mof::Vector3D(0.0f , 0.0f , 0.0f) , mof::Vector3D(0.0f , 1.0f , 0.0f));
+ m_pCamera->reflect();
+
+ //mof::AmbientLight(mof::createColor(255 , 255 , 255)).reflect();
+ mof::GraphicsDevice::getInstance()->setProjectionTransform(0.01f , 50.0f);
+
+ m_pTexture = m_pTextureManager->getResource(_T("image/maptip0.png"));
+
+ //\83V\83\93\83{\83\8b\82Ì\8dì\90¬
+ m_pSymbolManager = new et::SymbolManager(m_pTextureManager , m_pMapBuilder);
+ mof::Billboard* pBillboard = new mof::Billboard(mof::Billboard::Y_FIXED , m_pTextureManager->getResource(_T("image/chara.png")));
+ pBillboard->setTextureRectangle(mof::Line2D(0 , 0 ,32 , 64));
+ m_pHero = new et::Symbol( pBillboard , mof::Vector3D(0.2f , 0.4f , 0.2f));
+
+ //m_pHeroController = new et::RandomSymbolController();
+ m_pHeroController = new et::InputSymbolController(m_pInputReceiver);
+ m_pHeroController->add(m_pHero);
+ m_pSymbolManager->add(m_pHeroController);
+
+
+
+ //\83~\83j\83}\83b\83v\82Ì\8dì\90¬
+ const int tWidth = pTexture->getWidth();
+ const int tHeight = pTexture->getHeight();
+ for(int x = 0 ; x < tWidth ; x++){
+ for(int y = 0 ; y < tHeight ; y++){
+ if(map->get(x , y) == mof::createColor(0 , 255 , 0)){
+ //\8eå\90l\8cö\88Ê\92u\82Æ\91å\82«\82³\82ð\90Ý\92è
+ mof::Vector3D position(((float)x+0.5f) * m_pMapBuilder->getScale() , 0.0f , (-(float)y+0.5f) * m_pMapBuilder->getScale());
+ m_pHero->setPosition(position , et::Symbol::DOWN );//\90Ã\8e~\82³\82¹\82é
+ m_pHero->update();
+ }
+ if(et::isWalkableColor(map->get(x , y)) ){
+ mof::Color color = mof::createColor(55 , 50 , 255);
+ map->set(x , y , color);
+ }
+ else{
+ mof::Color color = mof::createColor(100 , 0 , 0 , 255);
+ map->set(x , y , color);
+ }
+ }
+ }
+ pTexture = mof::TextureResource(new mof::Texture(mof::tstring(_T("")) , *(map.get())));
+ m_pMiniMap = new mof::Sprite(mof::Line2D(32 , 32 , tWidth*2 +32, tHeight*2 + 32) , mof::Line2D(0 , 0 , tWidth , tHeight) , pTexture);
+
+ //\93G\83V\83\93\83{\83\8b\94z\92u
+ for(int i = 0 ; i < 100 ; i++)m_pSymbolManager->create();
+
+
+ return true;
+}
+
+bool et::StageScene::draw(){
+ //m_pCapturer->capture();
+ mof::GraphicsDevice* pDevice = mof::GraphicsDevice::getInstance();
+ pDevice->clearRenderTarget(mof::createColor(27 , 27 , 27));//27
+ pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_BASIC);
+ pDevice->setZBuffer(true);
+ pDevice->clearZBuffer();
+ pDevice->setLight(false);
+
+
+ m_pTexture->setTextureToDevice();
+ for(int x = 0 ; x < m_blockWidth ; x++){
+ for(int y = 0 ; y < m_blockHeight ; y++){
+ //\95K\97v\82È\83u\83\8d\83b\83N\82Ì\82Ý\95`\89æ\82·\82é(Direct3D\82Ì\83N\83\8a\83b\83s\83\93\83O\82É\94C\82¹\82é)
+
+ //if(x == blockPos.x && y == blockPos.y)
+ m_pMapBlocks[y * m_blockWidth + x]->draw(mof::Matrix3D());
+ }
+ }
+
+
+ m_pSymbolManager->draw();
+ m_pMiniMap->draw();
+
+ //\83V\83\93\83{\83\8b\88Ê\92u\83|\83C\83\93\83g\82Ì\95`\89æ
+ std::vector<et::Symbol*>* pList = m_pSymbolManager->getSymbolList();
+ for(int i = 0 ; i < pList->size() ; i++){
+ mof::Vector3D pos3D = pList->at(i)->getPosition();
+ mof::Vector2D pos2D(pos3D.x / m_pMapBuilder->getScale() , -pos3D.z / m_pMapBuilder->getScale());
+ pos2D.x = 32 + pos2D.x * 2;
+ pos2D.y = 32 + pos2D.y * 2;
+ mof::Sprite point(mof::Line2D(pos2D.x , pos2D.y , pos2D.x + 2 , pos2D.y + 2),
+ mof::Line2D(0 , 0 , 1 , 1) , m_pTextureManager->getResource(_T("null")));
+ if(pList->at(i) != m_pHero)point.setCornerColor(mof::createColor(255 , 0 , 0));
+ point.draw();
+ }
+
+ m_pTest->draw();
+ return true;
+}
+
+
+bool et::StageScene::update(){
+
+ m_pSymbolManager->update();
+
+ std::vector<et::Symbol*> touchedList = m_pSymbolManager->testCollision(m_pHero);
+ m_pTest->setPosition(mof::Vector2D(650 , 50));
+ for(int i = 0 ; i < touchedList.size() ; i++){
+ if(touchedList.at(i) == m_pHero)continue;
+ //\90í\93¬\93Ë\93ü\81`
+ m_pTest->setPosition(mof::Vector2D(400 , 50));
+ }
+
+ m_pCamera->setWorldTransform(mof::Matrix3D::createTranslation(m_pHero->getPosition()));//\8eå\90l\8cö\83V\83\93\83{\83\8b\82Ì\88Ê\92u\82ª\83J\83\81\83\89\82Ì\88Ê\92u
+ m_pCamera->reflect();
+
+ mof::Billboard::updateBillboardDirection(m_pCamera);
+
+
+ return true;
+}
+
+
-#pragma once\r
-#include "GameScene.h"\r
-#include "mof/TextureResource.h"\r
-#include "mof/Camera.h"\r
-#include "mof/VertexBuffer.h"\r
-#include "mof/VertexTypes.h"\r
-#include "mof/Billboard.h"\r
-#include "SymbolManager.h"\r
-#include "mof/InputReceiver.h"\r
-#include "DungeonBuilder.h"\r
-\r
-#include "mof/Capturer.h"\r
-#include "InputSymbolController.h"\r
-#include "RandomSymbolController.h"\r
-\r
-namespace et{\r
-\r
- class StageScene\r
- : public et::GameScene\r
- {\r
- mof::Sprite* m_pMiniMap;\r
- mof::VertexBuffer<mof::VertexXYZCUV>** m_pMapBlocks;\r
- const int m_blockWidth , m_blockHeight;\r
- mof::Camera* m_pCamera;\r
- mof::TextureResource m_pTexture;\r
- SymbolManager* m_pSymbolManager;\r
- et::DungeonBuilder* m_pMapBuilder;\r
-\r
- Symbol* m_pHero;\r
- et::SymbolController* m_pHeroController;\r
- \r
- //mof::InputReceiver* m_pInputReceiver;\r
- mof::Sprite* m_pTest;\r
- public:\r
- StageScene();\r
- virtual ~StageScene(void);\r
-\r
- \r
-\r
- virtual bool initialize();\r
- virtual bool draw();\r
- virtual bool update();\r
- \r
-\r
- };\r
-\r
-};\r
+#pragma once
+#include "GameScene.h"
+#include "mof/TextureResource.h"
+#include "mof/Camera.h"
+#include "mof/VertexBuffer.h"
+#include "mof/VertexTypes.h"
+#include "mof/Billboard.h"
+#include "SymbolManager.h"
+#include "mof/InputReceiver.h"
+#include "DungeonBuilder.h"
+
+#include "mof/Capturer.h"
+#include "InputSymbolController.h"
+#include "RandomSymbolController.h"
+
+namespace et{
+
+ class StageScene
+ : public et::GameScene
+ {
+ mof::Sprite* m_pMiniMap;
+ mof::VertexBuffer<mof::VertexXYZCUV>** m_pMapBlocks;
+ const int m_blockWidth , m_blockHeight;
+ mof::Camera* m_pCamera;
+ mof::TextureResource m_pTexture;
+ SymbolManager* m_pSymbolManager;
+ et::DungeonBuilder* m_pMapBuilder;
+
+ Symbol* m_pHero;
+ et::SymbolController* m_pHeroController;
+
+ //mof::InputReceiver* m_pInputReceiver;
+ mof::Sprite* m_pTest;
+ public:
+ StageScene();
+ virtual ~StageScene(void);
+
+
+
+ virtual bool initialize();
+ virtual bool draw();
+ virtual bool update();
+
+
+ };
+
+};
-#include "Symbol.h"\r
-#include <iostream>\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "mof/ConsoleIO.h"\r
-\r
-\r
-et::Symbol::Symbol(mof::Component3D* pBody , float scale)\r
-: mof::Component3D()\r
-{\r
- m_pBody = pBody;\r
- m_nextRunningKey = 0;\r
- setDirection(et::Symbol::DOWN);\r
- m_scale = mof::Vector3D(scale , scale , scale);\r
- \r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);\r
- pAnimation->setScale(0 , m_scale);\r
- setAnimation(0 , mof::AnimationResource(pAnimation));\r
- \r
-}\r
-\r
-\r
-\r
-et::Symbol::Symbol(mof::Component3D* pBody , mof::Vector3D& scale)\r
-: mof::Component3D()\r
-{\r
- m_pBody = pBody;\r
- m_nextRunningKey = 0;\r
- setDirection(et::Symbol::DOWN);\r
- m_scale = scale;\r
- \r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);\r
- pAnimation->setScale(0 , mof::Vector3D(scale.x , scale.y , scale.z));\r
- setAnimation(0 , mof::AnimationResource(pAnimation));\r
-}\r
-\r
-\r
-et::Symbol::~Symbol(void)\r
-{\r
- delete m_pBody;\r
-}\r
-\r
-\r
-/*\r
-void et::Symbol::move(et::Symbol::Direction direction , float span , int length){\r
- m_direction = direction;\r
- mof::AnimationResource pAnimation = getAnimation(2);\r
- if(pAnimation.get() != NULL && !pAnimation->isFinalized())return;\r
- \r
-\r
- const float SPEED_X = span;\r
- const float SPEED_Y = span;\r
- const float tableX[] = {0.0f , 0.0f , -SPEED_X , SPEED_X};\r
- const float tableZ[] = {SPEED_Y , -SPEED_Y , 0.0f , 0.0f};\r
-\r
- mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();\r
- pKeyFrameAnimation->setVelocity(0 , mof::Vector3D(tableX[direction] , 0.0f , tableZ[direction] ));\r
- pKeyFrameAnimation->setVelocity(length ,mof::Vector3D( 0.0f , 0.0f , 0.0f));\r
-\r
-\r
- \r
-\r
- setAnimation(3 , mof::AnimationResource(pKeyFrameAnimation));\r
- \r
-\r
-}*/\r
-\r
-\r
-\r
-void et::Symbol::move(Direction direction , mof::Vector3D& position , int length)\r
-{\r
- m_direction = direction;\r
- mof::AnimationResource pAnimation = getAnimation(3);\r
- if(pAnimation.get() != NULL && !pAnimation->isFinalized())return;\r
- \r
- mof::Vector3D current = getPosition();\r
- mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();\r
- pKeyFrameAnimation->setPosition(0 , current);\r
- pKeyFrameAnimation->setPosition(length , position);\r
- pKeyFrameAnimation->update();//\8e\9f\82Ì\8dX\90V\82Å\88Ú\93®\82·\82é\r
-\r
- setAnimation( 3 , mof::AnimationResource(pKeyFrameAnimation));\r
- \r
- pKeyFrameAnimation = new mof::KeyFrameAnimation();\r
-\r
- const int tableRunningY[] = {3 , 2 , 1 , 2 , 3 , 3 , 2 , 1 , 2 , 3};\r
- const int tableRunningX[] = {0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1};\r
- const int lengthOfRunning = 10;\r
- for(int i = 0 ; i < 1 ; i++){\r
- int key = (m_nextRunningKey + i) % lengthOfRunning;\r
- mof::Vector2D begin(32 * direction + 128 * tableRunningX[key] , tableRunningY[key] * 64 );\r
- mof::Vector2D end(32 * (direction+1) + 128 * tableRunningX[key] , (tableRunningY[key]+1) * 64 );\r
- pKeyFrameAnimation->setTextureRectangle(i*6 , mof::Line2D(begin , end));\r
- }\r
- m_nextRunningKey = (m_nextRunningKey + 1) % lengthOfRunning;\r
-\r
- pKeyFrameAnimation->setTextureRectangle(length+1 , mof::Line2D(32 * direction , 0 , 32 * (direction+1) , 64));\r
- pKeyFrameAnimation->setFinalKey(length);\r
-\r
- setAnimation( 2 , mof::AnimationResource(pKeyFrameAnimation));\r
- \r
-\r
-}\r
-\r
-bool et::Symbol::update(){\r
- \r
- return m_pBody->update();\r
-\r
-}\r
-\r
-bool et::Symbol::draw(){\r
- return m_pBody->draw(m_worldTransform);\r
-}\r
-\r
-bool et::Symbol::draw(mof::Matrix3D& transform){\r
- return m_pBody->draw(m_worldTransform * transform);\r
-}\r
-\r
-\r
-\r
-void et::Symbol::setAnimation(int index , mof::AnimationResource& pAnimation){\r
- mof::GraphicsObject::setAnimation(index , pAnimation);\r
- m_pBody->setAnimation(index , pAnimation);\r
- \r
-}\r
-\r
-void et::Symbol::setWorldTransform(mof::Matrix3D& matrix){\r
- m_pBody->setWorldTransform( matrix);\r
-}\r
- \r
-\r
-mof::Vector3D et::Symbol::getPosition(){\r
- return m_pBody->getPosition();\r
-}\r
-\r
-/*\r
-void et::Symbol::setPosition(mof::Vector3D& position){\r
- m_pBody->setPosition(position);\r
-}*/\r
-\r
-void et::Symbol::setPosition(mof::Vector3D& position , et::Symbol::Direction direction){\r
- \r
- setDirection(direction);\r
- mof::Vector3D current = getPosition();\r
- mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();\r
- pKeyFrameAnimation->setPosition(0 , position);\r
- setAnimation( 3 , mof::AnimationResource(pKeyFrameAnimation));\r
- \r
-}\r
-\r
-\r
-et::Symbol::Direction et::Symbol::getDirection(){\r
- return m_direction;\r
-}\r
-\r
-void et::Symbol::setDirection(et::Symbol::Direction direction){\r
- mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();\r
- pKeyFrameAnimation->setTextureRectangle(0 , mof::Line2D(32 * direction , 0 , 32 * (direction+1) , 64));\r
- setAnimation(2 , mof::AnimationResource(pKeyFrameAnimation));\r
- m_direction = direction;\r
-\r
-}\r
-\r
-mof::Vector3D& et::Symbol::getScale(){\r
- return m_scale;\r
-}\r
-\r
-\r
+#include "Symbol.h"
+#include <iostream>
+#include "mof/KeyFrameAnimation.h"
+#include "mof/ConsoleIO.h"
+
+
+et::Symbol::Symbol(mof::Component3D* pBody , float scale)
+: mof::Component3D()
+{
+ m_pBody = pBody;
+ m_nextRunningKey = 0;
+ setDirection(et::Symbol::DOWN);
+ m_scale = mof::Vector3D(scale , scale , scale);
+
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);
+ pAnimation->setScale(0 , m_scale);
+ setAnimation(0 , mof::AnimationResource(pAnimation));
+
+}
+
+
+
+et::Symbol::Symbol(mof::Component3D* pBody , mof::Vector3D& scale)
+: mof::Component3D()
+{
+ m_pBody = pBody;
+ m_nextRunningKey = 0;
+ setDirection(et::Symbol::DOWN);
+ m_scale = scale;
+
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation(true);
+ pAnimation->setScale(0 , mof::Vector3D(scale.x , scale.y , scale.z));
+ setAnimation(0 , mof::AnimationResource(pAnimation));
+}
+
+
+et::Symbol::~Symbol(void)
+{
+ delete m_pBody;
+}
+
+
+/*
+void et::Symbol::move(et::Symbol::Direction direction , float span , int length){
+ m_direction = direction;
+ mof::AnimationResource pAnimation = getAnimation(2);
+ if(pAnimation.get() != NULL && !pAnimation->isFinalized())return;
+
+
+ const float SPEED_X = span;
+ const float SPEED_Y = span;
+ const float tableX[] = {0.0f , 0.0f , -SPEED_X , SPEED_X};
+ const float tableZ[] = {SPEED_Y , -SPEED_Y , 0.0f , 0.0f};
+
+ mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();
+ pKeyFrameAnimation->setVelocity(0 , mof::Vector3D(tableX[direction] , 0.0f , tableZ[direction] ));
+ pKeyFrameAnimation->setVelocity(length ,mof::Vector3D( 0.0f , 0.0f , 0.0f));
+
+
+
+
+ setAnimation(3 , mof::AnimationResource(pKeyFrameAnimation));
+
+
+}*/
+
+
+
+void et::Symbol::move(Direction direction , mof::Vector3D& position , int length)
+{
+ m_direction = direction;
+ mof::AnimationResource pAnimation = getAnimation(3);
+ if(pAnimation.get() != NULL && !pAnimation->isFinalized())return;
+
+ mof::Vector3D current = getPosition();
+ mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();
+ pKeyFrameAnimation->setPosition(0 , current);
+ pKeyFrameAnimation->setPosition(length , position);
+ pKeyFrameAnimation->update();//\8e\9f\82Ì\8dX\90V\82Å\88Ú\93®\82·\82é
+
+ setAnimation( 3 , mof::AnimationResource(pKeyFrameAnimation));
+
+ pKeyFrameAnimation = new mof::KeyFrameAnimation();
+
+ const int tableRunningY[] = {3 , 2 , 1 , 2 , 3 , 3 , 2 , 1 , 2 , 3};
+ const int tableRunningX[] = {0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1};
+ const int lengthOfRunning = 10;
+ for(int i = 0 ; i < 1 ; i++){
+ int key = (m_nextRunningKey + i) % lengthOfRunning;
+ mof::Vector2D begin(32 * direction + 128 * tableRunningX[key] , tableRunningY[key] * 64 );
+ mof::Vector2D end(32 * (direction+1) + 128 * tableRunningX[key] , (tableRunningY[key]+1) * 64 );
+ pKeyFrameAnimation->setTextureRectangle(i*6 , mof::Line2D(begin , end));
+ }
+ m_nextRunningKey = (m_nextRunningKey + 1) % lengthOfRunning;
+
+ pKeyFrameAnimation->setTextureRectangle(length+1 , mof::Line2D(32 * direction , 0 , 32 * (direction+1) , 64));
+ pKeyFrameAnimation->setFinalKey(length);
+
+ setAnimation( 2 , mof::AnimationResource(pKeyFrameAnimation));
+
+
+}
+
+bool et::Symbol::update(){
+
+ return m_pBody->update();
+
+}
+
+bool et::Symbol::draw(){
+ return m_pBody->draw(m_worldTransform);
+}
+
+bool et::Symbol::draw(mof::Matrix3D& transform){
+ return m_pBody->draw(m_worldTransform * transform);
+}
+
+
+
+void et::Symbol::setAnimation(int index , mof::AnimationResource& pAnimation){
+ mof::GraphicsObject::setAnimation(index , pAnimation);
+ m_pBody->setAnimation(index , pAnimation);
+
+}
+
+void et::Symbol::setWorldTransform(mof::Matrix3D& matrix){
+ m_pBody->setWorldTransform( matrix);
+}
+
+
+mof::Vector3D et::Symbol::getPosition(){
+ return m_pBody->getPosition();
+}
+
+/*
+void et::Symbol::setPosition(mof::Vector3D& position){
+ m_pBody->setPosition(position);
+}*/
+
+void et::Symbol::setPosition(mof::Vector3D& position , et::Symbol::Direction direction){
+
+ setDirection(direction);
+ mof::Vector3D current = getPosition();
+ mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();
+ pKeyFrameAnimation->setPosition(0 , position);
+ setAnimation( 3 , mof::AnimationResource(pKeyFrameAnimation));
+
+}
+
+
+et::Symbol::Direction et::Symbol::getDirection(){
+ return m_direction;
+}
+
+void et::Symbol::setDirection(et::Symbol::Direction direction){
+ mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();
+ pKeyFrameAnimation->setTextureRectangle(0 , mof::Line2D(32 * direction , 0 , 32 * (direction+1) , 64));
+ setAnimation(2 , mof::AnimationResource(pKeyFrameAnimation));
+ m_direction = direction;
+
+}
+
+mof::Vector3D& et::Symbol::getScale(){
+ return m_scale;
+}
+
+
-#pragma once\r
-#include "mof/Component3D.h"\r
-\r
-namespace et{\r
- class Symbol : public mof::Component3D\r
- {\r
- public:\r
- typedef enum{\r
- UP = 0,\r
- DOWN , LEFT , RIGHT\r
- } Direction;\r
- protected:\r
- Component3D* m_pBody;\r
- int m_nextRunningKey;\r
- Direction m_direction;\r
- mof::Vector3D m_scale;\r
- //body\82ÆAnimation\82ð\8b¤\97L\82·\82é\r
- \r
- public:\r
- Symbol(Component3D* pBody , float scale);\r
- Symbol(Component3D* pBody , mof::Vector3D& scale);\r
- virtual ~Symbol(void);\r
-\r
- //void move(Direction direction , float span , int length);//span--1\83t\83\8c\81[\83\80\82Ì\88Ú\93®\95ª length--\83t\83\8c\81[\83\80\90\94\r
- void move(Direction direction , mof::Vector3D& position , int length);\r
-\r
- virtual bool update();\r
- virtual bool draw();\r
- virtual bool draw(mof::Matrix3D& transform);\r
- virtual void setAnimation(int index , mof::AnimationResource& pAnimation);\r
- virtual void setWorldTransform(mof::Matrix3D& matrix);\r
- virtual mof::Vector3D getPosition();\r
- //virtual void setPosition(mof::Vector3D& position);\r
- virtual void setPosition(mof::Vector3D& position , Direction direction);\r
- mof::Vector3D& getScale();\r
- Direction getDirection();\r
- void setDirection(Direction direction);\r
-\r
-\r
- \r
- \r
-\r
- };\r
-\r
-\r
+#pragma once
+#include "mof/Component3D.h"
+
+namespace et{
+ class Symbol : public mof::Component3D
+ {
+ public:
+ typedef enum{
+ UP = 0,
+ DOWN , LEFT , RIGHT
+ } Direction;
+ protected:
+ Component3D* m_pBody;
+ int m_nextRunningKey;
+ Direction m_direction;
+ mof::Vector3D m_scale;
+ //body\82ÆAnimation\82ð\8b¤\97L\82·\82é
+
+ public:
+ Symbol(Component3D* pBody , float scale);
+ Symbol(Component3D* pBody , mof::Vector3D& scale);
+ virtual ~Symbol(void);
+
+ //void move(Direction direction , float span , int length);//span--1\83t\83\8c\81[\83\80\82Ì\88Ú\93®\95ª length--\83t\83\8c\81[\83\80\90\94
+ void move(Direction direction , mof::Vector3D& position , int length);
+
+ virtual bool update();
+ virtual bool draw();
+ virtual bool draw(mof::Matrix3D& transform);
+ virtual void setAnimation(int index , mof::AnimationResource& pAnimation);
+ virtual void setWorldTransform(mof::Matrix3D& matrix);
+ virtual mof::Vector3D getPosition();
+ //virtual void setPosition(mof::Vector3D& position);
+ virtual void setPosition(mof::Vector3D& position , Direction direction);
+ mof::Vector3D& getScale();
+ Direction getDirection();
+ void setDirection(Direction direction);
+
+
+
+
+
+ };
+
+
};
\ No newline at end of file
-#include "SymbolController.h"\r
-\r
-\r
-et::SymbolController::SymbolController(){\r
-\r
-\r
-}\r
-\r
-\r
-et::SymbolController::~SymbolController(){\r
-\r
-}\r
-\r
-\r
-void et::SymbolController::add(Symbol* pSymbol){\r
- m_symbols.push_back(pSymbol);\r
-}\r
-\r
-int et::SymbolController::getSize(){\r
- return m_symbols.size();\r
-}\r
-\r
-\r
-et::Symbol* et::SymbolController::get(int index){\r
- return m_symbols.at(index);\r
-}\r
-\r
-void et::SymbolController::update(){\r
- for(int i = 0 ; i < getSize() ; i++){\r
- move(get(i));\r
- }\r
-}\r
-\r
+#include "SymbolController.h"
+
+
+et::SymbolController::SymbolController(){
+
+
+}
+
+
+et::SymbolController::~SymbolController(){
+
+}
+
+
+void et::SymbolController::add(Symbol* pSymbol){
+ m_symbols.push_back(pSymbol);
+}
+
+int et::SymbolController::getSize(){
+ return m_symbols.size();
+}
+
+
+et::Symbol* et::SymbolController::get(int index){
+ return m_symbols.at(index);
+}
+
+void et::SymbolController::update(){
+ for(int i = 0 ; i < getSize() ; i++){
+ move(get(i));
+ }
+}
+
-#pragma once\r
-#include <vector>\r
-#include "Symbol.h"\r
-\r
-namespace et{\r
- class SymbolController\r
- {\r
- std::vector<Symbol*> m_symbols;\r
- protected:\r
- virtual void move(Symbol* pSymbol) = 0;\r
- public:\r
- SymbolController();\r
- virtual ~SymbolController(void) = 0;\r
- void update();\r
- void add(Symbol* pSymbol);\r
- int getSize();\r
- Symbol* get(int index);\r
- };\r
-\r
-\r
+#pragma once
+#include <vector>
+#include "Symbol.h"
+
+namespace et{
+ class SymbolController
+ {
+ std::vector<Symbol*> m_symbols;
+ protected:
+ virtual void move(Symbol* pSymbol) = 0;
+ public:
+ SymbolController();
+ virtual ~SymbolController(void) = 0;
+ void update();
+ void add(Symbol* pSymbol);
+ int getSize();
+ Symbol* get(int index);
+ };
+
+
}
\ No newline at end of file
-#include "SymbolManager.h"\r
-#include "MapImageColor.h"\r
-#include "mof/Billboard.h"\r
-#include "RandomSymbolController.h"\r
-#include <math.h>\r
-\r
-et::SymbolManager::SymbolManager(mof::TextureManager* pTextureManager , et::DungeonBuilder* pMapBuilder)\r
-{\r
- m_pTextureManager = pTextureManager;\r
- m_pMapBuilder = pMapBuilder;\r
-}\r
-\r
-et::SymbolManager::~SymbolManager(void)\r
-{\r
- for(int i = 0 ; i < m_symbols.size() ; i++)delete m_symbols.at(i);\r
- for(int i = 0 ; i < m_controllers.size() ; i++)delete m_controllers.at(i);\r
-}\r
-\r
-void et::SymbolManager::update(){\r
- for(int i = 0 ; i < m_controllers.size() ; i++)m_controllers.at(i)->update();//\88Ú\93®\83A\83j\83\81\90Ý\92è\r
- for(int i = 0 ; i < m_symbols.size() ; i++){\r
- et::Symbol* pSymbol = m_symbols.at(i);\r
- mof::Vector3D prePos3D = pSymbol->getPosition();\r
- pSymbol->update();//\82±\82±\82Å\8eÀ\8dÛ\82É\88Ú\93®\r
-\r
- mof::Vector3D pos3D = pSymbol->getPosition();\r
- //\82S\92¸\93_\82Å\93\96\82½\82è\94»\92è\r
- float tableX[] = { -pSymbol->getScale().x / 2 , -pSymbol->getScale().x / 2 , pSymbol->getScale().x / 2 , pSymbol->getScale().x / 2};\r
- float tableZ[] = { -pSymbol->getScale().z / 2 , pSymbol->getScale().z / 2 , -pSymbol->getScale().z / 2 , pSymbol->getScale().z / 2};\r
- for(int i = 0 ; i < 4 ; i++){\r
- \r
- mof::Vector2D pos2D((pos3D.x + tableX[i]) / m_pMapBuilder->getScale() , -(pos3D.z + tableZ[i]) / m_pMapBuilder->getScale());\r
- if(!et::isWalkableColor(m_pMapBuilder->getMapImageColor(pos2D.x , pos2D.y))){\r
- //\90i\8ds\8bt\95û\8cü\82É\89\9f\82µ\96ß\82·\r
- //if(m_pHero->getDirection() == et::Symbol::UP)prePos3D.z = -(pos2D.y+1) * m_pMapBuilder->getScale() - tableZ[1]*1.1;\r
- //else if(m_pHero->getDirection() == et::Symbol::DOWN)prePos3D.z = -(pos2D.y) * m_pMapBuilder->getScale() - tableZ[0]*1.1;\r
- //else if(m_pHero->getDirection() == et::Symbol::LEFT)prePos3D.x= (pos2D.x+1) * m_pMapBuilder->getScale() - tableX[0]*1.1;\r
- //else if(m_pHero->getDirection() == et::Symbol::RIGHT)prePos3D.x= (pos2D.x) * m_pMapBuilder->getScale() - tableX[2]*1.1;\r
-\r
- pSymbol->setPosition(prePos3D , pSymbol->getDirection() );//\90Ã\8e~\82³\82¹\82é\r
- pSymbol->update();//\89\9f\82µ\96ß\82µ\83A\83j\83\81\82ð\93K\97p\r
- break;\r
- }\r
- \r
- }\r
- }\r
-}\r
-\r
-bool compareTo( et::Symbol* &a , et::Symbol* &b){\r
- return (*a).getPosition().z > (*b).getPosition().z;\r
- }\r
-\r
-void et::SymbolManager::draw(){\r
- //z\8dÀ\95W\82Å\83\\81[\83g\82µ\82Ä\95`\89æ\r
- \r
- std::sort(m_symbols.begin() , m_symbols.end() , compareTo);\r
- for(int i = 0 ; i < m_symbols.size() ; i++)m_symbols.at(i)->draw();\r
-}\r
-\r
-void et::SymbolManager::add(et::SymbolController* pController){\r
- m_controllers.push_back(pController);\r
- for(int i = 0 ; i < pController->getSize() ; i++)m_symbols.push_back(pController->get(i));\r
-}\r
-\r
-\r
-std::vector<et::Symbol*> et::SymbolManager::testCollision(et::Symbol* pSymbol){\r
- std::vector<et::Symbol*> touchedList;\r
- for(int i = 0 ; i < m_symbols.size() ; i++){\r
- Symbol* pTarget = m_symbols.at(i);\r
- //\89~\93¯\8em\82Å\93\96\82½\82è\94»\92è\r
- if(fabs(pTarget->getPosition().x - pSymbol->getPosition().x) > (pTarget->getScale().x/2 + pSymbol->getScale().x/2))continue;\r
- else if(fabs(pTarget->getPosition().z - pSymbol->getPosition().z) > (pTarget->getScale().z/2 + pSymbol->getScale().z/2))continue;\r
- else touchedList.push_back(pTarget);\r
- \r
- }\r
- return touchedList;\r
-}\r
-\r
-void et::SymbolManager::create(){\r
- //\83\89\83\93\83_\83\80\82É\93G\83V\83\93\83{\83\8b\94z\92u\r
- while(true){\r
- int x = rand()%m_pMapBuilder->getWidth();\r
- int y = rand()%m_pMapBuilder->getHeight();\r
- if(!et::isWalkableColor(m_pMapBuilder->getMapImageColor(x , y)))continue;\r
- mof::Billboard* pBillboard = new mof::Billboard(mof::Billboard::Y_FIXED , m_pTextureManager->getResource(_T("image/chara2.png")));\r
- //pBillboard->setTextureRectangle(mof::Line2D(0 , 0 ,32 , 64));\r
- Symbol* pSymbol = new et::Symbol( pBillboard , mof::Vector3D(0.2f , 0.4f , 0.2f));\r
- SymbolController* pController = new et::RandomSymbolController();\r
- \r
- pController->add(pSymbol);\r
-\r
- mof::Vector3D position(((float)x+0.5f) * m_pMapBuilder->getScale() , 0.0f , (-(float)(y+1)+0.5f) * m_pMapBuilder->getScale());\r
- pSymbol->setPosition(position , et::Symbol::DOWN );//\90Ã\8e~\82³\82¹\82é\r
- pSymbol->update();\r
-\r
- add(pController);\r
- break;\r
- }\r
+#include "SymbolManager.h"
+#include "MapImageColor.h"
+#include "mof/Billboard.h"
+#include "RandomSymbolController.h"
+#include <math.h>
+
+et::SymbolManager::SymbolManager(mof::TextureManager* pTextureManager , et::DungeonBuilder* pMapBuilder)
+{
+ m_pTextureManager = pTextureManager;
+ m_pMapBuilder = pMapBuilder;
+}
+
+et::SymbolManager::~SymbolManager(void)
+{
+ for(int i = 0 ; i < m_symbols.size() ; i++)delete m_symbols.at(i);
+ for(int i = 0 ; i < m_controllers.size() ; i++)delete m_controllers.at(i);
+}
+
+void et::SymbolManager::update(){
+ for(int i = 0 ; i < m_controllers.size() ; i++)m_controllers.at(i)->update();//\88Ú\93®\83A\83j\83\81\90Ý\92è
+ for(int i = 0 ; i < m_symbols.size() ; i++){
+ et::Symbol* pSymbol = m_symbols.at(i);
+ mof::Vector3D prePos3D = pSymbol->getPosition();
+ pSymbol->update();//\82±\82±\82Å\8eÀ\8dÛ\82É\88Ú\93®
+
+ mof::Vector3D pos3D = pSymbol->getPosition();
+ //\82S\92¸\93_\82Å\93\96\82½\82è\94»\92è
+ float tableX[] = { -pSymbol->getScale().x / 2 , -pSymbol->getScale().x / 2 , pSymbol->getScale().x / 2 , pSymbol->getScale().x / 2};
+ float tableZ[] = { -pSymbol->getScale().z / 2 , pSymbol->getScale().z / 2 , -pSymbol->getScale().z / 2 , pSymbol->getScale().z / 2};
+ for(int i = 0 ; i < 4 ; i++){
+
+ mof::Vector2D pos2D((pos3D.x + tableX[i]) / m_pMapBuilder->getScale() , -(pos3D.z + tableZ[i]) / m_pMapBuilder->getScale());
+ if(!et::isWalkableColor(m_pMapBuilder->getMapImageColor(pos2D.x , pos2D.y))){
+ //\90i\8ds\8bt\95û\8cü\82É\89\9f\82µ\96ß\82·
+ //if(m_pHero->getDirection() == et::Symbol::UP)prePos3D.z = -(pos2D.y+1) * m_pMapBuilder->getScale() - tableZ[1]*1.1;
+ //else if(m_pHero->getDirection() == et::Symbol::DOWN)prePos3D.z = -(pos2D.y) * m_pMapBuilder->getScale() - tableZ[0]*1.1;
+ //else if(m_pHero->getDirection() == et::Symbol::LEFT)prePos3D.x= (pos2D.x+1) * m_pMapBuilder->getScale() - tableX[0]*1.1;
+ //else if(m_pHero->getDirection() == et::Symbol::RIGHT)prePos3D.x= (pos2D.x) * m_pMapBuilder->getScale() - tableX[2]*1.1;
+
+ pSymbol->setPosition(prePos3D , pSymbol->getDirection() );//\90Ã\8e~\82³\82¹\82é
+ pSymbol->update();//\89\9f\82µ\96ß\82µ\83A\83j\83\81\82ð\93K\97p
+ break;
+ }
+
+ }
+ }
+}
+
+bool compareTo( et::Symbol* &a , et::Symbol* &b){
+ return (*a).getPosition().z > (*b).getPosition().z;
+ }
+
+void et::SymbolManager::draw(){
+ //z\8dÀ\95W\82Å\83\\81[\83g\82µ\82Ä\95`\89æ
+
+ std::sort(m_symbols.begin() , m_symbols.end() , compareTo);
+ for(int i = 0 ; i < m_symbols.size() ; i++)m_symbols.at(i)->draw();
+}
+
+void et::SymbolManager::add(et::SymbolController* pController){
+ m_controllers.push_back(pController);
+ for(int i = 0 ; i < pController->getSize() ; i++)m_symbols.push_back(pController->get(i));
+}
+
+
+std::vector<et::Symbol*> et::SymbolManager::testCollision(et::Symbol* pSymbol){
+ std::vector<et::Symbol*> touchedList;
+ for(int i = 0 ; i < m_symbols.size() ; i++){
+ Symbol* pTarget = m_symbols.at(i);
+ //\89~\93¯\8em\82Å\93\96\82½\82è\94»\92è
+ if(fabs(pTarget->getPosition().x - pSymbol->getPosition().x) > (pTarget->getScale().x/2 + pSymbol->getScale().x/2))continue;
+ else if(fabs(pTarget->getPosition().z - pSymbol->getPosition().z) > (pTarget->getScale().z/2 + pSymbol->getScale().z/2))continue;
+ else touchedList.push_back(pTarget);
+
+ }
+ return touchedList;
+}
+
+void et::SymbolManager::create(){
+ //\83\89\83\93\83_\83\80\82É\93G\83V\83\93\83{\83\8b\94z\92u
+ while(true){
+ int x = rand()%m_pMapBuilder->getWidth();
+ int y = rand()%m_pMapBuilder->getHeight();
+ if(!et::isWalkableColor(m_pMapBuilder->getMapImageColor(x , y)))continue;
+ mof::Billboard* pBillboard = new mof::Billboard(mof::Billboard::Y_FIXED , m_pTextureManager->getResource(_T("image/chara2.png")));
+ //pBillboard->setTextureRectangle(mof::Line2D(0 , 0 ,32 , 64));
+ Symbol* pSymbol = new et::Symbol( pBillboard , mof::Vector3D(0.2f , 0.4f , 0.2f));
+ SymbolController* pController = new et::RandomSymbolController();
+
+ pController->add(pSymbol);
+
+ mof::Vector3D position(((float)x+0.5f) * m_pMapBuilder->getScale() , 0.0f , (-(float)(y+1)+0.5f) * m_pMapBuilder->getScale());
+ pSymbol->setPosition(position , et::Symbol::DOWN );//\90Ã\8e~\82³\82¹\82é
+ pSymbol->update();
+
+ add(pController);
+ break;
+ }
}
\ No newline at end of file
-#pragma once\r
-#include "Symbol.h"\r
-#include "mof/Graphics.h"\r
-#include <vector>\r
-#include "SymbolController.h"\r
-#include "DungeonBuilder.h"\r
-\r
-namespace et{\r
-\r
- class SymbolManager\r
- {\r
- std::vector<et::Symbol*> m_symbols;\r
- std::vector<et::SymbolController*> m_controllers;\r
- mof::TextureManager* m_pTextureManager;\r
- et::DungeonBuilder* m_pMapBuilder;\r
- public:\r
- SymbolManager(mof::TextureManager* pTextureManager , et::DungeonBuilder* pMapBuilder);\r
- virtual ~SymbolManager(void);\r
- virtual void update();\r
- virtual void draw();\r
- void add(SymbolController* pController);\r
- std::vector<et::Symbol*> testCollision(et::Symbol* pSymbol );\r
- std::vector<et::Symbol*>* getSymbolList(){return &m_symbols;}\r
- void create();\r
- };\r
-\r
-\r
+#pragma once
+#include "Symbol.h"
+#include "mof/Graphics.h"
+#include <vector>
+#include "SymbolController.h"
+#include "DungeonBuilder.h"
+
+namespace et{
+
+ class SymbolManager
+ {
+ std::vector<et::Symbol*> m_symbols;
+ std::vector<et::SymbolController*> m_controllers;
+ mof::TextureManager* m_pTextureManager;
+ et::DungeonBuilder* m_pMapBuilder;
+ public:
+ SymbolManager(mof::TextureManager* pTextureManager , et::DungeonBuilder* pMapBuilder);
+ virtual ~SymbolManager(void);
+ virtual void update();
+ virtual void draw();
+ void add(SymbolController* pController);
+ std::vector<et::Symbol*> testCollision(et::Symbol* pSymbol );
+ std::vector<et::Symbol*>* getSymbolList(){return &m_symbols;}
+ void create();
+ };
+
+
};
\ No newline at end of file
-#pragma once\r
-#include "mof/widget/WidgetView.hpp"\r
-#include "mof/FactoryMethod.hpp"\r
-#include "mof/graphics/utilities.hpp"\r
-#include "mof/widget/utilities.hpp"\r
-#include <boost/scoped_ptr.hpp>\r
-\r
-class HighlightMenuView \r
-: \r
- public mof::WidgetView\r
-{\r
-public:\r
- HighlightMenuView( const mof::FactoryMethod<mof::WidgetView>& child );\r
- virtual ~HighlightMenuView( );\r
-\r
- virtual mof::FrameNumber show( bool imidiately = false );\r
- virtual mof::FrameNumber hide( bool imidiately = false );\r
- virtual mof::FrameNumber focus( bool imidiately = false );\r
- virtual mof::FrameNumber blur( bool imidiately = false );\r
- virtual void update( );\r
- virtual void draw( ) const;\r
-\r
-private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- \r
-};\r
-\r
-\r
-#include <mof/MenuView.hpp>\r
-#include <mof/FactoryMethod.hpp>\r
-\r
-namespace mof{\r
-\r
- struct MenuItemInfo;\r
- struct Vector2D;\r
- class Effect;\r
-\r
- class SystemMenuView : public MenuWidget\r
- {\r
- public:\r
- virtual SystemMenuView( const mof::FactoryMethod<mof::WidgetView>& );\r
- virtual ~SystemMenuView();\r
- virtual mof::Rectangle<int> initialize() = 0;\r
- virtual void show() = 0;\r
- virtual void close() = 0;\r
- virtual void focus() = 0;\r
- virtual void blur() = 0;\r
- \r
- \r
- };\r
-\r
-\r
-} // namespace mof\r
+#pragma once
+#include "mof/widget/WidgetView.hpp"
+#include "mof/FactoryMethod.hpp"
+#include "mof/graphics/utilities.hpp"
+#include "mof/widget/utilities.hpp"
+#include <boost/scoped_ptr.hpp>
+
+class HighlightMenuView
+:
+ public mof::WidgetView
+{
+public:
+ HighlightMenuView( const mof::FactoryMethod<mof::WidgetView>& child );
+ virtual ~HighlightMenuView( );
+
+ virtual mof::FrameNumber show( bool imidiately = false );
+ virtual mof::FrameNumber hide( bool imidiately = false );
+ virtual mof::FrameNumber focus( bool imidiately = false );
+ virtual mof::FrameNumber blur( bool imidiately = false );
+ virtual void update( );
+ virtual void draw( ) const;
+
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+
+};
+
+
+#include <mof/MenuView.hpp>
+#include <mof/FactoryMethod.hpp>
+
+namespace mof{
+
+ struct MenuItemInfo;
+ struct Vector2D;
+ class Effect;
+
+ class SystemMenuView : public MenuWidget
+ {
+ public:
+ virtual SystemMenuView( const mof::FactoryMethod<mof::WidgetView>& );
+ virtual ~SystemMenuView();
+ virtual mof::Rectangle<int> initialize() = 0;
+ virtual void show() = 0;
+ virtual void close() = 0;
+ virtual void focus() = 0;
+ virtual void blur() = 0;
+
+
+ };
+
+
+} // namespace mof
-#pragma once\r
-#include "widget/SystemMenuWidget.hpp"\r
-#include <mof/widget/GridLayout.hpp>\r
-#include <mof/widget/ContainerWidgetView.hpp>\r
-\r
-//{{{ Impl\r
-struct SystemMenuWidget::Impl\r
-{\r
- std::vector< boost::function0<void> > actions;\r
- mof::ContainerWidgetView* pView; \r
- int currentIndex;\r
-\r
- Impl()\r
- : pView(NULL) , currentIndex(0)\r
- {}\r
-};\r
-//}}}\r
-//{{{ constructor\r
-SystemMenuWidget::SystemMenuWidget\r
-(\r
- const mof::MenuItem& front ,\r
- const mof::MenuItem& back\r
-)\r
-: m_pImpl(new Impl)\r
-{\r
- int length = &back - &front + 1;\r
- std::vector< mof::FactoryMethod<mof::WidgetView> > views;\r
- for(int i = 0 ; i < length ; i++)\r
- {\r
- views.push_back((&front + i)->view);\r
- }\r
-\r
- m_pImpl->pView = new mof::ContainerWidgetView\r
- (\r
- views.front() , views.back() ,\r
- mof::makeFactoryMethod<mof::GridLayout>\r
- (\r
- mof::GridLayout::VERTICAL , 0\r
- )\r
- );\r
-\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();\r
-}\r
-//}}}\r
-//{{{ destructor\r
-SystemMenuWidget::~SystemMenuWidget()\r
-{\r
- delete m_pImpl->pView;\r
-}\r
-//}}}\r
-//{{{ show\r
-mof::FrameNumber SystemMenuWidget::show(bool imidiately)\r
-{\r
- return m_pImpl->pView->show(imidiately);\r
-}\r
-//}}}\r
-//{{{ hide\r
-mof::FrameNumber SystemMenuWidget::hide(bool imidiately)\r
-{\r
- return m_pImpl->pView->hide(imidiately);\r
-}\r
-//}}}\r
-//{{{ getView\r
-const mof::WidgetView& SystemMenuWidget::getView() const\r
-{\r
- return *m_pImpl->pView;\r
-}\r
-//}}}\r
-//{{{ getView\r
-mof::WidgetView& SystemMenuWidget::getView()\r
-{\r
- return *m_pImpl->pView;\r
-}\r
-//}}}\r
-//{{{ update\r
-void SystemMenuWidget::update()\r
-{\r
- m_pImpl->pView->update();\r
-}\r
-//}}}\r
-//{{{ up\r
-void SystemMenuWidget::up()\r
-{\r
- int index = m_pImpl->pView->getAdjacencyAsUp();\r
- if(index == m_pImpl->currentIndex)return;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();\r
- m_pImpl->currentIndex = index;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();\r
-}\r
-//}}}\r
-//{{{ down\r
-void SystemMenuWidget::down()\r
-{\r
- int index = m_pImpl->pView->getAdjacencyAsDown();\r
- if(index == m_pImpl->currentIndex)return;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();\r
- m_pImpl->currentIndex = index;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();\r
-}\r
-//}}}\r
-//{{{ left \r
-void SystemMenuWidget::left()\r
-{\r
- int index = m_pImpl->pView->getAdjacencyAsLeft();\r
- if(index == m_pImpl->currentIndex)return;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();\r
- m_pImpl->currentIndex = index;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();\r
-}\r
-//}}}\r
-//{{{ right \r
-void SystemMenuWidget::right()\r
-{\r
- int index = m_pImpl->pView->getAdjacencyAsRight();\r
- if(index == m_pImpl->currentIndex)return;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();\r
- m_pImpl->currentIndex = index;\r
- m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();\r
-}\r
-//}}}\r
-//{{{ performAction\r
-void SystemMenuWidget::performAction() const\r
-{\r
- m_pImpl->actions[m_pImpl->currentIndex]();\r
-}\r
-//}}}\r
-\r
+#pragma once
+#include "widget/SystemMenuWidget.hpp"
+#include <mof/widget/GridLayout.hpp>
+#include <mof/widget/ContainerWidgetView.hpp>
+
+//{{{ Impl
+struct SystemMenuWidget::Impl
+{
+ std::vector< boost::function0<void> > actions;
+ mof::ContainerWidgetView* pView;
+ int currentIndex;
+
+ Impl()
+ : pView(NULL) , currentIndex(0)
+ {}
+};
+//}}}
+//{{{ constructor
+SystemMenuWidget::SystemMenuWidget
+(
+ const mof::MenuItem& front ,
+ const mof::MenuItem& back
+)
+: m_pImpl(new Impl)
+{
+ int length = &back - &front + 1;
+ std::vector< mof::FactoryMethod<mof::WidgetView> > views;
+ for(int i = 0 ; i < length ; i++)
+ {
+ views.push_back((&front + i)->view);
+ }
+
+ m_pImpl->pView = new mof::ContainerWidgetView
+ (
+ views.front() , views.back() ,
+ mof::makeFactoryMethod<mof::GridLayout>
+ (
+ mof::GridLayout::VERTICAL , 0
+ )
+ );
+
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();
+}
+//}}}
+//{{{ destructor
+SystemMenuWidget::~SystemMenuWidget()
+{
+ delete m_pImpl->pView;
+}
+//}}}
+//{{{ show
+mof::FrameNumber SystemMenuWidget::show(bool imidiately)
+{
+ return m_pImpl->pView->show(imidiately);
+}
+//}}}
+//{{{ hide
+mof::FrameNumber SystemMenuWidget::hide(bool imidiately)
+{
+ return m_pImpl->pView->hide(imidiately);
+}
+//}}}
+//{{{ getView
+const mof::WidgetView& SystemMenuWidget::getView() const
+{
+ return *m_pImpl->pView;
+}
+//}}}
+//{{{ getView
+mof::WidgetView& SystemMenuWidget::getView()
+{
+ return *m_pImpl->pView;
+}
+//}}}
+//{{{ update
+void SystemMenuWidget::update()
+{
+ m_pImpl->pView->update();
+}
+//}}}
+//{{{ up
+void SystemMenuWidget::up()
+{
+ int index = m_pImpl->pView->getAdjacencyAsUp();
+ if(index == m_pImpl->currentIndex)return;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();
+ m_pImpl->currentIndex = index;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();
+}
+//}}}
+//{{{ down
+void SystemMenuWidget::down()
+{
+ int index = m_pImpl->pView->getAdjacencyAsDown();
+ if(index == m_pImpl->currentIndex)return;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();
+ m_pImpl->currentIndex = index;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();
+}
+//}}}
+//{{{ left
+void SystemMenuWidget::left()
+{
+ int index = m_pImpl->pView->getAdjacencyAsLeft();
+ if(index == m_pImpl->currentIndex)return;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();
+ m_pImpl->currentIndex = index;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();
+}
+//}}}
+//{{{ right
+void SystemMenuWidget::right()
+{
+ int index = m_pImpl->pView->getAdjacencyAsRight();
+ if(index == m_pImpl->currentIndex)return;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->blur();
+ m_pImpl->currentIndex = index;
+ m_pImpl->pView->getAt(m_pImpl->currentIndex)->focus();
+}
+//}}}
+//{{{ performAction
+void SystemMenuWidget::performAction() const
+{
+ m_pImpl->actions[m_pImpl->currentIndex]();
+}
+//}}}
+
-#pragma once\r
-#include <mof/FactoryMethod.hpp>\r
-#include <mof/widget/MenuWidget.hpp>\r
-#include <mof/graphics/utilities.hpp>\r
-#include <mof/widget/utilities.hpp>\r
-#include <boost/scoped_ptr.hpp>\r
-#include <mof/widget/Widget.hpp>\r
-\r
- \r
-\r
-class SystemMenuWidget : public mof::MenuWidget\r
-{\r
-public:\r
- SystemMenuWidget(const mof::MenuItem& front , const mof::MenuItem& back);\r
- virtual ~SystemMenuWidget();\r
- virtual mof::FrameNumber show(bool imidiately);\r
- virtual mof::FrameNumber hide(bool imidiately);\r
- virtual const mof::WidgetView& getView() const;\r
- virtual mof::WidgetView& getView();\r
- virtual void update();\r
- \r
- virtual void up();\r
- virtual void down();\r
- virtual void left();\r
- virtual void right();\r
- virtual void performAction() const;\r
-\r
-private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
-};\r
-\r
+#pragma once
+#include <mof/FactoryMethod.hpp>
+#include <mof/widget/MenuWidget.hpp>
+#include <mof/graphics/utilities.hpp>
+#include <mof/widget/utilities.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <mof/widget/Widget.hpp>
+
+
+
+class SystemMenuWidget : public mof::MenuWidget
+{
+public:
+ SystemMenuWidget(const mof::MenuItem& front , const mof::MenuItem& back);
+ virtual ~SystemMenuWidget();
+ virtual mof::FrameNumber show(bool imidiately);
+ virtual mof::FrameNumber hide(bool imidiately);
+ virtual const mof::WidgetView& getView() const;
+ virtual mof::WidgetView& getView();
+ virtual void update();
+
+ virtual void up();
+ virtual void down();
+ virtual void left();
+ virtual void right();
+ virtual void performAction() const;
+
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+};
+
-#pragma once\r
-#include <mof/FactoryMethod.hpp>\r
-#include <mof/widget/MenuWidget.hpp>\r
-#include <mof/graphics/utilities.hpp>\r
-#include <mof/widget/utilities.hpp>\r
-#include <boost/scoped_ptr.hpp>\r
-#include <mof/widget/Widget.hpp>\r
-\r
- \r
-\r
-class SystemMenuWidget : public mof::MenuWidget\r
-{\r
-public:\r
- SystemMenuWidget(const mof::MenuItem& front , const mof::MenuItem& back);\r
- virtual ~SystemMenuWidget();\r
- virtual mof::FrameNumber show(bool imidiately = false);\r
- virtual mof::FrameNumber hide(bool imidiately = false);\r
- virtual const mof::WidgetView& getView() const;\r
- virtual mof::WidgetView& getView();\r
- virtual void update();\r
- \r
- virtual void up();\r
- virtual void down();\r
- virtual void left();\r
- virtual void right();\r
- virtual void performAction() const;\r
-\r
-private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
-};\r
-\r
+#pragma once
+#include <mof/FactoryMethod.hpp>
+#include <mof/widget/MenuWidget.hpp>
+#include <mof/graphics/utilities.hpp>
+#include <mof/widget/utilities.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <mof/widget/Widget.hpp>
+
+
+
+class SystemMenuWidget : public mof::MenuWidget
+{
+public:
+ SystemMenuWidget(const mof::MenuItem& front , const mof::MenuItem& back);
+ virtual ~SystemMenuWidget();
+ virtual mof::FrameNumber show(bool imidiately = false);
+ virtual mof::FrameNumber hide(bool imidiately = false);
+ virtual const mof::WidgetView& getView() const;
+ virtual mof::WidgetView& getView();
+ virtual void update();
+
+ virtual void up();
+ virtual void down();
+ virtual void left();
+ virtual void right();
+ virtual void performAction() const;
+
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+};
+
-#include "TargetMenu.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MyWindow.h"\r
-#include "BattlerGroup.h"\r
-#include "BattlerFacade.h"\r
-\r
-mof::Window* addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , \r
- mof::Sprite* pSprite , mof::TextureManager* pTextureManager){\r
- mof::Window* pSelectable = new et::MyWindow(pSprite , pTextureManager);\r
- pOwner->add(pSelectable);\r
- selectables.push_back(pSelectable);\r
- return pSelectable;\r
-}\r
-\r
-et::TargetMenu::TargetMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData , et::BattleAction& action , int position )\r
-: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )\r
-{\r
- m_action = action;\r
- m_position = position;\r
- m_pBattleData = pBattleData;\r
-\r
- m_pSelector = NULL;\r
- m_pTextureManager = pTextureManager;\r
- std::vector<mof::Window*> selectables;\r
-\r
- mof::Window* pSelectable = NULL;\r
- //\93G\83\82\83\93\83X\83^\81[\82Ì\83\8a\83X\83g\8dì\90¬\r
- std::vector<BattlerFacade*> battlerList = m_pBattleData->getBattlerGroup()->getEnemyBattlerListAlive();\r
- for(std::vector<et::BattlerFacade*>::const_iterator itr = battlerList.begin() ; itr != battlerList.end() ; ++itr){\r
- addSelectableTextItem(this , selectables , mof::Sprite::createSpriteFromText((mof::tstring)(*itr)->getParameter().name , 16) , m_pTextureManager);\r
- \r
- }\r
- m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());\r
- setVisible(true);\r
-}\r
-\r
-et::TargetMenu::~TargetMenu(void)\r
-{\r
- delete m_pSelector;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-void et::TargetMenu::setVisible(bool visible){\r
- et::MyFrame::setVisible(visible);\r
- if(visible){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(m_position ,500));\r
- pAnimation->setPosition(10 , mof::Vector2D(m_position , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(m_position , 370));\r
- pAnimation->setPosition(10 , mof::Vector2D(m_position , 500));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
-}\r
-\r
-et::MyFrame* et::TargetMenu::performAction(){\r
- int index = getSelectionModel()->getSelectingIndex();\r
- \r
- int cntEnemy = 0;\r
- for(std::vector<et::BattlerFacade*>::const_iterator itr = m_pBattleData->getBattlerGroup()->getBattlerList().begin() ;\r
- itr != m_pBattleData->getBattlerGroup()->getBattlerList().end() ; ++itr){\r
- if((*itr)->getType() != et::ENEMY || !(*itr)->getParameter().alive)continue;\r
- else if(index == cntEnemy++)m_action.pTarget = *itr;\r
- }\r
- m_pBattleData->setBattleAction(m_action);\r
-\r
- return this;\r
-}\r
-\r
-\r
+#include "TargetMenu.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MyWindow.h"
+#include "BattlerGroup.h"
+#include "BattlerFacade.h"
+
+mof::Window* addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables ,
+ mof::Sprite* pSprite , mof::TextureManager* pTextureManager){
+ mof::Window* pSelectable = new et::MyWindow(pSprite , pTextureManager);
+ pOwner->add(pSelectable);
+ selectables.push_back(pSelectable);
+ return pSelectable;
+}
+
+et::TargetMenu::TargetMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData , et::BattleAction& action , int position )
+: et::MyFrame(mof::Line2D( 0 , 0 , 200 , 300) , true , pTextureManager->getResource(_T("image/frame0.png")) )
+{
+ m_action = action;
+ m_position = position;
+ m_pBattleData = pBattleData;
+
+ m_pSelector = NULL;
+ m_pTextureManager = pTextureManager;
+ std::vector<mof::Window*> selectables;
+
+ mof::Window* pSelectable = NULL;
+ //\93G\83\82\83\93\83X\83^\81[\82Ì\83\8a\83X\83g\8dì\90¬
+ std::vector<BattlerFacade*> battlerList = m_pBattleData->getBattlerGroup()->getEnemyBattlerListAlive();
+ for(std::vector<et::BattlerFacade*>::const_iterator itr = battlerList.begin() ; itr != battlerList.end() ; ++itr){
+ addSelectableTextItem(this , selectables , mof::Sprite::createSpriteFromText((mof::tstring)(*itr)->getParameter().name , 16) , m_pTextureManager);
+
+ }
+ m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());
+ setVisible(true);
+}
+
+et::TargetMenu::~TargetMenu(void)
+{
+ delete m_pSelector;
+}
+
+
+
+
+
+void et::TargetMenu::setVisible(bool visible){
+ et::MyFrame::setVisible(visible);
+ if(visible){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(m_position ,500));
+ pAnimation->setPosition(10 , mof::Vector2D(m_position , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(m_position , 370));
+ pAnimation->setPosition(10 , mof::Vector2D(m_position , 500));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+}
+
+et::MyFrame* et::TargetMenu::performAction(){
+ int index = getSelectionModel()->getSelectingIndex();
+
+ int cntEnemy = 0;
+ for(std::vector<et::BattlerFacade*>::const_iterator itr = m_pBattleData->getBattlerGroup()->getBattlerList().begin() ;
+ itr != m_pBattleData->getBattlerGroup()->getBattlerList().end() ; ++itr){
+ if((*itr)->getType() != et::ENEMY || !(*itr)->getParameter().alive)continue;
+ else if(index == cntEnemy++)m_action.pTarget = *itr;
+ }
+ m_pBattleData->setBattleAction(m_action);
+
+ return this;
+}
+
+
-#pragma once\r
-#include "MyFrame.h"\r
-#include "mof/Texture.h"\r
-#include "BattleData.h"\r
-\r
-namespace et{\r
-\r
- class TargetMenu : public MyFrame\r
- {\r
- \r
- mof::SelectionModel* m_pSelector;\r
- mof::TextureManager* m_pTextureManager;\r
- et::BattleData* m_pBattleData;\r
-\r
- et::BattleAction m_action;\r
- int m_position;\r
- public:\r
- TargetMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData , et::BattleAction& action , int position);\r
- virtual ~TargetMenu(void);\r
- virtual void setVisible(bool visible);\r
- virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}\r
- virtual MyFrame* performAction();\r
- };\r
-\r
-\r
+#pragma once
+#include "MyFrame.h"
+#include "mof/Texture.h"
+#include "BattleData.h"
+
+namespace et{
+
+ class TargetMenu : public MyFrame
+ {
+
+ mof::SelectionModel* m_pSelector;
+ mof::TextureManager* m_pTextureManager;
+ et::BattleData* m_pBattleData;
+
+ et::BattleAction m_action;
+ int m_position;
+ public:
+ TargetMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData , et::BattleAction& action , int position);
+ virtual ~TargetMenu(void);
+ virtual void setVisible(bool visible);
+ virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}
+ virtual MyFrame* performAction();
+ };
+
+
};
\ No newline at end of file
-#include "TestScene.hpp"\r
-#include "mof/GraphicsDevice.hpp"\r
-#include <vector>\r
-#include "mof/VertexBuffer.hpp"\r
-#include "mof/AmbientLight.hpp"\r
-#include "mof/MaterialBuilder.hpp"\r
-#include "mof/Material.hpp"\r
-#include "mof/Camera.hpp"\r
-#include "mof/Texture.hpp"\r
-#include "mof/MeshBuilder.hpp"\r
-#include "mof/Graphics3D.hpp"\r
-#include "mof/mofAnimations.hpp"\r
-#include "mof/EventScheduler.hpp"\r
-#include "mof/EventCondition.hpp"\r
-#include "mof/Board.hpp"\r
-#include "mof/Font.hpp"\r
-#include "CharacterBoard.hpp"\r
-#include <vector>\r
-#include <boost/bind.hpp>\r
-#include <math.h>\r
-#include <lua.hpp>\r
-#include "mof/Finalizer.hpp"\r
-\r
-namespace \r
-{\r
-\r
- mof::AmbientLight* m_pLight;\r
- mof::Camera* m_pCamera;\r
- boost::shared_ptr<mof::Texture> m_pTexture;\r
- std::vector<::CharacterBoard*> m_modelList;\r
- mof::Graphics3D* m_pBox;\r
- mof::EventScheduler* m_pScheduler;\r
- mof::Animation<mof::Color4f>::Handler m_backgroundColor;\r
- mof::FrameNumber m_backgroundColorFrame;\r
- mof::tstring m_part;\r
-};\r
-\r
-\r
-\r
- \r
-namespace TestScene\r
-{\r
-\r
- void begin(){\r
- std::vector<mof::Animation<mof::Matrix3D>::Handler> handlerList;\r
- \r
- {\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[4];\r
- keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 25 , mof::Vector3D( mof::deg2rad(-90) , 0 , 0));\r
- keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 50 , mof::Vector3D( mof::deg2rad(-80) , 0 , 0));\r
- keyFrames[2] = std::pair<mof::FrameNumber , mof::Vector3D>( 75 , mof::Vector3D( mof::deg2rad(-25) , 0 , 0));\r
- keyFrames[3] = std::pair<mof::FrameNumber , mof::Vector3D>( 100 , mof::Vector3D( mof::deg2rad(0) , 0 , 0));\r
- mof::Animation<mof::Matrix3D>::Handler handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[3]));\r
- handlerList.push_back(handler);\r
- }\r
- {\r
- mof::Animation<mof::Matrix3D>::Handler handler(\r
- mof::constantHandler(mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0 , -4.5f)))\r
- );\r
- handlerList.push_back(handler);\r
- }\r
- {\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[3];\r
- keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D( 0 , mof::deg2rad(70) , 0));\r
- keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 130 , mof::Vector3D( 0 , mof::deg2rad(360) , 0));\r
- mof::Animation<mof::Matrix3D>::Handler handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));\r
- handler = mof::Animation<mof::Matrix3D>::Handler(new mof::LoopAnimation<mof::Matrix3D>(handler , 200));\r
- handlerList.push_back(handler);\r
- }\r
- \r
- int size = handlerList.size();\r
- handlerList.resize(size + 1);\r
-\r
- mof::tstring title[] = { _T("\82R") , _T("\94N") , _T("\91O") , _T("\82É") , _T("\8dÁ") , _T("\90Ü") , _T("\82µ") ,\r
- _T("\82½") , _T("\82q") , _T("\82o") , _T("\82f") , _T("\8aJ") , _T("\94") , _T("\82ð") , _T("\8dÄ") , _T("\8aJ") ,\r
- _T("\82µ") , _T("\82Ä") , _T("\82Ý") , _T("\82é") };\r
-\r
- for(int i = 0 ; i < 20 ; i++)\r
- {\r
- m_modelList.push_back(new ::CharacterBoard( title[i]));\r
- {\r
- mof::Animation<mof::Matrix3D>::Handler handler(\r
- mof::constantHandler(mof::Matrix3D::createRotation(mof::Vector3D(0 , mof::deg2rad(-360.0f/20 * i) , 0)))\r
- );\r
- handlerList.at(size) = handler;\r
- }\r
- mof::Animation<mof::Matrix3D>::Handler handler(new mof::CascadingAnimation<mof::Matrix3D >(handlerList.front() , handlerList.back()));\r
- m_modelList.at(i)->setWorldMatrix(handler);\r
- }\r
-\r
- \r
- {\r
- mof::MeshBuilder meshBuilder( "model/demo/box.x");\r
- m_pBox = meshBuilder.construct();\r
- handlerList.clear();\r
- \r
- {\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[2];\r
- keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D( 0 , 0 , 0));\r
- keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 130 , mof::Vector3D( mof::deg2rad(360) , mof::deg2rad(360) , mof::deg2rad(360)));\r
- mof::Animation<mof::Matrix3D>::Handler handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));\r
- handler = mof::Animation<mof::Matrix3D>::Handler(new mof::LoopAnimation<mof::Matrix3D>(handler , 130));\r
- handlerList.push_back(handler);\r
- }\r
- mof::Animation<mof::Matrix3D>::Handler handler(new mof::CascadingAnimation<mof::Matrix3D >(handlerList.front() , handlerList.back()));\r
- m_pBox->setWorldMatrix(handler);\r
- }\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[2];\r
- keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , 10.5f , -5));\r
- keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 130 , mof::Vector3D(0 , 1.5f , -10 ));\r
- mof::Animation<mof::Vector3D>::Handler handler(new mof::KeyFrameAnimation<mof::Vector3D>(keyFrames[0] , keyFrames[1]));\r
- m_pCamera->setEye(handler);\r
- }\r
- \r
- }\r
- \r
- void showTitle(){\r
- std::vector<mof::Animation<mof::Matrix3D>::Handler> handlerList;\r
- mof::Animation<mof::Matrix3D>::Handler handler;\r
- for(unsigned int i = 0 ; i < m_modelList.size() ; ++i){\r
- handlerList.clear();\r
- mof::Matrix3D matrix = m_modelList.at(i)->getWorldMatrix();\r
-\r
- {\r
- mof::Vector3D a = mof::Vector3D(1 , 0 , 0) * matrix;\r
- float rad = static_cast<float>(atan2( -a.x , -a.z));\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 20 , mof::Vector3D(0 , 0 , 0) ) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 50 , mof::Vector3D(0 , -rad , 0))\r
- };\r
- handler = mof::Animation<mof::Matrix3D>::Handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));\r
- handlerList.push_back(handler);\r
- }\r
- \r
- {\r
- handler = mof::constantHandler(matrix);\r
- handlerList.push_back(handler);\r
- }\r
- \r
- \r
- {\r
- float y = (i > 7) ? -1.0f : 0;\r
- float x = (i > 7) ? i - 8.0f : i;\r
- mof::Vector3D position(1.0f * x - 20 , y , -5);\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , 0 , 0) ) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 50 , position - m_modelList.at(i)->getPosition())\r
- };\r
- handler = mof::Animation<mof::Matrix3D>::Handler(new mof::TranslationAnimation3D(keyFrames[0] , keyFrames[1]));\r
- handlerList.push_back(handler);\r
- }\r
- handler = mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlerList.front() , handlerList.back())\r
- );\r
- m_modelList.at(i)->setWorldMatrix(handler);\r
- m_modelList.at(i)->setFinishColor(70 , 20);\r
- m_modelList.at(i)->setFrameNumber(0);\r
- }\r
- \r
- \r
-\r
- {\r
- mof::Vector3D eye = m_pCamera->getEye();\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 0 , eye) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 20 , eye) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 60 , mof::Vector3D(-16 , 1.0f , eye.z + 1)) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 70 , mof::Vector3D(-14 , -0.5f , eye.z - 8 ))\r
- };\r
- mof::Animation<mof::Vector3D>::Handler handler(new mof::KeyFrameAnimation<mof::Vector3D>(keyFrames[0] , keyFrames[3]));\r
- m_pCamera->setEye(handler);\r
- }\r
- \r
- {\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , 0 , 0)) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 20 , mof::Vector3D(0 , 0 , 0)) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 60 , mof::Vector3D(-14 , 0.0f , 0 ))\r
- };\r
- mof::Animation<mof::Vector3D>::Handler handler(new mof::KeyFrameAnimation<mof::Vector3D>(keyFrames[0] , keyFrames[2]));\r
- m_pCamera->setCenter(handler);\r
- }\r
- m_pCamera->setFrameNumber(0);\r
-\r
- {\r
- std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Color4f>( 70 , mof::Color4f(mof::createColor(0 , 20 , 55)) ) ,\r
- std::pair<mof::FrameNumber , mof::Color4f>( 90 , mof::Color4f(mof::createColor(255 , 255 , 255)) )\r
- };\r
- m_backgroundColor = mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]));\r
- m_backgroundColorFrame = 0;\r
- }\r
- }\r
-\r
- void addPart(){\r
- std::vector<mof::Animation<mof::Matrix3D>::Handler> handlerList;\r
- mof::Animation<mof::Matrix3D>::Handler handler;\r
- {\r
- \r
- handlerList.clear();\r
- std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , mof::deg2rad(270) , 0) ) ,\r
- std::pair<mof::FrameNumber , mof::Vector3D>( 40 , mof::Vector3D(0 , mof::deg2rad(360) , 0))\r
- };\r
- handler = mof::Animation<mof::Matrix3D>::Handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));\r
- handlerList.push_back(handler);\r
-\r
- handler = mof::constantHandler(mof::Matrix3D::createScaling(mof::Vector3D(4 , 1 , 1)));\r
- handlerList.push_back(handler);\r
- handler = mof::constantHandler(mof::Matrix3D::createTranslation(mof::Vector3D(-10 , -2 , -5)));\r
- handlerList.push_back(handler);\r
- handler = mof::Animation<mof::Matrix3D>::Handler(\r
- new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlerList.front() , handlerList.back())\r
- );\r
- ::CharacterBoard* pPartBoard = new ::CharacterBoard( m_part);\r
- pPartBoard->setWorldMatrix(handler);\r
- pPartBoard->setPartColor(0 , 1);\r
- m_modelList.push_back(pPartBoard);\r
- }\r
- }\r
-\r
-\r
-\r
-\r
-\r
-\r
-void initialize( )\r
-{\r
- m_pLight = NULL;\r
- m_pCamera = NULL;\r
- m_pBox = NULL;\r
- m_pScheduler = NULL;\r
- m_backgroundColorFrame = 0;\r
- m_part = _T("part7");\r
- \r
- \r
-\r
- mof::GraphicsDevice::lightEnable(true);\r
- m_pLight = new mof::AmbientLight( mof::Color4f(mof::createColor(255 , 255 , 255)));\r
-\r
- m_pCamera = new mof::Camera(mof::Vector3D(0 , 0.5f , -10) , mof::Vector3D(0 , 0 , 0) , mof::Vector3D(0 , 1 , 0));\r
- m_backgroundColor = \r
- mof::Animation<mof::Color4f>::Handler(mof::constantHandler(mof::Color4f(mof::createColor(0 , 20 , 55))));\r
-\r
- m_pScheduler = new mof::EventScheduler();\r
- m_pScheduler->addEvent( 125 , &::TestScene::showTitle );\r
- m_pScheduler->addEvent( 125+70 , &::TestScene::addPart );\r
- begin();\r
-\r
- \r
-}\r
-\r
-\r
-void finalize(){\r
- for(std::vector<::CharacterBoard*>::iterator itr = m_modelList.begin() ;\r
- itr != m_modelList.end() ;\r
- ++itr ){\r
- delete *itr;\r
- }\r
- delete m_pCamera;\r
- delete m_pBox;\r
- delete m_pScheduler;\r
- delete m_pLight;\r
- }\r
-\r
-\r
-\r
-\r
-void update(){\r
- for(std::vector<::CharacterBoard*>::iterator itr = m_modelList.begin() ;\r
- itr != m_modelList.end() ;\r
- ++itr ){\r
- (*itr)->update();\r
- }\r
- m_pBox->update();\r
- m_pScheduler->update();\r
- m_pCamera->nextFrame();\r
- m_backgroundColorFrame++;\r
-}\r
-\r
-\r
-\r
-void draw()\r
-{\r
- mof::GraphicsDevice::lightEnable(true);\r
- //m_pGraphics->setZBuffer(false);\r
- mof::GraphicsDevice::setViewTransform(m_pCamera->getViewMatrix());\r
- mof::GraphicsDevice::clearRenderTarget(m_backgroundColor->getValue(m_backgroundColorFrame).toColorCode());\r
- mof::GraphicsDevice::clearZBuffer();\r
- mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);\r
- \r
- //m_pBox->draw();\r
- mof::GraphicsDevice::lightEnable(false);\r
- std::list<mof::Board*> boardList;\r
-\r
- for(std::vector<::CharacterBoard*>::iterator itr = m_modelList.begin() ;\r
- itr != m_modelList.end() ;\r
- ++itr ){\r
- (*itr)->append(boardList);\r
- }\r
-\r
- for(std::list<mof::Board*>::iterator itr = boardList.begin() ;\r
- itr != boardList.end() ;\r
- ++itr ){\r
- (*itr)->draw();\r
- }\r
-\r
-\r
-\r
-}\r
-\r
-} // namespace TestScene\r
+#include "TestScene.hpp"
+#include "mof/GraphicsDevice.hpp"
+#include <vector>
+#include "mof/VertexBuffer.hpp"
+#include "mof/AmbientLight.hpp"
+#include "mof/MaterialBuilder.hpp"
+#include "mof/Material.hpp"
+#include "mof/Camera.hpp"
+#include "mof/Texture.hpp"
+#include "mof/MeshBuilder.hpp"
+#include "mof/Graphics3D.hpp"
+#include "mof/mofAnimations.hpp"
+#include "mof/EventScheduler.hpp"
+#include "mof/EventCondition.hpp"
+#include "mof/Board.hpp"
+#include "mof/Font.hpp"
+#include "CharacterBoard.hpp"
+#include <vector>
+#include <boost/bind.hpp>
+#include <math.h>
+#include <lua.hpp>
+#include "mof/Finalizer.hpp"
+
+namespace
+{
+
+ mof::AmbientLight* m_pLight;
+ mof::Camera* m_pCamera;
+ boost::shared_ptr<mof::Texture> m_pTexture;
+ std::vector<::CharacterBoard*> m_modelList;
+ mof::Graphics3D* m_pBox;
+ mof::EventScheduler* m_pScheduler;
+ mof::Animation<mof::Color4f>::Handler m_backgroundColor;
+ mof::FrameNumber m_backgroundColorFrame;
+ mof::tstring m_part;
+};
+
+
+
+
+namespace TestScene
+{
+
+ void begin(){
+ std::vector<mof::Animation<mof::Matrix3D>::Handler> handlerList;
+
+ {
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[4];
+ keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 25 , mof::Vector3D( mof::deg2rad(-90) , 0 , 0));
+ keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 50 , mof::Vector3D( mof::deg2rad(-80) , 0 , 0));
+ keyFrames[2] = std::pair<mof::FrameNumber , mof::Vector3D>( 75 , mof::Vector3D( mof::deg2rad(-25) , 0 , 0));
+ keyFrames[3] = std::pair<mof::FrameNumber , mof::Vector3D>( 100 , mof::Vector3D( mof::deg2rad(0) , 0 , 0));
+ mof::Animation<mof::Matrix3D>::Handler handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[3]));
+ handlerList.push_back(handler);
+ }
+ {
+ mof::Animation<mof::Matrix3D>::Handler handler(
+ mof::constantHandler(mof::Matrix3D::createTranslation(mof::Vector3D(0 , 0 , -4.5f)))
+ );
+ handlerList.push_back(handler);
+ }
+ {
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[3];
+ keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D( 0 , mof::deg2rad(70) , 0));
+ keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 130 , mof::Vector3D( 0 , mof::deg2rad(360) , 0));
+ mof::Animation<mof::Matrix3D>::Handler handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));
+ handler = mof::Animation<mof::Matrix3D>::Handler(new mof::LoopAnimation<mof::Matrix3D>(handler , 200));
+ handlerList.push_back(handler);
+ }
+
+ int size = handlerList.size();
+ handlerList.resize(size + 1);
+
+ mof::tstring title[] = { _T("\82R") , _T("\94N") , _T("\91O") , _T("\82É") , _T("\8dÁ") , _T("\90Ü") , _T("\82µ") ,
+ _T("\82½") , _T("\82q") , _T("\82o") , _T("\82f") , _T("\8aJ") , _T("\94") , _T("\82ð") , _T("\8dÄ") , _T("\8aJ") ,
+ _T("\82µ") , _T("\82Ä") , _T("\82Ý") , _T("\82é") };
+
+ for(int i = 0 ; i < 20 ; i++)
+ {
+ m_modelList.push_back(new ::CharacterBoard( title[i]));
+ {
+ mof::Animation<mof::Matrix3D>::Handler handler(
+ mof::constantHandler(mof::Matrix3D::createRotation(mof::Vector3D(0 , mof::deg2rad(-360.0f/20 * i) , 0)))
+ );
+ handlerList.at(size) = handler;
+ }
+ mof::Animation<mof::Matrix3D>::Handler handler(new mof::CascadingAnimation<mof::Matrix3D >(handlerList.front() , handlerList.back()));
+ m_modelList.at(i)->setWorldMatrix(handler);
+ }
+
+
+ {
+ mof::MeshBuilder meshBuilder( "model/demo/box.x");
+ m_pBox = meshBuilder.construct();
+ handlerList.clear();
+
+ {
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[2];
+ keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D( 0 , 0 , 0));
+ keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 130 , mof::Vector3D( mof::deg2rad(360) , mof::deg2rad(360) , mof::deg2rad(360)));
+ mof::Animation<mof::Matrix3D>::Handler handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));
+ handler = mof::Animation<mof::Matrix3D>::Handler(new mof::LoopAnimation<mof::Matrix3D>(handler , 130));
+ handlerList.push_back(handler);
+ }
+ mof::Animation<mof::Matrix3D>::Handler handler(new mof::CascadingAnimation<mof::Matrix3D >(handlerList.front() , handlerList.back()));
+ m_pBox->setWorldMatrix(handler);
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[2];
+ keyFrames[0] = std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , 10.5f , -5));
+ keyFrames[1] = std::pair<mof::FrameNumber , mof::Vector3D>( 130 , mof::Vector3D(0 , 1.5f , -10 ));
+ mof::Animation<mof::Vector3D>::Handler handler(new mof::KeyFrameAnimation<mof::Vector3D>(keyFrames[0] , keyFrames[1]));
+ m_pCamera->setEye(handler);
+ }
+
+ }
+
+ void showTitle(){
+ std::vector<mof::Animation<mof::Matrix3D>::Handler> handlerList;
+ mof::Animation<mof::Matrix3D>::Handler handler;
+ for(unsigned int i = 0 ; i < m_modelList.size() ; ++i){
+ handlerList.clear();
+ mof::Matrix3D matrix = m_modelList.at(i)->getWorldMatrix();
+
+ {
+ mof::Vector3D a = mof::Vector3D(1 , 0 , 0) * matrix;
+ float rad = static_cast<float>(atan2( -a.x , -a.z));
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Vector3D>( 20 , mof::Vector3D(0 , 0 , 0) ) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 50 , mof::Vector3D(0 , -rad , 0))
+ };
+ handler = mof::Animation<mof::Matrix3D>::Handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));
+ handlerList.push_back(handler);
+ }
+
+ {
+ handler = mof::constantHandler(matrix);
+ handlerList.push_back(handler);
+ }
+
+
+ {
+ float y = (i > 7) ? -1.0f : 0;
+ float x = (i > 7) ? i - 8.0f : i;
+ mof::Vector3D position(1.0f * x - 20 , y , -5);
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , 0 , 0) ) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 50 , position - m_modelList.at(i)->getPosition())
+ };
+ handler = mof::Animation<mof::Matrix3D>::Handler(new mof::TranslationAnimation3D(keyFrames[0] , keyFrames[1]));
+ handlerList.push_back(handler);
+ }
+ handler = mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlerList.front() , handlerList.back())
+ );
+ m_modelList.at(i)->setWorldMatrix(handler);
+ m_modelList.at(i)->setFinishColor(70 , 20);
+ m_modelList.at(i)->setFrameNumber(0);
+ }
+
+
+
+ {
+ mof::Vector3D eye = m_pCamera->getEye();
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Vector3D>( 0 , eye) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 20 , eye) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 60 , mof::Vector3D(-16 , 1.0f , eye.z + 1)) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 70 , mof::Vector3D(-14 , -0.5f , eye.z - 8 ))
+ };
+ mof::Animation<mof::Vector3D>::Handler handler(new mof::KeyFrameAnimation<mof::Vector3D>(keyFrames[0] , keyFrames[3]));
+ m_pCamera->setEye(handler);
+ }
+
+ {
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , 0 , 0)) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 20 , mof::Vector3D(0 , 0 , 0)) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 60 , mof::Vector3D(-14 , 0.0f , 0 ))
+ };
+ mof::Animation<mof::Vector3D>::Handler handler(new mof::KeyFrameAnimation<mof::Vector3D>(keyFrames[0] , keyFrames[2]));
+ m_pCamera->setCenter(handler);
+ }
+ m_pCamera->setFrameNumber(0);
+
+ {
+ std::pair<mof::FrameNumber , mof::Color4f> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Color4f>( 70 , mof::Color4f(mof::createColor(0 , 20 , 55)) ) ,
+ std::pair<mof::FrameNumber , mof::Color4f>( 90 , mof::Color4f(mof::createColor(255 , 255 , 255)) )
+ };
+ m_backgroundColor = mof::Animation<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[1]));
+ m_backgroundColorFrame = 0;
+ }
+ }
+
+ void addPart(){
+ std::vector<mof::Animation<mof::Matrix3D>::Handler> handlerList;
+ mof::Animation<mof::Matrix3D>::Handler handler;
+ {
+
+ handlerList.clear();
+ std::pair<mof::FrameNumber , mof::Vector3D> keyFrames[] = {
+ std::pair<mof::FrameNumber , mof::Vector3D>( 0 , mof::Vector3D(0 , mof::deg2rad(270) , 0) ) ,
+ std::pair<mof::FrameNumber , mof::Vector3D>( 40 , mof::Vector3D(0 , mof::deg2rad(360) , 0))
+ };
+ handler = mof::Animation<mof::Matrix3D>::Handler(new mof::RotationAnimation3D(keyFrames[0] , keyFrames[1]));
+ handlerList.push_back(handler);
+
+ handler = mof::constantHandler(mof::Matrix3D::createScaling(mof::Vector3D(4 , 1 , 1)));
+ handlerList.push_back(handler);
+ handler = mof::constantHandler(mof::Matrix3D::createTranslation(mof::Vector3D(-10 , -2 , -5)));
+ handlerList.push_back(handler);
+ handler = mof::Animation<mof::Matrix3D>::Handler(
+ new mof::CascadingAnimation<mof::Matrix3D , mof::Multiply<mof::Matrix3D>>(handlerList.front() , handlerList.back())
+ );
+ ::CharacterBoard* pPartBoard = new ::CharacterBoard( m_part);
+ pPartBoard->setWorldMatrix(handler);
+ pPartBoard->setPartColor(0 , 1);
+ m_modelList.push_back(pPartBoard);
+ }
+ }
+
+
+
+
+
+
+void initialize( )
+{
+ m_pLight = NULL;
+ m_pCamera = NULL;
+ m_pBox = NULL;
+ m_pScheduler = NULL;
+ m_backgroundColorFrame = 0;
+ m_part = _T("part7");
+
+
+
+ mof::GraphicsDevice::lightEnable(true);
+ m_pLight = new mof::AmbientLight( mof::Color4f(mof::createColor(255 , 255 , 255)));
+
+ m_pCamera = new mof::Camera(mof::Vector3D(0 , 0.5f , -10) , mof::Vector3D(0 , 0 , 0) , mof::Vector3D(0 , 1 , 0));
+ m_backgroundColor =
+ mof::Animation<mof::Color4f>::Handler(mof::constantHandler(mof::Color4f(mof::createColor(0 , 20 , 55))));
+
+ m_pScheduler = new mof::EventScheduler();
+ m_pScheduler->addEvent( 125 , &::TestScene::showTitle );
+ m_pScheduler->addEvent( 125+70 , &::TestScene::addPart );
+ begin();
+
+
+}
+
+
+void finalize(){
+ for(std::vector<::CharacterBoard*>::iterator itr = m_modelList.begin() ;
+ itr != m_modelList.end() ;
+ ++itr ){
+ delete *itr;
+ }
+ delete m_pCamera;
+ delete m_pBox;
+ delete m_pScheduler;
+ delete m_pLight;
+ }
+
+
+
+
+void update(){
+ for(std::vector<::CharacterBoard*>::iterator itr = m_modelList.begin() ;
+ itr != m_modelList.end() ;
+ ++itr ){
+ (*itr)->update();
+ }
+ m_pBox->update();
+ m_pScheduler->update();
+ m_pCamera->nextFrame();
+ m_backgroundColorFrame++;
+}
+
+
+
+void draw()
+{
+ mof::GraphicsDevice::lightEnable(true);
+ //m_pGraphics->setZBuffer(false);
+ mof::GraphicsDevice::setViewTransform(m_pCamera->getViewMatrix());
+ mof::GraphicsDevice::clearRenderTarget(m_backgroundColor->getValue(m_backgroundColorFrame).toColorCode());
+ mof::GraphicsDevice::clearZBuffer();
+ mof::GraphicsDevice::setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);
+
+ //m_pBox->draw();
+ mof::GraphicsDevice::lightEnable(false);
+ std::list<mof::Board*> boardList;
+
+ for(std::vector<::CharacterBoard*>::iterator itr = m_modelList.begin() ;
+ itr != m_modelList.end() ;
+ ++itr ){
+ (*itr)->append(boardList);
+ }
+
+ for(std::list<mof::Board*>::iterator itr = boardList.begin() ;
+ itr != boardList.end() ;
+ ++itr ){
+ (*itr)->draw();
+ }
+
+
+
+}
+
+} // namespace TestScene
-#include "UsingBattleItemMenu.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MyWindow.h"\r
-#include "TargetMenu.h"\r
-#include "BattleData.h"\r
-#include "BattlerGroup.h"\r
-#include "BattlerFacade.h"\r
-\r
-mof::Window* et::UsingBattleItemMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){\r
- mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);\r
- pOwner->add(pSelectable);\r
- selectables.push_back(pSelectable);\r
- return pSelectable;\r
-}\r
-\r
-et::UsingBattleItemMenu::UsingBattleItemMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )\r
-: et::ItemOperationMenu(pTextureManager->getResource(_T("image/frame0.png")) )\r
-{\r
- m_pBattleData = pBattleData;\r
-\r
- m_pSelector = NULL;\r
- m_pTextureManager = pTextureManager;\r
- std::vector<mof::Window*> selectables;\r
-\r
- mof::Window* pSelectable = NULL;\r
- addSelectableTextItem(this , selectables , _T("\82Â\82©\82¤") , 16);\r
- \r
- m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());\r
- setVisible(true);\r
-}\r
-\r
-et::UsingBattleItemMenu::~UsingBattleItemMenu(void)\r
-{\r
- delete m_pSelector;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-void et::UsingBattleItemMenu::setVisible(bool visible){\r
- et::MyFrame::setVisible(visible);\r
- if(visible){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(160 ,500));\r
- pAnimation->setPosition(10 , mof::Vector2D(160 , 370));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(160 , 370));\r
- pAnimation->setPosition(10 , mof::Vector2D(160 , 500));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
-}\r
-\r
-et::MyFrame* et::UsingBattleItemMenu::performAction(){\r
- et::BattleAction action;\r
- action.type = et::BattleAction::USE_ITEM;\r
- action.pTargetItem = m_pItemData;\r
- action.pTarget = m_pBattleData->getBattlerGroup()->getHeroBattler();\r
- m_pBattleData->setBattleAction(action);\r
- return this;\r
-}\r
-\r
-\r
-\r
-\r
-et::UsingBattleItemMenuFactory::UsingBattleItemMenuFactory(mof::TextureManager* pTextureManager , et::BattleData* pBattleData){\r
- m_pTextureManager = pTextureManager;\r
- m_pBattleData = pBattleData;\r
-}\r
-\r
-et::UsingBattleItemMenuFactory::~UsingBattleItemMenuFactory(){\r
-\r
-}\r
-\r
-et::ItemOperationMenu* et::UsingBattleItemMenuFactory::create(){\r
- return new UsingBattleItemMenu(m_pTextureManager , m_pBattleData);\r
+#include "UsingBattleItemMenu.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MyWindow.h"
+#include "TargetMenu.h"
+#include "BattleData.h"
+#include "BattlerGroup.h"
+#include "BattlerFacade.h"
+
+mof::Window* et::UsingBattleItemMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){
+ mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);
+ pOwner->add(pSelectable);
+ selectables.push_back(pSelectable);
+ return pSelectable;
+}
+
+et::UsingBattleItemMenu::UsingBattleItemMenu( mof::TextureManager* pTextureManager , et::BattleData* pBattleData )
+: et::ItemOperationMenu(pTextureManager->getResource(_T("image/frame0.png")) )
+{
+ m_pBattleData = pBattleData;
+
+ m_pSelector = NULL;
+ m_pTextureManager = pTextureManager;
+ std::vector<mof::Window*> selectables;
+
+ mof::Window* pSelectable = NULL;
+ addSelectableTextItem(this , selectables , _T("\82Â\82©\82¤") , 16);
+
+ m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());
+ setVisible(true);
+}
+
+et::UsingBattleItemMenu::~UsingBattleItemMenu(void)
+{
+ delete m_pSelector;
+}
+
+
+
+
+
+void et::UsingBattleItemMenu::setVisible(bool visible){
+ et::MyFrame::setVisible(visible);
+ if(visible){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(160 ,500));
+ pAnimation->setPosition(10 , mof::Vector2D(160 , 370));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(160 , 370));
+ pAnimation->setPosition(10 , mof::Vector2D(160 , 500));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+}
+
+et::MyFrame* et::UsingBattleItemMenu::performAction(){
+ et::BattleAction action;
+ action.type = et::BattleAction::USE_ITEM;
+ action.pTargetItem = m_pItemData;
+ action.pTarget = m_pBattleData->getBattlerGroup()->getHeroBattler();
+ m_pBattleData->setBattleAction(action);
+ return this;
+}
+
+
+
+
+et::UsingBattleItemMenuFactory::UsingBattleItemMenuFactory(mof::TextureManager* pTextureManager , et::BattleData* pBattleData){
+ m_pTextureManager = pTextureManager;
+ m_pBattleData = pBattleData;
+}
+
+et::UsingBattleItemMenuFactory::~UsingBattleItemMenuFactory(){
+
+}
+
+et::ItemOperationMenu* et::UsingBattleItemMenuFactory::create(){
+ return new UsingBattleItemMenu(m_pTextureManager , m_pBattleData);
}
\ No newline at end of file
-#pragma once\r
-#include "MyFrame.h"\r
-#include "mof/Texture.h"\r
-#include "ItemOperationMenu.h"\r
-\r
-\r
-namespace et{\r
- class BattleData;\r
-\r
- class UsingBattleItemMenu : public ItemOperationMenu\r
- {\r
- mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);\r
- \r
- mof::SelectionModel* m_pSelector;\r
- mof::TextureManager* m_pTextureManager;\r
- \r
- et::BattleData* m_pBattleData;\r
-\r
- public:\r
- UsingBattleItemMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);\r
- virtual ~UsingBattleItemMenu(void);\r
- virtual void setVisible(bool visible);\r
- virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}\r
- virtual MyFrame* performAction();\r
- };\r
-\r
- class UsingBattleItemMenuFactory : public ItemOperatorFactory{\r
- mof::TextureManager* m_pTextureManager;\r
- et::BattleData* m_pBattleData;\r
- public:\r
- UsingBattleItemMenuFactory(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);\r
- virtual ~UsingBattleItemMenuFactory();\r
- virtual ItemOperationMenu* create();\r
-\r
- };\r
-\r
-\r
+#pragma once
+#include "MyFrame.h"
+#include "mof/Texture.h"
+#include "ItemOperationMenu.h"
+
+
+namespace et{
+ class BattleData;
+
+ class UsingBattleItemMenu : public ItemOperationMenu
+ {
+ mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);
+
+ mof::SelectionModel* m_pSelector;
+ mof::TextureManager* m_pTextureManager;
+
+ et::BattleData* m_pBattleData;
+
+ public:
+ UsingBattleItemMenu(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);
+ virtual ~UsingBattleItemMenu(void);
+ virtual void setVisible(bool visible);
+ virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}
+ virtual MyFrame* performAction();
+ };
+
+ class UsingBattleItemMenuFactory : public ItemOperatorFactory{
+ mof::TextureManager* m_pTextureManager;
+ et::BattleData* m_pBattleData;
+ public:
+ UsingBattleItemMenuFactory(mof::TextureManager* pTextureManager , et::BattleData* pBattleData);
+ virtual ~UsingBattleItemMenuFactory();
+ virtual ItemOperationMenu* create();
+
+ };
+
+
};
\ No newline at end of file
-#include "World.h"\r
-#include "mof/ConsoleIO.h"\r
-\r
-\r
-\r
-\r
-et::World::World(std::vector<et::RegenerationEvent>& regenerationHistory)\r
-{\r
- m_regenerationLevel = 0;\r
- m_term = 0;\r
- int regenePoint = 0;\r
-\r
- std::vector<et::RegenerationEvent> stock;\r
- \r
- m_pAreaMap = new et::AreaMap(10 , 10);\r
- for(int i = 0 ; i < regenerationHistory.size() ; i++){\r
- et::RegenerationEvent event = regenerationHistory.at(i);\r
- if(event.isSleepEvent()){\r
- m_term++;\r
- for(int j = 0 ; j < stock.size() ; j++){\r
- regenePoint += updateAreaPowerLevel(stock.at(j).position , stock.at(j));\r
- }\r
- stock.clear();\r
- }\r
- else stock.push_back(event);\r
- }\r
- \r
- for(int i = 0 ; i < stock.size() ; i++){\r
- //\94z\92u\8dÏ\82Ý\83G\83\8c\83\81\83\93\83g\82Æ\82µ\82Ä\8f\88\97\9d\r
- et::Area area = m_pAreaMap->get(stock.at(i).position.x , stock.at(i).position.y);\r
- if(stock.at(i).forest)area.forestGen = true;\r
- }\r
- m_regenerationLevel = regenePoint / 10;\r
-}\r
-\r
-et::World::~World(void)\r
-{\r
- delete m_pAreaMap;\r
-}\r
-\r
-\r
-int et::World::updateAreaPowerLevel(mof::Vector2D& position , et::RegenerationEvent& event){\r
- int regenePoint = 0;\r
- static int tableX[] = { -1 , 0 , 1 , -1 , 0 , 1 , -1 , 0 , 1};\r
- static int tableY[] = { -1 , -1 , -1 , 0 , 0 , 0 , 1 , 1 , 1};\r
- static int tableEffect[] = { 1 , 3 , 1 , 3 , 5 , 3 , 1 , 3 , 1};\r
- for(int i = 0 ; i < 9 ; i++){\r
- mof::Vector2D target = position;\r
- target.x += tableX[i];\r
- target.y += tableY[i];\r
- if(0 <= target.x && target.x < m_pAreaMap->getWidth() && 0 <= target.y && target.y < m_pAreaMap->getHeight() ){\r
- et::Area area = m_pAreaMap->get(target.x , target.y);\r
- if(event.forest){\r
- int tmp = area.powerLevel.forest;\r
- area.powerLevel.forest += tableEffect[i]; \r
- if(area.powerLevel.forest > 9)area.powerLevel.forest = 9;\r
- regenePoint += area.powerLevel.forest - tmp;\r
- }\r
- m_pAreaMap->set(target.x , target.y , area);\r
- }\r
- \r
- }\r
- return regenePoint;\r
- \r
-}\r
-\r
-et::Area& et::World::getArea(int x , int y){\r
- return m_pAreaMap->get(x , y);\r
-}\r
-\r
-void et::World::setArea(int x , int y , et::Area& area){\r
- m_pAreaMap->set(x , y , area);\r
-}\r
-\r
-\r
-\r
-et::AreaPowerLevelMap et::World::getAreaPowerLevelMap(){\r
- et::AreaPowerLevelMap powerLevelMap(m_pAreaMap->getWidth() , m_pAreaMap->getHeight());\r
- for(int x = 0 ; x < powerLevelMap.getWidth() ; x++){\r
- for(int y = 0 ; y < powerLevelMap.getHeight() ; y++)powerLevelMap.set(x , y , m_pAreaMap->get(x , y).powerLevel);\r
- }\r
- return powerLevelMap;\r
-}\r
+#include "World.h"
+#include "mof/ConsoleIO.h"
+
+
+
+
+et::World::World(std::vector<et::RegenerationEvent>& regenerationHistory)
+{
+ m_regenerationLevel = 0;
+ m_term = 0;
+ int regenePoint = 0;
+
+ std::vector<et::RegenerationEvent> stock;
+
+ m_pAreaMap = new et::AreaMap(10 , 10);
+ for(int i = 0 ; i < regenerationHistory.size() ; i++){
+ et::RegenerationEvent event = regenerationHistory.at(i);
+ if(event.isSleepEvent()){
+ m_term++;
+ for(int j = 0 ; j < stock.size() ; j++){
+ regenePoint += updateAreaPowerLevel(stock.at(j).position , stock.at(j));
+ }
+ stock.clear();
+ }
+ else stock.push_back(event);
+ }
+
+ for(int i = 0 ; i < stock.size() ; i++){
+ //\94z\92u\8dÏ\82Ý\83G\83\8c\83\81\83\93\83g\82Æ\82µ\82Ä\8f\88\97\9d
+ et::Area area = m_pAreaMap->get(stock.at(i).position.x , stock.at(i).position.y);
+ if(stock.at(i).forest)area.forestGen = true;
+ }
+ m_regenerationLevel = regenePoint / 10;
+}
+
+et::World::~World(void)
+{
+ delete m_pAreaMap;
+}
+
+
+int et::World::updateAreaPowerLevel(mof::Vector2D& position , et::RegenerationEvent& event){
+ int regenePoint = 0;
+ static int tableX[] = { -1 , 0 , 1 , -1 , 0 , 1 , -1 , 0 , 1};
+ static int tableY[] = { -1 , -1 , -1 , 0 , 0 , 0 , 1 , 1 , 1};
+ static int tableEffect[] = { 1 , 3 , 1 , 3 , 5 , 3 , 1 , 3 , 1};
+ for(int i = 0 ; i < 9 ; i++){
+ mof::Vector2D target = position;
+ target.x += tableX[i];
+ target.y += tableY[i];
+ if(0 <= target.x && target.x < m_pAreaMap->getWidth() && 0 <= target.y && target.y < m_pAreaMap->getHeight() ){
+ et::Area area = m_pAreaMap->get(target.x , target.y);
+ if(event.forest){
+ int tmp = area.powerLevel.forest;
+ area.powerLevel.forest += tableEffect[i];
+ if(area.powerLevel.forest > 9)area.powerLevel.forest = 9;
+ regenePoint += area.powerLevel.forest - tmp;
+ }
+ m_pAreaMap->set(target.x , target.y , area);
+ }
+
+ }
+ return regenePoint;
+
+}
+
+et::Area& et::World::getArea(int x , int y){
+ return m_pAreaMap->get(x , y);
+}
+
+void et::World::setArea(int x , int y , et::Area& area){
+ m_pAreaMap->set(x , y , area);
+}
+
+
+
+et::AreaPowerLevelMap et::World::getAreaPowerLevelMap(){
+ et::AreaPowerLevelMap powerLevelMap(m_pAreaMap->getWidth() , m_pAreaMap->getHeight());
+ for(int x = 0 ; x < powerLevelMap.getWidth() ; x++){
+ for(int y = 0 ; y < powerLevelMap.getHeight() ; y++)powerLevelMap.set(x , y , m_pAreaMap->get(x , y).powerLevel);
+ }
+ return powerLevelMap;
+}
-#pragma once\r
-#include "Area.h"\r
-#include "mof/Vector2D.h"\r
-#include <vector>\r
-\r
-namespace et{\r
- struct RegenerationEvent{\r
- int term;\r
- mof::Vector2D position;\r
- bool forest;\r
- bool earth;\r
-\r
- static RegenerationEvent createSleepEvent(int currentTerm ){\r
- RegenerationEvent event;\r
- event.term = currentTerm;\r
- event.forest = event.earth = false;\r
- return event;\r
- }\r
-\r
- static RegenerationEvent createForestGenEvent(int currentTerm , mof::Vector2D _position){\r
- RegenerationEvent event; \r
- event.position = _position;\r
- event.forest = true;\r
- event.earth = false;\r
- event.term = currentTerm;\r
- return event;\r
- }\r
-\r
- bool isSleepEvent(){\r
- return (!forest && !earth);\r
- }\r
- };\r
-\r
-\r
-\r
- class World\r
- {\r
- et::AreaMap* m_pAreaMap;\r
- int m_regenerationLevel;\r
- int m_term;\r
-\r
- int updateAreaPowerLevel(mof::Vector2D& position , et::RegenerationEvent& event);\r
- public:\r
- World(std::vector<et::RegenerationEvent>& regenerationHistory);\r
- ~World(void);\r
-\r
-\r
- et::Area& getArea(int x , int y);\r
- void setArea(int x , int y , et::Area& area);\r
- et::AreaPowerLevelMap getAreaPowerLevelMap();\r
- int getRegenerationLevel(){return m_regenerationLevel;}\r
- int getTerm(){return m_term;}\r
- \r
- int getAreaWidth(){return m_pAreaMap->getWidth();}\r
- int getAreaHeight(){return m_pAreaMap->getHeight();}\r
- };\r
-\r
-\r
-\r
+#pragma once
+#include "Area.h"
+#include "mof/Vector2D.h"
+#include <vector>
+
+namespace et{
+ struct RegenerationEvent{
+ int term;
+ mof::Vector2D position;
+ bool forest;
+ bool earth;
+
+ static RegenerationEvent createSleepEvent(int currentTerm ){
+ RegenerationEvent event;
+ event.term = currentTerm;
+ event.forest = event.earth = false;
+ return event;
+ }
+
+ static RegenerationEvent createForestGenEvent(int currentTerm , mof::Vector2D _position){
+ RegenerationEvent event;
+ event.position = _position;
+ event.forest = true;
+ event.earth = false;
+ event.term = currentTerm;
+ return event;
+ }
+
+ bool isSleepEvent(){
+ return (!forest && !earth);
+ }
+ };
+
+
+
+ class World
+ {
+ et::AreaMap* m_pAreaMap;
+ int m_regenerationLevel;
+ int m_term;
+
+ int updateAreaPowerLevel(mof::Vector2D& position , et::RegenerationEvent& event);
+ public:
+ World(std::vector<et::RegenerationEvent>& regenerationHistory);
+ ~World(void);
+
+
+ et::Area& getArea(int x , int y);
+ void setArea(int x , int y , et::Area& area);
+ et::AreaPowerLevelMap getAreaPowerLevelMap();
+ int getRegenerationLevel(){return m_regenerationLevel;}
+ int getTerm(){return m_term;}
+
+ int getAreaWidth(){return m_pAreaMap->getWidth();}
+ int getAreaHeight(){return m_pAreaMap->getHeight();}
+ };
+
+
+
};
\ No newline at end of file
-#include "WorldMapBuilder.h"\r
-#include "MapImageColor.h"\r
-#include "mof/ConsoleIO.h"\r
-\r
-\r
-et::WorldMapBuilder::WorldMapBuilder(et::AreaPowerLevelMap &map , mof::TextureManager* pTextureManager , float scale)\r
-: et::MapBuilder( pTextureManager , scale , map.getWidth() , map.getHeight()) , m_map(map)\r
-{\r
- m_pTexture = m_pTextureManager->getResource(_T("image/worldtip.png"));\r
-}\r
-\r
-et::WorldMapBuilder::~WorldMapBuilder(void)\r
-{\r
-}\r
-\r
-void et::WorldMapBuilder::addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y){\r
- \r
- const float SCALE = getScale();\r
- et::VertexTypeDungeon vertex;\r
- vertex.y = 0.0f;\r
- float t = 0.0001f;//\83e\83N\83X\83`\83\83\8b«\8aE\95â\90³\r
- const float tmpTexel = 32.0f / (float)m_pTexture->getWidth();\r
- vertex.color = mof::createColor(255 , 255 , 255);\r
- float tableX[]={ 0.0f , SCALE , SCALE , SCALE , 0.0f , 0.0f};\r
- float tableZ[]={ 0.0f , 0.0f , -SCALE , -SCALE , -SCALE , 0.0f};\r
- float tableTU[]={ 0.0f+t , tmpTexel-t , tmpTexel-t , tmpTexel-t , 0.0f+t , 0.0f+t};\r
- float tableTV[]={ 0.0f+t, 0.0f+t , tmpTexel-t , tmpTexel-t , tmpTexel-t , 0.0f+t};\r
-\r
-\r
- float toForestLevelTable[] = {0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 5 };\r
- for(int i = 0 ; i < 6 ; i++){\r
- vertex.x = tableX[i] + SCALE * x;\r
- vertex.z = tableZ[i] - SCALE * y;\r
- vertex.tu = tableTU[i] + toForestLevelTable[getMap().get(x , y).forest] * tmpTexel;\r
- vertex.tv = tableTV[i];\r
- vertices.push_back(vertex);\r
- \r
- }\r
- return;\r
-\r
- \r
+#include "WorldMapBuilder.h"
+#include "MapImageColor.h"
+#include "mof/ConsoleIO.h"
+
+
+et::WorldMapBuilder::WorldMapBuilder(et::AreaPowerLevelMap &map , mof::TextureManager* pTextureManager , float scale)
+: et::MapBuilder( pTextureManager , scale , map.getWidth() , map.getHeight()) , m_map(map)
+{
+ m_pTexture = m_pTextureManager->getResource(_T("image/worldtip.png"));
+}
+
+et::WorldMapBuilder::~WorldMapBuilder(void)
+{
+}
+
+void et::WorldMapBuilder::addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y){
+
+ const float SCALE = getScale();
+ et::VertexTypeDungeon vertex;
+ vertex.y = 0.0f;
+ float t = 0.0001f;//\83e\83N\83X\83`\83\83\8b«\8aE\95â\90³
+ const float tmpTexel = 32.0f / (float)m_pTexture->getWidth();
+ vertex.color = mof::createColor(255 , 255 , 255);
+ float tableX[]={ 0.0f , SCALE , SCALE , SCALE , 0.0f , 0.0f};
+ float tableZ[]={ 0.0f , 0.0f , -SCALE , -SCALE , -SCALE , 0.0f};
+ float tableTU[]={ 0.0f+t , tmpTexel-t , tmpTexel-t , tmpTexel-t , 0.0f+t , 0.0f+t};
+ float tableTV[]={ 0.0f+t, 0.0f+t , tmpTexel-t , tmpTexel-t , tmpTexel-t , 0.0f+t};
+
+
+ float toForestLevelTable[] = {0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 5 };
+ for(int i = 0 ; i < 6 ; i++){
+ vertex.x = tableX[i] + SCALE * x;
+ vertex.z = tableZ[i] - SCALE * y;
+ vertex.tu = tableTU[i] + toForestLevelTable[getMap().get(x , y).forest] * tmpTexel;
+ vertex.tv = tableTV[i];
+ vertices.push_back(vertex);
+
+ }
+ return;
+
+
}
\ No newline at end of file
-#pragma once\r
-#include "DungeonBuilder.h"\r
-#include "mof/GeneralMap.h"\r
-#include "Area.h"\r
-\r
-namespace et{\r
- \r
-\r
- class WorldMapBuilder : public MapBuilder\r
- {\r
- et::AreaPowerLevelMap m_map;\r
- mof::TextureResource m_pTexture;\r
- protected:\r
- et::AreaPowerLevelMap& getMap(){return m_map;}\r
- virtual void addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y);\r
-\r
- public:\r
- WorldMapBuilder(et::AreaPowerLevelMap &map , mof::TextureManager* pTextureManager , float scale);\r
- virtual ~WorldMapBuilder(void);\r
- };\r
-\r
-\r
-};\r
+#pragma once
+#include "DungeonBuilder.h"
+#include "mof/GeneralMap.h"
+#include "Area.h"
+
+namespace et{
+
+
+ class WorldMapBuilder : public MapBuilder
+ {
+ et::AreaPowerLevelMap m_map;
+ mof::TextureResource m_pTexture;
+ protected:
+ et::AreaPowerLevelMap& getMap(){return m_map;}
+ virtual void addParts(std::vector<et::VertexTypeDungeon>& vertices , int x , int y);
+
+ public:
+ WorldMapBuilder(et::AreaPowerLevelMap &map , mof::TextureManager* pTextureManager , float scale);
+ virtual ~WorldMapBuilder(void);
+ };
+
+
+};
-#include "WorldMapCursor.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "mof/ConsoleIO.h"\r
-\r
-\r
-et::WorldMapCursor::WorldMapCursor(mof::Component3D* pBody)\r
-: Symbol(pBody , 0.05f)\r
-{\r
- mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation(true);\r
- for(int i = 0 ; i < 120 ; i++){\r
- float angle = 2 * 3.14f / (float)120 * (float)i;\r
- pKeyFrameAnimation->setRotation(i , mof::Vector3D(0.0f , angle , 0.0f));\r
- }\r
- setAnimation( 1 , mof::AnimationResource(pKeyFrameAnimation));\r
-}\r
-\r
-et::WorldMapCursor::~WorldMapCursor(void)\r
-{\r
-}\r
-\r
-\r
-void et::WorldMapCursor::move(Direction direction , mof::Vector3D& position , int length)\r
-{\r
- m_direction = direction;\r
- mof::AnimationResource pAnimation = getAnimation(3);\r
- if(pAnimation.get() != NULL && !pAnimation->isFinalized())return;\r
- \r
- mof::Vector3D current = getPosition();\r
- mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();\r
- pKeyFrameAnimation->setPosition(0 , current);\r
- pKeyFrameAnimation->setPosition(length , position);\r
-\r
- setAnimation( 3 , mof::AnimationResource(pKeyFrameAnimation));\r
- \r
-}\r
-\r
-\r
-bool et::WorldMapCursor::isTraveling(){\r
- return (getAnimationSet()->getElement(3).get() != NULL && !getAnimationSet()->getElement(3)->isFinalized());\r
+#include "WorldMapCursor.h"
+#include "mof/KeyFrameAnimation.h"
+#include "mof/ConsoleIO.h"
+
+
+et::WorldMapCursor::WorldMapCursor(mof::Component3D* pBody)
+: Symbol(pBody , 0.05f)
+{
+ mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation(true);
+ for(int i = 0 ; i < 120 ; i++){
+ float angle = 2 * 3.14f / (float)120 * (float)i;
+ pKeyFrameAnimation->setRotation(i , mof::Vector3D(0.0f , angle , 0.0f));
+ }
+ setAnimation( 1 , mof::AnimationResource(pKeyFrameAnimation));
+}
+
+et::WorldMapCursor::~WorldMapCursor(void)
+{
+}
+
+
+void et::WorldMapCursor::move(Direction direction , mof::Vector3D& position , int length)
+{
+ m_direction = direction;
+ mof::AnimationResource pAnimation = getAnimation(3);
+ if(pAnimation.get() != NULL && !pAnimation->isFinalized())return;
+
+ mof::Vector3D current = getPosition();
+ mof::KeyFrameAnimation* pKeyFrameAnimation = new mof::KeyFrameAnimation();
+ pKeyFrameAnimation->setPosition(0 , current);
+ pKeyFrameAnimation->setPosition(length , position);
+
+ setAnimation( 3 , mof::AnimationResource(pKeyFrameAnimation));
+
+}
+
+
+bool et::WorldMapCursor::isTraveling(){
+ return (getAnimationSet()->getElement(3).get() != NULL && !getAnimationSet()->getElement(3)->isFinalized());
}
\ No newline at end of file
-#pragma once\r
-#include "Symbol.h"\r
-\r
-namespace et{\r
-\r
-\r
- class WorldMapCursor : public Symbol\r
- {\r
- public:\r
- WorldMapCursor(mof::Component3D* pBody);\r
- virtual ~WorldMapCursor(void);\r
- void move(Direction direction , mof::Vector3D& position , int length);\r
- bool isTraveling();\r
- //void setAnimation(mof::AnimationResource& pAnime);\r
- };\r
-\r
-\r
+#pragma once
+#include "Symbol.h"
+
+namespace et{
+
+
+ class WorldMapCursor : public Symbol
+ {
+ public:
+ WorldMapCursor(mof::Component3D* pBody);
+ virtual ~WorldMapCursor(void);
+ void move(Direction direction , mof::Vector3D& position , int length);
+ bool isTraveling();
+ //void setAnimation(mof::AnimationResource& pAnime);
+ };
+
+
};
\ No newline at end of file
-#include "WorldMenu.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include "MyWindow.h"\r
-\r
-\r
-et::WorldMenu::WorldMenu( mof::TextureManager* pTextureManager , et::World* pWorld , et::GameData* pGameData)\r
-: et::MyFrame(mof::Line2D( 650 , 50 , 800 , 200) , true , pTextureManager->getResource(_T("image/frame0.png")) )\r
-{\r
- m_pTextureManager = pTextureManager;\r
- m_pWorld = pWorld;\r
- m_pGameData = pGameData;\r
- m_pSelector = NULL;\r
- std::vector<mof::Window*> selectables;\r
-\r
- mof::Window* pSelectable = NULL;\r
- add(mof::Sprite::createSpriteFromText(_T("\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[") , 16) );\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\83_\83\93\83W\83\87\83\93\92T\8dõ") , 16);\r
- pSelectable->setAvailable(false);\r
- addSelectableTextItem(this , selectables , _T("\83G\83\8a\83A\83\81\83j\83\85\81[") , 16);\r
- addSelectableTextItem(this , selectables , _T("\83X\83\8a\81[\83v") , 16);\r
- pSelectable = addSelectableTextItem(this , selectables , _T("\83\8f\81[\83\8b\83h\89ð\90Í") , 16);\r
- pSelectable->setAvailable(false);\r
- m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());\r
- setVisible(true);\r
-}\r
-\r
-\r
-\r
-\r
-et::WorldMenu::~WorldMenu(void)\r
-{\r
- delete m_pSelector;\r
-}\r
-\r
-\r
-\r
-\r
-void et::WorldMenu::setVisible(bool visible){\r
- et::MyFrame::setVisible(visible);\r
- if(visible){\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(650 , 50));\r
- pAnimation->setPosition(7 , mof::Vector2D(440 , 50));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
- else {\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition(0 , mof::Vector2D(440 , 50));\r
- pAnimation->setPosition(7 , mof::Vector2D(650 , 50));\r
- mof::AnimationResource resource(pAnimation);\r
- m_pSelector->setMenuAnimation(resource);\r
- setAnimation(0 , resource);\r
- }\r
-}\r
-\r
-et::MyFrame* et::WorldMenu::performAction(){\r
- \r
- switch(getSelectionModel()->getSelectingIndex()){\r
- case 0 : //\83_\83\93\83W\83\87\83\93\92T\8dõ\r
- return this;\r
- case 1 : //\83G\83\8a\83A\83\81\83j\83\85\81[\r
- {\r
- //\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[\81¨\83G\83\8a\83A\83\81\83j\83\85\81[\82Ì\91J\88Ú\83A\83j\83\81\82ð\83Z\83b\83g\r
- setVisible(false);\r
- return NULL;\r
- }\r
- case 2 : //\83X\83\8a\81[\83v\r
- {\r
- m_pGameData->addRegenerationEvent(et::RegenerationEvent::createSleepEvent(m_pWorld->getTerm()));\r
- setVisible(false);\r
- return NULL;\r
- }\r
- default :\r
- DEBUG_PRINT("\96¢\92è\8b`\82Ì\83A\83N\83V\83\87\83\93\82ª\97v\8b\81\82³\82ê\82Ü\82µ\82½");\r
- return NULL;\r
- }\r
-}\r
-\r
-\r
-\r
-mof::Window* et::WorldMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){\r
- mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);\r
- pOwner->add(pSelectable);\r
- selectables.push_back(pSelectable);\r
- return pSelectable;\r
+#include "WorldMenu.h"
+#include "mof/KeyFrameAnimation.h"
+#include "MyWindow.h"
+
+
+et::WorldMenu::WorldMenu( mof::TextureManager* pTextureManager , et::World* pWorld , et::GameData* pGameData)
+: et::MyFrame(mof::Line2D( 650 , 50 , 800 , 200) , true , pTextureManager->getResource(_T("image/frame0.png")) )
+{
+ m_pTextureManager = pTextureManager;
+ m_pWorld = pWorld;
+ m_pGameData = pGameData;
+ m_pSelector = NULL;
+ std::vector<mof::Window*> selectables;
+
+ mof::Window* pSelectable = NULL;
+ add(mof::Sprite::createSpriteFromText(_T("\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[") , 16) );
+ pSelectable = addSelectableTextItem(this , selectables , _T("\83_\83\93\83W\83\87\83\93\92T\8dõ") , 16);
+ pSelectable->setAvailable(false);
+ addSelectableTextItem(this , selectables , _T("\83G\83\8a\83A\83\81\83j\83\85\81[") , 16);
+ addSelectableTextItem(this , selectables , _T("\83X\83\8a\81[\83v") , 16);
+ pSelectable = addSelectableTextItem(this , selectables , _T("\83\8f\81[\83\8b\83h\89ð\90Í") , 16);
+ pSelectable->setAvailable(false);
+ m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());
+ setVisible(true);
+}
+
+
+
+
+et::WorldMenu::~WorldMenu(void)
+{
+ delete m_pSelector;
+}
+
+
+
+
+void et::WorldMenu::setVisible(bool visible){
+ et::MyFrame::setVisible(visible);
+ if(visible){
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(650 , 50));
+ pAnimation->setPosition(7 , mof::Vector2D(440 , 50));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+ else {
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition(0 , mof::Vector2D(440 , 50));
+ pAnimation->setPosition(7 , mof::Vector2D(650 , 50));
+ mof::AnimationResource resource(pAnimation);
+ m_pSelector->setMenuAnimation(resource);
+ setAnimation(0 , resource);
+ }
+}
+
+et::MyFrame* et::WorldMenu::performAction(){
+
+ switch(getSelectionModel()->getSelectingIndex()){
+ case 0 : //\83_\83\93\83W\83\87\83\93\92T\8dõ
+ return this;
+ case 1 : //\83G\83\8a\83A\83\81\83j\83\85\81[
+ {
+ //\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[\81¨\83G\83\8a\83A\83\81\83j\83\85\81[\82Ì\91J\88Ú\83A\83j\83\81\82ð\83Z\83b\83g
+ setVisible(false);
+ return NULL;
+ }
+ case 2 : //\83X\83\8a\81[\83v
+ {
+ m_pGameData->addRegenerationEvent(et::RegenerationEvent::createSleepEvent(m_pWorld->getTerm()));
+ setVisible(false);
+ return NULL;
+ }
+ default :
+ DEBUG_PRINT("\96¢\92è\8b`\82Ì\83A\83N\83V\83\87\83\93\82ª\97v\8b\81\82³\82ê\82Ü\82µ\82½");
+ return NULL;
+ }
+}
+
+
+
+mof::Window* et::WorldMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){
+ mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);
+ pOwner->add(pSelectable);
+ selectables.push_back(pSelectable);
+ return pSelectable;
}
\ No newline at end of file
-#pragma once\r
-#include "mof/SelectionModel.h"\r
-#include "MyFrame.h"\r
-#include "World.h"\r
-#include "GameData.h"\r
-\r
-\r
-namespace et{\r
-\r
- class WorldMenu : public MyFrame{\r
- mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);\r
-\r
- mof::SelectionModel* m_pSelector;\r
- mof::TextureManager* m_pTextureManager;\r
- et::World* m_pWorld;\r
- et::GameData* m_pGameData;\r
- public:\r
- WorldMenu( mof::TextureManager* pTextureManager , et::World* pWorld , et::GameData* pGameData);\r
- virtual ~WorldMenu();\r
- virtual void setVisible(bool visible);\r
-\r
- virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}\r
- virtual MyFrame* performAction();\r
-\r
- };\r
-\r
-\r
-\r
+#pragma once
+#include "mof/SelectionModel.h"
+#include "MyFrame.h"
+#include "World.h"
+#include "GameData.h"
+
+
+namespace et{
+
+ class WorldMenu : public MyFrame{
+ mof::Window* addSelectableTextItem(mof::Window* pOwner , std::vector<mof::Window*>& selectables , TCHAR* text , int size);
+
+ mof::SelectionModel* m_pSelector;
+ mof::TextureManager* m_pTextureManager;
+ et::World* m_pWorld;
+ et::GameData* m_pGameData;
+ public:
+ WorldMenu( mof::TextureManager* pTextureManager , et::World* pWorld , et::GameData* pGameData);
+ virtual ~WorldMenu();
+ virtual void setVisible(bool visible);
+
+ virtual mof::SelectionModel* getSelectionModel(){return m_pSelector;}
+ virtual MyFrame* performAction();
+
+ };
+
+
+
};
\ No newline at end of file
-#include "WorldScene.h"\r
-#include "mof/GraphicsDevice.h"\r
-#include "mof/AmbientLight.h"\r
-#include "mof/InputDevice.h"\r
-#include "mof/ConsoleIO.h"\r
-#include <math.h>\r
-#include "mof/System.h"\r
-#include "Area.h"\r
-#include "DungeonBuilderA.h"\r
-#include "mof/AmbientLight.h"\r
-#include "mof/DirectionalLight.h"\r
-#include "mof/ConsoleIO.h"\r
-#include "mof/SoftVertexBufferImpl.h"\r
-#include "mof/KeyFrameAnimation.h"\r
-#include <sstream>\r
-\r
-mof::Vector2D toAreaCoord(mof::Vector3D position){\r
- return mof::Vector2D(position.x / 0.03f , -position.z / 0.03f);\r
-}\r
-\r
-mof::Vector3D toWorldCoord(mof::Vector2D position){\r
- return mof::Vector3D((float)position.x * 0.03f + 0.015f , 0.015f , (float)position.y * -0.03f - 0.015f);\r
-}\r
-\r
-et::WorldScene::WorldScene()\r
-: et::GameScene() \r
-{\r
-\r
- m_pWindow = NULL;\r
- m_pBuilder = NULL;\r
- m_pWorldMap = NULL;\r
- m_pCamera = NULL;\r
- m_pGrid = NULL;\r
- m_pPoint = NULL;\r
- //m_state = et::WorldScene::OPENING;\r
- m_pCurrentFrame = NULL;\r
- m_pAreaMenu = NULL;\r
- m_pWorldMenu = NULL;\r
- m_pWorld = NULL;\r
- m_pFeedEffect = NULL;\r
-}\r
-\r
-et::WorldScene::~WorldScene(void)\r
-{\r
- //delete m_pAreaMenu;\r
- delete m_pWorld;\r
- delete m_pAreaMenu;\r
- delete m_pWorldMenu;\r
- delete m_pWindow;\r
- delete m_pBuilder;\r
- delete m_pWorldMap;\r
- delete m_pCamera;\r
- delete m_pCursor;\r
- delete m_pGrid;\r
- delete m_pPoint;\r
- delete m_pFeedEffect;\r
-}\r
-\r
-\r
-bool et::WorldScene::initialize(){\r
-\r
- m_pWorld = m_pGameData->createWorld();\r
-\r
- //\8dÄ\90¶\93x\95\\8e¦\83t\83\8c\81[\83\80\82Ì\8dì\90¬\r
- m_pWindow = new et::MyFrame(mof::Line2D( 370 , 400 , 600 , 450) , false , m_pTextureManager->getResource(_T("image/frame0.png")));\r
- std::stringstream os;\r
- os << _T("\8dÄ\90¶\93x") << m_pWorld->getRegenerationLevel() << _T("/Term") << m_pWorld->getTerm();\r
- m_pWindow->add(mof::Sprite::createSpriteFromText((TCHAR*)os.str().c_str() , 24));\r
- m_pWindow->setLayout();\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- //\83A\83j\83\81\82Ì\90Ý\92è\r
- pAnimation->setPosition( 1 , mof::Vector2D( 220 , 200 ));\r
- pAnimation->setPosition(180 , mof::Vector2D(400 , 380));\r
- m_pWindow->setAnimation(0 , mof::AnimationResource(pAnimation));\r
-\r
- //\83\8f\81[\83\8b\83h\83\81\83j\83\85\82Ì\8dì\90¬\r
- m_pWorldMenu = new et::WorldMenu(m_pTextureManager , m_pWorld , m_pGameData);\r
- m_pCurrentFrame = m_pWorldMenu;\r
-\r
- //\83t\83F\81[\83h\83G\83t\83F\83N\83g\r
- mof::RectangleModel rect = mof::System::getInstance()->getBounds();\r
- m_pFeedEffect = new mof::Sprite(mof::Line2D(rect.getPosition() , rect.getWidth() , rect.getHeight()) ,\r
- mof::Line2D() , m_pTextureManager->getResource(_T("null")));\r
- pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setColor(0 , mof::createColor(255 , 0 , 0 , 0));\r
- pAnimation->setColor(180 , mof::createColor(255 , 0 , 0 , 0));\r
- pAnimation->setColor(210 , mof::createColor(0 , 0 , 0 , 0));\r
- m_pFeedEffect->setAnimation(0 , mof::AnimationResource(pAnimation));\r
-\r
- m_translationScheduler.add(0 , m_pWindow->getAnimationSet());\r
- m_translationScheduler.add(180 , m_pWorldMenu->getAnimationSet());\r
- m_translationScheduler.add(0 , m_pFeedEffect->getAnimationSet());\r
- \r
-\r
-\r
- //\83\8f\81[\83\8b\83h\83}\83b\83v\82Ì\8dì\90¬\r
- m_pBuilder = new et::WorldMapBuilder(m_pWorld->getAreaPowerLevelMap() , m_pTextureManager , 0.03f);\r
- m_pWorldMap = m_pBuilder->create();\r
- m_pTexture = m_pTextureManager->getResource(_T("image/worldtip.png"));\r
-\r
- \r
- //\83J\81[\83\\83\8b\82Ì\90Ý\92è\r
- m_pCursor = new et::WorldMapCursor(new mof::Mesh(mof::tstring(_T("model/cursor.x"))));\r
- m_pCursor->move(et::Symbol::UP , toWorldCoord(mof::Vector2D(0 , 0 )) , 1);\r
- \r
- \r
-\r
- //\83\89\83C\83g\82Ì\90Ý\92è\r
- mof::AmbientLight light(mof::createColor(255 , 255 , 255));\r
- light.reflect();\r
- mof::GraphicsDevice::getInstance()->setLight(true);\r
-\r
- //\83O\83\8a\83b\83h\82Ì\8dì\90¬\r
- m_pGrid = new mof::SoftVertexBuffer<mof::VertexXYZC>(mof::VertexBuffer<mof::VertexXYZC>::PRIMITIVE_TYPE_LINELIST);\r
- mof::VertexXYZC vertex;\r
- vertex.color = mof::createColor(155 , 155 , 155);\r
- vertex.y = 0.001f;\r
- //\8fc\90ü\r
- for(int x = 0 ; x < 10+1 ; x++){\r
- vertex.x = (float)x * 0.03f;\r
- vertex.z = 0.0f;\r
- m_pGrid->add(vertex);\r
- vertex.x = (float)x * 0.03f;\r
- vertex.z = -0.03f * 10;\r
- m_pGrid->add(vertex);\r
- }\r
- //\89¡\90ü\r
- for(int y = 0 ; y < 10+1 ; y++){\r
- vertex.x = 0.0f;\r
- vertex.z = -(float)y * 0.03f;\r
- m_pGrid->add(vertex);\r
- vertex.x = 0.03f * 10;\r
- vertex.z = -(float)y * 0.03f;\r
- m_pGrid->add(vertex);\r
- }\r
- \r
- //\83J\81[\83\\83\8b\83|\83C\83\93\83g\82ð\8dì\90¬\r
- m_pPoint = new mof::SoftVertexBuffer<mof::VertexXYZC>(mof::VertexBuffer<mof::VertexXYZC>::PRIMITIVE_TYPE_LINELIST);\r
- mof::Color color = mof::createColor(255 , 255 , 0);\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f , 0.002f , 0.0f) , color));\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f ,0.002f , -0.03f) , color));\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f , 0.002f , -0.03f) , color));\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f , -0.03f) , color));\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f , -0.03f) , color));\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f, 0.0f) , color));\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f , 0.0f) , color));\r
- m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f , 0.002f , 0.0f) , color));\r
- \r
-\r
- //3D\8aÂ\8b«\82Ì\8f\80\94õ1\r
- m_pCamera = new mof::Camera(mof::Vector3D(/*0.25f*/ 0.03f * 5 , 0.5f , -0.35f) , mof::Vector3D( 0.03f * 5 , 0.0f , -0.17f) , mof::Vector3D(0.0f , 0.0f , 0.90f));\r
- m_pCamera->reflect();\r
- mof::GraphicsDevice::getInstance()->setProjectionTransform(0.01f , 50.0f);\r
-\r
- \r
- \r
- return true;\r
-}\r
- \r
-bool et::WorldScene::draw(){\r
- //m_pCapturer->capture();\r
- mof::GraphicsDevice* pDevice = mof::GraphicsDevice::getInstance();\r
- pDevice->clearRenderTarget(mof::createColor(27 , 37 , 67));//27\r
- pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_BASIC);\r
- \r
- if(m_pWindow != NULL && m_pWindow->getAnimationSet()->isFinalized()){\r
- pDevice->setZBuffer(true);\r
- pDevice->clearZBuffer();\r
- pDevice->setLight(false);\r
- mof::Material().reflect();\r
- m_pTexture->setTextureToDevice();\r
- m_pWorldMap->draw(mof::Matrix3D());\r
- }\r
-\r
- if(m_pAreaMenu != NULL || (m_pCurrentFrame == NULL || (m_menuChangeAnimation.get() != NULL && !m_menuChangeAnimation->isFinalized()))){\r
- //\83G\83\8a\83A\83O\83\8a\83b\83h\82Ì\95`\89æ\r
- pDevice->setLight(false);\r
- m_pTextureManager->getResource(_T("null"))->setTextureToDevice(); \r
- m_pGrid->draw(m_menuChangeAnimation->getWorldTransform(mof::Matrix3D()));\r
- }\r
-\r
- if(m_pAreaMenu != NULL || (m_pCurrentFrame == NULL && m_translationScheduler.isFinalized())){\r
- \r
- //\83J\81[\83\\83\8b\83|\83C\83\93\83g\82Ì\95`\89æ\r
- mof::Vector3D pointPosition = m_pCursor->getPosition();\r
- pointPosition.x = (float)(int)(pointPosition.x / 0.03f) * 0.03f;\r
- pointPosition.z = (float)(int)(pointPosition.z / 0.03f) * 0.03f;\r
- //DEBUG_PRINT(pointPosition.y);\r
- m_pPoint->draw(mof::Matrix3D::createTranslation(pointPosition));\r
- \r
- //\83G\83\8a\83A\83A\83C\83R\83\93\82Ì\95`\89æ\r
- mof::Billboard icon(mof::Billboard::XYZ_FIXED , m_pTexture);\r
- mof::Matrix3D scaling = mof::Matrix3D::createScaling(0.03f , 0.03f , 0.03f);\r
- for(int y = 0 ; y < m_pWorld->getAreaHeight() ; y++){\r
- for(int x = 0 ; x < m_pWorld->getAreaWidth() ; x++){\r
- if(m_pWorld->getArea(x , y).forestGen)icon.setTextureRectangle(mof::Line2D(32 * 4 , 32 * 6 , 32 * 5 , 32 * 7));\r
- else continue;\r
- icon.setWorldTransform(scaling * mof::Matrix3D::createTranslation(mof::Vector3D(0.015f + 0.03*x , pointPosition.y , -0.015f - 0.03*y)));\r
- icon.draw();\r
- }\r
- }\r
- pDevice->setZBuffer(false);\r
- pDevice->setLight(true);\r
- //\83G\83\8a\83A\83J\81[\83\\83\8b\82Ì\95`\89æ\r
- mof::DirectionalLight(mof::createColor(255 , 255 , 0) , mof::createColor(55 , 55 , 155) , mof::Vector3D(1.0f , -1.0f , -1.0f)).reflect();\r
- m_pCursor->draw();\r
- \r
-\r
- }else pDevice->setZBuffer(false);\r
- \r
- if(m_pAreaMenu != NULL)m_pAreaMenu->draw();\r
- if(m_pWorldMenu != NULL)m_pWorldMenu->draw();\r
- \r
- mof::Color color = m_pFeedEffect->getCornerColor(mof::Sprite::C_RIGHT_BOTTOM);\r
- //DEBUG_PRINT("color:" << (int)mof::getRed(color));\r
- if(mof::getAlpha(color) != 0){//\93§\96¾\82Å\8c©\82¦\82È\82¢\82Æ\82«\82Í\95`\89æ\82µ\82È\82¢\r
- pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);\r
- m_pFeedEffect->draw();\r
- pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_BASIC);\r
- }\r
- m_pWindow->draw();\r
- \r
- return true;\r
-}\r
-\r
-\r
-bool et::WorldScene::update(){\r
- //\83J\81[\83\\83\8b\82Ì\88Ú\93®\r
- mof::Vector2D areaPosition = toAreaCoord(m_pCursor->getPosition());\r
- if(m_pCurrentFrame == NULL && m_translationScheduler.isFinalized()){\r
- mof::Vector2D nextPosition = areaPosition;\r
- if(m_pInputReceiver->checkKeyState(mof::InputReceiver::UP) && areaPosition.y > 0){\r
- nextPosition.y--;\r
- m_pCursor->move(et::Symbol::UP , toWorldCoord(nextPosition) , 10);\r
- }\r
- else if(m_pInputReceiver->checkKeyState(mof::InputReceiver::DOWN) && areaPosition.y < 10-1){\r
- nextPosition.y++;\r
- m_pCursor->move(et::Symbol::DOWN , toWorldCoord(nextPosition) , 10);\r
- }\r
- else if(m_pInputReceiver->checkKeyState(mof::InputReceiver::LEFT) && areaPosition.x > 0){\r
- nextPosition.x--;\r
- m_pCursor->move(et::Symbol::LEFT , toWorldCoord(nextPosition) , 10);\r
- }\r
- else if(m_pInputReceiver->checkKeyState(mof::InputReceiver::RIGHT) && areaPosition.x < 10-1){\r
- nextPosition.x++;\r
- m_pCursor->move(et::Symbol::RIGHT , toWorldCoord(nextPosition) , 10);\r
- }\r
- else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::Z)){\r
- if(!m_pCursor->isTraveling()){\r
- //\83G\83\8a\83A\83\81\83j\83\85\81[\90Ý\92è\r
- m_pAreaMenu = new et::AreaMenu( m_pWorld->getArea(areaPosition.x , areaPosition.y) , m_pTextureManager\r
- , m_pWorld , m_pGameData , areaPosition);\r
- m_pCurrentFrame = m_pAreaMenu;\r
-\r
- m_translationScheduler.clear();\r
- m_translationScheduler.add(0 , m_pAreaMenu->getAnimationSet());\r
- }\r
- \r
- }\r
- else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::X)){\r
- //\83G\83\8a\83A\83\81\83j\83\85\81[\81¨\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[\82Ì\91J\88Ú\83A\83j\83\81\82ð\83Z\83b\83g\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition( 0 , mof::Vector3D(0.0f , 0.015f , 0.0f));\r
- pAnimation->setPosition(30 , mof::Vector3D(0 , 0.0001 , 0));\r
- m_menuChangeAnimation = mof::AnimationResource(pAnimation);\r
- \r
- m_pWorldMenu = new et::WorldMenu(m_pTextureManager , m_pWorld , m_pGameData);\r
- m_pCurrentFrame = m_pWorldMenu;\r
-\r
- m_translationScheduler.clear();\r
- m_translationScheduler.add(0 , m_pWorldMenu->getAnimationSet());\r
- m_translationScheduler.add(0 , m_menuChangeAnimation);\r
- \r
- }\r
- }\r
- else if(m_pCurrentFrame != NULL && m_translationScheduler.isFinalized()){\r
- \r
- //\83E\83B\83\93\83h\83E\82É\91Î\82·\82é\83L\81[\r
- if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::UP))m_pCurrentFrame->getSelectionModel()->previous();\r
- else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::DOWN))m_pCurrentFrame->getSelectionModel()->next();\r
- else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::Z) && \r
- m_pCurrentFrame->getSelectionModel()->getSelectingItem()->isAvailable()){\r
- \r
- int selectedIndex = m_pCurrentFrame->getSelectionModel()->getSelectingIndex();\r
- MyFrame* tmpFrame = m_pCurrentFrame;\r
- MyFrame* pFrame = m_pCurrentFrame->performAction();\r
- if(pFrame != m_pCurrentFrame){\r
- //\83E\83B\83\93\83h\83E\82Ì\91J\88Ú\r
- m_translationScheduler.clear();\r
- if(!m_pCurrentFrame->isVisible())m_translationScheduler.add(0 , m_pCurrentFrame->getAnimationSet());\r
- m_pCurrentFrame = pFrame;\r
- if(m_pCurrentFrame != NULL)m_translationScheduler.add(0 , m_pCurrentFrame->getAnimationSet());\r
-\r
- }\r
- if(tmpFrame == m_pWorldMenu && selectedIndex == 1){\r
- //\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[\81¨\83G\83\8a\83A\83\81\83j\83\85\81[\82Ì\91J\88Ú\83A\83j\83\81\82ð\83Z\83b\83g\r
- mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();\r
- pAnimation->setPosition( 0 , mof::Vector3D(0.0f , 0.0001f , 0.0f));\r
- pAnimation->setPosition(30 , mof::Vector3D(0 , 0.015 , 0));\r
- m_menuChangeAnimation = mof::AnimationResource(pAnimation);\r
- m_translationScheduler.add(0 , m_menuChangeAnimation);\r
- \r
- }\r
- else if(tmpFrame == m_pWorldMenu && selectedIndex == 2){\r
- //\83\8f\81[\83\8b\83h\83V\81[\83\93\82Ì\8fI\97¹\r
- end(0);\r
- }\r
- }\r
- else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::X)){\r
- if(m_pCurrentFrame == m_pAreaMenu){\r
- m_pAreaMenu->setVisible(false);\r
- m_pCurrentFrame = NULL;\r
- }\r
- }\r
-\r
- }\r
-\r
-\r
- \r
- //\83t\83\8c\81[\83\80\82Ì\8dX\90V\8f\88\97\9d\r
- /*et::MyFrame** targets[] = {&m_pAreaMenu , &m_pWorldMenu};\r
- int length = sizeof(targets) / sizeof(targets[0]);\r
- for(int i = 0 ; i < length ; i++){\r
- if(*(targets[i]) != NULL){\r
- (*(targets[i]))->update();\r
- if(!(*(targets[i]))->isVisible() && (*(targets[i]))->getAnimation(0)->isFinalized()){\r
- delete *(targets[i]);\r
- *(targets[i]) = NULL;\r
- }\r
- }\r
- }*/\r
- if(m_pAreaMenu != NULL){\r
- m_pAreaMenu->update();\r
- if(!m_pAreaMenu->isVisible() && m_pAreaMenu->getAnimation(0)->isFinalized()){\r
- delete m_pAreaMenu;\r
- m_pAreaMenu = NULL;\r
- }\r
- }\r
- if(m_pWorldMenu != NULL){\r
- m_pWorldMenu->update();\r
- if(!m_pWorldMenu->isVisible() && m_pWorldMenu->getAnimation(0)->isFinalized()){\r
- delete m_pWorldMenu;\r
- m_pWorldMenu = NULL;\r
- }\r
- }\r
- if(m_pWindow != NULL){\r
- m_pWindow->update();\r
- }\r
- \r
- if(m_menuChangeAnimation.get() != NULL)m_menuChangeAnimation->update();\r
- m_pCamera->setWorldTransform(mof::Matrix3D::createTranslation(mof::Vector3D(0.0f , 0.0f, 0.0f)));\r
- m_pCamera->reflect();\r
- m_pCursor->update();\r
- m_pFeedEffect->update();\r
- \r
- mof::Billboard::updateBillboardDirection(m_pCamera);\r
- m_translationScheduler.update();\r
-\r
- return true;\r
-}\r
-\r
+#include "WorldScene.h"
+#include "mof/GraphicsDevice.h"
+#include "mof/AmbientLight.h"
+#include "mof/InputDevice.h"
+#include "mof/ConsoleIO.h"
+#include <math.h>
+#include "mof/System.h"
+#include "Area.h"
+#include "DungeonBuilderA.h"
+#include "mof/AmbientLight.h"
+#include "mof/DirectionalLight.h"
+#include "mof/ConsoleIO.h"
+#include "mof/SoftVertexBufferImpl.h"
+#include "mof/KeyFrameAnimation.h"
+#include <sstream>
+
+mof::Vector2D toAreaCoord(mof::Vector3D position){
+ return mof::Vector2D(position.x / 0.03f , -position.z / 0.03f);
+}
+
+mof::Vector3D toWorldCoord(mof::Vector2D position){
+ return mof::Vector3D((float)position.x * 0.03f + 0.015f , 0.015f , (float)position.y * -0.03f - 0.015f);
+}
+
+et::WorldScene::WorldScene()
+: et::GameScene()
+{
+
+ m_pWindow = NULL;
+ m_pBuilder = NULL;
+ m_pWorldMap = NULL;
+ m_pCamera = NULL;
+ m_pGrid = NULL;
+ m_pPoint = NULL;
+ //m_state = et::WorldScene::OPENING;
+ m_pCurrentFrame = NULL;
+ m_pAreaMenu = NULL;
+ m_pWorldMenu = NULL;
+ m_pWorld = NULL;
+ m_pFeedEffect = NULL;
+}
+
+et::WorldScene::~WorldScene(void)
+{
+ //delete m_pAreaMenu;
+ delete m_pWorld;
+ delete m_pAreaMenu;
+ delete m_pWorldMenu;
+ delete m_pWindow;
+ delete m_pBuilder;
+ delete m_pWorldMap;
+ delete m_pCamera;
+ delete m_pCursor;
+ delete m_pGrid;
+ delete m_pPoint;
+ delete m_pFeedEffect;
+}
+
+
+bool et::WorldScene::initialize(){
+
+ m_pWorld = m_pGameData->createWorld();
+
+ //\8dÄ\90¶\93x\95\\8e¦\83t\83\8c\81[\83\80\82Ì\8dì\90¬
+ m_pWindow = new et::MyFrame(mof::Line2D( 370 , 400 , 600 , 450) , false , m_pTextureManager->getResource(_T("image/frame0.png")));
+ std::stringstream os;
+ os << _T("\8dÄ\90¶\93x") << m_pWorld->getRegenerationLevel() << _T("/Term") << m_pWorld->getTerm();
+ m_pWindow->add(mof::Sprite::createSpriteFromText((TCHAR*)os.str().c_str() , 24));
+ m_pWindow->setLayout();
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ //\83A\83j\83\81\82Ì\90Ý\92è
+ pAnimation->setPosition( 1 , mof::Vector2D( 220 , 200 ));
+ pAnimation->setPosition(180 , mof::Vector2D(400 , 380));
+ m_pWindow->setAnimation(0 , mof::AnimationResource(pAnimation));
+
+ //\83\8f\81[\83\8b\83h\83\81\83j\83\85\82Ì\8dì\90¬
+ m_pWorldMenu = new et::WorldMenu(m_pTextureManager , m_pWorld , m_pGameData);
+ m_pCurrentFrame = m_pWorldMenu;
+
+ //\83t\83F\81[\83h\83G\83t\83F\83N\83g
+ mof::RectangleModel rect = mof::System::getInstance()->getBounds();
+ m_pFeedEffect = new mof::Sprite(mof::Line2D(rect.getPosition() , rect.getWidth() , rect.getHeight()) ,
+ mof::Line2D() , m_pTextureManager->getResource(_T("null")));
+ pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setColor(0 , mof::createColor(255 , 0 , 0 , 0));
+ pAnimation->setColor(180 , mof::createColor(255 , 0 , 0 , 0));
+ pAnimation->setColor(210 , mof::createColor(0 , 0 , 0 , 0));
+ m_pFeedEffect->setAnimation(0 , mof::AnimationResource(pAnimation));
+
+ m_translationScheduler.add(0 , m_pWindow->getAnimationSet());
+ m_translationScheduler.add(180 , m_pWorldMenu->getAnimationSet());
+ m_translationScheduler.add(0 , m_pFeedEffect->getAnimationSet());
+
+
+
+ //\83\8f\81[\83\8b\83h\83}\83b\83v\82Ì\8dì\90¬
+ m_pBuilder = new et::WorldMapBuilder(m_pWorld->getAreaPowerLevelMap() , m_pTextureManager , 0.03f);
+ m_pWorldMap = m_pBuilder->create();
+ m_pTexture = m_pTextureManager->getResource(_T("image/worldtip.png"));
+
+
+ //\83J\81[\83\\83\8b\82Ì\90Ý\92è
+ m_pCursor = new et::WorldMapCursor(new mof::Mesh(mof::tstring(_T("model/cursor.x"))));
+ m_pCursor->move(et::Symbol::UP , toWorldCoord(mof::Vector2D(0 , 0 )) , 1);
+
+
+
+ //\83\89\83C\83g\82Ì\90Ý\92è
+ mof::AmbientLight light(mof::createColor(255 , 255 , 255));
+ light.reflect();
+ mof::GraphicsDevice::getInstance()->setLight(true);
+
+ //\83O\83\8a\83b\83h\82Ì\8dì\90¬
+ m_pGrid = new mof::SoftVertexBuffer<mof::VertexXYZC>(mof::VertexBuffer<mof::VertexXYZC>::PRIMITIVE_TYPE_LINELIST);
+ mof::VertexXYZC vertex;
+ vertex.color = mof::createColor(155 , 155 , 155);
+ vertex.y = 0.001f;
+ //\8fc\90ü
+ for(int x = 0 ; x < 10+1 ; x++){
+ vertex.x = (float)x * 0.03f;
+ vertex.z = 0.0f;
+ m_pGrid->add(vertex);
+ vertex.x = (float)x * 0.03f;
+ vertex.z = -0.03f * 10;
+ m_pGrid->add(vertex);
+ }
+ //\89¡\90ü
+ for(int y = 0 ; y < 10+1 ; y++){
+ vertex.x = 0.0f;
+ vertex.z = -(float)y * 0.03f;
+ m_pGrid->add(vertex);
+ vertex.x = 0.03f * 10;
+ vertex.z = -(float)y * 0.03f;
+ m_pGrid->add(vertex);
+ }
+
+ //\83J\81[\83\\83\8b\83|\83C\83\93\83g\82ð\8dì\90¬
+ m_pPoint = new mof::SoftVertexBuffer<mof::VertexXYZC>(mof::VertexBuffer<mof::VertexXYZC>::PRIMITIVE_TYPE_LINELIST);
+ mof::Color color = mof::createColor(255 , 255 , 0);
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f , 0.002f , 0.0f) , color));
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f ,0.002f , -0.03f) , color));
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f , 0.002f , -0.03f) , color));
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f , -0.03f) , color));
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f , -0.03f) , color));
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f, 0.0f) , color));
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.03f , 0.002f , 0.0f) , color));
+ m_pPoint->add(mof::VertexXYZC(mof::Vector3D(0.0f , 0.002f , 0.0f) , color));
+
+
+ //3D\8aÂ\8b«\82Ì\8f\80\94õ1
+ m_pCamera = new mof::Camera(mof::Vector3D(/*0.25f*/ 0.03f * 5 , 0.5f , -0.35f) , mof::Vector3D( 0.03f * 5 , 0.0f , -0.17f) , mof::Vector3D(0.0f , 0.0f , 0.90f));
+ m_pCamera->reflect();
+ mof::GraphicsDevice::getInstance()->setProjectionTransform(0.01f , 50.0f);
+
+
+
+ return true;
+}
+
+bool et::WorldScene::draw(){
+ //m_pCapturer->capture();
+ mof::GraphicsDevice* pDevice = mof::GraphicsDevice::getInstance();
+ pDevice->clearRenderTarget(mof::createColor(27 , 37 , 67));//27
+ pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_BASIC);
+
+ if(m_pWindow != NULL && m_pWindow->getAnimationSet()->isFinalized()){
+ pDevice->setZBuffer(true);
+ pDevice->clearZBuffer();
+ pDevice->setLight(false);
+ mof::Material().reflect();
+ m_pTexture->setTextureToDevice();
+ m_pWorldMap->draw(mof::Matrix3D());
+ }
+
+ if(m_pAreaMenu != NULL || (m_pCurrentFrame == NULL || (m_menuChangeAnimation.get() != NULL && !m_menuChangeAnimation->isFinalized()))){
+ //\83G\83\8a\83A\83O\83\8a\83b\83h\82Ì\95`\89æ
+ pDevice->setLight(false);
+ m_pTextureManager->getResource(_T("null"))->setTextureToDevice();
+ m_pGrid->draw(m_menuChangeAnimation->getWorldTransform(mof::Matrix3D()));
+ }
+
+ if(m_pAreaMenu != NULL || (m_pCurrentFrame == NULL && m_translationScheduler.isFinalized())){
+
+ //\83J\81[\83\\83\8b\83|\83C\83\93\83g\82Ì\95`\89æ
+ mof::Vector3D pointPosition = m_pCursor->getPosition();
+ pointPosition.x = (float)(int)(pointPosition.x / 0.03f) * 0.03f;
+ pointPosition.z = (float)(int)(pointPosition.z / 0.03f) * 0.03f;
+ //DEBUG_PRINT(pointPosition.y);
+ m_pPoint->draw(mof::Matrix3D::createTranslation(pointPosition));
+
+ //\83G\83\8a\83A\83A\83C\83R\83\93\82Ì\95`\89æ
+ mof::Billboard icon(mof::Billboard::XYZ_FIXED , m_pTexture);
+ mof::Matrix3D scaling = mof::Matrix3D::createScaling(0.03f , 0.03f , 0.03f);
+ for(int y = 0 ; y < m_pWorld->getAreaHeight() ; y++){
+ for(int x = 0 ; x < m_pWorld->getAreaWidth() ; x++){
+ if(m_pWorld->getArea(x , y).forestGen)icon.setTextureRectangle(mof::Line2D(32 * 4 , 32 * 6 , 32 * 5 , 32 * 7));
+ else continue;
+ icon.setWorldTransform(scaling * mof::Matrix3D::createTranslation(mof::Vector3D(0.015f + 0.03*x , pointPosition.y , -0.015f - 0.03*y)));
+ icon.draw();
+ }
+ }
+ pDevice->setZBuffer(false);
+ pDevice->setLight(true);
+ //\83G\83\8a\83A\83J\81[\83\\83\8b\82Ì\95`\89æ
+ mof::DirectionalLight(mof::createColor(255 , 255 , 0) , mof::createColor(55 , 55 , 155) , mof::Vector3D(1.0f , -1.0f , -1.0f)).reflect();
+ m_pCursor->draw();
+
+
+ }else pDevice->setZBuffer(false);
+
+ if(m_pAreaMenu != NULL)m_pAreaMenu->draw();
+ if(m_pWorldMenu != NULL)m_pWorldMenu->draw();
+
+ mof::Color color = m_pFeedEffect->getCornerColor(mof::Sprite::C_RIGHT_BOTTOM);
+ //DEBUG_PRINT("color:" << (int)mof::getRed(color));
+ if(mof::getAlpha(color) != 0){//\93§\96¾\82Å\8c©\82¦\82È\82¢\82Æ\82«\82Í\95`\89æ\82µ\82È\82¢
+ pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_ALPHA);
+ m_pFeedEffect->draw();
+ pDevice->setAlphaBlendingMode(mof::GraphicsDevice::BLENDING_MODE_BASIC);
+ }
+ m_pWindow->draw();
+
+ return true;
+}
+
+
+bool et::WorldScene::update(){
+ //\83J\81[\83\\83\8b\82Ì\88Ú\93®
+ mof::Vector2D areaPosition = toAreaCoord(m_pCursor->getPosition());
+ if(m_pCurrentFrame == NULL && m_translationScheduler.isFinalized()){
+ mof::Vector2D nextPosition = areaPosition;
+ if(m_pInputReceiver->checkKeyState(mof::InputReceiver::UP) && areaPosition.y > 0){
+ nextPosition.y--;
+ m_pCursor->move(et::Symbol::UP , toWorldCoord(nextPosition) , 10);
+ }
+ else if(m_pInputReceiver->checkKeyState(mof::InputReceiver::DOWN) && areaPosition.y < 10-1){
+ nextPosition.y++;
+ m_pCursor->move(et::Symbol::DOWN , toWorldCoord(nextPosition) , 10);
+ }
+ else if(m_pInputReceiver->checkKeyState(mof::InputReceiver::LEFT) && areaPosition.x > 0){
+ nextPosition.x--;
+ m_pCursor->move(et::Symbol::LEFT , toWorldCoord(nextPosition) , 10);
+ }
+ else if(m_pInputReceiver->checkKeyState(mof::InputReceiver::RIGHT) && areaPosition.x < 10-1){
+ nextPosition.x++;
+ m_pCursor->move(et::Symbol::RIGHT , toWorldCoord(nextPosition) , 10);
+ }
+ else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::Z)){
+ if(!m_pCursor->isTraveling()){
+ //\83G\83\8a\83A\83\81\83j\83\85\81[\90Ý\92è
+ m_pAreaMenu = new et::AreaMenu( m_pWorld->getArea(areaPosition.x , areaPosition.y) , m_pTextureManager
+ , m_pWorld , m_pGameData , areaPosition);
+ m_pCurrentFrame = m_pAreaMenu;
+
+ m_translationScheduler.clear();
+ m_translationScheduler.add(0 , m_pAreaMenu->getAnimationSet());
+ }
+
+ }
+ else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::X)){
+ //\83G\83\8a\83A\83\81\83j\83\85\81[\81¨\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[\82Ì\91J\88Ú\83A\83j\83\81\82ð\83Z\83b\83g
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition( 0 , mof::Vector3D(0.0f , 0.015f , 0.0f));
+ pAnimation->setPosition(30 , mof::Vector3D(0 , 0.0001 , 0));
+ m_menuChangeAnimation = mof::AnimationResource(pAnimation);
+
+ m_pWorldMenu = new et::WorldMenu(m_pTextureManager , m_pWorld , m_pGameData);
+ m_pCurrentFrame = m_pWorldMenu;
+
+ m_translationScheduler.clear();
+ m_translationScheduler.add(0 , m_pWorldMenu->getAnimationSet());
+ m_translationScheduler.add(0 , m_menuChangeAnimation);
+
+ }
+ }
+ else if(m_pCurrentFrame != NULL && m_translationScheduler.isFinalized()){
+
+ //\83E\83B\83\93\83h\83E\82É\91Î\82·\82é\83L\81[
+ if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::UP))m_pCurrentFrame->getSelectionModel()->previous();
+ else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::DOWN))m_pCurrentFrame->getSelectionModel()->next();
+ else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::Z) &&
+ m_pCurrentFrame->getSelectionModel()->getSelectingItem()->isAvailable()){
+
+ int selectedIndex = m_pCurrentFrame->getSelectionModel()->getSelectingIndex();
+ MyFrame* tmpFrame = m_pCurrentFrame;
+ MyFrame* pFrame = m_pCurrentFrame->performAction();
+ if(pFrame != m_pCurrentFrame){
+ //\83E\83B\83\93\83h\83E\82Ì\91J\88Ú
+ m_translationScheduler.clear();
+ if(!m_pCurrentFrame->isVisible())m_translationScheduler.add(0 , m_pCurrentFrame->getAnimationSet());
+ m_pCurrentFrame = pFrame;
+ if(m_pCurrentFrame != NULL)m_translationScheduler.add(0 , m_pCurrentFrame->getAnimationSet());
+
+ }
+ if(tmpFrame == m_pWorldMenu && selectedIndex == 1){
+ //\83\8f\81[\83\8b\83h\83\81\83j\83\85\81[\81¨\83G\83\8a\83A\83\81\83j\83\85\81[\82Ì\91J\88Ú\83A\83j\83\81\82ð\83Z\83b\83g
+ mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
+ pAnimation->setPosition( 0 , mof::Vector3D(0.0f , 0.0001f , 0.0f));
+ pAnimation->setPosition(30 , mof::Vector3D(0 , 0.015 , 0));
+ m_menuChangeAnimation = mof::AnimationResource(pAnimation);
+ m_translationScheduler.add(0 , m_menuChangeAnimation);
+
+ }
+ else if(tmpFrame == m_pWorldMenu && selectedIndex == 2){
+ //\83\8f\81[\83\8b\83h\83V\81[\83\93\82Ì\8fI\97¹
+ end(0);
+ }
+ }
+ else if(m_pInputReceiver->checkKeyPressed(mof::InputReceiver::X)){
+ if(m_pCurrentFrame == m_pAreaMenu){
+ m_pAreaMenu->setVisible(false);
+ m_pCurrentFrame = NULL;
+ }
+ }
+
+ }
+
+
+
+ //\83t\83\8c\81[\83\80\82Ì\8dX\90V\8f\88\97\9d
+ /*et::MyFrame** targets[] = {&m_pAreaMenu , &m_pWorldMenu};
+ int length = sizeof(targets) / sizeof(targets[0]);
+ for(int i = 0 ; i < length ; i++){
+ if(*(targets[i]) != NULL){
+ (*(targets[i]))->update();
+ if(!(*(targets[i]))->isVisible() && (*(targets[i]))->getAnimation(0)->isFinalized()){
+ delete *(targets[i]);
+ *(targets[i]) = NULL;
+ }
+ }
+ }*/
+ if(m_pAreaMenu != NULL){
+ m_pAreaMenu->update();
+ if(!m_pAreaMenu->isVisible() && m_pAreaMenu->getAnimation(0)->isFinalized()){
+ delete m_pAreaMenu;
+ m_pAreaMenu = NULL;
+ }
+ }
+ if(m_pWorldMenu != NULL){
+ m_pWorldMenu->update();
+ if(!m_pWorldMenu->isVisible() && m_pWorldMenu->getAnimation(0)->isFinalized()){
+ delete m_pWorldMenu;
+ m_pWorldMenu = NULL;
+ }
+ }
+ if(m_pWindow != NULL){
+ m_pWindow->update();
+ }
+
+ if(m_menuChangeAnimation.get() != NULL)m_menuChangeAnimation->update();
+ m_pCamera->setWorldTransform(mof::Matrix3D::createTranslation(mof::Vector3D(0.0f , 0.0f, 0.0f)));
+ m_pCamera->reflect();
+ m_pCursor->update();
+ m_pFeedEffect->update();
+
+ mof::Billboard::updateBillboardDirection(m_pCamera);
+ m_translationScheduler.update();
+
+ return true;
+}
+
-#pragma once\r
-#include "GameScene.h"\r
-#include "mof/Graphics.h"\r
-#include "mof/Camera.h"\r
-#include "mof/VertexBuffer.h"\r
-#include "mof/VertexTypes.h"\r
-#include "mof/Billboard.h"\r
-#include "MyWindow.h"\r
-#include "mof/InputReceiver.h"\r
-#include "WorldMapBuilder.h"\r
-#include "mof/Capturer.h"\r
-#include "WorldMapCursor.h"\r
-#include "GameData.h"\r
-#include "mof/SelectionModel.h"\r
-#include "MyFrame.h"\r
-#include "AreaMenu.h"\r
-#include "WorldMenu.h"\r
-#include "World.h"\r
-\r
-#include "mof/AnimationScheduler.h"\r
-\r
-namespace et{\r
-\r
- class WorldScene\r
- : public et::GameScene\r
- {\r
- \r
- \r
- //\8b¤\92Ê\r
- mof::Window* m_pWindow;\r
- mof::Camera* m_pCamera;\r
- mof::TextureResource m_pTexture;\r
- MyFrame* m_pCurrentFrame;\r
- et::World* m_pWorld;\r
- mof::AnimationResource m_menuChangeAnimation;\r
- \r
- //\83\8f\81[\83\8b\83h\83r\83\85\81[\r
- et::WorldMapBuilder* m_pBuilder;\r
- et::MapBuffer* m_pWorldMap;\r
- et::WorldMenu* m_pWorldMenu;\r
- \r
- //\83G\83\8a\83A\83r\83\85\81[\r
- et::WorldMapCursor* m_pCursor;\r
- mof::SoftVertexBuffer<mof::VertexXYZC>* m_pGrid;\r
- mof::SoftVertexBuffer<mof::VertexXYZC>* m_pPoint;\r
- et::AreaMenu* m_pAreaMenu;\r
-\r
- mof::AnimationScheduler m_translationScheduler;\r
-\r
-\r
- mof::Sprite* m_pFeedEffect;\r
- \r
- public:\r
- WorldScene();\r
- virtual ~WorldScene(void);\r
-\r
- \r
-\r
- virtual bool initialize();\r
- virtual bool draw();\r
- virtual bool update();\r
- \r
-\r
- };\r
-\r
-};\r
+#pragma once
+#include "GameScene.h"
+#include "mof/Graphics.h"
+#include "mof/Camera.h"
+#include "mof/VertexBuffer.h"
+#include "mof/VertexTypes.h"
+#include "mof/Billboard.h"
+#include "MyWindow.h"
+#include "mof/InputReceiver.h"
+#include "WorldMapBuilder.h"
+#include "mof/Capturer.h"
+#include "WorldMapCursor.h"
+#include "GameData.h"
+#include "mof/SelectionModel.h"
+#include "MyFrame.h"
+#include "AreaMenu.h"
+#include "WorldMenu.h"
+#include "World.h"
+
+#include "mof/AnimationScheduler.h"
+
+namespace et{
+
+ class WorldScene
+ : public et::GameScene
+ {
+
+
+ //\8b¤\92Ê
+ mof::Window* m_pWindow;
+ mof::Camera* m_pCamera;
+ mof::TextureResource m_pTexture;
+ MyFrame* m_pCurrentFrame;
+ et::World* m_pWorld;
+ mof::AnimationResource m_menuChangeAnimation;
+
+ //\83\8f\81[\83\8b\83h\83r\83\85\81[
+ et::WorldMapBuilder* m_pBuilder;
+ et::MapBuffer* m_pWorldMap;
+ et::WorldMenu* m_pWorldMenu;
+
+ //\83G\83\8a\83A\83r\83\85\81[
+ et::WorldMapCursor* m_pCursor;
+ mof::SoftVertexBuffer<mof::VertexXYZC>* m_pGrid;
+ mof::SoftVertexBuffer<mof::VertexXYZC>* m_pPoint;
+ et::AreaMenu* m_pAreaMenu;
+
+ mof::AnimationScheduler m_translationScheduler;
+
+
+ mof::Sprite* m_pFeedEffect;
+
+ public:
+ WorldScene();
+ virtual ~WorldScene(void);
+
+
+
+ virtual bool initialize();
+ virtual bool draw();
+ virtual bool update();
+
+
+ };
+
+};
-#pragma once\r
-\r
-#define FONT_SIZE_STANDARD 24\r
-#define FONT_SIZE_LARGE 36\r
-#define FONT_PATH_UME _T("font/ume-ugo4.ttf") \r
-//#define FONT_NAME_UME mof::Font::MS_GOTHIC\r
-#define FONT_NAME_UME _T("\94~UI\83S\83V\83b\83N") \r
+#pragma once
+
+#define FONT_SIZE_STANDARD 24
+#define FONT_SIZE_LARGE 36
+#define FONT_PATH_UME _T("font/ume-ugo4.ttf")
+//#define FONT_NAME_UME mof::Font::MS_GOTHIC
+#define FONT_NAME_UME _T("\94~UI\83S\83V\83b\83N")
-#include "configure.hpp"\r
-#include "mof/Application.hpp"\r
-#include "mof/streams.hpp"\r
-#include "mof/Color.hpp"\r
-#include <exception>\r
-#include "mof/utilities.hpp"\r
-#include "mof/ConsoleIO.hpp"\r
-#include <conio.h>\r
-#include "mof/Finalizer.hpp"\r
-#include "mof/Font.hpp"\r
-\r
-#include "Demo1.hpp"\r
-#include "Demo2.hpp"\r
-#include "Demo3.hpp"\r
-\r
-\r
-int main(int , char**)\r
-{\r
- mof::Font::addFontResource( FONT_PATH_UME );\r
- mof::Finalizer application;\r
- try\r
- {\r
- { // \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\8f\89\8aú\89»\r
- mof::Application::initialize\r
- (\r
- _T("MyApplication") ,\r
- 640 , 480 , false , // fullscreen\r
- 32 , 2 // 30FPS\r
- //16 , 1 // 60FPS\r
- ); \r
- application = mof::Finalizer( mof::Application::finalize );\r
- }\r
- \r
- { // \83V\81[\83\93\82Ì\83Z\83b\83g\82Æ\8aJ\8en\r
- mof::Scene scene;\r
- #define FIRST_SCENE ::Demo3\r
- scene.initialize = FIRST_SCENE::initialize;\r
- scene.finalize = FIRST_SCENE::finalize;\r
- scene.update = FIRST_SCENE::update;\r
- scene.draw = FIRST_SCENE::draw;\r
- mof::Application::run( scene );\r
- }\r
- }\r
- catch(std::exception& e)\r
- {\r
- DEBUG_PRINT( e.what() );\r
- getch();\r
- }\r
-\r
- return 0;\r
-}\r
+#include "configure.hpp"
+#include "mof/Application.hpp"
+#include "mof/streams.hpp"
+#include "mof/Color.hpp"
+#include <exception>
+#include "mof/utilities.hpp"
+#include "mof/ConsoleIO.hpp"
+#include <conio.h>
+#include "mof/Finalizer.hpp"
+#include "mof/Font.hpp"
+
+#include "Demo1.hpp"
+#include "Demo2.hpp"
+#include "Demo3.hpp"
+
+
+int main(int , char**)
+{
+ mof::Font::addFontResource( FONT_PATH_UME );
+ mof::Finalizer application;
+ try
+ {
+ { // \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\8f\89\8aú\89»
+ mof::Application::initialize
+ (
+ _T("MyApplication") ,
+ 640 , 480 , false , // fullscreen
+ 32 , 2 // 30FPS
+ //16 , 1 // 60FPS
+ );
+ application = mof::Finalizer( mof::Application::finalize );
+ }
+
+ { // \83V\81[\83\93\82Ì\83Z\83b\83g\82Æ\8aJ\8en
+ mof::Scene scene;
+ #define FIRST_SCENE ::Demo3
+ scene.initialize = FIRST_SCENE::initialize;
+ scene.finalize = FIRST_SCENE::finalize;
+ scene.update = FIRST_SCENE::update;
+ scene.draw = FIRST_SCENE::draw;
+ mof::Application::run( scene );
+ }
+ }
+ catch(std::exception& e)
+ {
+ DEBUG_PRINT( e.what() );
+ getch();
+ }
+
+ return 0;
+}
-#include "resource.hpp"\r
-#include <stdexcept>\r
-\r
-namespace\r
-{\r
- mof::TextureManagerHandler m_systemTextureManager;\r
- bool m_initialized = false;\r
-\r
- void initialize( )\r
- {\r
- m_systemTextureManager = mof::TextureManagerHandler( new mof::TextureManager );\r
- }\r
-}\r
-\r
-TextureManagerHandler \r
-getTextureResourceManager( ResourceGroup rg )\r
-{\r
- if( !m_initialized )initialize();\r
- switch( rg )\r
- {\r
- case SYSTEM :\r
- return m_systemTextureManager;\r
- default :\r
- std::runtime_error("invalid resource group"); \r
- }\r
-}\r
+#include "resource.hpp"
+#include <stdexcept>
+
+namespace
+{
+ mof::TextureManagerHandler m_systemTextureManager;
+ bool m_initialized = false;
+
+ void initialize( )
+ {
+ m_systemTextureManager = mof::TextureManagerHandler( new mof::TextureManager );
+ }
+}
+
+TextureManagerHandler
+getTextureResourceManager( ResourceGroup rg )
+{
+ if( !m_initialized )initialize();
+ switch( rg )
+ {
+ case SYSTEM :
+ return m_systemTextureManager;
+ default :
+ std::runtime_error("invalid resource group");
+ }
+}
-#pragma once\r
-#include <mof/graphics/utilities.hpp>\r
-\r
-enum ResourceGroup\r
-{\r
- /** アプリケーション全体共通のリソース */ SYSTEM \r
-};\r
-\r
-TextureManagerHandler getTextureResourceManager( ResourceGroup rg );\r
+#pragma once
+#include <mof/graphics/utilities.hpp>
+
+enum ResourceGroup
+{
+ /** アプリケーション全体共通のリソース */ SYSTEM
+};
+
+TextureManagerHandler getTextureResourceManager( ResourceGroup rg );
-#include "mof/Menu.hpp"\r
-#include "mof/Effect.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/LayoutManager.hpp"\r
-#include <boost/scoped_array.hpp>\r
-#include "mof/ConsoleIO.hpp"\r
-#include "mof/WidgetView.hpp"\r
-#include "mof/GraphicsDevice.hpp"\r
-#include "mof/mofAnimations.hpp"\r
-\r
-\r
-struct mof::Menu::Impl{\r
- mof::WidgetView* pBackgroundView;\r
- mof::LayoutManager* pLayout;\r
- std::shared_ptr<mof::Matrix2D> pTranslation;\r
- int width;\r
- int height;\r
- \r
- MenuItem* items;\r
- int size;\r
- int indicator;\r
-\r
- Impl( const mof::Rectangle<int>& _bounds)\r
- : pBackgroundView(NULL) , \r
- width(_bounds.endX - _bounds.beginX) , height(_bounds.endY - _bounds.beginY) ,\r
- items(NULL) , size(0) , indicator(0) , pLayout(NULL) {\r
- pTranslation = std::shared_ptr<mof::Matrix2D>(\r
- new mof::Matrix2D(\r
- mof::Matrix2D::createTranslation(\r
- mof::Vector2D(_bounds.beginX , _bounds.beginY )\r
- )\r
- )\r
- );\r
- }\r
-\r
- ~Impl(){\r
- for(int i = 0 ; i < size ; ++i){\r
- delete items[i].pView;\r
- }\r
- delete[] items;\r
- delete pLayout;\r
- delete pBackgroundView;\r
- }\r
-\r
-\r
- \r
-};\r
-\r
-\r
-mof::Menu::Menu\r
-(\r
- mof::WidgetView* pBackgroundView ,\r
- const mof::Menu::MenuItem & front ,\r
- const mof::Menu::MenuItem& back ,\r
- const mof::Rectangle<int>& bounds ,\r
- mof::LayoutManager* pLayout\r
-)\r
-: m_pImpl(new Impl(bounds))\r
-{\r
- m_pImpl->pLayout = pLayout;\r
- m_pImpl->pBackgroundView = pBackgroundView;\r
-\r
- m_pImpl->size = &back - &front + 1;\r
- if(m_pImpl->size <= 0)throw std::invalid_argument("the length of front-back is less than zero");\r
-\r
- m_pImpl->items = new MenuItem[m_pImpl->size];\r
- boost::scoped_array<mof::Rectangle<int> > boundList(new mof::Rectangle<int>[m_pImpl->size]);\r
- \r
- for(int i = 0 ; i < m_pImpl->size ; ++i){\r
- m_pImpl->items[i] = (&front)[i];\r
- mof::Rectangle<int> bounds = m_pImpl->items[i].pView->initialize();\r
- boundList[i] = bounds;\r
- }\r
-\r
- m_pImpl->pLayout->replace(m_pImpl->width , m_pImpl->height , boundList[0] , boundList[m_pImpl->size-1]);\r
-\r
- //TODO: LayoutAnimation\82ð\82Â\82\82é\r
- for(int i = 0 ; i < m_pImpl->size ; ++i){\r
- const mof::Animation<mof::Matrix2D>::Handler children[] = \r
- {\r
- mof::makeParametricHandler(m_pImpl->pTranslation) ,\r
- mof::makeConstantHandler\r
- (\r
- mof::Matrix2D::createTranslation( m_pImpl->pLayout->getPosition(i))\r
- )\r
- };\r
- \r
- m_pImpl->items[i].pView->setPosition\r
- (\r
- mof::Animation<mof::Matrix2D>::Handler\r
- (\r
- new mof::CascadingAnimation<mof::Matrix2D>(children[0] , children[1])\r
- )\r
- );\r
- }\r
- m_pImpl->pBackgroundView->setBounds(bounds);\r
- \r
-}\r
-\r
-\r
-mof::Menu::~Menu(){\r
-\r
-}\r
-\r
-void mof::Menu::show(){\r
- m_pImpl->pBackgroundView->show();\r
- for(int i = 0 ; i < m_pImpl->size ; ++i){\r
- m_pImpl->items[i].pView->show();\r
- }\r
-}\r
-\r
-void mof::Menu::close(){\r
- m_pImpl->pBackgroundView->close();\r
- for(int i = 0 ; i < m_pImpl->size ; ++i){\r
- m_pImpl->items[i].pView->close();\r
- }\r
-}\r
-\r
-void mof::Menu::up(){\r
- mof::Menu::MenuItem* pItem = &m_pImpl->items[m_pImpl->indicator];\r
- pItem->pView->blur();\r
-\r
- m_pImpl->indicator--;\r
- if(m_pImpl->indicator == -1)m_pImpl->indicator = m_pImpl->size -1;\r
-\r
- pItem = &m_pImpl->items[m_pImpl->indicator];\r
- pItem->pView->focus();\r
-}\r
-\r
-void mof::Menu::down(){\r
- mof::Menu::MenuItem* pItem = &m_pImpl->items[m_pImpl->indicator];\r
- pItem->pView->blur();\r
-\r
- m_pImpl->indicator++;\r
- if(m_pImpl->indicator == m_pImpl->size)m_pImpl->indicator = 0;\r
-\r
- pItem = &m_pImpl->items[m_pImpl->indicator];\r
- pItem->pView->focus();\r
-}\r
-\r
-\r
-\r
-void mof::Menu::left() {\r
-\r
-}\r
-\r
-void mof::Menu::right(){\r
-\r
-}\r
-\r
-void mof::Menu::performAction() const{\r
- if(!m_pImpl->items[m_pImpl->indicator].action)return;\r
- m_pImpl->items[m_pImpl->indicator].action();\r
-}\r
-\r
-void mof::Menu::draw() const{\r
- m_pImpl->pBackgroundView->draw();\r
- mof::GraphicsDevice::setViewport(m_pImpl->pBackgroundView->getBounds());\r
- for(int i = 0 ; i < m_pImpl->size ; ++i){\r
- m_pImpl->items[i].pView->getEffect()->draw();\r
- }\r
- mof::GraphicsDevice::setViewport(mof::Rectangle<int>(0 , 0 , 640 , 480));//TODO\r
-}\r
-\r
-\r
-void mof::Menu::update() {\r
- m_pImpl->pBackgroundView->update();\r
- for(int i = 0 ; i < m_pImpl->size ; ++i){\r
- m_pImpl->items[i].pView->update();\r
- }\r
-}\r
+#include "mof/Menu.hpp"
+#include "mof/Effect.hpp"
+#include "mof/utilities.hpp"
+#include "mof/LayoutManager.hpp"
+#include <boost/scoped_array.hpp>
+#include "mof/ConsoleIO.hpp"
+#include "mof/WidgetView.hpp"
+#include "mof/GraphicsDevice.hpp"
+#include "mof/mofAnimations.hpp"
+
+
+struct mof::Menu::Impl{
+ mof::WidgetView* pBackgroundView;
+ mof::LayoutManager* pLayout;
+ std::shared_ptr<mof::Matrix2D> pTranslation;
+ int width;
+ int height;
+
+ MenuItem* items;
+ int size;
+ int indicator;
+
+ Impl( const mof::Rectangle<int>& _bounds)
+ : pBackgroundView(NULL) ,
+ width(_bounds.endX - _bounds.beginX) , height(_bounds.endY - _bounds.beginY) ,
+ items(NULL) , size(0) , indicator(0) , pLayout(NULL) {
+ pTranslation = std::shared_ptr<mof::Matrix2D>(
+ new mof::Matrix2D(
+ mof::Matrix2D::createTranslation(
+ mof::Vector2D(_bounds.beginX , _bounds.beginY )
+ )
+ )
+ );
+ }
+
+ ~Impl(){
+ for(int i = 0 ; i < size ; ++i){
+ delete items[i].pView;
+ }
+ delete[] items;
+ delete pLayout;
+ delete pBackgroundView;
+ }
+
+
+
+};
+
+
+mof::Menu::Menu
+(
+ mof::WidgetView* pBackgroundView ,
+ const mof::Menu::MenuItem & front ,
+ const mof::Menu::MenuItem& back ,
+ const mof::Rectangle<int>& bounds ,
+ mof::LayoutManager* pLayout
+)
+: m_pImpl(new Impl(bounds))
+{
+ m_pImpl->pLayout = pLayout;
+ m_pImpl->pBackgroundView = pBackgroundView;
+
+ m_pImpl->size = &back - &front + 1;
+ if(m_pImpl->size <= 0)throw std::invalid_argument("the length of front-back is less than zero");
+
+ m_pImpl->items = new MenuItem[m_pImpl->size];
+ boost::scoped_array<mof::Rectangle<int> > boundList(new mof::Rectangle<int>[m_pImpl->size]);
+
+ for(int i = 0 ; i < m_pImpl->size ; ++i){
+ m_pImpl->items[i] = (&front)[i];
+ mof::Rectangle<int> bounds = m_pImpl->items[i].pView->initialize();
+ boundList[i] = bounds;
+ }
+
+ m_pImpl->pLayout->replace(m_pImpl->width , m_pImpl->height , boundList[0] , boundList[m_pImpl->size-1]);
+
+ //TODO: LayoutAnimation\82ð\82Â\82\82é
+ for(int i = 0 ; i < m_pImpl->size ; ++i){
+ const mof::Animation<mof::Matrix2D>::Handler children[] =
+ {
+ mof::makeParametricHandler(m_pImpl->pTranslation) ,
+ mof::makeConstantHandler
+ (
+ mof::Matrix2D::createTranslation( m_pImpl->pLayout->getPosition(i))
+ )
+ };
+
+ m_pImpl->items[i].pView->setPosition
+ (
+ mof::Animation<mof::Matrix2D>::Handler
+ (
+ new mof::CascadingAnimation<mof::Matrix2D>(children[0] , children[1])
+ )
+ );
+ }
+ m_pImpl->pBackgroundView->setBounds(bounds);
+
+}
+
+
+mof::Menu::~Menu(){
+
+}
+
+void mof::Menu::show(){
+ m_pImpl->pBackgroundView->show();
+ for(int i = 0 ; i < m_pImpl->size ; ++i){
+ m_pImpl->items[i].pView->show();
+ }
+}
+
+void mof::Menu::close(){
+ m_pImpl->pBackgroundView->close();
+ for(int i = 0 ; i < m_pImpl->size ; ++i){
+ m_pImpl->items[i].pView->close();
+ }
+}
+
+void mof::Menu::up(){
+ mof::Menu::MenuItem* pItem = &m_pImpl->items[m_pImpl->indicator];
+ pItem->pView->blur();
+
+ m_pImpl->indicator--;
+ if(m_pImpl->indicator == -1)m_pImpl->indicator = m_pImpl->size -1;
+
+ pItem = &m_pImpl->items[m_pImpl->indicator];
+ pItem->pView->focus();
+}
+
+void mof::Menu::down(){
+ mof::Menu::MenuItem* pItem = &m_pImpl->items[m_pImpl->indicator];
+ pItem->pView->blur();
+
+ m_pImpl->indicator++;
+ if(m_pImpl->indicator == m_pImpl->size)m_pImpl->indicator = 0;
+
+ pItem = &m_pImpl->items[m_pImpl->indicator];
+ pItem->pView->focus();
+}
+
+
+
+void mof::Menu::left() {
+
+}
+
+void mof::Menu::right(){
+
+}
+
+void mof::Menu::performAction() const{
+ if(!m_pImpl->items[m_pImpl->indicator].action)return;
+ m_pImpl->items[m_pImpl->indicator].action();
+}
+
+void mof::Menu::draw() const{
+ m_pImpl->pBackgroundView->draw();
+ mof::GraphicsDevice::setViewport(m_pImpl->pBackgroundView->getBounds());
+ for(int i = 0 ; i < m_pImpl->size ; ++i){
+ m_pImpl->items[i].pView->getEffect()->draw();
+ }
+ mof::GraphicsDevice::setViewport(mof::Rectangle<int>(0 , 0 , 640 , 480));//TODO
+}
+
+
+void mof::Menu::update() {
+ m_pImpl->pBackgroundView->update();
+ for(int i = 0 ; i < m_pImpl->size ; ++i){
+ m_pImpl->items[i].pView->update();
+ }
+}
-#include "resource.hpp"\r
-#include <stdexcept>\r
-\r
-namespace\r
-{\r
- mof::TextureManagerHandler m_systemTextureManager;\r
- bool m_initialized = false;\r
-\r
- void initialize( )\r
- {\r
- m_systemTextureManager = mof::TextureManagerHandler( new mof::TextureManager );\r
- }\r
-}\r
-\r
-mof::TextureManagerHandler \r
-getTextureResourceManager( ResourceGroup rg )\r
-{\r
- if( !m_initialized )initialize();\r
- switch( rg )\r
- {\r
- case SYSTEM :\r
- return m_systemTextureManager;\r
- default :\r
- std::runtime_error("invalid resource group"); \r
- }\r
-}\r
+#include "resource.hpp"
+#include <stdexcept>
+
+namespace
+{
+ mof::TextureManagerHandler m_systemTextureManager;
+ bool m_initialized = false;
+
+ void initialize( )
+ {
+ m_systemTextureManager = mof::TextureManagerHandler( new mof::TextureManager );
+ }
+}
+
+mof::TextureManagerHandler
+getTextureResourceManager( ResourceGroup rg )
+{
+ if( !m_initialized )initialize();
+ switch( rg )
+ {
+ case SYSTEM :
+ return m_systemTextureManager;
+ default :
+ std::runtime_error("invalid resource group");
+ }
+}
-#pragma once\r
-#include <mof/graphics/utilities.hpp>\r
-\r
-enum ResourceGroup\r
-{\r
- /** アプリケーション全体共通のリソース */ SYSTEM \r
-};\r
-\r
-mof::TextureManagerHandler getTextureResourceManager( ResourceGroup rg );\r
+#pragma once
+#include <mof/graphics/utilities.hpp>
+
+enum ResourceGroup
+{
+ /** アプリケーション全体共通のリソース */ SYSTEM
+};
+
+mof::TextureManagerHandler getTextureResourceManager( ResourceGroup rg );
-<?xml version="1.0" encoding="shift_jis"?>\r
-<VisualStudioProject\r
- ProjectType="Visual C++"\r
- Version="8.00"\r
- Name="rpg"\r
- ProjectGUID="{0F6EAEBE-4F7B-485F-99CE-5D9918CBC304}"\r
- >\r
- <Platforms>\r
- <Platform\r
- Name="Win32"\r
- />\r
- </Platforms>\r
- <ToolFiles>\r
- </ToolFiles>\r
- <Configurations>\r
- <Configuration\r
- Name="Debug|Win32"\r
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
- IntermediateDirectory="$(ConfigurationName)"\r
- ConfigurationType="1"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- Optimization="0"\r
- AdditionalIncludeDirectories=""C:\Program Files\Lua\5.1\include";"C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\rpg";"C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib""\r
- WarningLevel="4"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLinkerTool"\r
- AdditionalDependencies="moflib.lib lua5.1.lib"\r
- AdditionalLibraryDirectories=""C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\debug";"C:\Program Files\Lua\5.1\lib""\r
- GenerateDebugInformation="true"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCManifestTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCAppVerifierTool"\r
- />\r
- <Tool\r
- Name="VCWebDeploymentTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- />\r
- </Configuration>\r
- <Configuration\r
- Name="Release|Win32"\r
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
- IntermediateDirectory="$(ConfigurationName)"\r
- ConfigurationType="1"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- AdditionalIncludeDirectories=""C:\Program Files\Lua\5.1\include";"C:\Program Files\luabind-0.8";"C:\Program Files\Lua\5.1\include\cppunit";"C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib""\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLinkerTool"\r
- AdditionalOptions="/NODEFAULTLIB:library /LTCG"\r
- AdditionalDependencies="moflib.lib"\r
- AdditionalLibraryDirectories=""C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\release""\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCManifestTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCAppVerifierTool"\r
- />\r
- <Tool\r
- Name="VCWebDeploymentTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- />\r
- </Configuration>\r
- </Configurations>\r
- <References>\r
- </References>\r
- <Files>\r
- <Filter\r
- Name="\83\\81[\83X \83t\83@\83C\83\8b"\r
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
- >\r
- <File\r
- RelativePath=".\Demo1.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Demo2.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Demo3.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\main.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\resource.cpp"\r
- >\r
- </File>\r
- <Filter\r
- Name="widget"\r
- >\r
- <File\r
- RelativePath=".\widget\createFrame.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\createMenuView.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\HighlightButtonView.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\ImageTiler.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\ImageTileView.cpp"\r
- >\r
- </File>\r
- </Filter>\r
- </Filter>\r
- <Filter\r
- Name="\83\8a\83\\81[\83X \83t\83@\83C\83\8b"\r
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
- >\r
- </Filter>\r
- <Filter\r
- Name="\83w\83b\83_\81[ \83t\83@\83C\83\8b"\r
- Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
- >\r
- <File\r
- RelativePath=".\configure.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Demo1.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Demo2.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Demo3.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\resource.hpp"\r
- >\r
- </File>\r
- <Filter\r
- Name="widget"\r
- >\r
- <File\r
- RelativePath=".\widget\createFrame.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\createMenuView.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\HighlightButtonView.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\ImageTiler.hpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\widget\ImageTileView.hpp"\r
- >\r
- </File>\r
- </Filter>\r
- </Filter>\r
- </Files>\r
- <Globals>\r
- </Globals>\r
-</VisualStudioProject>\r
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="rpg"
+ ProjectGUID="{0F6EAEBE-4F7B-485F-99CE-5D9918CBC304}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""C:\Program Files\Lua\5.1\include";"C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\rpg";"C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib""
+ WarningLevel="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="moflib.lib lua5.1.lib"
+ AdditionalLibraryDirectories=""C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\debug";"C:\Program Files\Lua\5.1\lib""
+ GenerateDebugInformation="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""C:\Program Files\Lua\5.1\include";"C:\Program Files\luabind-0.8";"C:\Program Files\Lua\5.1\include\cppunit";"C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NODEFAULTLIB:library /LTCG"
+ AdditionalDependencies="moflib.lib"
+ AdditionalLibraryDirectories=""C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\release""
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="\83\\81[\83X \83t\83@\83C\83\8b"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\Demo1.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Demo2.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Demo3.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\main.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.cpp"
+ >
+ </File>
+ <Filter
+ Name="widget"
+ >
+ <File
+ RelativePath=".\widget\createFrame.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\createMenuView.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\HighlightButtonView.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\ImageTiler.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\ImageTileView.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="\83\8a\83\\81[\83X \83t\83@\83C\83\8b"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <Filter
+ Name="\83w\83b\83_\81[ \83t\83@\83C\83\8b"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\configure.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Demo1.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Demo2.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Demo3.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.hpp"
+ >
+ </File>
+ <Filter
+ Name="widget"
+ >
+ <File
+ RelativePath=".\widget\createFrame.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\createMenuView.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\HighlightButtonView.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\ImageTiler.hpp"
+ >
+ </File>
+ <File
+ RelativePath=".\widget\ImageTileView.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
-<?xml version="1.0" encoding="shift_jis"?>\r
-<VisualStudioUserFile\r
- ProjectType="Visual C++"\r
- Version="8.00"\r
- ShowAllFiles="false"\r
- >\r
- <Configurations>\r
- <Configuration\r
- Name="Debug|Win32"\r
- >\r
- <DebugSettings\r
- Command="$(TargetPath)"\r
- WorkingDirectory="C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\debug"\r
- CommandArguments=""\r
- Attach="false"\r
- DebuggerType="3"\r
- Remote="1"\r
- RemoteMachine="TOMOHIRO"\r
- RemoteCommand=""\r
- HttpUrl=""\r
- PDBPath=""\r
- SQLDebugging=""\r
- Environment=""\r
- EnvironmentMerge="true"\r
- DebuggerFlavor="0"\r
- MPIRunCommand=""\r
- MPIRunArguments=""\r
- MPIRunWorkingDirectory=""\r
- ApplicationCommand=""\r
- ApplicationArguments=""\r
- ShimCommand=""\r
- MPIAcceptMode=""\r
- MPIAcceptFilter=""\r
- />\r
- </Configuration>\r
- <Configuration\r
- Name="Release|Win32"\r
- >\r
- <DebugSettings\r
- Command="$(TargetPath)"\r
- WorkingDirectory=""\r
- CommandArguments=""\r
- Attach="false"\r
- DebuggerType="3"\r
- Remote="1"\r
- RemoteMachine="TOMOHIRO"\r
- RemoteCommand=""\r
- HttpUrl=""\r
- PDBPath=""\r
- SQLDebugging=""\r
- Environment=""\r
- EnvironmentMerge="true"\r
- DebuggerFlavor=""\r
- MPIRunCommand=""\r
- MPIRunArguments=""\r
- MPIRunWorkingDirectory=""\r
- ApplicationCommand=""\r
- ApplicationArguments=""\r
- ShimCommand=""\r
- MPIAcceptMode=""\r
- MPIAcceptFilter=""\r
- />\r
- </Configuration>\r
- </Configurations>\r
-</VisualStudioUserFile>\r
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioUserFile
+ ProjectType="Visual C++"
+ Version="8.00"
+ ShowAllFiles="false"
+ >
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ >
+ <DebugSettings
+ Command="$(TargetPath)"
+ WorkingDirectory="C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\debug"
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="TOMOHIRO"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor="0"
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ >
+ <DebugSettings
+ Command="$(TargetPath)"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="TOMOHIRO"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ </Configurations>
+</VisualStudioUserFile>
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{0F6EAEBE-4F7B-485F-99CE-5D9918CBC304}</ProjectGuid>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>\r
- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib;C:\Program Files\Microsoft DirectX SDK %28February 2010%29\Lib\x86;C:\Program Files\boost\boost_1_40_0\stage\lib;$(LibraryPath)</LibraryPath>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <ClCompile>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\rpg;C:\Program Files\Lua\5.1\include;C:\Program Files\boost\boost_1_40_0;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\rpg\extlib;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib\extlib\expat\include</AdditionalIncludeDirectories>\r
- <WarningLevel>Level4</WarningLevel>\r
- <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>moflib.lib;sqlite3.lib</AdditionalDependencies>\r
- <AdditionalLibraryDirectories>C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\debug;C:\Program Files\Lua\5.1\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <ClCompile>\r
- <AdditionalIncludeDirectories>C:\Program Files\Lua\5.1\include;C:\Program Files\luabind-0.8;C:\Program Files\Lua\5.1\include\cppunit;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalOptions>/NODEFAULTLIB:library /LTCG %(AdditionalOptions)</AdditionalOptions>\r
- <AdditionalDependencies>moflib.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <AdditionalLibraryDirectories>C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClCompile Include="CharacterBoard.cpp" />\r
- <ClCompile Include="Demo1.cpp" />\r
- <ClCompile Include="Demo2.cpp" />\r
- <ClCompile Include="Demo3.cpp" />\r
- <ClCompile Include="main.cpp" />\r
- <ClCompile Include="resource.cpp" />\r
- <ClCompile Include="script\MyEnvironment.cpp" />\r
- <ClCompile Include="Settings.cpp" />\r
- <ClCompile Include="sqlite_wrapper.cpp" />\r
- <ClCompile Include="TestScene.cpp" />\r
- <ClCompile Include="widget\createFrame.cpp" />\r
- <ClCompile Include="widget\createMenuView.cpp" />\r
- <ClCompile Include="widget\HighlightButtonView.cpp" />\r
- <ClCompile Include="widget\ImageTiler.cpp" />\r
- <ClCompile Include="widget\ImageTileView.cpp" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="CharacterBoard.hpp" />\r
- <ClInclude Include="configure.hpp" />\r
- <ClInclude Include="Demo1.hpp" />\r
- <ClInclude Include="Demo2.hpp" />\r
- <ClInclude Include="Demo3.hpp" />\r
- <ClInclude Include="resource.hpp" />\r
- <ClInclude Include="script\MyEnvironment.hpp" />\r
- <ClInclude Include="Settings.hpp" />\r
- <ClInclude Include="sqlite_wrapper.hpp" />\r
- <ClInclude Include="TestScene.hpp" />\r
- <ClInclude Include="widget\createFrame.hpp" />\r
- <ClInclude Include="widget\createMenuView.hpp" />\r
- <ClInclude Include="widget\HighlightButtonView.hpp" />\r
- <ClInclude Include="widget\ImageTiler.hpp" />\r
- <ClInclude Include="widget\ImageTileView.hpp" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\moflib\moflib\moflib.vcxproj">\r
- <Project>{04cd4817-1559-4830-bcb0-c5ae997cd904}</Project>\r
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{0F6EAEBE-4F7B-485F-99CE-5D9918CBC304}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib;C:\Program Files\Microsoft DirectX SDK %28February 2010%29\Lib\x86;C:\Program Files\boost\boost_1_40_0\stage\lib;$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\rpg;C:\Program Files\Lua\5.1\include;C:\Program Files\boost\boost_1_40_0;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\rpg\extlib;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib\extlib\expat\include</AdditionalIncludeDirectories>
+ <WarningLevel>Level4</WarningLevel>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>moflib.lib;sqlite3.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\debug;C:\Program Files\Lua\5.1\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>C:\Program Files\Lua\5.1\include;C:\Program Files\luabind-0.8;C:\Program Files\Lua\5.1\include\cppunit;C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\moflib\moflib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/NODEFAULTLIB:library /LTCG %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>moflib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>C:\Documents and Settings\TomohiroYasuda\My Documents\Visual Studio 2005\Projects\rpg\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="CharacterBoard.cpp" />
+ <ClCompile Include="Demo1.cpp" />
+ <ClCompile Include="Demo2.cpp" />
+ <ClCompile Include="Demo3.cpp" />
+ <ClCompile Include="main.cpp" />
+ <ClCompile Include="resource.cpp" />
+ <ClCompile Include="script\MyEnvironment.cpp" />
+ <ClCompile Include="Settings.cpp" />
+ <ClCompile Include="sqlite_wrapper.cpp" />
+ <ClCompile Include="TestScene.cpp" />
+ <ClCompile Include="widget\createFrame.cpp" />
+ <ClCompile Include="widget\createMenuView.cpp" />
+ <ClCompile Include="widget\HighlightButtonView.cpp" />
+ <ClCompile Include="widget\ImageTiler.cpp" />
+ <ClCompile Include="widget\ImageTileView.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="CharacterBoard.hpp" />
+ <ClInclude Include="configure.hpp" />
+ <ClInclude Include="Demo1.hpp" />
+ <ClInclude Include="Demo2.hpp" />
+ <ClInclude Include="Demo3.hpp" />
+ <ClInclude Include="resource.hpp" />
+ <ClInclude Include="script\MyEnvironment.hpp" />
+ <ClInclude Include="Settings.hpp" />
+ <ClInclude Include="sqlite_wrapper.hpp" />
+ <ClInclude Include="TestScene.hpp" />
+ <ClInclude Include="widget\createFrame.hpp" />
+ <ClInclude Include="widget\createMenuView.hpp" />
+ <ClInclude Include="widget\HighlightButtonView.hpp" />
+ <ClInclude Include="widget\ImageTiler.hpp" />
+ <ClInclude Include="widget\ImageTileView.hpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\moflib\moflib\moflib.vcxproj">
+ <Project>{04cd4817-1559-4830-bcb0-c5ae997cd904}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project>
\ No newline at end of file
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup>\r
- <Filter Include="ソース ファイル">\r
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
- </Filter>\r
- <Filter Include="ソース ファイル\widget">\r
- <UniqueIdentifier>{add1e201-f39b-4bbe-a2c2-94e94303e6fa}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="リソース ファイル">\r
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>\r
- </Filter>\r
- <Filter Include="ヘッダー ファイル">\r
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
- </Filter>\r
- <Filter Include="ヘッダー ファイル\widget">\r
- <UniqueIdentifier>{3b7a5d19-fdb1-41de-a6eb-0b0264cdfde1}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="ヘッダー ファイル\script">\r
- <UniqueIdentifier>{1f07a6e6-4368-41c1-98c4-3904c828a74e}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="ソース ファイル\script">\r
- <UniqueIdentifier>{16614efb-9490-4228-977d-e2a13c3f6179}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="ヘッダー ファイル\other">\r
- <UniqueIdentifier>{9eac29d6-8d45-4ddb-9a0f-e291ab144ab5}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="ソース ファイル\other">\r
- <UniqueIdentifier>{375d9b3c-d9d6-4ae1-9518-a717ba580359}</UniqueIdentifier>\r
- </Filter>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="Demo1.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- <ClCompile Include="Demo2.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- <ClCompile Include="Demo3.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- <ClCompile Include="main.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- <ClCompile Include="resource.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- <ClCompile Include="widget\createFrame.cpp">\r
- <Filter>ソース ファイル\widget</Filter>\r
- </ClCompile>\r
- <ClCompile Include="widget\createMenuView.cpp">\r
- <Filter>ソース ファイル\widget</Filter>\r
- </ClCompile>\r
- <ClCompile Include="widget\HighlightButtonView.cpp">\r
- <Filter>ソース ファイル\widget</Filter>\r
- </ClCompile>\r
- <ClCompile Include="widget\ImageTiler.cpp">\r
- <Filter>ソース ファイル\widget</Filter>\r
- </ClCompile>\r
- <ClCompile Include="widget\ImageTileView.cpp">\r
- <Filter>ソース ファイル\widget</Filter>\r
- </ClCompile>\r
- <ClCompile Include="script\MyEnvironment.cpp">\r
- <Filter>ソース ファイル\script</Filter>\r
- </ClCompile>\r
- <ClCompile Include="TestScene.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- <ClCompile Include="CharacterBoard.cpp">\r
- <Filter>ソース ファイル\other</Filter>\r
- </ClCompile>\r
- <ClCompile Include="Settings.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- <ClCompile Include="sqlite_wrapper.cpp">\r
- <Filter>ソース ファイル</Filter>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="configure.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- <ClInclude Include="Demo1.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- <ClInclude Include="Demo2.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- <ClInclude Include="Demo3.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- <ClInclude Include="resource.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- <ClInclude Include="widget\createFrame.hpp">\r
- <Filter>ヘッダー ファイル\widget</Filter>\r
- </ClInclude>\r
- <ClInclude Include="widget\createMenuView.hpp">\r
- <Filter>ヘッダー ファイル\widget</Filter>\r
- </ClInclude>\r
- <ClInclude Include="widget\HighlightButtonView.hpp">\r
- <Filter>ヘッダー ファイル\widget</Filter>\r
- </ClInclude>\r
- <ClInclude Include="widget\ImageTiler.hpp">\r
- <Filter>ヘッダー ファイル\widget</Filter>\r
- </ClInclude>\r
- <ClInclude Include="widget\ImageTileView.hpp">\r
- <Filter>ヘッダー ファイル\widget</Filter>\r
- </ClInclude>\r
- <ClInclude Include="script\MyEnvironment.hpp">\r
- <Filter>ヘッダー ファイル\script</Filter>\r
- </ClInclude>\r
- <ClInclude Include="TestScene.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- <ClInclude Include="CharacterBoard.hpp">\r
- <Filter>ヘッダー ファイル\other</Filter>\r
- </ClInclude>\r
- <ClInclude Include="Settings.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- <ClInclude Include="sqlite_wrapper.hpp">\r
- <Filter>ヘッダー ファイル</Filter>\r
- </ClInclude>\r
- </ItemGroup>\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="ソース ファイル">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="ソース ファイル\widget">
+ <UniqueIdentifier>{add1e201-f39b-4bbe-a2c2-94e94303e6fa}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="リソース ファイル">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ <Filter Include="ヘッダー ファイル">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="ヘッダー ファイル\widget">
+ <UniqueIdentifier>{3b7a5d19-fdb1-41de-a6eb-0b0264cdfde1}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="ヘッダー ファイル\script">
+ <UniqueIdentifier>{1f07a6e6-4368-41c1-98c4-3904c828a74e}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="ソース ファイル\script">
+ <UniqueIdentifier>{16614efb-9490-4228-977d-e2a13c3f6179}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="ヘッダー ファイル\other">
+ <UniqueIdentifier>{9eac29d6-8d45-4ddb-9a0f-e291ab144ab5}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="ソース ファイル\other">
+ <UniqueIdentifier>{375d9b3c-d9d6-4ae1-9518-a717ba580359}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="Demo1.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ <ClCompile Include="Demo2.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ <ClCompile Include="Demo3.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ <ClCompile Include="main.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ <ClCompile Include="resource.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ <ClCompile Include="widget\createFrame.cpp">
+ <Filter>ソース ファイル\widget</Filter>
+ </ClCompile>
+ <ClCompile Include="widget\createMenuView.cpp">
+ <Filter>ソース ファイル\widget</Filter>
+ </ClCompile>
+ <ClCompile Include="widget\HighlightButtonView.cpp">
+ <Filter>ソース ファイル\widget</Filter>
+ </ClCompile>
+ <ClCompile Include="widget\ImageTiler.cpp">
+ <Filter>ソース ファイル\widget</Filter>
+ </ClCompile>
+ <ClCompile Include="widget\ImageTileView.cpp">
+ <Filter>ソース ファイル\widget</Filter>
+ </ClCompile>
+ <ClCompile Include="script\MyEnvironment.cpp">
+ <Filter>ソース ファイル\script</Filter>
+ </ClCompile>
+ <ClCompile Include="TestScene.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ <ClCompile Include="CharacterBoard.cpp">
+ <Filter>ソース ファイル\other</Filter>
+ </ClCompile>
+ <ClCompile Include="Settings.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ <ClCompile Include="sqlite_wrapper.cpp">
+ <Filter>ソース ファイル</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="configure.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="Demo1.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="Demo2.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="Demo3.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="widget\createFrame.hpp">
+ <Filter>ヘッダー ファイル\widget</Filter>
+ </ClInclude>
+ <ClInclude Include="widget\createMenuView.hpp">
+ <Filter>ヘッダー ファイル\widget</Filter>
+ </ClInclude>
+ <ClInclude Include="widget\HighlightButtonView.hpp">
+ <Filter>ヘッダー ファイル\widget</Filter>
+ </ClInclude>
+ <ClInclude Include="widget\ImageTiler.hpp">
+ <Filter>ヘッダー ファイル\widget</Filter>
+ </ClInclude>
+ <ClInclude Include="widget\ImageTileView.hpp">
+ <Filter>ヘッダー ファイル\widget</Filter>
+ </ClInclude>
+ <ClInclude Include="script\MyEnvironment.hpp">
+ <Filter>ヘッダー ファイル\script</Filter>
+ </ClInclude>
+ <ClInclude Include="TestScene.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="CharacterBoard.hpp">
+ <Filter>ヘッダー ファイル\other</Filter>
+ </ClInclude>
+ <ClInclude Include="Settings.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ <ClInclude Include="sqlite_wrapper.hpp">
+ <Filter>ヘッダー ファイル</Filter>
+ </ClInclude>
+ </ItemGroup>
</Project>
\ No newline at end of file
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <LocalDebuggerWorkingDirectory>$(SolutionDir)$(Configuration)\</LocalDebuggerWorkingDirectory>\r
- <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>\r
- </PropertyGroup>\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerWorkingDirectory>$(SolutionDir)$(Configuration)\</LocalDebuggerWorkingDirectory>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
</Project>
\ No newline at end of file
-#include "widget/HighlightButtonView.hpp"\r
-#include "mof/mofGraphics.hpp"\r
-#include "mof/Sprite.hpp"\r
-#include "mof/widget/Effect.hpp"\r
-#include "mof/utilities.hpp"\r
-#include "mof/widgets.hpp"\r
-#include "mof/streams.hpp"\r
-#include "resource.hpp"\r
-\r
-using mof::widget::WidgetView;\r
-\r
-namespace \r
-{\r
- const mof::Color4f HIGHLIGHT_COLOR( 0.8f , 0.4f , 0.6f , 1 );\r
- const mof::Color4f HIGHLIGHT_COLOR2( 1 , 0.6f , 0.8f , 1 );\r
- const mof::Color4f NORMAL_COLOR( 0 , 0.4f , 0.6f , 1 );\r
- const mof::Color4f HIGHLIGHT_TEXT_COLOR_FASE1( 1 , 1 , 1 , 0.5f );\r
- const mof::Color4f HIGHLIGHT_TEXT_COLOR_FASE2( 1 , 0.5f , 1 , 0.7f );\r
- const mof::Color4f HIGHLIGHT_TEXT_COLOR_FASE3( 1 , 0.8f , 1 , 0.9f );\r
- const mof::Color4f NORMAL_TEXT_COLOR( 1 , 1 , 1 , 1 );\r
-}\r
-//{{{ struct Impl\r
-struct HighlightButtonView::Impl\r
-{\r
- mof::Effect* pEffect;\r
- WidgetView* pView;\r
- mof::Vector2D preferredSize;\r
- mof::ReferenceWrapper<mof::Color4f> imageColorWrapper;\r
- mof::ReferenceWrapper<mof::Color4f> bgColorWrapper;\r
- bool visible_;\r
- bool is_disable_;\r
-\r
- Impl( WidgetView* pView_, bool is_disable )\r
- : visible_(true), pEffect( NULL ) , pView( pView_ ), is_disable_(is_disable)\r
- {\r
- }\r
-\r
- ~Impl()\r
- {\r
- delete pEffect;\r
- delete pView;\r
- }\r
-\r
-};\r
-//}}}\r
-//{{{ constructor\r
-HighlightButtonView::HighlightButtonView\r
-(\r
- const boost::function<WidgetView*(void)>& viewFactory,\r
- bool is_disable \r
-)\r
-: m_pImpl( new Impl( viewFactory(), is_disable ) ) \r
-{\r
- m_pImpl->pEffect = new mof::Effect( );\r
- { \r
- m_pImpl->pView->getPositionStream()\r
- << getPositionStream()\r
- << mof::Vector2D( 0 , 0 )\r
- << mof::Vector2D( 0 , 0 );\r
- m_pImpl->pView->getColorStream() \r
- << getColorStream() \r
- << m_pImpl->imageColorWrapper.makeRef(mof::Color4f(1 , 1 , 1 , 1))\r
- << m_pImpl->imageColorWrapper.makeRef(NORMAL_TEXT_COLOR);\r
- m_pImpl->preferredSize = m_pImpl->pView->getSizeStream().value(); \r
- m_sizeStream << m_pImpl->preferredSize; \r
- }\r
- { // 背景の生成\r
- mof::Sprite* pSprite = new mof::Sprite\r
- (\r
- ::getTextureResourceManager( SYSTEM )->getResource( "image/fill.png" ) , \r
- mof::Rectangle<mof::real>( 0 , 0 , 1 , 1 ) \r
- );\r
- m_pImpl->pEffect->addSprite(_T("bg") , pSprite);\r
- \r
- pSprite->getPositionStream() << getPositionStream( ) << mof::Vector2D( 0 , 0 ) << mof::Vector2D( 0 , 0 );\r
- pSprite->getColorStream() \r
- << getColorStream() \r
- << m_pImpl->bgColorWrapper.makeRef(mof::Color4f(0 , 1 , 1 , 1))\r
- << m_pImpl->bgColorWrapper.makeRef(NORMAL_COLOR);\r
- pSprite->setSizeStream( m_sizeStream );//背景のサイズはビューのサイズに依存\r
- }\r
-\r
- \r
-}\r
-//}}}\r
-//{{{ destructor\r
-HighlightButtonView::~HighlightButtonView()\r
-{\r
-}\r
-//}}}\r
-//{{{ update\r
-void HighlightButtonView::update( )\r
-{\r
- m_positionStream.update( );\r
- m_sizeStream.update( );\r
- m_colorStream.update( );\r
- m_pImpl->pEffect->update( );\r
- m_pImpl->pView->update( );\r
-}\r
-//}}}\r
-//{{{ draw\r
-void HighlightButtonView::draw( ) const\r
-{\r
- if (!m_pImpl->visible_) return; \r
- m_pImpl->pEffect->draw( );\r
- m_pImpl->pView->draw( );\r
-}\r
-//}}}\r
-//{{{ setVisible\r
-void HighlightButtonView::setVisible(bool visible)\r
-{\r
- m_pImpl->visible_ = visible;\r
-}\r
-//}}}\r
-//{{{ show\r
-mof::FrameNumber HighlightButtonView::show( bool imidiately ) \r
-{\r
- m_pImpl->pView->show( imidiately );\r
- if( imidiately )\r
- {\r
- m_pImpl->imageColorWrapper.replace(0 , mof::Color4f(1 , 1 , 1 , 1));\r
- m_pImpl->bgColorWrapper.replace(0 , mof::Color4f(1 , 1 , 1 , 1));\r
- return 0;\r
- }\r
- \r
- { //Text更新\r
- m_pImpl->imageColorWrapper.replace\r
- (\r
- 0 , m_colorStream ,\r
- mof::makeKeyFrameAnimationHandler\r
- ( \r
- 0 , mof::Color4f(0 , 1, 1 , 1) ,\r
- 30 , mof::Color4f(1 , 1, 1 , 1) \r
- ) \r
- );\r
- }\r
- { //背景更新(透明度)\r
- m_pImpl->bgColorWrapper.replace\r
- (\r
- 0 , m_colorStream , \r
- mof::makeKeyFrameAnimationHandler\r
- ( \r
- 0 , mof::Color4f(0 , 1, 1 , 1) ,\r
- 30 , mof::Color4f(1 , 1, 1 , 1) \r
- ) \r
- );\r
- }\r
-\r
- return 30;\r
-}\r
-//}}}\r
-//{{{ hide\r
-mof::FrameNumber HighlightButtonView::hide( bool imidiately )\r
-{\r
- m_pImpl->pView->hide( imidiately );\r
- if( imidiately )\r
- {\r
- m_pImpl->imageColorWrapper.replace(0 , mof::Color4f( 0 , 1 , 1 , 1)); \r
- m_pImpl->bgColorWrapper.replace(0 , mof::makeConstantHandler( mof::Color4f( 0 , 1 , 1 , 1 ) ));\r
- return 0;\r
- }\r
- \r
- { //Text更新\r
- m_pImpl->imageColorWrapper.replace\r
- ( \r
- 0 , m_colorStream ,\r
- mof::makeKeyFrameAnimationHandler\r
- ( \r
- 0 , mof::Color4f(1 , 1, 1 , 1) ,\r
- 30 , mof::Color4f(0 , 1, 1 , 1) \r
- ) \r
- );\r
- }\r
- { //背景更新\r
- m_pImpl->bgColorWrapper.replace\r
- (\r
- 0 , m_colorStream ,\r
- mof::makeKeyFrameAnimationHandler\r
- ( \r
- 0 , mof::Color4f(1 , 1, 1 , 1) ,\r
- 30 , mof::Color4f(0 , 1, 1 , 1) \r
- ) \r
- );\r
- }\r
-\r
- return 30;\r
-}\r
-//}}}\r
-//{{{ focus\r
-mof::FrameNumber HighlightButtonView::focus( bool imidiately ) \r
-{\r
- m_pImpl->pView->focus( imidiately );\r
- \r
- //TODO imidiately , shared\r
- static mof::Manipulator<mof::Color4f>::Handler manip;\r
- static bool isInitialized = false;\r
- if(!isInitialized)\r
- {\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame keyFrames[] = {\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(0 , HIGHLIGHT_TEXT_COLOR_FASE2) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(30 , HIGHLIGHT_TEXT_COLOR_FASE2) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(50 , HIGHLIGHT_TEXT_COLOR_FASE1) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(70 , HIGHLIGHT_TEXT_COLOR_FASE1) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(120 , HIGHLIGHT_TEXT_COLOR_FASE2) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(170 , HIGHLIGHT_TEXT_COLOR_FASE2) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(220 , HIGHLIGHT_TEXT_COLOR_FASE3) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(270 , HIGHLIGHT_TEXT_COLOR_FASE2) ,\r
- };\r
- manip = mof::makeKeyFrameAnimationHandler<mof::Color4f>\r
- (\r
- keyFrames[0] , mof::lastOf(keyFrames)\r
- );\r
- isInitialized = true;\r
- }\r
- {\r
- if (!m_pImpl->is_disable_) m_pImpl->imageColorWrapper.replace(1 , m_colorStream , manip);\r
- m_pImpl->bgColorWrapper.replace(1 , HIGHLIGHT_COLOR);\r
- return 30;\r
- }\r
- \r
-}\r
-//}}}\r
-//{{{ blur\r
-mof::FrameNumber HighlightButtonView::blur( bool imidiately )\r
-{\r
- m_pImpl->pView->blur( imidiately );\r
- {\r
- if (!m_pImpl->is_disable_) m_pImpl->imageColorWrapper.replace(1 , NORMAL_TEXT_COLOR);\r
- m_pImpl->bgColorWrapper.replace(1 , NORMAL_COLOR);\r
- return 0;\r
- }\r
-\r
-}\r
-//}}}\r
-//{{{ click \r
-mof::FrameNumber HighlightButtonView::click(bool)\r
-{\r
- static mof::Manipulator<mof::Color4f>::Handler manip1;\r
- static mof::Manipulator<mof::Color4f>::Handler manip2;\r
- static bool isInitialized = false;\r
- if(!isInitialized)\r
- {\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame keyFrames1[] = {\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(0 , HIGHLIGHT_TEXT_COLOR_FASE2) ,\r
- };\r
- manip1 = mof::makeKeyFrameAnimationHandler<mof::Color4f>\r
- (\r
- keyFrames1[0] , mof::lastOf(keyFrames1)\r
- );\r
-\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame keyFrames2[] = {\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(0 , HIGHLIGHT_COLOR) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(5 , HIGHLIGHT_COLOR2) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(10 , HIGHLIGHT_COLOR) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(15 , HIGHLIGHT_COLOR2) ,\r
- mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(20 , HIGHLIGHT_COLOR) ,\r
- };\r
- manip2 = mof::makeKeyFrameAnimationHandler<mof::Color4f>\r
- (\r
- keyFrames2[0] , mof::lastOf(keyFrames2)\r
- );\r
- isInitialized = true;\r
- }\r
- {\r
- m_pImpl->imageColorWrapper.replace(1 , m_colorStream , manip1);\r
- m_pImpl->bgColorWrapper.replace(1, m_colorStream, manip2);\r
- return 10;\r
- }\r
-}\r
-//}}}\r
-//{{{ getPreferredSize\r
-mof::Vector2D HighlightButtonView::getPreferredSize() const\r
-{\r
- return m_pImpl->preferredSize;\r
-}\r
-//}}}\r
-\r
+#include "widget/HighlightButtonView.hpp"
+#include "mof/mofGraphics.hpp"
+#include "mof/Sprite.hpp"
+#include "mof/widget/Effect.hpp"
+#include "mof/utilities.hpp"
+#include "mof/widgets.hpp"
+#include "mof/streams.hpp"
+#include "resource.hpp"
+
+using mof::widget::WidgetView;
+
+namespace
+{
+ const mof::Color4f HIGHLIGHT_COLOR( 0.8f , 0.4f , 0.6f , 1 );
+ const mof::Color4f HIGHLIGHT_COLOR2( 1 , 0.6f , 0.8f , 1 );
+ const mof::Color4f NORMAL_COLOR( 0 , 0.4f , 0.6f , 1 );
+ const mof::Color4f HIGHLIGHT_TEXT_COLOR_FASE1( 1 , 1 , 1 , 0.5f );
+ const mof::Color4f HIGHLIGHT_TEXT_COLOR_FASE2( 1 , 0.5f , 1 , 0.7f );
+ const mof::Color4f HIGHLIGHT_TEXT_COLOR_FASE3( 1 , 0.8f , 1 , 0.9f );
+ const mof::Color4f NORMAL_TEXT_COLOR( 1 , 1 , 1 , 1 );
+}
+//{{{ struct Impl
+struct HighlightButtonView::Impl
+{
+ mof::Effect* pEffect;
+ WidgetView* pView;
+ mof::Vector2D preferredSize;
+ mof::ReferenceWrapper<mof::Color4f> imageColorWrapper;
+ mof::ReferenceWrapper<mof::Color4f> bgColorWrapper;
+ bool visible_;
+ bool is_disable_;
+
+ Impl( WidgetView* pView_, bool is_disable )
+ : visible_(true), pEffect( NULL ) , pView( pView_ ), is_disable_(is_disable)
+ {
+ }
+
+ ~Impl()
+ {
+ delete pEffect;
+ delete pView;
+ }
+
+};
+//}}}
+//{{{ constructor
+HighlightButtonView::HighlightButtonView
+(
+ const boost::function<WidgetView*(void)>& viewFactory,
+ bool is_disable
+)
+: m_pImpl( new Impl( viewFactory(), is_disable ) )
+{
+ m_pImpl->pEffect = new mof::Effect( );
+ {
+ m_pImpl->pView->getPositionStream()
+ << getPositionStream()
+ << mof::Vector2D( 0 , 0 )
+ << mof::Vector2D( 0 , 0 );
+ m_pImpl->pView->getColorStream()
+ << getColorStream()
+ << m_pImpl->imageColorWrapper.makeRef(mof::Color4f(1 , 1 , 1 , 1))
+ << m_pImpl->imageColorWrapper.makeRef(NORMAL_TEXT_COLOR);
+ m_pImpl->preferredSize = m_pImpl->pView->getSizeStream().value();
+ m_sizeStream << m_pImpl->preferredSize;
+ }
+ { // 背景の生成
+ mof::Sprite* pSprite = new mof::Sprite
+ (
+ ::getTextureResourceManager( SYSTEM )->getResource( "image/fill.png" ) ,
+ mof::Rectangle<mof::real>( 0 , 0 , 1 , 1 )
+ );
+ m_pImpl->pEffect->addSprite(_T("bg") , pSprite);
+
+ pSprite->getPositionStream() << getPositionStream( ) << mof::Vector2D( 0 , 0 ) << mof::Vector2D( 0 , 0 );
+ pSprite->getColorStream()
+ << getColorStream()
+ << m_pImpl->bgColorWrapper.makeRef(mof::Color4f(0 , 1 , 1 , 1))
+ << m_pImpl->bgColorWrapper.makeRef(NORMAL_COLOR);
+ pSprite->setSizeStream( m_sizeStream );//背景のサイズはビューのサイズに依存
+ }
+
+
+}
+//}}}
+//{{{ destructor
+HighlightButtonView::~HighlightButtonView()
+{
+}
+//}}}
+//{{{ update
+void HighlightButtonView::update( )
+{
+ m_positionStream.update( );
+ m_sizeStream.update( );
+ m_colorStream.update( );
+ m_pImpl->pEffect->update( );
+ m_pImpl->pView->update( );
+}
+//}}}
+//{{{ draw
+void HighlightButtonView::draw( ) const
+{
+ if (!m_pImpl->visible_) return;
+ m_pImpl->pEffect->draw( );
+ m_pImpl->pView->draw( );
+}
+//}}}
+//{{{ setVisible
+void HighlightButtonView::setVisible(bool visible)
+{
+ m_pImpl->visible_ = visible;
+}
+//}}}
+//{{{ show
+mof::FrameNumber HighlightButtonView::show( bool imidiately )
+{
+ m_pImpl->pView->show( imidiately );
+ if( imidiately )
+ {
+ m_pImpl->imageColorWrapper.replace(0 , mof::Color4f(1 , 1 , 1 , 1));
+ m_pImpl->bgColorWrapper.replace(0 , mof::Color4f(1 , 1 , 1 , 1));
+ return 0;
+ }
+
+ { //Text更新
+ m_pImpl->imageColorWrapper.replace
+ (
+ 0 , m_colorStream ,
+ mof::makeKeyFrameAnimationHandler
+ (
+ 0 , mof::Color4f(0 , 1, 1 , 1) ,
+ 30 , mof::Color4f(1 , 1, 1 , 1)
+ )
+ );
+ }
+ { //背景更新(透明度)
+ m_pImpl->bgColorWrapper.replace
+ (
+ 0 , m_colorStream ,
+ mof::makeKeyFrameAnimationHandler
+ (
+ 0 , mof::Color4f(0 , 1, 1 , 1) ,
+ 30 , mof::Color4f(1 , 1, 1 , 1)
+ )
+ );
+ }
+
+ return 30;
+}
+//}}}
+//{{{ hide
+mof::FrameNumber HighlightButtonView::hide( bool imidiately )
+{
+ m_pImpl->pView->hide( imidiately );
+ if( imidiately )
+ {
+ m_pImpl->imageColorWrapper.replace(0 , mof::Color4f( 0 , 1 , 1 , 1));
+ m_pImpl->bgColorWrapper.replace(0 , mof::makeConstantHandler( mof::Color4f( 0 , 1 , 1 , 1 ) ));
+ return 0;
+ }
+
+ { //Text更新
+ m_pImpl->imageColorWrapper.replace
+ (
+ 0 , m_colorStream ,
+ mof::makeKeyFrameAnimationHandler
+ (
+ 0 , mof::Color4f(1 , 1, 1 , 1) ,
+ 30 , mof::Color4f(0 , 1, 1 , 1)
+ )
+ );
+ }
+ { //背景更新
+ m_pImpl->bgColorWrapper.replace
+ (
+ 0 , m_colorStream ,
+ mof::makeKeyFrameAnimationHandler
+ (
+ 0 , mof::Color4f(1 , 1, 1 , 1) ,
+ 30 , mof::Color4f(0 , 1, 1 , 1)
+ )
+ );
+ }
+
+ return 30;
+}
+//}}}
+//{{{ focus
+mof::FrameNumber HighlightButtonView::focus( bool imidiately )
+{
+ m_pImpl->pView->focus( imidiately );
+
+ //TODO imidiately , shared
+ static mof::Manipulator<mof::Color4f>::Handler manip;
+ static bool isInitialized = false;
+ if(!isInitialized)
+ {
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame keyFrames[] = {
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(0 , HIGHLIGHT_TEXT_COLOR_FASE2) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(30 , HIGHLIGHT_TEXT_COLOR_FASE2) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(50 , HIGHLIGHT_TEXT_COLOR_FASE1) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(70 , HIGHLIGHT_TEXT_COLOR_FASE1) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(120 , HIGHLIGHT_TEXT_COLOR_FASE2) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(170 , HIGHLIGHT_TEXT_COLOR_FASE2) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(220 , HIGHLIGHT_TEXT_COLOR_FASE3) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(270 , HIGHLIGHT_TEXT_COLOR_FASE2) ,
+ };
+ manip = mof::makeKeyFrameAnimationHandler<mof::Color4f>
+ (
+ keyFrames[0] , mof::lastOf(keyFrames)
+ );
+ isInitialized = true;
+ }
+ {
+ if (!m_pImpl->is_disable_) m_pImpl->imageColorWrapper.replace(1 , m_colorStream , manip);
+ m_pImpl->bgColorWrapper.replace(1 , HIGHLIGHT_COLOR);
+ return 30;
+ }
+
+}
+//}}}
+//{{{ blur
+mof::FrameNumber HighlightButtonView::blur( bool imidiately )
+{
+ m_pImpl->pView->blur( imidiately );
+ {
+ if (!m_pImpl->is_disable_) m_pImpl->imageColorWrapper.replace(1 , NORMAL_TEXT_COLOR);
+ m_pImpl->bgColorWrapper.replace(1 , NORMAL_COLOR);
+ return 0;
+ }
+
+}
+//}}}
+//{{{ click
+mof::FrameNumber HighlightButtonView::click(bool)
+{
+ static mof::Manipulator<mof::Color4f>::Handler manip1;
+ static mof::Manipulator<mof::Color4f>::Handler manip2;
+ static bool isInitialized = false;
+ if(!isInitialized)
+ {
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame keyFrames1[] = {
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(0 , HIGHLIGHT_TEXT_COLOR_FASE2) ,
+ };
+ manip1 = mof::makeKeyFrameAnimationHandler<mof::Color4f>
+ (
+ keyFrames1[0] , mof::lastOf(keyFrames1)
+ );
+
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame keyFrames2[] = {
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(0 , HIGHLIGHT_COLOR) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(5 , HIGHLIGHT_COLOR2) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(10 , HIGHLIGHT_COLOR) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(15 , HIGHLIGHT_COLOR2) ,
+ mof::KeyFrameAnimation<mof::Color4f>::KeyFrame(20 , HIGHLIGHT_COLOR) ,
+ };
+ manip2 = mof::makeKeyFrameAnimationHandler<mof::Color4f>
+ (
+ keyFrames2[0] , mof::lastOf(keyFrames2)
+ );
+ isInitialized = true;
+ }
+ {
+ m_pImpl->imageColorWrapper.replace(1 , m_colorStream , manip1);
+ m_pImpl->bgColorWrapper.replace(1, m_colorStream, manip2);
+ return 10;
+ }
+}
+//}}}
+//{{{ getPreferredSize
+mof::Vector2D HighlightButtonView::getPreferredSize() const
+{
+ return m_pImpl->preferredSize;
+}
+//}}}
+
-#pragma once\r
-#include "mof/widget/WidgetView.hpp"\r
-#include "mof/FactoryMethod.hpp"\r
-#include "mof/graphics/utilities.hpp"\r
-#include "mof/widget/utilities.hpp"\r
-#include <boost/scoped_ptr.hpp>\r
-#include <boost/function.hpp>\r
-\r
-using mof::widget::WidgetView;\r
-\r
-class HighlightButtonView \r
-: \r
- public WidgetView\r
-{\r
-public:\r
- HighlightButtonView(const boost::function<WidgetView*(void)>& child, bool is_disable_item);\r
- virtual ~HighlightButtonView( );\r
-\r
- virtual mof::FrameNumber show( bool imidiately = false );\r
- virtual mof::FrameNumber hide( bool imidiately = false );\r
- virtual mof::FrameNumber focus( bool imidiately = false );\r
- virtual mof::FrameNumber blur( bool imidiately = false );\r
- virtual mof::FrameNumber click( bool imidiately = false );\r
- virtual mof::Vector2D getPreferredSize() const;\r
- virtual void update( );\r
- virtual void draw( ) const;\r
- virtual void setVisible(bool visible);\r
-\r
-private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- \r
-};\r
-\r
+#pragma once
+#include "mof/widget/WidgetView.hpp"
+#include "mof/FactoryMethod.hpp"
+#include "mof/graphics/utilities.hpp"
+#include "mof/widget/utilities.hpp"
+#include <boost/scoped_ptr.hpp>
+#include <boost/function.hpp>
+
+using mof::widget::WidgetView;
+
+class HighlightButtonView
+:
+ public WidgetView
+{
+public:
+ HighlightButtonView(const boost::function<WidgetView*(void)>& child, bool is_disable_item);
+ virtual ~HighlightButtonView( );
+
+ virtual mof::FrameNumber show( bool imidiately = false );
+ virtual mof::FrameNumber hide( bool imidiately = false );
+ virtual mof::FrameNumber focus( bool imidiately = false );
+ virtual mof::FrameNumber blur( bool imidiately = false );
+ virtual mof::FrameNumber click( bool imidiately = false );
+ virtual mof::Vector2D getPreferredSize() const;
+ virtual void update( );
+ virtual void draw( ) const;
+ virtual void setVisible(bool visible);
+
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+
+};
+
-#include "widget/ImageTileView.hpp"\r
-#include "widget/ImageTiler.hpp"\r
-#include <memory>\r
-#include <memory>\r
-#include <mof/streams.hpp>\r
-\r
-using std::shared_ptr;\r
-using std::make_shared;\r
-using mof::FrameNumber;\r
-using mof::Texture;\r
-using namespace mof::widget;\r
-\r
-//{{{ struct Impl\r
-struct ImageTileView::Impl\r
-{\r
- ImageTiler tiler;\r
-\r
- Impl( const shared_ptr<Texture>& pTexture )\r
- : tiler( pTexture )\r
- {\r
- }\r
-};\r
-//}}}\r
-//{{{ constructor\r
-ImageTileView::ImageTileView( const shared_ptr<Texture>& pTexture )\r
-: m_pImpl( new Impl (pTexture ) )\r
-{\r
-}\r
-//}}}\r
-//{{{ destructor\r
-ImageTileView::~ImageTileView()\r
-{\r
-}\r
-//}}}\r
-//{{{ show\r
-FrameNumber ImageTileView::show( bool )\r
-{\r
- return 0;\r
-}\r
-//}}}\r
-//{{{ hide\r
-FrameNumber ImageTileView::hide( bool )\r
-{\r
- return 0;\r
-}\r
-//}}}\r
-//{{{ focus\r
-FrameNumber ImageTileView::focus( bool )\r
-{\r
- return 0;\r
-}\r
-//}}}\r
-//{{{ blur\r
-FrameNumber ImageTileView::blur( bool )\r
-{\r
- return 0;\r
-}\r
-//}}}\r
-//{{{ click\r
-FrameNumber ImageTileView::click( bool )\r
-{\r
- return 0;\r
-}\r
-//}}}\r
-//{{{ getPreferredSize\r
-mof::Vector2D ImageTileView::getPreferredSize() const\r
-{\r
- return mof::Vector2D(0, 0);\r
-}\r
-//}}}\r
-//{{{ update\r
-void ImageTileView::update( )\r
-{\r
- m_positionStream.update( );\r
- m_sizeStream.update( );\r
- m_colorStream.update();\r
-\r
- mof::Rectangle<float> region;\r
- mof::Vector2D position = m_positionStream.value();\r
- mof::Vector2D size = m_sizeStream.value();\r
- region.beginX = position.x;\r
- region.beginY = position.y;\r
- region.endX = region.beginX + size.x;\r
- region.endY = region.beginY + size.y;\r
- m_pImpl->tiler.setRegion( region );\r
- m_pImpl->tiler.setColor(m_colorStream.value().toColorCode());\r
- \r
-}\r
-//}}}\r
-//{{{ draw\r
-void ImageTileView::draw( ) const\r
-{\r
- m_pImpl->tiler.draw( );\r
-}\r
-//}}}\r
-//{{{ setVisible\r
-void ImageTileView::setVisible(bool visible)\r
-{\r
- m_pImpl->tiler.setVisible(visible);\r
-}\r
-//}}}\r
+#include "widget/ImageTileView.hpp"
+#include "widget/ImageTiler.hpp"
+#include <memory>
+#include <memory>
+#include <mof/streams.hpp>
+
+using std::shared_ptr;
+using std::make_shared;
+using mof::FrameNumber;
+using mof::Texture;
+using namespace mof::widget;
+
+//{{{ struct Impl
+struct ImageTileView::Impl
+{
+ ImageTiler tiler;
+
+ Impl( const shared_ptr<Texture>& pTexture )
+ : tiler( pTexture )
+ {
+ }
+};
+//}}}
+//{{{ constructor
+ImageTileView::ImageTileView( const shared_ptr<Texture>& pTexture )
+: m_pImpl( new Impl (pTexture ) )
+{
+}
+//}}}
+//{{{ destructor
+ImageTileView::~ImageTileView()
+{
+}
+//}}}
+//{{{ show
+FrameNumber ImageTileView::show( bool )
+{
+ return 0;
+}
+//}}}
+//{{{ hide
+FrameNumber ImageTileView::hide( bool )
+{
+ return 0;
+}
+//}}}
+//{{{ focus
+FrameNumber ImageTileView::focus( bool )
+{
+ return 0;
+}
+//}}}
+//{{{ blur
+FrameNumber ImageTileView::blur( bool )
+{
+ return 0;
+}
+//}}}
+//{{{ click
+FrameNumber ImageTileView::click( bool )
+{
+ return 0;
+}
+//}}}
+//{{{ getPreferredSize
+mof::Vector2D ImageTileView::getPreferredSize() const
+{
+ return mof::Vector2D(0, 0);
+}
+//}}}
+//{{{ update
+void ImageTileView::update( )
+{
+ m_positionStream.update( );
+ m_sizeStream.update( );
+ m_colorStream.update();
+
+ mof::Rectangle<float> region;
+ mof::Vector2D position = m_positionStream.value();
+ mof::Vector2D size = m_sizeStream.value();
+ region.beginX = position.x;
+ region.beginY = position.y;
+ region.endX = region.beginX + size.x;
+ region.endY = region.beginY + size.y;
+ m_pImpl->tiler.setRegion( region );
+ m_pImpl->tiler.setColor(m_colorStream.value().toColorCode());
+
+}
+//}}}
+//{{{ draw
+void ImageTileView::draw( ) const
+{
+ m_pImpl->tiler.draw( );
+}
+//}}}
+//{{{ setVisible
+void ImageTileView::setVisible(bool visible)
+{
+ m_pImpl->tiler.setVisible(visible);
+}
+//}}}
-#pragma once\r
-#include "mof/widget/WidgetView.hpp"\r
-#include "mof/FactoryMethod.hpp"\r
-#include "mof/graphics/utilities.hpp"\r
-#include "mof/widget/utilities.hpp"\r
-#include <memory>\r
-\r
-\r
-class ImageTileView : public mof::widget::WidgetView\r
-{\r
-public:\r
- ImageTileView( const std::shared_ptr<mof::Texture>& pTexture );\r
- virtual ~ImageTileView( );\r
-\r
- virtual mof::FrameNumber show( bool imidiately = false );\r
- virtual mof::FrameNumber hide( bool imidiately = false );\r
- virtual mof::FrameNumber focus( bool imidiately = false );\r
- virtual mof::FrameNumber blur( bool imidiately = false );\r
- virtual mof::FrameNumber click( bool imidiately = false );\r
- virtual mof::Vector2D getPreferredSize() const;\r
- virtual void update( );\r
- virtual void draw( ) const;\r
- virtual void setVisible(bool visible);\r
-\r
-private:\r
- struct Impl;\r
- std::unique_ptr<Impl> m_pImpl;\r
- \r
-};\r
-\r
+#pragma once
+#include "mof/widget/WidgetView.hpp"
+#include "mof/FactoryMethod.hpp"
+#include "mof/graphics/utilities.hpp"
+#include "mof/widget/utilities.hpp"
+#include <memory>
+
+
+class ImageTileView : public mof::widget::WidgetView
+{
+public:
+ ImageTileView( const std::shared_ptr<mof::Texture>& pTexture );
+ virtual ~ImageTileView( );
+
+ virtual mof::FrameNumber show( bool imidiately = false );
+ virtual mof::FrameNumber hide( bool imidiately = false );
+ virtual mof::FrameNumber focus( bool imidiately = false );
+ virtual mof::FrameNumber blur( bool imidiately = false );
+ virtual mof::FrameNumber click( bool imidiately = false );
+ virtual mof::Vector2D getPreferredSize() const;
+ virtual void update( );
+ virtual void draw( ) const;
+ virtual void setVisible(bool visible);
+
+private:
+ struct Impl;
+ std::unique_ptr<Impl> m_pImpl;
+
+};
+
-#include "widget/ImageTileWidgetView.hpp"\r
-#include "mof/GraphicsDevice.hpp"\r
-#include "mof/Sprite.hpp"\r
-#include "widget/Frame.hpp"\r
-#include "mof/streams.hpp"\r
-#include "mof/Font.hpp"\r
-\r
-\r
-\r
-struct ImageTileWidgetView::Impl{\r
-\r
- Frame* pFrame;\r
- mof::Manipulator<bool>::Handler visible;\r
- mof::FrameNumber frame;\r
- mof::Rectangle<int> bounds;\r
- //mof::Sprite* pCaption;\r
- \r
-\r
- Impl( )\r
- : pFrame(NULL) , frame(0) \r
- {\r
- }\r
-\r
- ~Impl(){\r
- delete pFrame;\r
- }\r
-};\r
-\r
-\r
-ImageTileWidgetView::ImageTileWidgetView\r
-(\r
- const mof::tstring& filepath \r
-)\r
-: m_pImpl( new Impl( ) )\r
-{\r
-\r
- std::shared_ptr<mof::Texture> pTexture(new mof::Texture( filepath));\r
- m_pImpl->pFrame = new Frame( pTexture );\r
- //mof::Manipulator<mof::Matrix2D>::Handler t = mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) ;\r
- //m_pImpl->transform = mof::makeJointHandler( t );\r
- //m_pImpl->transform = mof::makeJointHandler< mof::Matrix2D >( mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) );\r
- \r
- { //visible\82Ì\90Ý\92è\r
- //m_pImpl->visible = mof::makeConstantHandler(false);\r
- }\r
-\r
- //m_pImpl->pCaption = mof::Sprite::createTextSprite( mof::Font(mof::Font::MS_P_GOTHIC , 25) , title );\r
-}\r
- \r
-ImageTileWidgetView::~ImageTileWidgetView()\r
-{\r
-\r
-}\r
-\r
-\r
-\r
-\r
-void ImageTileWidgetView::update( )\r
-{\r
- m_pImpl->frame++;\r
- //m_pImpl->pCaption->update();\r
- /*mof::Matrix2D transformMatrix = m_pImpl->transform->getValue(m_pImpl->frame);\r
- mof::Vector2D begin = mof::Vector2D(0 , 0) * transformMatrix;\r
- mof::Vector2D end = mof::Vector2D(1 , 1) * transformMatrix;\r
- m_pImpl->pFrame->setRegion(mof::Rectangle<int>(begin.x , begin. y , end.x , end.y)); \r
- */\r
-}\r
- \r
-void ImageTileWidgetView::draw() const\r
-{\r
- if(m_pImpl->visible->value(m_pImpl->frame))\r
- {\r
- m_pImpl->pFrame->draw();\r
- //m_pImpl->pCaption->draw();\r
- }\r
-}\r
-\r
-\r
-\r
-/*\r
-#include "mof/ImageTileWidgetView.hpp"\r
-#include "mof/GraphicsDevice.hpp"\r
-#include "mof/Sprite.hpp"\r
-#include "mof/Frame.hpp"\r
-#include "mof/mofManipulators.hpp"\r
-#include "mof/Font.hpp"\r
-\r
-struct mof::ImageTileWidgetView::Impl{\r
-\r
- mof::Frame* pFrame;\r
- mof::Joint< mof::Matrix2D , mof::Matrix2D >::Handler transform;\r
- mof::Manipulator<bool>::Handler visible;\r
- mof::FrameNumber frame;\r
- mof::Rectangle<int> bounds;\r
- //mof::Sprite* pCaption;\r
- \r
-\r
- Impl( )\r
- : pFrame(NULL) , frame(0) \r
- {\r
- }\r
-\r
- ~Impl(){\r
- delete pFrame;\r
- }\r
-};\r
-\r
-\r
-mof::ImageTileWidgetView::ImageTileWidgetView(\r
- const mof::tstring& filepath \r
- )\r
- : m_pImpl( new Impl( ) ){\r
-\r
- std::shared_ptr<mof::Texture> pTexture(new mof::Texture( filepath));\r
- m_pImpl->pFrame = new mof::Frame( pTexture);\r
- //mof::Manipulator<mof::Matrix2D>::Handler t = mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) ;\r
- //m_pImpl->transform = mof::makeJointHandler( t );\r
- m_pImpl->transform = mof::makeJointHandler< mof::Matrix2D >( mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) );\r
- {\r
- //visible\82Ì\90Ý\92è\r
- m_pImpl->visible = mof::makeConstantHandler(false);\r
- }\r
-\r
- //m_pImpl->pCaption = mof::Sprite::createTextSprite( mof::Font(mof::Font::MS_P_GOTHIC , 25) , title );\r
-}\r
- \r
-mof::ImageTileWidgetView::~ImageTileWidgetView(){\r
-\r
-}\r
-\r
-\r
-void mof::ImageTileWidgetView::focus(){\r
-\r
-}\r
- \r
-void mof::ImageTileWidgetView::blur(){\r
-\r
-}\r
-\r
-//{{{ show\r
-void mof::ImageTileWidgetView::show(){\r
- const int endWidth = m_pImpl->bounds.endX - m_pImpl->bounds.beginX;\r
- const int beginWidth = static_cast<int>( static_cast<float>(endWidth ) / 10.0f );\r
- const int endHeight = m_pImpl->bounds.endY - m_pImpl->bounds.beginY;\r
- const int beginHeight = static_cast<int>( static_cast<float>(endHeight ) / 10.0f);\r
- mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames1[] = {\r
- mof::makeKeyFrame(0 , mof::Vector2D(beginWidth , beginHeight )) ,\r
- mof::makeKeyFrame(10 , mof::Vector2D(endWidth , beginHeight )) ,\r
- mof::makeKeyFrame(20 , mof::Vector2D(endWidth , endHeight))\r
- };\r
-\r
- const int beginCX = (m_pImpl->bounds.beginX + m_pImpl->bounds.endX - beginWidth) / 2;\r
- const int beginCY = (m_pImpl->bounds.beginY + m_pImpl->bounds.endY - beginHeight) / 2;\r
- mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames2[] = {\r
- mof::makeKeyFrame(0 , mof::Vector2D(beginCX , beginCY )) ,\r
- mof::makeKeyFrame(10 , mof::Vector2D(m_pImpl->bounds.beginX , beginCY )) ,\r
- mof::makeKeyFrame(20 , mof::Vector2D(m_pImpl->bounds.beginX , m_pImpl->bounds.beginY))\r
- };\r
- mof::Manipulator<mof::Matrix2D>::Handler list[] = {\r
- mof::Manipulator<mof::Matrix2D>::Handler(new mof::ScalingAnimation2D(keyFrames1[0] , keyFrames1[2])) ,\r
- mof::Manipulator<mof::Matrix2D>::Handler(new mof::TranslationAnimation2D(keyFrames2[0] , keyFrames2[2])) ,\r
- };\r
- m_pImpl->transform->set( mof::Manipulator<mof::Matrix2D>::Handler(new mof::CascadingAnimation<mof::Matrix2D>(list[0] , list[1])) );\r
-\r
- {\r
- //title\8aÖ\8cW\82Ì\90Ý\92è\r
- {\r
- //world transform\r
- mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames[] = {\r
- mof::makeKeyFrame(0 , mof::Vector2D(-10 , 0 ) ) ,\r
- mof::makeKeyFrame(20 , mof::Vector2D(-10 , 0 ) ) ,\r
- mof::makeKeyFrame(30 , mof::Vector2D(0 , 0 ) ) \r
- };\r
- mof::Manipulator<mof::Matrix2D>::Handler tmp(new mof::TranslationAnimation2D(keyFrames[0] , keyFrames[2]));\r
-\r
- mof::Manipulator<mof::Matrix2D>::Handler list[]= {\r
- mof::makeConstantHandler( mof::Matrix2D::createScaling( m_pImpl->pCaption->getWorldTransform().getDiagonal())) ,\r
- mof::makeConstantHandler( mof::Matrix2D::createTranslation(mof::Vector2D(m_pImpl->bounds.beginX + 20 , m_pImpl->bounds.beginY + 5 )) ) ,\r
- tmp\r
- };\r
- m_pImpl->pCaption->setWorldTransform(mof::Manipulator<mof::Matrix2D>::Handler(new mof::CascadingAnimation<mof::Matrix2D>(list[0] , list[2])));\r
-\r
- }\r
- mof::KeyFrameManipulator<mof::Color4f>::KeyFrame keyFrames[] = {\r
- mof::makeKeyFrame(0 , mof::Color4f(0 , 1 , 1 , 1) ) ,\r
- mof::makeKeyFrame(20 , mof::Color4f(0 , 1 , 1 , 1) ) ,\r
- mof::makeKeyFrame(30 , mof::Color4f(1 , 1 , 1 , 1) ) \r
- };\r
- m_pImpl->pCaption->setColor(mof::Manipulator<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[2])));\r
- m_pImpl->pCaption->setFrameNumber(0);\r
- }\r
- {\r
- //visible\82Ì\90Ý\92è\r
- m_pImpl->visible = mof::makeConstantHandler(true);\r
- }\r
- m_pImpl->frame = 0;\r
-\r
-}\r
-//}}} \r
-//{{{ close\r
-void mof::ImageTileWidgetView::close(){\r
- const int beginWidth = m_pImpl->bounds.endX - m_pImpl->bounds.beginX;\r
- const int endWidth = static_cast<int>( static_cast<float>(beginWidth ) / 10.0f );\r
- const int beginHeight = m_pImpl->bounds.endY - m_pImpl->bounds.beginY;\r
- const int endHeight = static_cast<int>( static_cast<float>(beginHeight ) / 10.0f);\r
- mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames1[] = {\r
- mof::makeKeyFrame(0 , mof::Vector2D(beginWidth , beginHeight )) ,\r
- mof::makeKeyFrame(10 , mof::Vector2D(beginWidth , endHeight )) ,\r
- mof::makeKeyFrame(20 , mof::Vector2D(endWidth , endHeight))\r
- };\r
-\r
- const int endCX = (m_pImpl->bounds.beginX + m_pImpl->bounds.endX - endWidth) / 2;\r
- const int endCY = (m_pImpl->bounds.beginY + m_pImpl->bounds.endY - endHeight) / 2;\r
- mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames2[] = {\r
- mof::makeKeyFrame(0 , mof::Vector2D(m_pImpl->bounds.beginX , m_pImpl->bounds.beginY )) ,\r
- mof::makeKeyFrame(10 , mof::Vector2D(m_pImpl->bounds.beginX , endCY)) ,\r
- mof::makeKeyFrame(20 , mof::Vector2D(endCX , endCY ))\r
- };\r
- mof::Manipulator<mof::Matrix2D>::Handler list[] = {\r
- mof::Manipulator<mof::Matrix2D>::Handler(new mof::ScalingAnimation2D(keyFrames1[0] , keyFrames1[2])) ,\r
- mof::Manipulator<mof::Matrix2D>::Handler(new mof::TranslationAnimation2D(keyFrames2[0] , keyFrames2[2])) ,\r
- };\r
- m_pImpl->transform->set( mof::Manipulator<mof::Matrix2D>::Handler(new mof::CascadingAnimation<mof::Matrix2D>(list[0] , list[1])) );\r
-\r
- {\r
- //title\8aÖ\8cW\82Ì\90Ý\92è\r
- //m_pImpl->pCaption->setColor(mof::Color4f(0 , 0 , 0 , 0));\r
- //m_pImpl->pCaption->setFrameNumber(0);\r
- }\r
- {\r
- //visible\82Ì\90Ý\92è\r
- mof::KeyFrameManipulator<bool>::KeyFrame keyFrames[] = {\r
- mof::makeKeyFrame(0 , true) ,\r
- mof::makeKeyFrame(20 , false) \r
- };\r
- m_pImpl->visible = mof::Manipulator<bool>::Handler(\r
- new mof::KeyFrameManipulator<bool>(keyFrames[0] , keyFrames[1] , &mof::stepInterpolate<bool> )\r
- );\r
- }\r
- m_pImpl->frame = 0;\r
-}\r
-//}}}\r
-mof::Manipulator<mof::Vector2D>::Handler mof::ImageTileWidgetView::getPosition( ) const\r
-{\r
- return mof::dynamic::makeTranslation2DHandler( m_pImpl->transform );\r
-}\r
-\r
-mof::Manipulator<mof::Vector2D>::Handler mof::ImageTileWidgetView::getSize( ) const\r
-{\r
- return mof::dynamic::makeScaling2DHandler( m_pImpl->transform );\r
-}\r
-\r
-\r
-void mof::ImageTileWidgetView::setBounds(const mof::Rectangle<int>& bounds)\r
-{\r
- m_pImpl->bounds = bounds;\r
-}\r
-\r
-mof::Rectangle<int> mof::ImageTileWidgetView::getBounds() const\r
-{\r
- return m_pImpl->bounds;\r
-}\r
-\r
-\r
-void mof::ImageTileWidgetView::update( )\r
-{\r
- m_pImpl->frame++;\r
- //m_pImpl->pCaption->update();\r
- mof::Matrix2D transformMatrix = m_pImpl->transform->getValue(m_pImpl->frame);\r
- mof::Vector2D begin = mof::Vector2D(0 , 0) * transformMatrix;\r
- mof::Vector2D end = mof::Vector2D(1 , 1) * transformMatrix;\r
- m_pImpl->pFrame->setRegion(mof::Rectangle<int>(begin.x , begin. y , end.x , end.y));\r
-}\r
- \r
-void mof::ImageTileWidgetView::draw(){\r
- if(m_pImpl->visible->getValue(m_pImpl->frame)){\r
- m_pImpl->pFrame->draw();\r
- //m_pImpl->pCaption->draw();\r
- }\r
-}\r
-*/\r
+#include "widget/ImageTileWidgetView.hpp"
+#include "mof/GraphicsDevice.hpp"
+#include "mof/Sprite.hpp"
+#include "widget/Frame.hpp"
+#include "mof/streams.hpp"
+#include "mof/Font.hpp"
+
+
+
+struct ImageTileWidgetView::Impl{
+
+ Frame* pFrame;
+ mof::Manipulator<bool>::Handler visible;
+ mof::FrameNumber frame;
+ mof::Rectangle<int> bounds;
+ //mof::Sprite* pCaption;
+
+
+ Impl( )
+ : pFrame(NULL) , frame(0)
+ {
+ }
+
+ ~Impl(){
+ delete pFrame;
+ }
+};
+
+
+ImageTileWidgetView::ImageTileWidgetView
+(
+ const mof::tstring& filepath
+)
+: m_pImpl( new Impl( ) )
+{
+
+ std::shared_ptr<mof::Texture> pTexture(new mof::Texture( filepath));
+ m_pImpl->pFrame = new Frame( pTexture );
+ //mof::Manipulator<mof::Matrix2D>::Handler t = mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) ;
+ //m_pImpl->transform = mof::makeJointHandler( t );
+ //m_pImpl->transform = mof::makeJointHandler< mof::Matrix2D >( mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) );
+
+ { //visible\82Ì\90Ý\92è
+ //m_pImpl->visible = mof::makeConstantHandler(false);
+ }
+
+ //m_pImpl->pCaption = mof::Sprite::createTextSprite( mof::Font(mof::Font::MS_P_GOTHIC , 25) , title );
+}
+
+ImageTileWidgetView::~ImageTileWidgetView()
+{
+
+}
+
+
+
+
+void ImageTileWidgetView::update( )
+{
+ m_pImpl->frame++;
+ //m_pImpl->pCaption->update();
+ /*mof::Matrix2D transformMatrix = m_pImpl->transform->getValue(m_pImpl->frame);
+ mof::Vector2D begin = mof::Vector2D(0 , 0) * transformMatrix;
+ mof::Vector2D end = mof::Vector2D(1 , 1) * transformMatrix;
+ m_pImpl->pFrame->setRegion(mof::Rectangle<int>(begin.x , begin. y , end.x , end.y));
+ */
+}
+
+void ImageTileWidgetView::draw() const
+{
+ if(m_pImpl->visible->value(m_pImpl->frame))
+ {
+ m_pImpl->pFrame->draw();
+ //m_pImpl->pCaption->draw();
+ }
+}
+
+
+
+/*
+#include "mof/ImageTileWidgetView.hpp"
+#include "mof/GraphicsDevice.hpp"
+#include "mof/Sprite.hpp"
+#include "mof/Frame.hpp"
+#include "mof/mofManipulators.hpp"
+#include "mof/Font.hpp"
+
+struct mof::ImageTileWidgetView::Impl{
+
+ mof::Frame* pFrame;
+ mof::Joint< mof::Matrix2D , mof::Matrix2D >::Handler transform;
+ mof::Manipulator<bool>::Handler visible;
+ mof::FrameNumber frame;
+ mof::Rectangle<int> bounds;
+ //mof::Sprite* pCaption;
+
+
+ Impl( )
+ : pFrame(NULL) , frame(0)
+ {
+ }
+
+ ~Impl(){
+ delete pFrame;
+ }
+};
+
+
+mof::ImageTileWidgetView::ImageTileWidgetView(
+ const mof::tstring& filepath
+ )
+ : m_pImpl( new Impl( ) ){
+
+ std::shared_ptr<mof::Texture> pTexture(new mof::Texture( filepath));
+ m_pImpl->pFrame = new mof::Frame( pTexture);
+ //mof::Manipulator<mof::Matrix2D>::Handler t = mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) ;
+ //m_pImpl->transform = mof::makeJointHandler( t );
+ m_pImpl->transform = mof::makeJointHandler< mof::Matrix2D >( mof::makeConstantHandler( mof::Matrix2D::createIdentity() ) );
+ {
+ //visible\82Ì\90Ý\92è
+ m_pImpl->visible = mof::makeConstantHandler(false);
+ }
+
+ //m_pImpl->pCaption = mof::Sprite::createTextSprite( mof::Font(mof::Font::MS_P_GOTHIC , 25) , title );
+}
+
+mof::ImageTileWidgetView::~ImageTileWidgetView(){
+
+}
+
+
+void mof::ImageTileWidgetView::focus(){
+
+}
+
+void mof::ImageTileWidgetView::blur(){
+
+}
+
+//{{{ show
+void mof::ImageTileWidgetView::show(){
+ const int endWidth = m_pImpl->bounds.endX - m_pImpl->bounds.beginX;
+ const int beginWidth = static_cast<int>( static_cast<float>(endWidth ) / 10.0f );
+ const int endHeight = m_pImpl->bounds.endY - m_pImpl->bounds.beginY;
+ const int beginHeight = static_cast<int>( static_cast<float>(endHeight ) / 10.0f);
+ mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames1[] = {
+ mof::makeKeyFrame(0 , mof::Vector2D(beginWidth , beginHeight )) ,
+ mof::makeKeyFrame(10 , mof::Vector2D(endWidth , beginHeight )) ,
+ mof::makeKeyFrame(20 , mof::Vector2D(endWidth , endHeight))
+ };
+
+ const int beginCX = (m_pImpl->bounds.beginX + m_pImpl->bounds.endX - beginWidth) / 2;
+ const int beginCY = (m_pImpl->bounds.beginY + m_pImpl->bounds.endY - beginHeight) / 2;
+ mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames2[] = {
+ mof::makeKeyFrame(0 , mof::Vector2D(beginCX , beginCY )) ,
+ mof::makeKeyFrame(10 , mof::Vector2D(m_pImpl->bounds.beginX , beginCY )) ,
+ mof::makeKeyFrame(20 , mof::Vector2D(m_pImpl->bounds.beginX , m_pImpl->bounds.beginY))
+ };
+ mof::Manipulator<mof::Matrix2D>::Handler list[] = {
+ mof::Manipulator<mof::Matrix2D>::Handler(new mof::ScalingAnimation2D(keyFrames1[0] , keyFrames1[2])) ,
+ mof::Manipulator<mof::Matrix2D>::Handler(new mof::TranslationAnimation2D(keyFrames2[0] , keyFrames2[2])) ,
+ };
+ m_pImpl->transform->set( mof::Manipulator<mof::Matrix2D>::Handler(new mof::CascadingAnimation<mof::Matrix2D>(list[0] , list[1])) );
+
+ {
+ //title\8aÖ\8cW\82Ì\90Ý\92è
+ {
+ //world transform
+ mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames[] = {
+ mof::makeKeyFrame(0 , mof::Vector2D(-10 , 0 ) ) ,
+ mof::makeKeyFrame(20 , mof::Vector2D(-10 , 0 ) ) ,
+ mof::makeKeyFrame(30 , mof::Vector2D(0 , 0 ) )
+ };
+ mof::Manipulator<mof::Matrix2D>::Handler tmp(new mof::TranslationAnimation2D(keyFrames[0] , keyFrames[2]));
+
+ mof::Manipulator<mof::Matrix2D>::Handler list[]= {
+ mof::makeConstantHandler( mof::Matrix2D::createScaling( m_pImpl->pCaption->getWorldTransform().getDiagonal())) ,
+ mof::makeConstantHandler( mof::Matrix2D::createTranslation(mof::Vector2D(m_pImpl->bounds.beginX + 20 , m_pImpl->bounds.beginY + 5 )) ) ,
+ tmp
+ };
+ m_pImpl->pCaption->setWorldTransform(mof::Manipulator<mof::Matrix2D>::Handler(new mof::CascadingAnimation<mof::Matrix2D>(list[0] , list[2])));
+
+ }
+ mof::KeyFrameManipulator<mof::Color4f>::KeyFrame keyFrames[] = {
+ mof::makeKeyFrame(0 , mof::Color4f(0 , 1 , 1 , 1) ) ,
+ mof::makeKeyFrame(20 , mof::Color4f(0 , 1 , 1 , 1) ) ,
+ mof::makeKeyFrame(30 , mof::Color4f(1 , 1 , 1 , 1) )
+ };
+ m_pImpl->pCaption->setColor(mof::Manipulator<mof::Color4f>::Handler(new mof::KeyFrameAnimation<mof::Color4f>(keyFrames[0] , keyFrames[2])));
+ m_pImpl->pCaption->setFrameNumber(0);
+ }
+ {
+ //visible\82Ì\90Ý\92è
+ m_pImpl->visible = mof::makeConstantHandler(true);
+ }
+ m_pImpl->frame = 0;
+
+}
+//}}}
+//{{{ close
+void mof::ImageTileWidgetView::close(){
+ const int beginWidth = m_pImpl->bounds.endX - m_pImpl->bounds.beginX;
+ const int endWidth = static_cast<int>( static_cast<float>(beginWidth ) / 10.0f );
+ const int beginHeight = m_pImpl->bounds.endY - m_pImpl->bounds.beginY;
+ const int endHeight = static_cast<int>( static_cast<float>(beginHeight ) / 10.0f);
+ mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames1[] = {
+ mof::makeKeyFrame(0 , mof::Vector2D(beginWidth , beginHeight )) ,
+ mof::makeKeyFrame(10 , mof::Vector2D(beginWidth , endHeight )) ,
+ mof::makeKeyFrame(20 , mof::Vector2D(endWidth , endHeight))
+ };
+
+ const int endCX = (m_pImpl->bounds.beginX + m_pImpl->bounds.endX - endWidth) / 2;
+ const int endCY = (m_pImpl->bounds.beginY + m_pImpl->bounds.endY - endHeight) / 2;
+ mof::KeyFrameManipulator<mof::Vector2D>::KeyFrame keyFrames2[] = {
+ mof::makeKeyFrame(0 , mof::Vector2D(m_pImpl->bounds.beginX , m_pImpl->bounds.beginY )) ,
+ mof::makeKeyFrame(10 , mof::Vector2D(m_pImpl->bounds.beginX , endCY)) ,
+ mof::makeKeyFrame(20 , mof::Vector2D(endCX , endCY ))
+ };
+ mof::Manipulator<mof::Matrix2D>::Handler list[] = {
+ mof::Manipulator<mof::Matrix2D>::Handler(new mof::ScalingAnimation2D(keyFrames1[0] , keyFrames1[2])) ,
+ mof::Manipulator<mof::Matrix2D>::Handler(new mof::TranslationAnimation2D(keyFrames2[0] , keyFrames2[2])) ,
+ };
+ m_pImpl->transform->set( mof::Manipulator<mof::Matrix2D>::Handler(new mof::CascadingAnimation<mof::Matrix2D>(list[0] , list[1])) );
+
+ {
+ //title\8aÖ\8cW\82Ì\90Ý\92è
+ //m_pImpl->pCaption->setColor(mof::Color4f(0 , 0 , 0 , 0));
+ //m_pImpl->pCaption->setFrameNumber(0);
+ }
+ {
+ //visible\82Ì\90Ý\92è
+ mof::KeyFrameManipulator<bool>::KeyFrame keyFrames[] = {
+ mof::makeKeyFrame(0 , true) ,
+ mof::makeKeyFrame(20 , false)
+ };
+ m_pImpl->visible = mof::Manipulator<bool>::Handler(
+ new mof::KeyFrameManipulator<bool>(keyFrames[0] , keyFrames[1] , &mof::stepInterpolate<bool> )
+ );
+ }
+ m_pImpl->frame = 0;
+}
+//}}}
+mof::Manipulator<mof::Vector2D>::Handler mof::ImageTileWidgetView::getPosition( ) const
+{
+ return mof::dynamic::makeTranslation2DHandler( m_pImpl->transform );
+}
+
+mof::Manipulator<mof::Vector2D>::Handler mof::ImageTileWidgetView::getSize( ) const
+{
+ return mof::dynamic::makeScaling2DHandler( m_pImpl->transform );
+}
+
+
+void mof::ImageTileWidgetView::setBounds(const mof::Rectangle<int>& bounds)
+{
+ m_pImpl->bounds = bounds;
+}
+
+mof::Rectangle<int> mof::ImageTileWidgetView::getBounds() const
+{
+ return m_pImpl->bounds;
+}
+
+
+void mof::ImageTileWidgetView::update( )
+{
+ m_pImpl->frame++;
+ //m_pImpl->pCaption->update();
+ mof::Matrix2D transformMatrix = m_pImpl->transform->getValue(m_pImpl->frame);
+ mof::Vector2D begin = mof::Vector2D(0 , 0) * transformMatrix;
+ mof::Vector2D end = mof::Vector2D(1 , 1) * transformMatrix;
+ m_pImpl->pFrame->setRegion(mof::Rectangle<int>(begin.x , begin. y , end.x , end.y));
+}
+
+void mof::ImageTileWidgetView::draw(){
+ if(m_pImpl->visible->getValue(m_pImpl->frame)){
+ m_pImpl->pFrame->draw();
+ //m_pImpl->pCaption->draw();
+ }
+}
+*/
-#pragma once\r
-#include "mof/widget/WidgetView.hpp"\r
-#include "mof/Font.hpp"\r
-#include "mof/tstring.hpp"\r
-#include <boost/scoped_ptr.hpp>\r
-\r
-class ImageTileWidgetView \r
-: \r
- public mof::WidgetView\r
-{\r
-public:\r
- ImageTileWidgetView( const mof::tstring& caption , const mof::Font& font );\r
- virtual ~ImageTileWidgetView( );\r
-\r
- virtual mof::FrameNumber show( bool imidiately = false );\r
- virtual mof::FrameNumber hide( bool imidiately = false );\r
- virtual mof::FrameNumber focus( bool imidiately = false );\r
- virtual mof::FrameNumber blur( bool imidiately = false );\r
- virtual void update( );\r
- virtual void draw( ) const;\r
-\r
-private:\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
- \r
-};\r
-\r
+#pragma once
+#include "mof/widget/WidgetView.hpp"
+#include "mof/Font.hpp"
+#include "mof/tstring.hpp"
+#include <boost/scoped_ptr.hpp>
+
+class ImageTileWidgetView
+:
+ public mof::WidgetView
+{
+public:
+ ImageTileWidgetView( const mof::tstring& caption , const mof::Font& font );
+ virtual ~ImageTileWidgetView( );
+
+ virtual mof::FrameNumber show( bool imidiately = false );
+ virtual mof::FrameNumber hide( bool imidiately = false );
+ virtual mof::FrameNumber focus( bool imidiately = false );
+ virtual mof::FrameNumber blur( bool imidiately = false );
+ virtual void update( );
+ virtual void draw( ) const;
+
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+
+};
+
-#include "widget/ImageTiler.hpp"\r
-#include "mof/GraphicsDevice.hpp"\r
-#include "mof/ConsoleIO.hpp"\r
-#include "mof/Sprite.hpp"\r
-#include "mof/utilities.hpp"\r
-#include <vector>\r
-#include <iomanip>\r
-\r
-const int TIP_SIZE = 32;\r
-\r
-struct ImageTiler::Impl{\r
- std::shared_ptr<mof::Texture> pTexture;\r
- std::vector<mof::VertexXYZRHWCUV> vertices;\r
- mof::Rectangle<float> region;\r
- mof::Color color_;\r
- bool visible_;\r
- bool update_;\r
- \r
- \r
- Impl()\r
- : region(0 , 0 , 0 , 0), visible_(true), color_(mof::createColor(255, 255, 255)),\r
- update_(true)\r
- {}\r
-\r
- ~Impl(){}\r
- \r
- //{{{ _addVerticesOfInternal\r
- void _addVerticesOfInternal( )\r
- {\r
- \r
- const int tipMaxWidth = 32;\r
- const int tipMaxHeight = 32;\r
- \r
- float sumY = region.beginY;\r
- while( sumY < region.endY )\r
- {\r
- // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\8d\82\82³\82ð\92²\90ß\r
- float tipHeight = tipMaxHeight;\r
- float tipTextureHeight = 0.25f;\r
- if( tipMaxHeight > region.endY - sumY ) \r
- {\r
- tipHeight = region.endY - sumY;\r
- tipTextureHeight = tipTextureHeight * tipHeight / tipMaxHeight;\r
- }\r
- \r
- float sumX = region.beginX;\r
- while( sumX < region.endX )\r
- {\r
- // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\95\9d\82ð\92²\90ß\r
- float tipWidth = tipMaxWidth;\r
- float tipTextureWidth = 0.25f;\r
- if( tipMaxWidth > region.endX - sumX ) \r
- {\r
- tipWidth = region.endX - sumX;\r
- tipTextureWidth = tipTextureWidth * tipWidth / tipMaxWidth;\r
- }\r
- \r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>(sumX , sumY , sumX + tipWidth , sumY + tipHeight ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.25 , 0.25 , 0.25 + tipTextureWidth , 0.25 + tipTextureHeight )\r
- );\r
- \r
- sumX += tipWidth;\r
- } // while sumX\r
- sumY += tipHeight;\r
- } // while sumY\r
-\r
- }\r
- //}}}\r
- //{{{ _addVerticesOfExternal\r
- void _addVerticesOfExternal( )\r
- {\r
- const int tipMaxWidth = 32;\r
- const int tipMaxHeight = 32;\r
- \r
- float sumY = region.beginY;\r
- while( sumY < region.endY )\r
- {\r
- // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\8d\82\82³\82ð\92²\90ß\r
- float tipHeight = tipMaxHeight;\r
- float tipTextureHeight = 0.25f;\r
- if( tipMaxHeight > region.endY - sumY ) \r
- {\r
- tipHeight = region.endY - sumY;\r
- tipTextureHeight = tipTextureHeight * tipHeight / tipMaxHeight;\r
- }\r
- \r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( region.beginX - tipMaxWidth , sumY , region.beginX , sumY + tipHeight ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.0 , 0.25 , 0.25 , 0.25 + tipTextureHeight )\r
- );\r
- \r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( region.endX , sumY , region.endX + tipMaxWidth , sumY + tipHeight ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.5 , 0.25 , 0.75 , 0.25 + tipTextureHeight )\r
- );\r
-\r
- sumY += tipHeight;\r
- } // while sumY\r
-\r
- \r
- float sumX = region.beginX;\r
- while( sumX < region.endX )\r
- {\r
- // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\95\9d\82ð\92²\90ß\r
- float tipWidth = tipMaxWidth;\r
- float tipTextureWidth = 0.25f;\r
- if( tipMaxWidth > region.endX - sumX ) \r
- {\r
- tipWidth = region.endX - sumX;\r
- tipTextureWidth = tipTextureWidth * tipWidth / tipMaxWidth;\r
- }\r
- \r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( sumX , region.beginY - tipMaxHeight , sumX + tipWidth , region.beginY ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.25 , 0.0 , 0.25 + tipTextureWidth , 0.25 )\r
- );\r
- \r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( sumX , region.endY , sumX + tipWidth , region.endY + tipMaxHeight ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.25 , 0.5 , 0.25 + tipTextureWidth , 0.75 )\r
- );\r
-\r
- sumX += tipWidth;\r
- } // while sumY\r
-\r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( region.beginX - tipMaxWidth , region.beginY - tipMaxHeight , region.beginX , region.beginY ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.0 , 0.0 , 0.25 , 0.25 )\r
- );\r
- \r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( region.endX , region.beginY - tipMaxHeight , region.endX + tipMaxWidth , region.beginY ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.5 , 0.0 , 0.75 , 0.25 )\r
- );\r
-\r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( region.beginX - tipMaxWidth , region.endY , region.beginX , region.endY + tipMaxHeight ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.0 , 0.5 , 0.25 , 0.75 )\r
- );\r
- \r
- mof::Sprite::append(\r
- vertices , \r
- mof::Rectangle<float>( region.endX , region.endY , region.endX + tipMaxWidth , region.endY + tipMaxHeight ) ,\r
- color_ ,\r
- mof::Rectangle<float>( 0.5 , 0.5 , 0.75 , 0.75 )\r
- );\r
-\r
-\r
- }\r
- //}}}\r
-};\r
-\r
-ImageTiler::ImageTiler( const std::shared_ptr<mof::Texture>& pTexture)\r
-: m_pImpl(new Impl)\r
-{\r
- m_pImpl->pTexture = pTexture;\r
-}\r
-\r
-ImageTiler::~ImageTiler(){}\r
-//{{{ setRegion\r
-void ImageTiler::setRegion( const mof::Rectangle<float>& region ){\r
- \r
- if(m_pImpl->region == region)return;\r
- m_pImpl->region = region;\r
- m_pImpl->update_ = true;\r
-}\r
-//}}}\r
-//{{{ setColor\r
-void ImageTiler::setColor(mof::Color color)\r
-{\r
- if (m_pImpl->color_ == color) return;\r
- m_pImpl->color_ = color;\r
- m_pImpl->update_ = true;\r
-\r
-}\r
-//}}}\r
-//{{{ draw\r
-void ImageTiler::draw() const{\r
- if (!m_pImpl->visible_) return;\r
- if (m_pImpl->update_) {\r
- m_pImpl->vertices.clear();\r
- m_pImpl->_addVerticesOfInternal();\r
- m_pImpl->_addVerticesOfExternal();\r
- m_pImpl->update_ = false;\r
- }\r
- if (m_pImpl->vertices.empty()) return;\r
-\r
- mof::GraphicsDevice::setTexture( m_pImpl->pTexture.get( ) );\r
- mof::GraphicsDevice::drawVertexArray(\r
- m_pImpl->vertices.front() ,\r
- m_pImpl->vertices.back() ,\r
- mof::PRIMITIVE_TYPE_TRIANGLELIST\r
- );\r
-}\r
-//}}}\r
-//{{{ setVisible\r
-void ImageTiler::setVisible(bool visible) \r
-{\r
- m_pImpl->visible_ = visible;\r
-}\r
-//}}}\r
+#include "widget/ImageTiler.hpp"
+#include "mof/GraphicsDevice.hpp"
+#include "mof/ConsoleIO.hpp"
+#include "mof/Sprite.hpp"
+#include "mof/utilities.hpp"
+#include <vector>
+#include <iomanip>
+
+const int TIP_SIZE = 32;
+
+struct ImageTiler::Impl{
+ std::shared_ptr<mof::Texture> pTexture;
+ std::vector<mof::VertexXYZRHWCUV> vertices;
+ mof::Rectangle<float> region;
+ mof::Color color_;
+ bool visible_;
+ bool update_;
+
+
+ Impl()
+ : region(0 , 0 , 0 , 0), visible_(true), color_(mof::createColor(255, 255, 255)),
+ update_(true)
+ {}
+
+ ~Impl(){}
+
+ //{{{ _addVerticesOfInternal
+ void _addVerticesOfInternal( )
+ {
+
+ const int tipMaxWidth = 32;
+ const int tipMaxHeight = 32;
+
+ float sumY = region.beginY;
+ while( sumY < region.endY )
+ {
+ // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\8d\82\82³\82ð\92²\90ß
+ float tipHeight = tipMaxHeight;
+ float tipTextureHeight = 0.25f;
+ if( tipMaxHeight > region.endY - sumY )
+ {
+ tipHeight = region.endY - sumY;
+ tipTextureHeight = tipTextureHeight * tipHeight / tipMaxHeight;
+ }
+
+ float sumX = region.beginX;
+ while( sumX < region.endX )
+ {
+ // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\95\9d\82ð\92²\90ß
+ float tipWidth = tipMaxWidth;
+ float tipTextureWidth = 0.25f;
+ if( tipMaxWidth > region.endX - sumX )
+ {
+ tipWidth = region.endX - sumX;
+ tipTextureWidth = tipTextureWidth * tipWidth / tipMaxWidth;
+ }
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>(sumX , sumY , sumX + tipWidth , sumY + tipHeight ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.25 , 0.25 , 0.25 + tipTextureWidth , 0.25 + tipTextureHeight )
+ );
+
+ sumX += tipWidth;
+ } // while sumX
+ sumY += tipHeight;
+ } // while sumY
+
+ }
+ //}}}
+ //{{{ _addVerticesOfExternal
+ void _addVerticesOfExternal( )
+ {
+ const int tipMaxWidth = 32;
+ const int tipMaxHeight = 32;
+
+ float sumY = region.beginY;
+ while( sumY < region.endY )
+ {
+ // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\8d\82\82³\82ð\92²\90ß
+ float tipHeight = tipMaxHeight;
+ float tipTextureHeight = 0.25f;
+ if( tipMaxHeight > region.endY - sumY )
+ {
+ tipHeight = region.endY - sumY;
+ tipTextureHeight = tipTextureHeight * tipHeight / tipMaxHeight;
+ }
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( region.beginX - tipMaxWidth , sumY , region.beginX , sumY + tipHeight ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.0 , 0.25 , 0.25 , 0.25 + tipTextureHeight )
+ );
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( region.endX , sumY , region.endX + tipMaxWidth , sumY + tipHeight ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.5 , 0.25 , 0.75 , 0.25 + tipTextureHeight )
+ );
+
+ sumY += tipHeight;
+ } // while sumY
+
+
+ float sumX = region.beginX;
+ while( sumX < region.endX )
+ {
+ // region\82ð\83I\81[\83o\81[\82µ\82È\82¢\82æ\82¤\82É\83`\83b\83v\95\9d\82ð\92²\90ß
+ float tipWidth = tipMaxWidth;
+ float tipTextureWidth = 0.25f;
+ if( tipMaxWidth > region.endX - sumX )
+ {
+ tipWidth = region.endX - sumX;
+ tipTextureWidth = tipTextureWidth * tipWidth / tipMaxWidth;
+ }
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( sumX , region.beginY - tipMaxHeight , sumX + tipWidth , region.beginY ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.25 , 0.0 , 0.25 + tipTextureWidth , 0.25 )
+ );
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( sumX , region.endY , sumX + tipWidth , region.endY + tipMaxHeight ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.25 , 0.5 , 0.25 + tipTextureWidth , 0.75 )
+ );
+
+ sumX += tipWidth;
+ } // while sumY
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( region.beginX - tipMaxWidth , region.beginY - tipMaxHeight , region.beginX , region.beginY ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.0 , 0.0 , 0.25 , 0.25 )
+ );
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( region.endX , region.beginY - tipMaxHeight , region.endX + tipMaxWidth , region.beginY ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.5 , 0.0 , 0.75 , 0.25 )
+ );
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( region.beginX - tipMaxWidth , region.endY , region.beginX , region.endY + tipMaxHeight ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.0 , 0.5 , 0.25 , 0.75 )
+ );
+
+ mof::Sprite::append(
+ vertices ,
+ mof::Rectangle<float>( region.endX , region.endY , region.endX + tipMaxWidth , region.endY + tipMaxHeight ) ,
+ color_ ,
+ mof::Rectangle<float>( 0.5 , 0.5 , 0.75 , 0.75 )
+ );
+
+
+ }
+ //}}}
+};
+
+ImageTiler::ImageTiler( const std::shared_ptr<mof::Texture>& pTexture)
+: m_pImpl(new Impl)
+{
+ m_pImpl->pTexture = pTexture;
+}
+
+ImageTiler::~ImageTiler(){}
+//{{{ setRegion
+void ImageTiler::setRegion( const mof::Rectangle<float>& region ){
+
+ if(m_pImpl->region == region)return;
+ m_pImpl->region = region;
+ m_pImpl->update_ = true;
+}
+//}}}
+//{{{ setColor
+void ImageTiler::setColor(mof::Color color)
+{
+ if (m_pImpl->color_ == color) return;
+ m_pImpl->color_ = color;
+ m_pImpl->update_ = true;
+
+}
+//}}}
+//{{{ draw
+void ImageTiler::draw() const{
+ if (!m_pImpl->visible_) return;
+ if (m_pImpl->update_) {
+ m_pImpl->vertices.clear();
+ m_pImpl->_addVerticesOfInternal();
+ m_pImpl->_addVerticesOfExternal();
+ m_pImpl->update_ = false;
+ }
+ if (m_pImpl->vertices.empty()) return;
+
+ mof::GraphicsDevice::setTexture( m_pImpl->pTexture.get( ) );
+ mof::GraphicsDevice::drawVertexArray(
+ m_pImpl->vertices.front() ,
+ m_pImpl->vertices.back() ,
+ mof::PRIMITIVE_TYPE_TRIANGLELIST
+ );
+}
+//}}}
+//{{{ setVisible
+void ImageTiler::setVisible(bool visible)
+{
+ m_pImpl->visible_ = visible;
+}
+//}}}
-#pragma once\r
-#include <boost/scoped_ptr.hpp>\r
-#include "mof/SceneGraph.hpp"\r
-#include "mof/Texture.hpp"\r
-#include "mof/Drawable.hpp"\r
-#include "mof/Color.hpp"\r
-#include "mof/Rectangle.hpp"\r
-\r
-class ImageTiler : public mof::Drawable {\r
- struct Impl;\r
- boost::scoped_ptr<Impl> m_pImpl;\r
-\r
-public:\r
- ImageTiler( const std::shared_ptr<mof::Texture>& pTexture );\r
- virtual ~ImageTiler();\r
-\r
- void setRegion(const mof::Rectangle<float>& region);\r
- void setColor(mof::Color color);\r
- virtual void draw() const;\r
- virtual void setVisible(bool visible);\r
-};\r
-\r
-\r
-\r
+#pragma once
+#include <boost/scoped_ptr.hpp>
+#include "mof/SceneGraph.hpp"
+#include "mof/Texture.hpp"
+#include "mof/Drawable.hpp"
+#include "mof/Color.hpp"
+#include "mof/Rectangle.hpp"
+
+class ImageTiler : public mof::Drawable {
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+
+public:
+ ImageTiler( const std::shared_ptr<mof::Texture>& pTexture );
+ virtual ~ImageTiler();
+
+ void setRegion(const mof::Rectangle<float>& region);
+ void setColor(mof::Color color);
+ virtual void draw() const;
+ virtual void setVisible(bool visible);
+};
+
+
+
-#include "widget/createFrame.hpp"\r
-#include "widget/ImageTileView.hpp"\r
-#include <mof/widgets.hpp>\r
-#include <mof/Font.hpp>\r
-#include <mof/utilities.hpp>\r
-#include <mof/widget/ImageView.hpp>\r
-#include <mof/FactoryMethod.hpp>\r
-#include <memory>\r
-#include "configure.hpp"\r
-#include "resource.hpp"\r
-\r
-using mof::Texture;\r
-using mof::Font;\r
-using mof::makeFactoryMethod;\r
-using mof::Rectangle;\r
-using mof::widget::ImageView;\r
-using std::shared_ptr;\r
-using std::make_shared;\r
-using namespace mof::widget;\r
-\r
-std::unique_ptr<Frame> createFrame\r
-(\r
- const mof::tstring& caption ,\r
- const mof::tstring& contentImagePath ,\r
- const mof::tstring& titleImagePath ,\r
- shared_ptr<WidgetView> pContentView\r
-)\r
-{\r
- std::unique_ptr<Frame> pFrame\r
- (\r
-\r
- new Frame\r
- (\r
- caption , \r
- pContentView ,\r
- makeFactoryMethod<ImageTileView>( make_shared<Texture>( contentImagePath ) ) ,\r
- makeFactoryMethod<ImageTileView>( make_shared<Texture>( titleImagePath ) ),\r
- makeFactoryMethod<TextCompiler>\r
- (\r
- Font( FONT_NAME_UME, FONT_SIZE_LARGE ),\r
- [] (const mof::tstring& path) { return ::getTextureResourceManager(::SYSTEM)->getResource(path);}\r
- )\r
- )\r
- );\r
- return pFrame;\r
-\r
-}\r
-\r
-\r
-\r
+#include "widget/createFrame.hpp"
+#include "widget/ImageTileView.hpp"
+#include <mof/widgets.hpp>
+#include <mof/Font.hpp>
+#include <mof/utilities.hpp>
+#include <mof/widget/ImageView.hpp>
+#include <mof/FactoryMethod.hpp>
+#include <memory>
+#include "configure.hpp"
+#include "resource.hpp"
+
+using mof::Texture;
+using mof::Font;
+using mof::makeFactoryMethod;
+using mof::Rectangle;
+using mof::widget::ImageView;
+using std::shared_ptr;
+using std::make_shared;
+using namespace mof::widget;
+
+std::unique_ptr<Frame> createFrame
+(
+ const mof::tstring& caption ,
+ const mof::tstring& contentImagePath ,
+ const mof::tstring& titleImagePath ,
+ shared_ptr<WidgetView> pContentView
+)
+{
+ std::unique_ptr<Frame> pFrame
+ (
+
+ new Frame
+ (
+ caption ,
+ pContentView ,
+ makeFactoryMethod<ImageTileView>( make_shared<Texture>( contentImagePath ) ) ,
+ makeFactoryMethod<ImageTileView>( make_shared<Texture>( titleImagePath ) ),
+ makeFactoryMethod<TextCompiler>
+ (
+ Font( FONT_NAME_UME, FONT_SIZE_LARGE ),
+ [] (const mof::tstring& path) { return ::getTextureResourceManager(::SYSTEM)->getResource(path);}
+ )
+ )
+ );
+ return pFrame;
+
+}
+
+
+
-#pragma once\r
-#include <mof/widget/Frame.hpp>\r
-#include <mof/widget/WidgetView.hpp>\r
-#include <mof/tstring.hpp>\r
-#include <memory>\r
-#include <memory>\r
-\r
-\r
-std::unique_ptr<mof::widget::Frame> createFrame\r
-( \r
- const mof::tstring& text ,\r
- const mof::tstring& contentImagePath ,\r
- const mof::tstring& titleImagePath ,\r
- std::shared_ptr<mof::widget::WidgetView> pContentView\r
-);\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
+#pragma once
+#include <mof/widget/Frame.hpp>
+#include <mof/widget/WidgetView.hpp>
+#include <mof/tstring.hpp>
+#include <memory>
+#include <memory>
+
+
+std::unique_ptr<mof::widget::Frame> createFrame
+(
+ const mof::tstring& text ,
+ const mof::tstring& contentImagePath ,
+ const mof::tstring& titleImagePath ,
+ std::shared_ptr<mof::widget::WidgetView> pContentView
+);
+
+
+
+
+
+
+
-#include "widget/createMenuView.hpp"\r
-#include <mof/widgets.hpp>\r
-#include "widget/HighlightButtonView.hpp"\r
-#include <mof/FactoryMethod.hpp>\r
-#include <mof/Font.hpp>\r
-#include <mof/utilities.hpp>\r
-#include "configure.hpp"\r
-#include "resource.hpp"\r
-#include <mof/widget/TextCompiler.hpp>\r
-\r
-using mof::widget::WidgetView;\r
-using mof::widget::ImageView;\r
-\r
-namespace \r
-{\r
- std::shared_ptr<mof::widget::AbstractTextCompiler> text_compiler;\r
-}\r
-\r
-mof::FactoryMethod<WidgetView> createMenuView(const mof::tstring& text, bool is_disable_item)\r
-{\r
- //using namespace mof::widget;\r
-\r
- if (text_compiler.get() == NULL) {\r
- text_compiler = std::make_shared<mof::widget::TextCompiler>\r
- (\r
- mof::Font(FONT_NAME_UME, FONT_SIZE_STANDARD),\r
- [] (const mof::tstring& path) { return ::getTextureResourceManager(::SYSTEM)->getResource(path);}\r
- );\r
-\r
- text_compiler->setBehaviorOnColor\r
- (\r
- mof::widget::AbstractTextCompiler::PAGE_OPEN, \r
- mof::makeConstantHandler(mof::Color4f(1, 1, 1, 1)),\r
- 0\r
- );\r
-\r
- text_compiler->setBehaviorOnColor\r
- (\r
- mof::widget::AbstractTextCompiler::PAGE_CLOSE, \r
- mof::makeConstantHandler(mof::Color4f(1, 1, 1, 1)),\r
- 0\r
- );\r
- }\r
-\r
- return mof::makeFactoryMethod<HighlightButtonView> \r
- (\r
- [text]() {return text_compiler->compile_d(text).release();},\r
- is_disable_item\r
- );\r
-}\r
-\r
-\r
-\r
+#include "widget/createMenuView.hpp"
+#include <mof/widgets.hpp>
+#include "widget/HighlightButtonView.hpp"
+#include <mof/FactoryMethod.hpp>
+#include <mof/Font.hpp>
+#include <mof/utilities.hpp>
+#include "configure.hpp"
+#include "resource.hpp"
+#include <mof/widget/TextCompiler.hpp>
+
+using mof::widget::WidgetView;
+using mof::widget::ImageView;
+
+namespace
+{
+ std::shared_ptr<mof::widget::AbstractTextCompiler> text_compiler;
+}
+
+mof::FactoryMethod<WidgetView> createMenuView(const mof::tstring& text, bool is_disable_item)
+{
+ //using namespace mof::widget;
+
+ if (text_compiler.get() == NULL) {
+ text_compiler = std::make_shared<mof::widget::TextCompiler>
+ (
+ mof::Font(FONT_NAME_UME, FONT_SIZE_STANDARD),
+ [] (const mof::tstring& path) { return ::getTextureResourceManager(::SYSTEM)->getResource(path);}
+ );
+
+ text_compiler->setBehaviorOnColor
+ (
+ mof::widget::AbstractTextCompiler::PAGE_OPEN,
+ mof::makeConstantHandler(mof::Color4f(1, 1, 1, 1)),
+ 0
+ );
+
+ text_compiler->setBehaviorOnColor
+ (
+ mof::widget::AbstractTextCompiler::PAGE_CLOSE,
+ mof::makeConstantHandler(mof::Color4f(1, 1, 1, 1)),
+ 0
+ );
+ }
+
+ return mof::makeFactoryMethod<HighlightButtonView>
+ (
+ [text]() {return text_compiler->compile_d(text).release();},
+ is_disable_item
+ );
+}
+
+
+
-#pragma once\r
-#include <mof/widget/WidgetView.hpp>\r
-#include <mof/FactoryMethod.hpp>\r
-#include <mof/tstring.hpp>\r
-\r
-using mof::widget::WidgetView;\r
-\r
-mof::FactoryMethod<WidgetView> createMenuView(const mof::tstring& text, bool is_disable_item);\r
+#pragma once
+#include <mof/widget/WidgetView.hpp>
+#include <mof/FactoryMethod.hpp>
+#include <mof/tstring.hpp>
+
+using mof::widget::WidgetView;
+
+mof::FactoryMethod<WidgetView> createMenuView(const mof::tstring& text, bool is_disable_item);