From 800df7376ccc1b88c56c286af5e7a1fe1e12c091 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 12 Apr 2012 14:26:21 +0200 Subject: [PATCH] use the cursors from morrowind.bsa and remove mwpointer.png --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/engine.cpp | 4 ++++ apps/openmw/mwgui/cursorreplace.cpp | 16 ++++++++++++++++ apps/openmw/mwgui/cursorreplace.hpp | 16 ++++++++++++++++ files/mygui/CMakeLists.txt | 1 - files/mygui/mwpointer.png | Bin 4810 -> 0 bytes files/mygui/openmw_images.xml | 18 +++++++++--------- libs/openengine/ogre/imagerotate.cpp | 3 +-- libs/openengine/ogre/imagerotate.hpp | 2 +- 9 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 apps/openmw/mwgui/cursorreplace.cpp create mode 100644 apps/openmw/mwgui/cursorreplace.hpp delete mode 100644 files/mygui/mwpointer.png diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index a8ae0bd49..b417c764d 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -25,7 +25,7 @@ add_openmw_dir (mwinput add_openmw_dir (mwgui layouts text_input widgets race class birth review window_manager console dialogue dialogue_history window_base stats_window messagebox journalwindow charactercreation - map_window window_pinnable_base + map_window window_pinnable_base cursorreplace ) add_openmw_dir (mwdialogue diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 259733600..8fe6963a9 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -28,6 +28,7 @@ #include "mwinput/inputmanager.hpp" #include "mwgui/window_manager.hpp" +#include "mwgui/cursorreplace.hpp" #include "mwscript/scriptmanager.hpp" #include "mwscript/compilercontext.hpp" @@ -368,6 +369,9 @@ void OMW::Engine::go() loadBSA(); + // cursor replacer (converts the cursor from the bsa so they can be used by mygui) + MWGui::CursorReplace replacer; + // Create the world mEnvironment.mWorld = new MWWorld::World (*mOgre, mFileCollections, mMaster, mResDir, mNewGame, mEnvironment, mEncoding, mFallbackMap); diff --git a/apps/openmw/mwgui/cursorreplace.cpp b/apps/openmw/mwgui/cursorreplace.cpp new file mode 100644 index 000000000..2079538fc --- /dev/null +++ b/apps/openmw/mwgui/cursorreplace.cpp @@ -0,0 +1,16 @@ +#include "cursorreplace.hpp" + +#include +#include + +#include +#include + +using namespace MWGui; + +CursorReplace::CursorReplace() +{ + OEngine::Render::ImageRotate::rotate("textures\\tx_cursormove.dds", "mwpointer_vresize.png", 90); + OEngine::Render::ImageRotate::rotate("textures\\tx_cursormove.dds", "mwpointer_dresize1.png", -45); + OEngine::Render::ImageRotate::rotate("textures\\tx_cursormove.dds", "mwpointer_dresize2.png", 45); +} diff --git a/apps/openmw/mwgui/cursorreplace.hpp b/apps/openmw/mwgui/cursorreplace.hpp new file mode 100644 index 000000000..06fe28e39 --- /dev/null +++ b/apps/openmw/mwgui/cursorreplace.hpp @@ -0,0 +1,16 @@ +#ifndef GAME_CURSORREPLACE_H +#define GAME_CURSORREPLACE_H + +#include + +namespace MWGui +{ + /// \brief MyGUI does not support rotating cursors, so we have to do it manually + class CursorReplace + { + public: + CursorReplace(); + }; +} + +#endif diff --git a/files/mygui/CMakeLists.txt b/files/mygui/CMakeLists.txt index dbc20f3f8..e3a7b9999 100644 --- a/files/mygui/CMakeLists.txt +++ b/files/mygui/CMakeLists.txt @@ -8,7 +8,6 @@ configure_file("${SDIR}/bigbars.png" "${DDIR}/bigbars.png" COPYONLY) configure_file("${SDIR}/black.png" "${DDIR}/black.png" COPYONLY) configure_file("${SDIR}/core.skin" "${DDIR}/core.skin" COPYONLY) configure_file("${SDIR}/core.xml" "${DDIR}/core.xml" COPYONLY) -configure_file("${SDIR}/mwpointer.png" "${DDIR}/mwpointer.png" COPYONLY) configure_file("${SDIR}/mwgui.png" "${DDIR}/mwgui.png" COPYONLY) configure_file("${SDIR}/openmw_images.xml" "${DDIR}/openmw_images.xml" COPYONLY) configure_file("${SDIR}/openmw_settings.xml" "${DDIR}/openmw_settings.xml" COPYONLY) diff --git a/files/mygui/mwpointer.png b/files/mygui/mwpointer.png deleted file mode 100644 index 90bc19b5e2c7ea4f30b895cc5b8cde00ce460e98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4810 zcmV;*5;g6KP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXDv z4ipCV%8V!g000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000stNklY!DT!(TT8(ATxmF9B$tA>HJFd$UG{4+JUXc=`2B zNY%$dM-iE8vvfryFk_PL1_Ops^?eoAzp@@F3sV3<1KNr4LYr5?kiPD$&*6 zg}DpoV(!AZ;Cp;7AU1}|Opc+Fs+&#a04y`4oB{>}3V2(1HW~_*0vvFlP${5|CXxN9 z4&VUq?mV8PQE1W?M^h*8<89-fh<-9zKDP}MGewQ!{X&h z6V>54odz=)p!hEQXX*VEiQUu(nC-4n=S{8V(d&fV3_OyNh?A#kq{}mswvxd6egaK8 zNCLSefwB!*>Y^KrAzhuWE?cuwf57jj?jI){6DTw(fwbE?=*UAvHJhIofDa^WRM?4 zz?zkM>ArVf%-i?Qi)CvUk<*$HH}wHZsbEWVL?{A;1Zay5LOu_*E!~g?OTcB^fESR3 zk{|>G2mygrkLpo!p%rai)<9LLBu5o0iEQf|D83z=t(Fl|QpDe~>Y+J*-~HzLrCE!$ zfmEmj*1iFRgh=r2XO))52GcJ0_4f=+N>u;4$J`M}MW{eUsE{~E6S(@RpXrn1RL}D{ z&@?u*b-IDh>BIoe%^Gz|F{?|6f}E0La9|Js;Nb@V0J1W4h*49ZD00*_C1nQGT{fcd zu+JZx`t2tSX4`83%5OFn!G{#U<~3PKd9QBFx+>vfAu+07R2+rEBb8UrJ)_+eY<314 z)~_COjKU)&mi=FyEhs!zzHPchZ8v2=ww7cm6$LpZ|8athZ^kid3K}(q%E~6BEr|b- zAn-A$@NhBeE*qg$kuaET&8KS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cjC?W-A(6y7BJrZ^7|$;PQ9@aNuy7Ic+`t z!GL=`pU3%*&*L1tk(r!K23X+Row5}GimOe?zNW+H$I30A`!+yNd0x!pWs58}_JqaO z9}XaGV91pgs|?EF^SP0vL?ACZSq!iMm&am7rZ)KW`8iZwW5=!TD>wBGtqCLq0D$fu z8{XP^62T%KJYF6Id>&hQxywn21odXyU=s(NkK7*i;urzKq?@3tdHP@xKQ~CkmtJh_ zfkG~WHePkLar+;)@2zfQ_Tuis4xrxU@t$>i*iV`}Y%PR<*J`F6-gaY~w104j&kNx3 z>HZ<1SVa6!V@uZ!pD$~ar0BUPm;7Fr5H0=hBc(We{30AqH{2eW>Wp-UsmFe}-{Jmn zz~Oq2_2O+Wi&_Bmo&NDVSqE5Z40J(;j@mqO12o`&7efiX4fhW2UaNx!uuoF2BsJNWp`+OSJ2tV5VL!_l_OokOEqWi*6G8x7S*Ro(K*)_c`AcCo%R-3u zKtk{dfL{Pey_%JpX4pKE0sD7s>LVucMNRht{(7YO0H~WWYBDjAWZW)88{N!!?O@zA z_J4J@fVsshX{I~+7_f{R6#z^C`lmYsEdG~X_+I~VcOswr4ihc?s|7fDbq$?+>l!-? kX2^MOka;&UqW3HQ4@_ElhBC1j1ONa407*qoM6N<$f{)=HO8@`> diff --git a/files/mygui/openmw_images.xml b/files/mygui/openmw_images.xml index 6487742c3..e149273e2 100644 --- a/files/mygui/openmw_images.xml +++ b/files/mygui/openmw_images.xml @@ -2,37 +2,37 @@ - + - + - + - + - + - + - + - + - + diff --git a/libs/openengine/ogre/imagerotate.cpp b/libs/openengine/ogre/imagerotate.cpp index 166a1d3c6..b7522c100 100644 --- a/libs/openengine/ogre/imagerotate.cpp +++ b/libs/openengine/ogre/imagerotate.cpp @@ -49,7 +49,7 @@ void ImageRotate::rotate(const std::string& sourceImage, const std::string& dest unsigned int height = sourceTexture->getHeight(); TexturePtr destTexture = TextureManager::getSingleton().createManual( - "ImageRotateDestTexture", + destImage, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, width, height, @@ -69,7 +69,6 @@ void ImageRotate::rotate(const std::string& sourceImage, const std::string& dest rtt->writeContentsToFile(destImage); // remove all the junk we've created - TextureManager::getSingleton().remove("ImageRotateDestTexture"); MaterialManager::getSingleton().remove("ImageRotateMaterial"); root->destroySceneManager(sceneMgr); delete rect; diff --git a/libs/openengine/ogre/imagerotate.hpp b/libs/openengine/ogre/imagerotate.hpp index 85363d71f..a3f6d662f 100644 --- a/libs/openengine/ogre/imagerotate.hpp +++ b/libs/openengine/ogre/imagerotate.hpp @@ -15,7 +15,7 @@ namespace Render public: /** * @param source image (file name - has to exist in an resource group) - * @param destination image (absolute file path) + * @param name of the destination texture to save to (in memory) * @param angle in degrees to turn */ static void rotate(const std::string& sourceImage, const std::string& destImage, const float angle);