mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 21:26:48 +00:00 
			
		
		
		
	Merge branch 'master' of https://github.com/zinnschlag/openmw.git into object_movement_creation
Conflicts: apps/openmw/mwrender/renderingmanager.cpp
This commit is contained in:
		
						commit
						5d1c01a58e
					
				
					 28 changed files with 419 additions and 111 deletions
				
			
		|  | @ -29,7 +29,7 @@ add_openmw_dir (mwgui | |||
|     dialogue_history window_base stats_window messagebox journalwindow charactercreation | ||||
|     map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list | ||||
|     formatting inventorywindow container hud countdialog tradewindow settingswindow | ||||
|     confirmationdialog alchemywindow referenceinterface spellwindow | ||||
|     confirmationdialog alchemywindow referenceinterface spellwindow mainmenu | ||||
|     ) | ||||
| 
 | ||||
| add_openmw_dir (mwdialogue | ||||
|  |  | |||
|  | @ -5,12 +5,9 @@ | |||
| #include <deque> | ||||
| #include <map> | ||||
| 
 | ||||
| namespace MWDialogue | ||||
| { | ||||
|     class Quest; | ||||
|     class Topic; | ||||
|     struct StampedJournalEntry; | ||||
| } | ||||
| #include "../mwdialogue/journalentry.hpp" | ||||
| #include "../mwdialogue/topic.hpp" | ||||
| #include "../mwdialogue/quest.hpp" | ||||
| 
 | ||||
| namespace MWBase | ||||
| { | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| #ifndef GAME_MMDIALOG_DIALOGUEMANAGERIMP_H | ||||
| #ifndef GAME_MWDIALOG_DIALOGUEMANAGERIMP_H | ||||
| #define GAME_MWDIALOG_DIALOGUEMANAGERIMP_H | ||||
| 
 | ||||
| #include <components/esm/loadinfo.hpp> | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| #ifndef GAME_MMDIALOGUE_JOURNALENTRY_H | ||||
| #define GAME_MMDIALOGUE_JOURNALENTRY_H | ||||
| #ifndef GAME_MWDIALOGUE_JOURNALENTRY_H | ||||
| #define GAME_MWDIALOGUE_JOURNALENTRY_H | ||||
| 
 | ||||
| #include <string> | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| #ifndef GAME_MMDIALOG_JOURNAL_H | ||||
| #ifndef GAME_MWDIALOG_JOURNAL_H | ||||
| #define GAME_MWDIALOG_JOURNAL_H | ||||
| 
 | ||||
| #include "../mwbase/journal.hpp" | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| #ifndef GAME_MMDIALOG_QUEST_H | ||||
| #ifndef GAME_MWDIALOG_QUEST_H | ||||
| #define GAME_MWDIALOG_QUEST_H | ||||
| 
 | ||||
| #include "topic.hpp" | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| #ifndef GAME_MMDIALOG_TOPIC_H | ||||
| #ifndef GAME_MWDIALOG_TOPIC_H | ||||
| #define GAME_MWDIALOG_TOPIC_H | ||||
| 
 | ||||
| #include <string> | ||||
|  |  | |||
|  | @ -16,4 +16,5 @@ CursorReplace::CursorReplace() | |||
|     OEngine::Render::ImageRotate::rotate("textures\\tx_cursormove.dds", "mwpointer_dresize2.png", 45); | ||||
| 
 | ||||
|     OEngine::Render::Atlas::createFromFile("atlas1.cfg", "mwgui1", "textures\\"); | ||||
|     OEngine::Render::Atlas::createFromFile("mainmenu.cfg", "mwgui2", "textures\\"); | ||||
| } | ||||
|  |  | |||
							
								
								
									
										78
									
								
								apps/openmw/mwgui/mainmenu.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								apps/openmw/mwgui/mainmenu.cpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,78 @@ | |||
| #include "mainmenu.hpp" | ||||
| 
 | ||||
| #include <OgreRoot.h> | ||||
| 
 | ||||
| 
 | ||||
| #include "../mwbase/environment.hpp" | ||||
| #include "../mwbase/world.hpp" | ||||
| 
 | ||||
| #include "window_manager.hpp" | ||||
| 
 | ||||
| namespace MWGui | ||||
| { | ||||
| 
 | ||||
|     MainMenu::MainMenu(int w, int h) | ||||
|         : OEngine::GUI::Layout("openmw_mainmenu.layout") | ||||
|     { | ||||
|         setCoord(0,0,w,h); | ||||
| 
 | ||||
|         int height = 64 * 3; | ||||
| 
 | ||||
|         mButtonBox = mMainWidget->createWidget<MyGUI::Widget>("", MyGUI::IntCoord(w/2 - 64, h/2 - height/2, 128, height), MyGUI::Align::Default); | ||||
|         int curH = 0; | ||||
| 
 | ||||
|         mReturn = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default); | ||||
|         mReturn->setImageResource ("Menu_Return"); | ||||
|         mReturn->eventMouseButtonClick += MyGUI::newDelegate(this, &MainMenu::returnToGame); | ||||
|         curH += 64; | ||||
| 
 | ||||
| 
 | ||||
|         /*
 | ||||
|         mNewGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default); | ||||
|         mNewGame->setImageResource ("Menu_NewGame"); | ||||
|         curH += 64; | ||||
| 
 | ||||
|         mLoadGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default); | ||||
|         mLoadGame->setImageResource ("Menu_LoadGame"); | ||||
|         curH += 64; | ||||
| 
 | ||||
| 
 | ||||
|         mSaveGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default); | ||||
|         mSaveGame->setImageResource ("Menu_SaveGame"); | ||||
|         curH += 64; | ||||
|         */ | ||||
| 
 | ||||
|         mOptions = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default); | ||||
|         mOptions->setImageResource ("Menu_Options"); | ||||
|         mOptions->eventMouseButtonClick += MyGUI::newDelegate(this, &MainMenu::showOptions); | ||||
|         curH += 64; | ||||
| 
 | ||||
|         /*
 | ||||
|         mCredits = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default); | ||||
|         mCredits->setImageResource ("Menu_Credits"); | ||||
|         curH += 64; | ||||
|         */ | ||||
| 
 | ||||
|         mExitGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default); | ||||
|         mExitGame->setImageResource ("Menu_ExitGame"); | ||||
|         mExitGame->eventMouseButtonClick += MyGUI::newDelegate(this, &MainMenu::exitGame); | ||||
|         curH += 64; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     void MainMenu::returnToGame(MyGUI::Widget* sender) | ||||
|     { | ||||
|         MWBase::Environment::get().getWindowManager ()->removeGuiMode (GM_MainMenu); | ||||
|     } | ||||
| 
 | ||||
|     void MainMenu::showOptions(MyGUI::Widget* sender) | ||||
|     { | ||||
|         MWBase::Environment::get().getWindowManager ()->pushGuiMode (GM_Settings); | ||||
|     } | ||||
| 
 | ||||
|     void MainMenu::exitGame(MyGUI::Widget* sender) | ||||
|     { | ||||
|         Ogre::Root::getSingleton ().queueEndRendering (); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | @ -6,11 +6,22 @@ namespace MWGui | |||
|     class MainMenu : public OEngine::GUI::Layout | ||||
|     { | ||||
|     public: | ||||
|         MainMenu(int w, int h) | ||||
|         : Layout("openmw_mainmenu.layout") | ||||
|         { | ||||
|             setCoord(0,0,w,h); | ||||
|         } | ||||
|         MainMenu(int w, int h); | ||||
| 
 | ||||
|     private: | ||||
|         MyGUI::Button* mReturn; | ||||
|         MyGUI::Button* mNewGame; | ||||
|         MyGUI::Button* mLoadGame; | ||||
|         MyGUI::Button* mSaveGame; | ||||
|         MyGUI::Button* mOptions; | ||||
|         MyGUI::Button* mCredits; | ||||
|         MyGUI::Button* mExitGame; | ||||
| 
 | ||||
|         MyGUI::Widget* mButtonBox; | ||||
| 
 | ||||
|         void returnToGame(MyGUI::Widget* sender); | ||||
|         void showOptions(MyGUI::Widget* sender); | ||||
|         void exitGame(MyGUI::Widget* sender); | ||||
|     }; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -263,6 +263,7 @@ namespace MWGui | |||
|         dialog->eventOkClicked.clear(); | ||||
|         dialog->eventOkClicked += MyGUI::newDelegate(this, &SettingsWindow::onResolutionAccept); | ||||
|         dialog->eventCancelClicked.clear(); | ||||
|         dialog->eventCancelClicked += MyGUI::newDelegate(this, &SettingsWindow::onResolutionCancel); | ||||
|     } | ||||
| 
 | ||||
|     void SettingsWindow::onResolutionAccept() | ||||
|  |  | |||
|  | @ -1,11 +1,12 @@ | |||
| #include "inputmanager.hpp" | ||||
| 
 | ||||
| #include <OgreRoot.h> | ||||
| 
 | ||||
| #include <openengine/input/dispatcher.hpp> | ||||
| #include <openengine/input/poller.hpp> | ||||
| 
 | ||||
| #include <openengine/gui/events.hpp> | ||||
| 
 | ||||
| #include <openengine/ogre/exitlistener.hpp> | ||||
| #include <openengine/ogre/renderer.hpp> | ||||
| 
 | ||||
| #include "../mwgui/window_manager.hpp" | ||||
|  | @ -20,6 +21,7 @@ | |||
| #include "../engine.hpp" | ||||
| 
 | ||||
| #include "../mwworld/player.hpp" | ||||
| #include "../mwbase/world.hpp" | ||||
| 
 | ||||
| #include <boost/bind.hpp> | ||||
| #include <boost/filesystem.hpp> | ||||
|  | @ -68,8 +70,6 @@ namespace MWInput | |||
|       A_ToggleWeapon, | ||||
|       A_ToggleSpell, | ||||
| 
 | ||||
|       A_Settings, // Temporary hotkey
 | ||||
| 
 | ||||
|       A_LAST            // Marker for the last item
 | ||||
|     }; | ||||
| 
 | ||||
|  | @ -78,7 +78,6 @@ namespace MWInput | |||
|   { | ||||
|     OEngine::Input::DispatcherPtr disp; | ||||
|     OEngine::Render::OgreRenderer &ogre; | ||||
|     OEngine::Render::ExitListener exit; | ||||
|     Mangle::Input::OISDriver input; | ||||
|     OEngine::Input::Poller poller; | ||||
|     MouseLookEventPtr mouse; | ||||
|  | @ -140,15 +139,6 @@ private: | |||
|         windows.messageBox ("Screenshot saved", empty); | ||||
|     } | ||||
| 
 | ||||
|     void showSettings() | ||||
|     { | ||||
|         if (mDragDrop) | ||||
|             return; | ||||
| 
 | ||||
|         if (!windows.isGuiMode() || windows.getMode() != MWGui::GM_Settings) | ||||
|             windows.pushGuiMode(MWGui::GM_Settings); | ||||
|     } | ||||
| 
 | ||||
|     /* toggleInventory() is called when the user presses the button to toggle the inventory screen. */ | ||||
|     void toggleInventory() | ||||
|     { | ||||
|  | @ -222,11 +212,19 @@ private: | |||
|         player.toggleRunning(); | ||||
|     } | ||||
| 
 | ||||
|     void toggleMainMenu() | ||||
|     { | ||||
|         if (windows.isGuiMode () && windows.getMode () == MWGui::GM_MainMenu) | ||||
|             windows.removeGuiMode (MWGui::GM_MainMenu); | ||||
|         else | ||||
|             windows.pushGuiMode (MWGui::GM_MainMenu); | ||||
|     } | ||||
| 
 | ||||
|     // Exit program now button (which is disabled in GUI mode)
 | ||||
|     void exitNow() | ||||
|     { | ||||
|         if(!windows.isGuiMode()) | ||||
|             exit.exitNow(); | ||||
|             Ogre::Root::getSingleton().queueEndRendering (); | ||||
|     } | ||||
| 
 | ||||
|   public: | ||||
|  | @ -236,7 +234,6 @@ private: | |||
|                    bool debug, | ||||
|                    OMW::Engine& engine) | ||||
|       : ogre(_ogre), | ||||
|         exit(ogre.getWindow()), | ||||
|         input(ogre.getWindow(), !debug), | ||||
|         poller(input), | ||||
|         player(_player), | ||||
|  | @ -273,10 +270,8 @@ private: | |||
|                       "Draw Weapon"); | ||||
|       disp->funcs.bind(A_ToggleSpell,boost::bind(&InputImpl::toggleSpell,this), | ||||
|                       "Ready hands"); | ||||
|       disp->funcs.bind(A_Settings, boost::bind(&InputImpl::showSettings, this), | ||||
|                       "Show settings window"); | ||||
|       // Add the exit listener
 | ||||
|       ogre.getRoot()->addFrameListener(&exit); | ||||
|       disp->funcs.bind(A_GameMenu, boost::bind(&InputImpl::toggleMainMenu, this), | ||||
|                       "Toggle main menu"); | ||||
| 
 | ||||
|       mouse = MouseLookEventPtr(new MouseLookEvent()); | ||||
| 
 | ||||
|  | @ -316,7 +311,7 @@ private: | |||
|       // NOTE: These keys do not require constant polling - use in conjuction with variables in loops.
 | ||||
| 
 | ||||
|       disp->bind(A_Quit, KC_Q); | ||||
|       disp->bind(A_Quit, KC_ESCAPE); | ||||
|       disp->bind(A_GameMenu, KC_ESCAPE); | ||||
|       disp->bind(A_Screenshot, KC_SYSRQ); | ||||
|       disp->bind(A_Inventory, KC_I); | ||||
|       disp->bind(A_Console, KC_F1); | ||||
|  | @ -327,7 +322,6 @@ private: | |||
|       disp->bind(A_ToggleWalk, KC_C); | ||||
|       disp->bind(A_ToggleWeapon,KC_F); | ||||
|       disp->bind(A_ToggleSpell,KC_R); | ||||
|       disp->bind(A_Settings, KC_F2); | ||||
| 
 | ||||
|       // Key bindings for polled keys
 | ||||
|       // NOTE: These keys are constantly being polled. Only add keys that must be checked each frame.
 | ||||
|  |  | |||
|  | @ -27,10 +27,10 @@ namespace MWRender | |||
|         // we are only interested in X and Y rotation
 | ||||
| 
 | ||||
|         // Rotate around X axis
 | ||||
|         Ogre::Quaternion xr(Ogre::Degree(rot.x), Ogre::Vector3::UNIT_X); | ||||
|         Ogre::Quaternion xr(Ogre::Radian(rot.x), Ogre::Vector3::UNIT_X); | ||||
| 
 | ||||
|         // Rotate around Y axis
 | ||||
|         Ogre::Quaternion yr(Ogre::Degree(-rot.z), Ogre::Vector3::UNIT_Y); | ||||
|         Ogre::Quaternion yr(Ogre::Radian(-rot.z), Ogre::Vector3::UNIT_Y); | ||||
| 
 | ||||
|         pitchNode->setOrientation(xr); | ||||
|         yawNode->setOrientation(yr); | ||||
|  | @ -56,8 +56,8 @@ namespace MWRender | |||
|         Ogre::SceneNode *pitchNode = mCamera->getParentSceneNode(); | ||||
|         Ogre::SceneNode *yawNode = pitchNode->getParentSceneNode(); | ||||
| 
 | ||||
|         pitchNode->pitch(Ogre::Degree(rot.x)); | ||||
|         yawNode->yaw(Ogre::Degree(-rot.z)); | ||||
|         pitchNode->pitch(Ogre::Radian(rot.x)); | ||||
|         yawNode->yaw(Ogre::Radian(-rot.z)); | ||||
| 
 | ||||
|         controlFlip(); | ||||
|         updateListener(); | ||||
|  |  | |||
|  | @ -28,6 +28,8 @@ namespace MWRender | |||
|         bool mVanityModeEnabled; | ||||
| 
 | ||||
|         void controlFlip(); | ||||
| 
 | ||||
|         /// Updates sound manager listener data
 | ||||
|         void updateListener(); | ||||
| 
 | ||||
|     public: | ||||
|  | @ -35,11 +37,19 @@ namespace MWRender | |||
|         Player (Ogre::Camera *camera, Ogre::SceneNode* mNode); | ||||
| 
 | ||||
|         /// Set where the player is looking at. Uses Morrowind (euler) angles
 | ||||
|         /// \param rot Rotation angles in radians
 | ||||
|         /// \return true if player object needs to bo rotated physically
 | ||||
|         bool setRotation(const Ogre::Vector3 &rot); | ||||
| 
 | ||||
|         /// \param rot Rotation angles in radians
 | ||||
|         /// \return true if player object needs to bo rotated physically
 | ||||
|         bool adjustRotation(const Ogre::Vector3 &rot); | ||||
| 
 | ||||
|         std::string getHandle() const; | ||||
| 
 | ||||
|         /// Attach camera to object
 | ||||
|         /// \note there is no protection from attaching the same camera to
 | ||||
|         /// several different objects
 | ||||
|         void attachTo(const MWWorld::Ptr &); | ||||
| 
 | ||||
|         void toggleViewMode() { | ||||
|  |  | |||
|  | @ -258,23 +258,26 @@ RenderingManager::rotateObject( | |||
|     bool force = true; | ||||
|      | ||||
|     if (isPlayer) { | ||||
|         force = (adjust) ? mPlayer->adjustRotation(rot) : mPlayer->setRotation(rot); | ||||
|         if (adjust) { | ||||
|             force = mPlayer->adjustRotation(rot); | ||||
|         } else { | ||||
|             force = mPlayer->setRotation(rot); | ||||
|         } | ||||
|     } | ||||
|     MWWorld::Class::get(ptr).adjustRotation(ptr, rot.x, rot.y, rot.z); | ||||
| 
 | ||||
|     if (adjust) { | ||||
|         /// \note Stored and passed in radians
 | ||||
|         float *f = ptr.getRefData().getPosition().rot; | ||||
|         rot.x += Ogre::Radian(f[0]).valueDegrees(); | ||||
|         rot.y += Ogre::Radian(f[1]).valueDegrees(); | ||||
|         rot.z += Ogre::Radian(f[2]).valueDegrees(); | ||||
|         rot.x += f[0], rot.y += f[1], rot.z += f[2]; | ||||
|     } | ||||
|     if (!isPlayer) { | ||||
|         Ogre::Quaternion xr(Ogre::Degree(rot.x), Ogre::Vector3::UNIT_X); | ||||
|         Ogre::Quaternion yr(Ogre::Degree(rot.y), Ogre::Vector3::UNIT_Y); | ||||
|         Ogre::Quaternion zr(Ogre::Degree(rot.z), Ogre::Vector3::UNIT_Z); | ||||
|         Ogre::Quaternion xr(Ogre::Radian(rot.x), Ogre::Vector3::UNIT_X); | ||||
|         Ogre::Quaternion yr(Ogre::Radian(rot.y), Ogre::Vector3::UNIT_Y); | ||||
|         Ogre::Quaternion zr(Ogre::Radian(rot.z), Ogre::Vector3::UNIT_Z); | ||||
| 
 | ||||
|         ptr.getRefData().getBaseNode()->setOrientation(xr * yr * zr); | ||||
|     } | ||||
| 
 | ||||
|     return force; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -85,6 +85,11 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList | |||
| 
 | ||||
|     void moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position); | ||||
|     void scaleObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& scale); | ||||
| 
 | ||||
|     /// Rotates object accordingly to its type
 | ||||
|     /// \param rot euler angles in radians
 | ||||
|     /// \param adjust indicates should rotation be set or adjusted
 | ||||
|     /// \return true if object needs to be rotated physically
 | ||||
|     bool rotateObject (const MWWorld::Ptr& ptr, Ogre::Vector3 &rot, bool adjust = false); | ||||
| 
 | ||||
|     void setWaterHeight(const float height); | ||||
|  |  | |||
|  | @ -150,7 +150,11 @@ namespace MWWorld | |||
| 
 | ||||
|         if (adjustPlayerPos) { | ||||
|             world->moveObject(player, pos.pos[0], pos.pos[1], pos.pos[2]); | ||||
|             world->rotateObject(player, pos.rot[0], pos.rot[1], pos.rot[2]); | ||||
| 
 | ||||
|             float x = Ogre::Radian(pos.rot[0]).valueDegrees(); | ||||
|             float y = Ogre::Radian(pos.rot[1]).valueDegrees(); | ||||
|             float z = Ogre::Radian(pos.rot[2]).valueDegrees(); | ||||
|             world->rotateObject(player, x, y, z); | ||||
|         } | ||||
| 
 | ||||
|         MWMechanics::MechanicsManager *mechMgr = | ||||
|  |  | |||
|  | @ -76,12 +76,12 @@ namespace MWWorld | |||
| 
 | ||||
|     TimeStamp operator+ (const TimeStamp& stamp, double hours) | ||||
|     { | ||||
|         return TimeStamp (stamp) + hours; | ||||
|         return TimeStamp (stamp) += hours; | ||||
|     } | ||||
| 
 | ||||
|     TimeStamp operator+ (double hours, const TimeStamp& stamp) | ||||
|     { | ||||
|         return TimeStamp (stamp) + hours; | ||||
|         return TimeStamp (stamp) += hours; | ||||
|     } | ||||
| 
 | ||||
|     double operator- (const TimeStamp& left, const TimeStamp& right) | ||||
|  |  | |||
|  | @ -629,12 +629,14 @@ namespace MWWorld | |||
| 
 | ||||
|     void World::rotateObject (const Ptr& ptr,float x,float y,float z, bool adjust) | ||||
|     { | ||||
|         Ogre::Vector3 rot(x, y, z); | ||||
|         Ogre::Vector3 rot; | ||||
|         rot.x = Ogre::Degree(x).valueRadians(); | ||||
|         rot.y = Ogre::Degree(y).valueRadians(); | ||||
|         rot.z = Ogre::Degree(z).valueRadians(); | ||||
| 
 | ||||
|         if (mRendering->rotateObject(ptr, rot, adjust)) { | ||||
|             float *objRot = ptr.getRefData().getPosition().rot; | ||||
|             objRot[0] = Ogre::Degree(rot.x).valueRadians(); | ||||
|             objRot[1] = Ogre::Degree(rot.y).valueRadians(); | ||||
|             objRot[2] = Ogre::Degree(rot.z).valueRadians(); | ||||
|             objRot[0] = rot.x, objRot[1] = rot.y, objRot[2] = rot.z; | ||||
| 
 | ||||
|             mPhysics->rotateObject( | ||||
|                 ptr.getRefData().getHandle(), | ||||
|  | @ -1147,4 +1149,5 @@ namespace MWWorld | |||
|         } | ||||
|         return pos.z < cell.water; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -210,6 +210,8 @@ namespace MWWorld | |||
| 
 | ||||
|             virtual void scaleObject (const Ptr& ptr, float scale); | ||||
| 
 | ||||
|             /// Rotates object, uses degrees
 | ||||
|             /// \param adjust indicates rotation should be set or adjusted
 | ||||
|             virtual void rotateObject (const Ptr& ptr,float x,float y,float z, bool adjust = false); | ||||
| 
 | ||||
|             virtual void indexToPosition (int cellX, int cellY, float &x, float &y, bool centre = false) | ||||
|  | @ -274,6 +276,7 @@ namespace MWWorld | |||
| 
 | ||||
|             virtual bool isSwimming(const MWWorld::Ptr &object); | ||||
|             virtual bool isUnderwater(const ESM::Cell &cell, const Ogre::Vector3 &pos); | ||||
| 
 | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -5,6 +5,7 @@ set(DDIR ${OpenMW_BINARY_DIR}/resources/mygui) | |||
| 
 | ||||
| set(MYGUI_FILES | ||||
|     atlas1.cfg | ||||
|     mainmenu.cfg | ||||
|     bigbars.png | ||||
|     black.png | ||||
|     core.skin | ||||
|  |  | |||
							
								
								
									
										95
									
								
								files/mygui/mainmenu.cfg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								files/mygui/mainmenu.cfg
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,95 @@ | |||
| [settings] | ||||
|     size_x = 512 | ||||
|     size_y = 512 | ||||
| 
 | ||||
| 
 | ||||
| [menu_newgame.dds] | ||||
|     x = 0 | ||||
|     y = 0 | ||||
| 
 | ||||
| [menu_newgame_pressed.dds] | ||||
|     x = 128 | ||||
|     y = 0 | ||||
| 
 | ||||
| [menu_newgame_over.dds] | ||||
|     x = 256 | ||||
|     y = 0 | ||||
| 
 | ||||
| 
 | ||||
| [menu_loadgame.dds] | ||||
|     x = 384 | ||||
|     y = 0 | ||||
| 
 | ||||
| [menu_loadgame_pressed.dds] | ||||
|     x = 0 | ||||
|     y = 64 | ||||
| 
 | ||||
| [menu_loadgame_over.dds] | ||||
|     x = 128 | ||||
|     y = 64 | ||||
| 
 | ||||
| 
 | ||||
| [menu_options.dds] | ||||
|     x = 256 | ||||
|     y = 64 | ||||
| 
 | ||||
| [menu_options_pressed.dds] | ||||
|     x = 384 | ||||
|     y = 64 | ||||
| 
 | ||||
| [menu_options_over.dds] | ||||
|     x = 0 | ||||
|     y = 128 | ||||
| 
 | ||||
| 
 | ||||
| [menu_credits.dds] | ||||
|     x = 128 | ||||
|     y = 128 | ||||
| 
 | ||||
| [menu_credits_pressed.dds] | ||||
|     x = 256 | ||||
|     y = 128 | ||||
| 
 | ||||
| [menu_credits_over.dds] | ||||
|     x = 384 | ||||
|     y = 128 | ||||
| 
 | ||||
| 
 | ||||
| [menu_exitgame.dds] | ||||
|     x = 0 | ||||
|     y = 192 | ||||
| 
 | ||||
| [menu_exitgame_pressed.dds] | ||||
|     x = 128 | ||||
|     y = 192 | ||||
| 
 | ||||
| [menu_exitgame_over.dds] | ||||
|     x = 256 | ||||
|     y = 192 | ||||
| 
 | ||||
| 
 | ||||
| [menu_savegame.dds] | ||||
|     x = 384 | ||||
|     y = 192 | ||||
| 
 | ||||
| [menu_savegame_pressed.dds] | ||||
|     x = 0 | ||||
|     y = 256 | ||||
| 
 | ||||
| [menu_savegame_over.dds] | ||||
|     x = 128 | ||||
|     y = 256 | ||||
| 
 | ||||
| 
 | ||||
| [menu_return.dds] | ||||
|     x = 256 | ||||
|     y = 256 | ||||
| 
 | ||||
| [menu_return_pressed.dds] | ||||
|     x = 384 | ||||
|     y = 256 | ||||
| 
 | ||||
| [menu_return_over.dds] | ||||
|     x = 0 | ||||
|     y = 320 | ||||
| 
 | ||||
|  | @ -4,8 +4,6 @@ | |||
|     <Layer name="Scene" overlapped="false" peek="true"/> | ||||
|     <Layer name="HUD" overlapped="false" peek="true"/> | ||||
|     <Layer name="Windows" overlapped="true" peek="true"/> | ||||
|     <Layer name="Books" overlapped="false" peek="false"/> | ||||
|     <Layer name="MainMenu" overlapped="false" peek="false"/> | ||||
|     <Layer name="Console" overlapped="false" peek="true"/> | ||||
|     <Layer name="Notification" overlapped="false" peek="false"/> | ||||
|     <Layer name="Popup" overlapped="true" peek="true"/> | ||||
|  |  | |||
|  | @ -2,16 +2,5 @@ | |||
| 
 | ||||
| <MyGUI type="Layout"> | ||||
|     <!-- The entire screen --> | ||||
|     <Widget type="Widget" layer="MainMenu" position="0 0 300 300" name="_Main"> | ||||
|         <!-- Centered box containing the buttons --> | ||||
|         <Widget type="Widget" position="86 12 128 276" align="Center"> | ||||
|             <!-- Menu boxes --> | ||||
|             <Widget type="Button" skin="ReturnButton" position="0 0 128 64" align="Top Left" name="Return"/> | ||||
|             <Widget type="Button" skin="NewButton" position="0 46 128 64" align="Top Left" name="New"/> | ||||
|             <Widget type="Button" skin="SaveButton" position="0 92 128 64" align="Top Left" name="Save"/> | ||||
|             <Widget type="Button" skin="LoadButton" position="0 138 128 64" align="Top Left" name="Load"/> | ||||
|             <Widget type="Button" skin="OptionsButton" position="0 184 128 64" align="Top Left" name="Options"/> | ||||
|             <Widget type="Button" skin="ExitButton" position="0 230 128 64" align="Top Left" name="Exit"/> | ||||
|         </Widget> | ||||
|     </Widget> | ||||
|     <Widget type="Widget" layer="Windows" position="0 0 300 300" name="_Main" /> | ||||
| </MyGUI> | ||||
|  |  | |||
|  | @ -1,6 +1,8 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| 
 | ||||
| <MyGUI type="Resource"> | ||||
| 
 | ||||
|     <!-- Cursors --> | ||||
|     <Resource type="ResourceImageSet" name="ArrowPointerImage"> | ||||
|         <Group name="Pointer" texture="textures\tx_cursor.dds" size="32 32"> | ||||
|             <Index name="Pointer" > | ||||
|  | @ -44,6 +46,10 @@ | |||
|         </Group> | ||||
|     </Resource> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     <!-- Journal, book, scroll --> | ||||
|     <Resource type="ResourceImageSet" name="MenuBook_Close"> | ||||
|         <Group name="States" texture="mwgui1" size="96 24"> | ||||
|             <Index name="disabled"> | ||||
|  | @ -113,6 +119,124 @@ | |||
|     </Resource> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     <!-- Main menu --> | ||||
|     <Resource type="ResourceImageSet" name="Menu_NewGame"> | ||||
|         <Group name="States" texture="mwgui2" size="128 64"> | ||||
|             <Index name="disabled"> | ||||
|                 <Frame point="0 0"/> | ||||
|             </Index> | ||||
|             <Index name="normal"> | ||||
|                 <Frame point="0 0"/> | ||||
|             </Index> | ||||
|             <Index name="highlighted"> | ||||
|                 <Frame point="256 0"/> | ||||
|             </Index> | ||||
|             <Index name="pushed"> | ||||
|                 <Frame point="128 0"/> | ||||
|             </Index> | ||||
|         </Group> | ||||
|     </Resource> | ||||
|     <Resource type="ResourceImageSet" name="Menu_LoadGame"> | ||||
|         <Group name="States" texture="mwgui2" size="128 64"> | ||||
|             <Index name="disabled"> | ||||
|                 <Frame point="384 0"/> | ||||
|             </Index> | ||||
|             <Index name="normal"> | ||||
|                 <Frame point="384 0"/> | ||||
|             </Index> | ||||
|             <Index name="highlighted"> | ||||
|                 <Frame point="128 64"/> | ||||
|             </Index> | ||||
|             <Index name="pushed"> | ||||
|                 <Frame point="0 64"/> | ||||
|             </Index> | ||||
|         </Group> | ||||
|     </Resource> | ||||
|     <Resource type="ResourceImageSet" name="Menu_Options"> | ||||
|         <Group name="States" texture="mwgui2" size="128 64"> | ||||
|             <Index name="disabled"> | ||||
|                 <Frame point="256 64"/> | ||||
|             </Index> | ||||
|             <Index name="normal"> | ||||
|                 <Frame point="256 64"/> | ||||
|             </Index> | ||||
|             <Index name="highlighted"> | ||||
|                 <Frame point="0 128"/> | ||||
|             </Index> | ||||
|             <Index name="pushed"> | ||||
|                 <Frame point="384 64"/> | ||||
|             </Index> | ||||
|         </Group> | ||||
|     </Resource> | ||||
|     <Resource type="ResourceImageSet" name="Menu_Credits"> | ||||
|         <Group name="States" texture="mwgui2" size="128 64"> | ||||
|             <Index name="disabled"> | ||||
|                 <Frame point="128 128"/> | ||||
|             </Index> | ||||
|             <Index name="normal"> | ||||
|                 <Frame point="128 128"/> | ||||
|             </Index> | ||||
|             <Index name="highlighted"> | ||||
|                 <Frame point="384 128"/> | ||||
|             </Index> | ||||
|             <Index name="pushed"> | ||||
|                 <Frame point="256 128"/> | ||||
|             </Index> | ||||
|         </Group> | ||||
|     </Resource> | ||||
|     <Resource type="ResourceImageSet" name="Menu_ExitGame"> | ||||
|         <Group name="States" texture="mwgui2" size="128 64"> | ||||
|             <Index name="disabled"> | ||||
|                 <Frame point="0 192"/> | ||||
|             </Index> | ||||
|             <Index name="normal"> | ||||
|                 <Frame point="0 192"/> | ||||
|             </Index> | ||||
|             <Index name="highlighted"> | ||||
|                 <Frame point="256 192"/> | ||||
|             </Index> | ||||
|             <Index name="pushed"> | ||||
|                 <Frame point="128 192"/> | ||||
|             </Index> | ||||
|         </Group> | ||||
|     </Resource> | ||||
|     <Resource type="ResourceImageSet" name="Menu_SaveGame"> | ||||
|         <Group name="States" texture="mwgui2" size="128 64"> | ||||
|             <Index name="disabled"> | ||||
|                 <Frame point="384 192"/> | ||||
|             </Index> | ||||
|             <Index name="normal"> | ||||
|                 <Frame point="384 192"/> | ||||
|             </Index> | ||||
|             <Index name="highlighted"> | ||||
|                 <Frame point="128 256"/> | ||||
|             </Index> | ||||
|             <Index name="pushed"> | ||||
|                 <Frame point="0 256"/> | ||||
|             </Index> | ||||
|         </Group> | ||||
|     </Resource> | ||||
|     <Resource type="ResourceImageSet" name="Menu_Return"> | ||||
|         <Group name="States" texture="mwgui2" size="128 64"> | ||||
|             <Index name="disabled"> | ||||
|                 <Frame point="256 256"/> | ||||
|             </Index> | ||||
|             <Index name="normal"> | ||||
|                 <Frame point="256 256"/> | ||||
|             </Index> | ||||
|             <Index name="highlighted"> | ||||
|                 <Frame point="0 320"/> | ||||
|             </Index> | ||||
|             <Index name="pushed"> | ||||
|                 <Frame point="384 256"/> | ||||
|             </Index> | ||||
|         </Group> | ||||
|     </Resource> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     <!-- Skins --> | ||||
| 
 | ||||
|     <Resource type="ResourceLayout" name="ButtonImage" version="3.2.0"> | ||||
|  |  | |||
|  | @ -1,37 +0,0 @@ | |||
| #ifndef OENGINE_OGRE_EXITLISTEN_H | ||||
| #define OENGINE_OGRE_EXITLISTEN_H | ||||
| 
 | ||||
| /*
 | ||||
|   This FrameListener simply exits the rendering loop when the window | ||||
|   is closed. You can also tell it to exit manually by setting the exit | ||||
|   member to true; | ||||
|  */ | ||||
| 
 | ||||
| #include <OgreFrameListener.h> | ||||
| #include <OgreRenderWindow.h> | ||||
| 
 | ||||
| namespace OEngine { | ||||
| namespace Render | ||||
| { | ||||
|   struct ExitListener : Ogre::FrameListener | ||||
|   { | ||||
|     Ogre::RenderWindow *window; | ||||
|     bool exit; | ||||
| 
 | ||||
|     ExitListener(Ogre::RenderWindow *wnd) | ||||
|       : window(wnd), exit(false) {} | ||||
| 
 | ||||
|     bool frameStarted(const Ogre::FrameEvent &evt) | ||||
|     { | ||||
|       if(window->isClosed()) | ||||
|         exit = true; | ||||
| 
 | ||||
|       return !exit; | ||||
|     } | ||||
| 
 | ||||
|     // Function equivalent of setting exit=true. Handy when you need a
 | ||||
|     // delegate to bind to an event.
 | ||||
|     void exitNow() { exit = true; } | ||||
|   }; | ||||
| }} | ||||
| #endif | ||||
|  | @ -9,8 +9,6 @@ | |||
|   inspired by http://www.ogre3d.org/tikiwiki/FadeEffectOverlay (heavily adjusted)
 | ||||
|  */ | ||||
|   | ||||
| #include <OgreFrameListener.h> | ||||
| 
 | ||||
| namespace Ogre | ||||
| { | ||||
|     class TextureUnitState; | ||||
|  |  | |||
|  | @ -17,6 +17,10 @@ | |||
| #include <cstdlib> | ||||
| #include <stdexcept> | ||||
| 
 | ||||
| #if defined(__APPLE__) && !defined(__LP64__) | ||||
| #include <Carbon/Carbon.h> | ||||
| #endif | ||||
| 
 | ||||
| using namespace Ogre; | ||||
| using namespace OEngine::Render; | ||||
| 
 | ||||
|  | @ -31,7 +35,33 @@ void OgreRenderer::cleanup() | |||
| 
 | ||||
| void OgreRenderer::start() | ||||
| { | ||||
| #if defined(__APPLE__) && !defined(__LP64__) | ||||
|     bool quit = false; | ||||
|     // OSX Carbon Message Pump
 | ||||
|     do { | ||||
|         EventRef event = NULL; | ||||
|         EventTargetRef targetWindow; | ||||
|         targetWindow = GetEventDispatcherTarget(); | ||||
| 
 | ||||
|         // If we are unable to get the target then we no longer care about events.
 | ||||
|         if (!targetWindow) return; | ||||
| 
 | ||||
|         // Grab the next event while possible
 | ||||
|         while (ReceiveNextEvent(0, NULL, kEventDurationNoWait, true, &event) == noErr) | ||||
|         { | ||||
|             // Dispatch the event
 | ||||
|             SendEventToEventTarget(event, targetWindow); | ||||
|             ReleaseEvent(event); | ||||
|         } | ||||
| 
 | ||||
|         if (!Ogre::Root::getSingleton().renderOneFrame()) { | ||||
|             quit = true; | ||||
|         } | ||||
| 
 | ||||
|     } while (!quit); | ||||
| #else | ||||
|     mRoot->startRendering(); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| bool OgreRenderer::loadPlugins() const | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue