From 0bfbc23927ce652af66e999aec443161ad7eacd3 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 8 Jul 2014 20:01:40 +0100 Subject: [PATCH] Coordinate axes --- media/coordinates.png | Bin 0 -> 223 bytes media/texture_terrain.png | Bin 1205 -> 1130 bytes media/texture_terrain_plain.png | Bin 1130 -> 0 bytes src/Editor.cpp | 24 ++++++++++++++++++++++++ src/NBEditor.cpp | 0 5 files changed, 24 insertions(+) create mode 100644 media/coordinates.png delete mode 100644 media/texture_terrain_plain.png mode change 100755 => 100644 src/NBEditor.cpp diff --git a/media/coordinates.png b/media/coordinates.png new file mode 100644 index 0000000000000000000000000000000000000000..523010574ccbc823529df337d0deb747b7486f38 GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Y)RhkEIs;#~HoT z=kTR{4DTErryZd!tp-TQf8rgb-}NpQcB%@TAmM> z)&Nc@stW9i?7@J}PfM`Z@0NIdS%ZBzoO(ZRK6ka7X_yld_lv9S+dp_m;NIXCQ5CE71y1DdmyT=$BV;&u8jCs$q zdh={fy}*Lty6OvM8P00DqF!0g27 z@jsebmVeg091x8#FDs3jT|zO;F+N&g47+3OJyPl|4C1WS)f73b#_yX@ogg6~00;*t z^}Gq&yv>@Qjd^)Cr+&P_+I&x%-jB@_*khU<-o0PZBf)2q#07BxaullrTo;_^`k^6u zfB+x>Fb6=-T_Yx}5C=>qtsYQm>aR_UdI7AZrwgnTd=Kk_FvMZpf%Jf9nnTnL#^`#DJ3(*n7GOX8 z!kwju`xmeank`PIu6Td|AOH{tL{Zzr&zH2LLor#=4LENXW#0RKGeCVHJ5jApdwxH^ zZ-0?3aM=j!ip3Lu4(-ZS{!gkc$Th0Kx%EsVvVsF-Ccu=j*EfFGdFS z?^~+%S1a5lt_zH5*72`aL9d<=CD>ccNPk}_sg7~FbB0Ip00BTaKq;ke*Yop%lyvom zV)8_Jx~9DEP+oRjoCAb^P#-7?G~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YB2ieOZHjIGlPv zZ$5Xy{=Iz#+ZY;PyRO;$gKfWk|J&D%GSr2?E*^lPQcA^9dOmRdW(6nYIlAn_{WI8_ zFq}+mu(PB9dqg4DG)O_mzcIS3iT7V$U-gFMaD?~I3jBOqo8kcifB--o5X_wO0m~f1 z3H$JXF-2*P5%h0n81r;L!_Z)leN1!9`J^|-UtW)3*HzQYF`naq9UU|A00BS%AP&f) zyv@TQmZtG31>5mPU|Sa2zK?alZig`&#|hXUKHgxA?vvg+#2#7r1a0J$Q-;@jKIQ#L zJU{>t0GI>1x%6?n#~2!89vx|ndC#+Y^K4GNz=HC;rbqDlf^~;$Bd4fF_x_-%>r-!$ zP+ek(2M7QH0C7O0+FWZ^)NI zEeztU)zuU^tj6z~P@NzlAOHvlDD}Jv+q})1pN)BWHm82P!P5C=>qtsYQm>aR_UdI7AZrwgnTd=Kk_FvMZp zf%Jf9nnTnL#^`#DJ3(*n7GOX8!kwju`xmeank`PIu6Td|AOH{tL{Zzr&zH2LLor#= z4LENXW#0RKGeCVHJ5jApdwxH^Z;^AT&M+;9dKH{oB%~iaZ4TlA0)PNO98h&qWkq{; zie_oN53r}%TzAf>lu|bJ4!p#F}RMh5loTdMU}E8Hcn3yf*j@vl}vubvPk*jvme0MPa5OaJ@)KU2DXcnzt8<^TWy07*qoM6N<$f|jQNyZ`_I diff --git a/src/Editor.cpp b/src/Editor.cpp index b3ffd51..245de27 100644 --- a/src/Editor.cpp +++ b/src/Editor.cpp @@ -16,6 +16,27 @@ Editor::Editor() : } } +void drawCoord(IGUIFont* font, IVideoDriver *driver, unsigned int x, unsigned int y, const wchar_t* xlabel, const wchar_t* ylabel) +{ + static ITexture *axes = driver->getTexture("media/coordinates.png"); + driver->draw2DImage( + axes, + position2d(x, y), + rect(0, 0, 32, 32), + NULL, SColor(255, 255, 255, 255), true + ); + font->draw( + ylabel, + core::rect(x - 2, y - 20, 300, 50), + video::SColor(255, 255, 255, 255) + ); + font->draw( + xlabel, + core::rect(x + 40, y + 22, 300, 50), + video::SColor(255, 255, 255, 255) + ); +} + bool Editor::run(IrrlichtDevice* irr_device,Configuration* conf) { // Do Irrlicht Stuff @@ -126,6 +147,9 @@ bool Editor::run(IrrlichtDevice* irr_device,Configuration* conf) driver->draw2DLine(vector2d(0, ResY/2-1), vector2d(ResX, ResY/2-1), SColor(175,255,255,255)); driver->draw2DLine(vector2d(ResX/2, 0), vector2d(ResX/2, ResY), SColor(175,255,255,255)); driver->draw2DLine(vector2d(ResX/2+1, 0), vector2d(ResX/2+1, ResY), SColor(175,255,255,255)); + drawCoord(guienv->getSkin()->getFont(), driver, ResX/2 + 10, ResY/2 - 42, L"X", L"Z"); + drawCoord(guienv->getSkin()->getFont(), driver, 10, ResY - 42, L"X", L"Y"); + drawCoord(guienv->getSkin()->getFont(), driver, ResX/2 + 10, ResY - 42, L"Z", L"Y"); } else if (camera[currentWindow]) { smgr->setActiveCamera(camera[currentWindow]); driver->setViewPort(rect(0, 0, ResX, ResY)); diff --git a/src/NBEditor.cpp b/src/NBEditor.cpp old mode 100755 new mode 100644