mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Remove irr
namespace (#16309)
This commit is contained in:
parent
7e22c72492
commit
61551cfc3a
381 changed files with 680 additions and 1632 deletions
|
@ -7,8 +7,6 @@
|
|||
// header file generated by xxd
|
||||
// for the source bitmap, see builtInFont.png
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
const u8 BuiltInFontData[] = {
|
||||
|
@ -132,4 +130,3 @@ const u8 BuiltInFontData[] = {
|
|||
|
||||
const u32 BuiltInFontDataSize = sizeof(BuiltInFontData);
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <optional>
|
||||
#include <cassert>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -680,4 +678,3 @@ ISceneNode *CAnimatedMeshSceneNode::clone(ISceneNode *newParent, ISceneManager *
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "Transform.h"
|
||||
#include "matrix4.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class IDummyTransformationSceneNode;
|
||||
|
@ -192,4 +190,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
#define _B3D_READER_DEBUG
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -850,4 +848,3 @@ void CB3DMeshFileLoader::readFloats(f32 *vec, u32 count)
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
#include "SB3DStructs.h"
|
||||
#include "IReadFile.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -76,4 +73,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "ICameraSceneNode.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -86,7 +84,7 @@ void CBillboardSceneNode::render()
|
|||
}
|
||||
}
|
||||
|
||||
void CBillboardSceneNode::updateMesh(const irr::scene::ICameraSceneNode *camera)
|
||||
void CBillboardSceneNode::updateMesh(const scene::ICameraSceneNode *camera)
|
||||
{
|
||||
// billboard looks toward camera
|
||||
core::vector3df pos = getAbsolutePosition();
|
||||
|
@ -139,7 +137,7 @@ const core::aabbox3d<f32> &CBillboardSceneNode::getBoundingBox() const
|
|||
return BBoxSafe;
|
||||
}
|
||||
|
||||
const core::aabbox3d<f32> &CBillboardSceneNode::getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode *camera)
|
||||
const core::aabbox3d<f32> &CBillboardSceneNode::getTransformedBillboardBoundingBox(const scene::ICameraSceneNode *camera)
|
||||
{
|
||||
updateMesh(camera);
|
||||
return Buffer->BoundingBox;
|
||||
|
@ -264,4 +262,3 @@ ISceneNode *CBillboardSceneNode::clone(ISceneNode *newParent, ISceneManager *new
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IBillboardSceneNode.h"
|
||||
#include "CMeshBuffer.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -68,7 +66,7 @@ public:
|
|||
video::SColor &bottomColor) const override;
|
||||
|
||||
//! Get the real boundingbox used by the billboard (which depends on the active camera)
|
||||
const core::aabbox3d<f32> &getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode *camera) override;
|
||||
const core::aabbox3d<f32> &getTransformedBillboardBoundingBox(const scene::ICameraSceneNode *camera) override;
|
||||
|
||||
//! Get the amount of mesh buffers.
|
||||
u32 getMeshBufferCount() const override
|
||||
|
@ -91,7 +89,7 @@ public:
|
|||
ISceneNode *clone(ISceneNode *newParent = 0, ISceneManager *newManager = 0) override;
|
||||
|
||||
protected:
|
||||
void updateMesh(const irr::scene::ICameraSceneNode *camera);
|
||||
void updateMesh(const scene::ICameraSceneNode *camera);
|
||||
|
||||
private:
|
||||
//! Size.Width is the bottom edge width
|
||||
|
@ -110,4 +108,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
#include "SoftwareDriver2_helper.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
//! f18 - fixpoint 14.18 limit to 16k Textures
|
||||
#define CBLIT_USE_FIXPOINT18
|
||||
|
||||
|
@ -938,5 +935,3 @@ static s32 Blit(eBlitter operation,
|
|||
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
|
||||
#include <optional>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -68,4 +66,3 @@ public:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IVideoDriver.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -307,4 +305,3 @@ ISceneNode *CCameraSceneNode::clone(ISceneNode *newParent, ISceneManager *newMan
|
|||
}
|
||||
|
||||
} // end namespace
|
||||
} // end namespace
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "ICameraSceneNode.h"
|
||||
#include "SViewFrustum.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -162,4 +160,3 @@ protected:
|
|||
};
|
||||
|
||||
} // end namespace
|
||||
} // end namespace
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
// convert_A1R5G5B5toR8G8B8 converts 0bARRRRRGGGGGBBBBB into [R][G][B].
|
||||
// This also means many conversions may be broken on big endian.
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -650,4 +648,3 @@ void CColorConverter::convert_viaFormat(const void *sP, ECOLOR_FORMAT sF, s32 sN
|
|||
}
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "irrTypes.h"
|
||||
#include "IImage.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -81,4 +79,3 @@ public:
|
|||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
#include "CDummyTransformationSceneNode.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -95,4 +93,3 @@ void CDummyTransformationSceneNode::setPosition(const core::vector3df &newpos)
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "IDummyTransformationSceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -52,4 +50,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "irrArray.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -294,7 +292,7 @@ EGLConfig CEGLManager::chooseConfig(EConfigStyle confStyle)
|
|||
return configResult;
|
||||
}
|
||||
|
||||
irr::s32 CEGLManager::rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log)
|
||||
s32 CEGLManager::rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log)
|
||||
{
|
||||
// some values must be there or we ignore the config
|
||||
#ifdef EGL_VERSION_1_3
|
||||
|
@ -572,7 +570,6 @@ bool CEGLManager::testEGLError()
|
|||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "SExposedVideoData.h"
|
||||
#include "IContextManager.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
// EGL manager.
|
||||
|
@ -80,13 +78,13 @@ protected:
|
|||
|
||||
//! Check how close this config is to the parameters we requested
|
||||
//! returns 0 is perfect, larger values are worse and < 0 is unusable.
|
||||
irr::s32 rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log = false);
|
||||
s32 rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log = false);
|
||||
|
||||
// Helper to sort EGLConfig's. (because we got no std::pair....)
|
||||
struct SConfigRating
|
||||
{
|
||||
EGLConfig config;
|
||||
irr::s32 rating;
|
||||
s32 rating;
|
||||
bool operator<(const SConfigRating &other) const
|
||||
{
|
||||
return rating < other.rating;
|
||||
|
@ -110,5 +108,4 @@ private:
|
|||
EGLint MinorVersion;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
#include "CEmptySceneNode.h"
|
||||
#include "ISceneManager.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -58,4 +56,3 @@ ISceneNode *CEmptySceneNode::clone(ISceneNode *newParent, ISceneManager *newMana
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "ISceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -37,4 +35,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
#include "CFPSCounter.h"
|
||||
#include "irrMath.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -32,4 +30,3 @@ void CFPSCounter::registerFrame(u32 now)
|
|||
}
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "irrTypes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -29,4 +27,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
|
||||
|
@ -147,5 +145,4 @@ const io::path &CFileList::getPath() const
|
|||
return Path;
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
} // end namespace io
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "irrString.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
|
||||
|
@ -124,5 +122,4 @@ protected:
|
|||
core::array<SFileListEntry> Files;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
} // end namespace io
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
|
||||
|
@ -488,5 +486,4 @@ IFileSystem *createFileSystem()
|
|||
return new CFileSystem();
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
} // end namespace io
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include <vector>
|
||||
#include "IFileSystem.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
|
||||
|
@ -98,5 +96,4 @@ private:
|
|||
std::vector<IArchiveLoader *> ArchiveLoader;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
} // end namespace io
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
namespace irr {
|
||||
|
||||
/* Notes on the coordinate system.
|
||||
*
|
||||
* glTF uses a right-handed coordinate system where +Z is the
|
||||
|
@ -920,5 +918,3 @@ tiniergltf::GlTF SelfType::parseGLTF(io::IReadFile* file)
|
|||
}
|
||||
|
||||
} // namespace scene
|
||||
|
||||
} // namespace irr
|
||||
|
|
|
@ -17,9 +17,6 @@
|
|||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -165,5 +162,3 @@ private:
|
|||
|
||||
} // namespace scene
|
||||
|
||||
} // namespace irr
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
#include <GL/glext.h>
|
||||
#include <GL/glxext.h>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -391,7 +389,6 @@ bool CGLXManager::swapBuffers()
|
|||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
// we can't include glx.h here, because gl.h has incompatible types with ogl es headers and it
|
||||
// cause redefinition errors, thats why we use ugly trick with void* types and casts.
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
// GLX manager.
|
||||
|
@ -71,6 +69,5 @@ private:
|
|||
XID GlxWin; // GLXWindow
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "IGUIFont.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -411,7 +409,7 @@ video::SColor CGUIButton::getOverrideColor() const
|
|||
return OverrideColor;
|
||||
}
|
||||
|
||||
irr::video::SColor CGUIButton::getActiveColor() const
|
||||
video::SColor CGUIButton::getActiveColor() const
|
||||
{
|
||||
if (OverrideColorEnabled)
|
||||
return OverrideColor;
|
||||
|
@ -494,4 +492,3 @@ bool CGUIButton::isDrawingBorder() const
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include "ITexture.h"
|
||||
#include "SColor.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -234,4 +232,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "IGUIFont.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -191,4 +189,3 @@ bool CGUICheckBox::isDrawBorderEnabled() const
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "IGUICheckBox.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -52,4 +50,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
#include "CGUIListBox.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -456,4 +454,3 @@ void CGUIComboBox::openCloseMenu()
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include "irrString.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
class IGUIButton;
|
||||
|
@ -101,4 +99,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
numerical
|
||||
*/
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -314,7 +312,7 @@ bool CGUIEditBox::processKey(const SEvent &event)
|
|||
// add the string
|
||||
const c8 *p = Operator->getTextFromClipboard();
|
||||
if (p) {
|
||||
irr::core::stringw widep;
|
||||
core::stringw widep;
|
||||
core::utf8ToWString(widep, p);
|
||||
|
||||
if (MarkBegin == MarkEnd) {
|
||||
|
@ -936,13 +934,13 @@ wchar_t CGUIEditBox::getCursorChar() const
|
|||
}
|
||||
|
||||
//! Set the blinktime for the cursor. 2x blinktime is one full cycle.
|
||||
void CGUIEditBox::setCursorBlinkTime(irr::u32 timeMs)
|
||||
void CGUIEditBox::setCursorBlinkTime(u32 timeMs)
|
||||
{
|
||||
CursorBlinkTime = timeMs;
|
||||
}
|
||||
|
||||
//! Get the cursor blinktime
|
||||
irr::u32 CGUIEditBox::getCursorBlinkTime() const
|
||||
u32 CGUIEditBox::getCursorBlinkTime() const
|
||||
{
|
||||
return CursorBlinkTime;
|
||||
}
|
||||
|
@ -950,7 +948,7 @@ irr::u32 CGUIEditBox::getCursorBlinkTime() const
|
|||
bool CGUIEditBox::processMouse(const SEvent &event)
|
||||
{
|
||||
switch (event.MouseInput.Event) {
|
||||
case irr::EMIE_LMOUSE_LEFT_UP:
|
||||
case EMIE_LMOUSE_LEFT_UP:
|
||||
if (Environment->hasFocus(this)) {
|
||||
CursorPos = getCursorPos(event.MouseInput.X, event.MouseInput.Y);
|
||||
if (MouseMarking) {
|
||||
|
@ -961,7 +959,7 @@ bool CGUIEditBox::processMouse(const SEvent &event)
|
|||
return true;
|
||||
}
|
||||
break;
|
||||
case irr::EMIE_MOUSE_MOVED: {
|
||||
case EMIE_MOUSE_MOVED: {
|
||||
if (MouseMarking) {
|
||||
CursorPos = getCursorPos(event.MouseInput.X, event.MouseInput.Y);
|
||||
setTextMarkers(MarkBegin, CursorPos);
|
||||
|
@ -1011,7 +1009,7 @@ bool CGUIEditBox::processMouse(const SEvent &event)
|
|||
|
||||
// paste from the primary selection
|
||||
inputString([&] {
|
||||
irr::core::stringw inserted_text;
|
||||
core::stringw inserted_text;
|
||||
if (!Operator)
|
||||
return inserted_text;
|
||||
const c8 *inserted_text_utf8 = Operator->getTextFromPrimarySelection();
|
||||
|
@ -1349,7 +1347,7 @@ void CGUIEditBox::calculateScrollPos()
|
|||
{
|
||||
// get cursor position
|
||||
// get cursor area
|
||||
irr::u32 cursorWidth = font->getDimension(CursorChar.c_str()).Width;
|
||||
u32 cursorWidth = font->getDimension(CursorChar.c_str()).Width;
|
||||
core::stringw *txtLine = hasBrokenText ? &BrokenText[cursLine] : &Text;
|
||||
s32 cPos = hasBrokenText ? CursorPos - BrokenTextPositions[cursLine] : CursorPos; // column
|
||||
s32 cStart = font->getDimension(txtLine->subString(0, cPos).c_str()).Width; // pixels from text-start
|
||||
|
@ -1380,9 +1378,9 @@ void CGUIEditBox::calculateScrollPos()
|
|||
|
||||
// calculate vertical scrolling
|
||||
if (hasBrokenText) {
|
||||
irr::u32 lineHeight = font->getDimension(L"A").Height + font->getKerning(L'A').Y;
|
||||
u32 lineHeight = font->getDimension(L"A").Height + font->getKerning(L'A').Y;
|
||||
// only up to 1 line fits?
|
||||
if (lineHeight >= (irr::u32)FrameRect.getHeight()) {
|
||||
if (lineHeight >= (u32)FrameRect.getHeight()) {
|
||||
VScrollPos = 0;
|
||||
setTextRect(cursLine);
|
||||
s32 unscrolledPos = CurrentTextRect.UpperLeftCorner.Y;
|
||||
|
@ -1486,4 +1484,3 @@ bool CGUIEditBox::acceptsIME()
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "irrArray.h"
|
||||
#include "IOSOperator.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
class CGUIEditBox : public IGUIEditBox
|
||||
|
@ -117,10 +115,10 @@ public:
|
|||
|
||||
//! Set the blinktime for the cursor. 2x blinktime is one full cycle.
|
||||
//** \param timeMs Blinktime in milliseconds. When set to 0 the cursor is constantly on without blinking */
|
||||
void setCursorBlinkTime(irr::u32 timeMs) override;
|
||||
void setCursorBlinkTime(u32 timeMs) override;
|
||||
|
||||
//! Get the cursor blinktime
|
||||
irr::u32 getCursorBlinkTime() const override;
|
||||
u32 getCursorBlinkTime() const override;
|
||||
|
||||
//! Sets whether the edit box is a password box. Setting this to true will
|
||||
/** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x
|
||||
|
@ -176,7 +174,7 @@ protected:
|
|||
IOSOperator *Operator;
|
||||
|
||||
u32 BlinkStartTime;
|
||||
irr::u32 CursorBlinkTime;
|
||||
u32 CursorBlinkTime;
|
||||
core::stringw CursorChar; // IGUIFont::draw needs stringw instead of wchar_t
|
||||
s32 CursorPos;
|
||||
s32 HScrollPos, VScrollPos; // scroll position in characters
|
||||
|
@ -193,4 +191,3 @@ protected:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
#endif
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -992,4 +990,3 @@ IGUIEnvironment *createGUIEnvironment(io::IFileSystem *fs,
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
#include "IFileSystem.h"
|
||||
#include "IOSOperator.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -223,4 +220,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include "IFileList.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -152,13 +150,13 @@ const wchar_t *CGUIFileOpenDialog::getDirectoryNameW() const
|
|||
return FileDirectoryFlatW.c_str();
|
||||
}
|
||||
|
||||
void CGUIFileOpenDialog::setFileName(const irr::io::path &name)
|
||||
void CGUIFileOpenDialog::setFileName(const io::path &name)
|
||||
{
|
||||
FileName = name;
|
||||
pathToStringW(FileNameW, FileName);
|
||||
}
|
||||
|
||||
void CGUIFileOpenDialog::setDirectoryName(const irr::io::path &name)
|
||||
void CGUIFileOpenDialog::setDirectoryName(const io::path &name)
|
||||
{
|
||||
FileDirectory = name;
|
||||
FileDirectoryFlat = name;
|
||||
|
@ -307,7 +305,7 @@ void CGUIFileOpenDialog::draw()
|
|||
IGUIElement::draw();
|
||||
}
|
||||
|
||||
void CGUIFileOpenDialog::pathToStringW(irr::core::stringw &result, const irr::io::path &p)
|
||||
void CGUIFileOpenDialog::pathToStringW(core::stringw &result, const io::path &p)
|
||||
{
|
||||
core::multibyteToWString(result, p);
|
||||
}
|
||||
|
@ -365,4 +363,3 @@ void CGUIFileOpenDialog::sendCancelEvent()
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "IGUIEditBox.h"
|
||||
#include "IFileSystem.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -45,11 +43,11 @@ public:
|
|||
void draw() override;
|
||||
|
||||
protected:
|
||||
void setFileName(const irr::io::path &name);
|
||||
void setDirectoryName(const irr::io::path &name);
|
||||
void setFileName(const io::path &name);
|
||||
void setDirectoryName(const io::path &name);
|
||||
|
||||
//! Ensure filenames are converted correct depending on wide-char settings
|
||||
void pathToStringW(irr::core::stringw &result, const irr::io::path &p);
|
||||
void pathToStringW(core::stringw &result, const io::path &p);
|
||||
|
||||
//! fills the listbox with files.
|
||||
void fillListBox();
|
||||
|
@ -81,4 +79,3 @@ protected:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include "IVideoDriver.h"
|
||||
#include "IGUISpriteBank.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -396,4 +394,3 @@ IGUISpriteBank *CGUIFont::getSpriteBank() const
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
#include "irrArray.h"
|
||||
#include <map>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
|
@ -103,4 +100,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "IGUIEnvironment.h"
|
||||
#include "IVideoDriver.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -157,4 +155,3 @@ core::rect<f32> CGUIImage::getDrawBounds() const
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "IGUIImage.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -94,4 +92,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
#include "CGUIImageList.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -77,4 +75,3 @@ void CGUIImageList::draw(s32 index, const core::position2d<s32> &destPos,
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#include "IGUIImageList.h"
|
||||
#include "IVideoDriver.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -62,4 +60,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
#include "CGUIScrollBar.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -738,4 +736,3 @@ IGUIScrollBar *CGUIListBox::getVerticalScrollBar() const
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IGUIListBox.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -170,4 +168,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "IGUIFontBitmap.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -456,4 +454,3 @@ void CGUIScrollBar::refreshControls()
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IGUIScrollBar.h"
|
||||
#include "IGUIButton.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -92,4 +90,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include "IGUIElement.h"
|
||||
#include "IVideoDriver.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -876,4 +874,3 @@ void CGUISkin::getColors(video::SColor* colors)
|
|||
// END PATCH
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include <string>
|
||||
#include "ITexture.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
|
@ -304,5 +302,4 @@ namespace gui
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "IVideoDriver.h"
|
||||
#include "ITexture.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -188,7 +186,7 @@ void CGUISpriteBank::draw2DSpriteBatch(const core::array<u32> &indices,
|
|||
u32 starttime, u32 currenttime,
|
||||
bool loop, bool center)
|
||||
{
|
||||
const irr::u32 drawCount = core::min_<u32>(indices.size(), pos.size());
|
||||
const u32 drawCount = core::min_<u32>(indices.size(), pos.size());
|
||||
|
||||
if (!getTextureCount())
|
||||
return;
|
||||
|
@ -239,4 +237,3 @@ void CGUISpriteBank::draw2DSpriteBatch(const core::array<u32> &indices,
|
|||
}
|
||||
|
||||
} // namespace gui
|
||||
} // namespace irr
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
#include "IGUISpriteBank.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
|
@ -78,4 +75,3 @@ protected:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "IVideoDriver.h"
|
||||
#include "rect.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -222,7 +220,7 @@ video::SColor CGUIStaticText::getOverrideColor() const
|
|||
return OverrideColor;
|
||||
}
|
||||
|
||||
irr::video::SColor CGUIStaticText::getActiveColor() const
|
||||
video::SColor CGUIStaticText::getActiveColor() const
|
||||
{
|
||||
if (OverrideColorEnabled)
|
||||
return OverrideColor;
|
||||
|
@ -506,4 +504,3 @@ s32 CGUIStaticText::getTextWidth() const
|
|||
}
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IGUIStaticText.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
class CGUIStaticText : public IGUIStaticText
|
||||
|
@ -128,4 +126,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "rect.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -922,5 +920,4 @@ void CGUITabControl::updateAbsolutePosition()
|
|||
recalculateScrollBar();
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
} // end namespace gui
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "irrArray.h"
|
||||
#include "IGUISkin.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
class CGUITabControl;
|
||||
|
@ -172,4 +170,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -128,7 +126,7 @@ void CImage::copyTo(IImage *target, const core::position2d<s32> &pos)
|
|||
if (!Blit(BLITTER_TEXTURE, target, 0, &pos, this, 0, 0) && target && pos.X == 0 && pos.Y == 0 &&
|
||||
CColorConverter::canConvertFormat(Format, target->getColorFormat())) {
|
||||
// No fast blitting, but copyToScaling uses other color conversions and might work
|
||||
irr::core::dimension2du dim(target->getDimension());
|
||||
core::dimension2du dim(target->getDimension());
|
||||
copyToScaling(target->getData(), dim.Width, dim.Height, target->getColorFormat(), target->getPitch());
|
||||
}
|
||||
}
|
||||
|
@ -377,4 +375,3 @@ inline SColor CImage::getPixelBox(s32 x, s32 y, s32 fx, s32 fy, s32 bias) const
|
|||
}
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IImage.h"
|
||||
#include "rect.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -71,4 +69,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include "irrString.h"
|
||||
#include <csetjmp>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -259,4 +257,3 @@ IImageLoader *createImageLoaderJPG()
|
|||
}
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include <cstdio> // IWYU pragma: keep (required for jpeglib.h)
|
||||
#include <jpeglib.h> // use system lib
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -83,4 +81,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include "coreutil.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -251,5 +249,4 @@ IImageLoader *createImageLoaderPNG()
|
|||
return new CImageLoaderPng();
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
} // end namespace video
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
#include "IImageLoader.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -31,4 +29,3 @@ public:
|
|||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
|
||||
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -138,13 +136,13 @@ IImage *CImageLoaderTGA::loadImage(io::IReadFile *file) const
|
|||
if (header.ColorMapType) {
|
||||
// Create 32 bit palette
|
||||
// `core::max_()` is not used here because it takes its inputs as references. Since `header` is packed, use the macro `MAX()` instead:
|
||||
const irr::u16 paletteSize = MAX((u16)256u, header.ColorMapLength); // ColorMapLength can lie, but so far we only use palette for 8-bit, so ensure it has 256 entries
|
||||
const u16 paletteSize = MAX((u16)256u, header.ColorMapLength); // ColorMapLength can lie, but so far we only use palette for 8-bit, so ensure it has 256 entries
|
||||
palette = new u32[paletteSize];
|
||||
|
||||
if (paletteSize > header.ColorMapLength) {
|
||||
// To catch images using palette colors with invalid indices
|
||||
const irr::u32 errorCol = irr::video::SColor(255, 255, 0, 205).color; // bright magenta
|
||||
for (irr::u16 i = header.ColorMapLength; i < paletteSize; ++i)
|
||||
const u32 errorCol = video::SColor(255, 255, 0, 205).color; // bright magenta
|
||||
for (u16 i = header.ColorMapLength; i < paletteSize; ++i)
|
||||
palette[i] = errorCol;
|
||||
}
|
||||
|
||||
|
@ -251,4 +249,3 @@ IImageLoader *createImageLoaderTGA()
|
|||
}
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "IImageLoader.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -63,4 +61,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include <jpeglib.h>
|
||||
#include <jerror.h>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -156,10 +154,7 @@ static bool writeJPEGFile(io::IWriteFile *file, IImage *image, u32 quality)
|
|||
}
|
||||
|
||||
} // namespace video
|
||||
} // namespace irr
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -182,4 +177,3 @@ bool CImageWriterJPG::writeImage(io::IWriteFile *file, IImage *image, u32 qualit
|
|||
}
|
||||
|
||||
} // namespace video
|
||||
} // namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "IImageWriter.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -25,4 +23,3 @@ public:
|
|||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include <png.h> // use system lib png
|
||||
#include <memory>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -179,4 +177,3 @@ bool CImageWriterPNG::writeImage(io::IWriteFile *file, IImage *image, u32 param)
|
|||
}
|
||||
|
||||
} // namespace video
|
||||
} // namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "IImageWriter.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -25,4 +23,3 @@ public:
|
|||
};
|
||||
|
||||
} // namespace video
|
||||
} // namespace irr
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#else
|
||||
|
||||
// linux/joystick.h includes linux/input.h, which #defines values for various KEY_FOO keys.
|
||||
// These override the irr::KEY_FOO equivalents, which stops key handling from working.
|
||||
// These override the KEY_FOO equivalents, which stops key handling from working.
|
||||
// As a workaround, defining _INPUT_H stops linux/input.h from being included; it
|
||||
// doesn't actually seem to be necessary except to pull in sys/ioctl.h.
|
||||
#define _INPUT_H
|
||||
|
@ -88,8 +88,6 @@ int XI_EXTENSIONS_OPCODE;
|
|||
#endif
|
||||
}
|
||||
|
||||
namespace irr
|
||||
{
|
||||
//! constructor
|
||||
CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters ¶m) :
|
||||
CIrrDeviceStub(param),
|
||||
|
@ -738,17 +736,17 @@ bool CIrrDeviceLinux::run()
|
|||
break;
|
||||
|
||||
case MotionNotify:
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
||||
irrevent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = EMIE_MOUSE_MOVED;
|
||||
irrevent.MouseInput.X = event.xbutton.x;
|
||||
irrevent.MouseInput.Y = event.xbutton.y;
|
||||
irrevent.MouseInput.Control = (event.xkey.state & ControlMask) != 0;
|
||||
irrevent.MouseInput.Shift = (event.xkey.state & ShiftMask) != 0;
|
||||
|
||||
// mouse button states
|
||||
irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? irr::EMBSM_LEFT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? irr::EMBSM_RIGHT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? irr::EMBSM_MIDDLE : 0;
|
||||
irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? EMBSM_LEFT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? EMBSM_RIGHT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? EMBSM_MIDDLE : 0;
|
||||
|
||||
postEventFromUser(irrevent);
|
||||
break;
|
||||
|
@ -756,7 +754,7 @@ bool CIrrDeviceLinux::run()
|
|||
case ButtonPress:
|
||||
case ButtonRelease:
|
||||
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.X = event.xbutton.x;
|
||||
irrevent.MouseInput.Y = event.xbutton.y;
|
||||
irrevent.MouseInput.Control = (event.xkey.state & ControlMask) != 0;
|
||||
|
@ -766,29 +764,29 @@ bool CIrrDeviceLinux::run()
|
|||
// This sets the state which the buttons had _prior_ to the event.
|
||||
// So unlike on Windows the button which just got changed has still the old state here.
|
||||
// We handle that below by flipping the corresponding bit later.
|
||||
irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? irr::EMBSM_LEFT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? irr::EMBSM_RIGHT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? irr::EMBSM_MIDDLE : 0;
|
||||
irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? EMBSM_LEFT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? EMBSM_RIGHT : 0;
|
||||
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? EMBSM_MIDDLE : 0;
|
||||
|
||||
irrevent.MouseInput.Event = irr::EMIE_COUNT;
|
||||
irrevent.MouseInput.Event = EMIE_COUNT;
|
||||
|
||||
switch (event.xbutton.button) {
|
||||
case Button1:
|
||||
irrevent.MouseInput.Event =
|
||||
(event.type == ButtonPress) ? irr::EMIE_LMOUSE_PRESSED_DOWN : irr::EMIE_LMOUSE_LEFT_UP;
|
||||
irrevent.MouseInput.ButtonStates ^= irr::EMBSM_LEFT;
|
||||
(event.type == ButtonPress) ? EMIE_LMOUSE_PRESSED_DOWN : EMIE_LMOUSE_LEFT_UP;
|
||||
irrevent.MouseInput.ButtonStates ^= EMBSM_LEFT;
|
||||
break;
|
||||
|
||||
case Button3:
|
||||
irrevent.MouseInput.Event =
|
||||
(event.type == ButtonPress) ? irr::EMIE_RMOUSE_PRESSED_DOWN : irr::EMIE_RMOUSE_LEFT_UP;
|
||||
irrevent.MouseInput.ButtonStates ^= irr::EMBSM_RIGHT;
|
||||
(event.type == ButtonPress) ? EMIE_RMOUSE_PRESSED_DOWN : EMIE_RMOUSE_LEFT_UP;
|
||||
irrevent.MouseInput.ButtonStates ^= EMBSM_RIGHT;
|
||||
break;
|
||||
|
||||
case Button2:
|
||||
irrevent.MouseInput.Event =
|
||||
(event.type == ButtonPress) ? irr::EMIE_MMOUSE_PRESSED_DOWN : irr::EMIE_MMOUSE_LEFT_UP;
|
||||
irrevent.MouseInput.ButtonStates ^= irr::EMBSM_MIDDLE;
|
||||
(event.type == ButtonPress) ? EMIE_MMOUSE_PRESSED_DOWN : EMIE_MMOUSE_LEFT_UP;
|
||||
irrevent.MouseInput.ButtonStates ^= EMBSM_MIDDLE;
|
||||
break;
|
||||
|
||||
case Button4:
|
||||
|
@ -806,7 +804,7 @@ bool CIrrDeviceLinux::run()
|
|||
break;
|
||||
}
|
||||
|
||||
if (irrevent.MouseInput.Event != irr::EMIE_COUNT) {
|
||||
if (irrevent.MouseInput.Event != EMIE_COUNT) {
|
||||
postEventFromUser(irrevent);
|
||||
|
||||
if (irrevent.MouseInput.Event >= EMIE_LMOUSE_PRESSED_DOWN && irrevent.MouseInput.Event <= EMIE_MMOUSE_PRESSED_DOWN) {
|
||||
|
@ -842,7 +840,7 @@ bool CIrrDeviceLinux::run()
|
|||
}
|
||||
}
|
||||
|
||||
irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
irrevent.EventType = EET_KEY_INPUT_EVENT;
|
||||
irrevent.KeyInput.PressedDown = false;
|
||||
irrevent.KeyInput.Char = 0; // on release that's undefined
|
||||
irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0;
|
||||
|
@ -864,7 +862,7 @@ bool CIrrDeviceLinux::run()
|
|||
if (strLen > 0 && (status == XLookupChars || status == XLookupBoth)) {
|
||||
if (strLen > 1) {
|
||||
// Multiple characters: send string event
|
||||
irrevent.EventType = irr::EET_STRING_INPUT_EVENT;
|
||||
irrevent.EventType = EET_STRING_INPUT_EVENT;
|
||||
irrevent.StringInput.Str = new core::stringw(buf);
|
||||
postEventFromUser(irrevent);
|
||||
delete irrevent.StringInput.Str;
|
||||
|
@ -899,7 +897,7 @@ bool CIrrDeviceLinux::run()
|
|||
irrevent.KeyInput.Char = tmp.wbuf[0];
|
||||
}
|
||||
|
||||
irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
irrevent.EventType = EET_KEY_INPUT_EVENT;
|
||||
irrevent.KeyInput.PressedDown = true;
|
||||
irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0;
|
||||
irrevent.KeyInput.Shift = (event.xkey.state & ShiftMask) != 0;
|
||||
|
@ -913,7 +911,7 @@ bool CIrrDeviceLinux::run()
|
|||
Close = true;
|
||||
} else {
|
||||
// we assume it's a user message
|
||||
irrevent.EventType = irr::EET_USER_EVENT;
|
||||
irrevent.EventType = EET_USER_EVENT;
|
||||
irrevent.UserEvent.UserData1 = static_cast<size_t>(event.xclient.data.l[0]);
|
||||
irrevent.UserEvent.UserData2 = static_cast<size_t>(event.xclient.data.l[1]);
|
||||
postEventFromUser(irrevent);
|
||||
|
@ -1232,7 +1230,7 @@ void CIrrDeviceLinux::setResizable(bool resize)
|
|||
}
|
||||
|
||||
//! Resize the render window.
|
||||
void CIrrDeviceLinux::setWindowSize(const irr::core::dimension2d<u32> &size)
|
||||
void CIrrDeviceLinux::setWindowSize(const core::dimension2d<u32> &size)
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_X11_
|
||||
if (CreationParams.DriverType == video::EDT_NULL || CreationParams.Fullscreen)
|
||||
|
@ -1563,7 +1561,7 @@ bool CIrrDeviceLinux::activateJoysticks(core::array<SJoystickInfo> &joystickInfo
|
|||
fcntl(info.fd, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
|
||||
info.persistentData.EventType = irr::EET_JOYSTICK_INPUT_EVENT;
|
||||
info.persistentData.EventType = EET_JOYSTICK_INPUT_EVENT;
|
||||
info.persistentData.JoystickEvent.Joystick = ActiveJoysticks.size();
|
||||
|
||||
// There's no obvious way to determine which (if any) axes represent a POV
|
||||
|
@ -1732,7 +1730,7 @@ const c8 *CIrrDeviceLinux::getTextFromSelection(Atom selection, core::stringc &t
|
|||
bytesLeft, 0, AnyPropertyType, &type, &format,
|
||||
&numItems, &dummy, &data);
|
||||
if (result == Success)
|
||||
text_buffer = (irr::c8 *)data;
|
||||
text_buffer = (c8 *)data;
|
||||
XFree(data);
|
||||
}
|
||||
|
||||
|
@ -1909,7 +1907,7 @@ void CIrrDeviceLinux::initXInput2()
|
|||
|
||||
#ifdef _IRR_COMPILE_WITH_X11_
|
||||
|
||||
Cursor CIrrDeviceLinux::TextureToMonochromeCursor(irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
Cursor CIrrDeviceLinux::TextureToMonochromeCursor(video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
{
|
||||
XImage *sourceImage = XCreateImage(XDisplay, VisualInfo->visual,
|
||||
1, // depth,
|
||||
|
@ -1994,7 +1992,7 @@ Cursor CIrrDeviceLinux::TextureToMonochromeCursor(irr::video::ITexture *tex, con
|
|||
}
|
||||
|
||||
#ifdef _IRR_LINUX_XCURSOR_
|
||||
Cursor CIrrDeviceLinux::TextureToARGBCursor(irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
Cursor CIrrDeviceLinux::TextureToARGBCursor(video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
{
|
||||
XcursorImage *image = XcursorImageCreate(sourceRect.getWidth(), sourceRect.getHeight());
|
||||
image->xhot = hotspot.X;
|
||||
|
@ -2030,7 +2028,7 @@ Cursor CIrrDeviceLinux::TextureToARGBCursor(irr::video::ITexture *tex, const cor
|
|||
}
|
||||
#endif // #ifdef _IRR_LINUX_XCURSOR_
|
||||
|
||||
Cursor CIrrDeviceLinux::TextureToCursor(irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
Cursor CIrrDeviceLinux::TextureToCursor(video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
{
|
||||
#ifdef _IRR_LINUX_XCURSOR_
|
||||
return TextureToARGBCursor(tex, sourceRect, hotspot);
|
||||
|
@ -2165,9 +2163,9 @@ gui::ECURSOR_ICON CIrrDeviceLinux::CCursorControl::addIcon(const gui::SCursorSpr
|
|||
CursorX11 cX11;
|
||||
cX11.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime;
|
||||
for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) {
|
||||
irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
irr::core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
Cursor cursor = Device->TextureToCursor(icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot);
|
||||
cX11.Frames.push_back(CursorFrameX11(cursor));
|
||||
}
|
||||
|
@ -2194,9 +2192,9 @@ void CIrrDeviceLinux::CCursorControl::changeIcon(gui::ECURSOR_ICON iconId, const
|
|||
CursorX11 cX11;
|
||||
cX11.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime;
|
||||
for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) {
|
||||
irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
irr::core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
Cursor cursor = Device->TextureToCursor(icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot);
|
||||
cX11.Frames.push_back(CursorFrameX11(cursor));
|
||||
}
|
||||
|
@ -2206,7 +2204,7 @@ void CIrrDeviceLinux::CCursorControl::changeIcon(gui::ECURSOR_ICON iconId, const
|
|||
#endif
|
||||
}
|
||||
|
||||
irr::core::dimension2di CIrrDeviceLinux::CCursorControl::getSupportedIconSize() const
|
||||
core::dimension2di CIrrDeviceLinux::CCursorControl::getSupportedIconSize() const
|
||||
{
|
||||
// this returns the closest match that is smaller or same size, so we just pass a value which should be large enough for cursors
|
||||
unsigned int width = 0, height = 0;
|
||||
|
@ -2216,6 +2214,4 @@ irr::core::dimension2di CIrrDeviceLinux::CCursorControl::getSupportedIconSize()
|
|||
return core::dimension2di(width, height);
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_X11_DEVICE_
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
#define KeySym s32
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
class CIrrDeviceLinux : public CIrrDeviceStub
|
||||
{
|
||||
public:
|
||||
|
@ -79,7 +76,7 @@ public:
|
|||
void setResizable(bool resize = false) override;
|
||||
|
||||
//! Resize the render window.
|
||||
void setWindowSize(const irr::core::dimension2d<u32> &size) override;
|
||||
void setWindowSize(const core::dimension2d<u32> &size) override;
|
||||
|
||||
//! Minimizes the window.
|
||||
void minimizeWindow() override;
|
||||
|
@ -128,10 +125,10 @@ public:
|
|||
|
||||
#ifdef _IRR_COMPILE_WITH_X11_
|
||||
// convert an Irrlicht texture to a X11 cursor
|
||||
Cursor TextureToCursor(irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
Cursor TextureToMonochromeCursor(irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
Cursor TextureToCursor(video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
Cursor TextureToMonochromeCursor(video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
#ifdef _IRR_LINUX_XCURSOR_
|
||||
Cursor TextureToARGBCursor(irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
Cursor TextureToARGBCursor(video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -467,6 +464,4 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_X11_DEVICE_
|
||||
|
|
|
@ -17,21 +17,16 @@
|
|||
|
||||
#include <map>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
class CIrrDeviceMacOSX;
|
||||
}
|
||||
|
||||
@interface CIrrDelegateOSX : NSObject <NSApplicationDelegate, NSWindowDelegate>
|
||||
|
||||
- (id)initWithDevice:(irr::CIrrDeviceMacOSX *)device;
|
||||
- (id)initWithDevice:(CIrrDeviceMacOSX *)device;
|
||||
- (void)terminate:(id)sender;
|
||||
- (BOOL)isQuit;
|
||||
|
||||
@end
|
||||
|
||||
namespace irr
|
||||
{
|
||||
class CIrrDeviceMacOSX : public CIrrDeviceStub
|
||||
{
|
||||
public:
|
||||
|
@ -214,8 +209,8 @@ private:
|
|||
bool createWindow();
|
||||
void initKeycodes();
|
||||
void storeMouseLocation();
|
||||
void postMouseEvent(void *event, irr::SEvent &ievent);
|
||||
void postKeyEvent(void *event, irr::SEvent &ievent, bool pressed);
|
||||
void postMouseEvent(void *event, SEvent &ievent);
|
||||
void postKeyEvent(void *event, SEvent &ievent, bool pressed);
|
||||
void pollJoysticks();
|
||||
|
||||
NSWindow *Window;
|
||||
|
@ -233,6 +228,4 @@ private:
|
|||
bool IsResizable;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_OSX_DEVICE_
|
||||
|
|
|
@ -54,16 +54,16 @@ struct JoystickComponent
|
|||
|
||||
struct JoystickInfo
|
||||
{
|
||||
irr::core::array<JoystickComponent> axisComp;
|
||||
irr::core::array<JoystickComponent> buttonComp;
|
||||
irr::core::array<JoystickComponent> hatComp;
|
||||
core::array<JoystickComponent> axisComp;
|
||||
core::array<JoystickComponent> buttonComp;
|
||||
core::array<JoystickComponent> hatComp;
|
||||
|
||||
int hats;
|
||||
int axes;
|
||||
int buttons;
|
||||
int numActiveJoysticks;
|
||||
|
||||
irr::SEvent persistentData;
|
||||
SEvent persistentData;
|
||||
|
||||
IOHIDDeviceInterface **interface;
|
||||
bool removed;
|
||||
|
@ -80,12 +80,12 @@ struct JoystickInfo
|
|||
buttonComp.clear();
|
||||
hatComp.clear();
|
||||
|
||||
persistentData.EventType = irr::EET_JOYSTICK_INPUT_EVENT;
|
||||
persistentData.EventType = EET_JOYSTICK_INPUT_EVENT;
|
||||
persistentData.JoystickEvent.POV = 65535;
|
||||
persistentData.JoystickEvent.ButtonStates = 0;
|
||||
}
|
||||
};
|
||||
irr::core::array<JoystickInfo> ActiveJoysticks;
|
||||
core::array<JoystickInfo> ActiveJoysticks;
|
||||
|
||||
// helper functions for init joystick
|
||||
static IOReturn closeJoystickDevice(JoystickInfo *joyInfo)
|
||||
|
@ -97,11 +97,11 @@ static IOReturn closeJoystickDevice(JoystickInfo *joyInfo)
|
|||
if (kIOReturnNotOpen == result) {
|
||||
/* do nothing as device was not opened, thus can't be closed */
|
||||
} else if (kIOReturnSuccess != result)
|
||||
irr::os::Printer::log("IOHIDDeviceInterface failed to close", irr::ELL_ERROR);
|
||||
os::Printer::log("IOHIDDeviceInterface failed to close", ELL_ERROR);
|
||||
/* release the interface */
|
||||
result = (*(joyInfo->interface))->Release(joyInfo->interface);
|
||||
if (kIOReturnSuccess != result)
|
||||
irr::os::Printer::log("IOHIDDeviceInterface failed to release", irr::ELL_ERROR);
|
||||
os::Printer::log("IOHIDDeviceInterface failed to release", ELL_ERROR);
|
||||
joyInfo->interface = NULL;
|
||||
}
|
||||
return result;
|
||||
|
@ -202,10 +202,10 @@ static void joystickTopLevelElementHandler(const void *value, void *parameter)
|
|||
return;
|
||||
refCF = CFDictionaryGetValue((CFDictionaryRef)value, CFSTR(kIOHIDElementUsagePageKey));
|
||||
if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &((JoystickInfo *)parameter)->usagePage))
|
||||
irr::os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usagePage", irr::ELL_ERROR);
|
||||
os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usagePage", ELL_ERROR);
|
||||
refCF = CFDictionaryGetValue((CFDictionaryRef)value, CFSTR(kIOHIDElementUsageKey));
|
||||
if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &((JoystickInfo *)parameter)->usage))
|
||||
irr::os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usage", irr::ELL_ERROR);
|
||||
os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usage", ELL_ERROR);
|
||||
}
|
||||
|
||||
static void getJoystickDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef hidProperties, JoystickInfo *joyInfo)
|
||||
|
@ -231,18 +231,18 @@ static void getJoystickDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef
|
|||
refCF = CFDictionaryGetValue(usbProperties, CFSTR("USB Product Name"));
|
||||
if (refCF) {
|
||||
if (!CFStringGetCString((CFStringRef)refCF, joyInfo->joystickName, 256, CFStringGetSystemEncoding()))
|
||||
irr::os::Printer::log("CFStringGetCString error getting joyInfo->joystickName", irr::ELL_ERROR);
|
||||
os::Printer::log("CFStringGetCString error getting joyInfo->joystickName", ELL_ERROR);
|
||||
}
|
||||
|
||||
/* get usage page and usage */
|
||||
refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey));
|
||||
if (refCF) {
|
||||
if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &joyInfo->usagePage))
|
||||
irr::os::Printer::log("CFNumberGetValue error getting joyInfo->usagePage", irr::ELL_ERROR);
|
||||
os::Printer::log("CFNumberGetValue error getting joyInfo->usagePage", ELL_ERROR);
|
||||
refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsageKey));
|
||||
if (refCF)
|
||||
if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &joyInfo->usage))
|
||||
irr::os::Printer::log("CFNumberGetValue error getting joyInfo->usage", irr::ELL_ERROR);
|
||||
os::Printer::log("CFNumberGetValue error getting joyInfo->usage", ELL_ERROR);
|
||||
}
|
||||
|
||||
if (NULL == refCF) /* get top level element HID usage page or usage */
|
||||
|
@ -259,12 +259,12 @@ static void getJoystickDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef
|
|||
|
||||
CFRelease(usbProperties);
|
||||
} else
|
||||
irr::os::Printer::log("IORegistryEntryCreateCFProperties failed to create usbProperties", irr::ELL_ERROR);
|
||||
os::Printer::log("IORegistryEntryCreateCFProperties failed to create usbProperties", ELL_ERROR);
|
||||
|
||||
if (kIOReturnSuccess != IOObjectRelease(parent2))
|
||||
irr::os::Printer::log("IOObjectRelease failed to release parent2", irr::ELL_ERROR);
|
||||
os::Printer::log("IOObjectRelease failed to release parent2", ELL_ERROR);
|
||||
if (kIOReturnSuccess != IOObjectRelease(parent1))
|
||||
irr::os::Printer::log("IOObjectRelease failed to release parent1", irr::ELL_ERROR);
|
||||
os::Printer::log("IOObjectRelease failed to release parent1", ELL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -436,11 +436,11 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void *key)
|
|||
static bool firstLaunch = true;
|
||||
|
||||
@implementation CIrrDelegateOSX {
|
||||
irr::CIrrDeviceMacOSX *Device;
|
||||
CIrrDeviceMacOSX *Device;
|
||||
bool Quit;
|
||||
}
|
||||
|
||||
- (id)initWithDevice:(irr::CIrrDeviceMacOSX *)device
|
||||
- (id)initWithDevice:(CIrrDeviceMacOSX *)device
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
|
@ -513,8 +513,6 @@ static bool firstLaunch = true;
|
|||
|
||||
@end
|
||||
|
||||
namespace irr
|
||||
{
|
||||
//! constructor
|
||||
CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters ¶m) :
|
||||
CIrrDeviceStub(param), Window(NULL), Display(NULL),
|
||||
|
@ -729,7 +727,7 @@ bool CIrrDeviceMacOSX::run()
|
|||
NSAutoreleasePool *Pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSEvent *event;
|
||||
irr::SEvent ievent;
|
||||
SEvent ievent;
|
||||
|
||||
os::Timer::tick();
|
||||
storeMouseLocation();
|
||||
|
@ -748,13 +746,13 @@ bool CIrrDeviceMacOSX::run()
|
|||
break;
|
||||
|
||||
case NSFlagsChanged:
|
||||
ievent.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
ievent.EventType = EET_KEY_INPUT_EVENT;
|
||||
ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
|
||||
ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
|
||||
|
||||
if (IsShiftDown != ievent.KeyInput.Shift) {
|
||||
ievent.KeyInput.Char = irr::KEY_SHIFT;
|
||||
ievent.KeyInput.Key = irr::KEY_SHIFT;
|
||||
ievent.KeyInput.Char = KEY_SHIFT;
|
||||
ievent.KeyInput.Key = KEY_SHIFT;
|
||||
ievent.KeyInput.PressedDown = ievent.KeyInput.Shift;
|
||||
|
||||
IsShiftDown = ievent.KeyInput.Shift;
|
||||
|
@ -763,8 +761,8 @@ bool CIrrDeviceMacOSX::run()
|
|||
}
|
||||
|
||||
if (IsControlDown != ievent.KeyInput.Control) {
|
||||
ievent.KeyInput.Char = irr::KEY_CONTROL;
|
||||
ievent.KeyInput.Key = irr::KEY_CONTROL;
|
||||
ievent.KeyInput.Char = KEY_CONTROL;
|
||||
ievent.KeyInput.Key = KEY_CONTROL;
|
||||
ievent.KeyInput.PressedDown = ievent.KeyInput.Control;
|
||||
|
||||
IsControlDown = ievent.KeyInput.Control;
|
||||
|
@ -776,34 +774,34 @@ bool CIrrDeviceMacOSX::run()
|
|||
break;
|
||||
|
||||
case NSLeftMouseDown:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= irr::EMBSM_LEFT;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = EMIE_LMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= EMBSM_LEFT;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
postMouseEvent(event, ievent);
|
||||
break;
|
||||
|
||||
case NSLeftMouseUp:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
MouseButtonStates &= !irr::EMBSM_LEFT;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
MouseButtonStates &= !EMBSM_LEFT;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
ievent.MouseInput.Event = irr::EMIE_LMOUSE_LEFT_UP;
|
||||
ievent.MouseInput.Event = EMIE_LMOUSE_LEFT_UP;
|
||||
postMouseEvent(event, ievent);
|
||||
break;
|
||||
|
||||
case NSOtherMouseDown:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = irr::EMIE_MMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= irr::EMBSM_MIDDLE;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = EMIE_MMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= EMBSM_MIDDLE;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
postMouseEvent(event, ievent);
|
||||
break;
|
||||
|
||||
case NSOtherMouseUp:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
MouseButtonStates &= !irr::EMBSM_MIDDLE;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
MouseButtonStates &= !EMBSM_MIDDLE;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
ievent.MouseInput.Event = irr::EMIE_MMOUSE_LEFT_UP;
|
||||
ievent.MouseInput.Event = EMIE_MMOUSE_LEFT_UP;
|
||||
postMouseEvent(event, ievent);
|
||||
break;
|
||||
|
||||
|
@ -811,31 +809,31 @@ bool CIrrDeviceMacOSX::run()
|
|||
case NSLeftMouseDragged:
|
||||
case NSRightMouseDragged:
|
||||
case NSOtherMouseDragged:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = EMIE_MOUSE_MOVED;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
postMouseEvent(event, ievent);
|
||||
break;
|
||||
|
||||
case NSRightMouseDown:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = irr::EMIE_RMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= irr::EMBSM_RIGHT;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = EMIE_RMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= EMBSM_RIGHT;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
postMouseEvent(event, ievent);
|
||||
break;
|
||||
|
||||
case NSRightMouseUp:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = irr::EMIE_RMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= !irr::EMBSM_RIGHT;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = EMIE_RMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= !EMBSM_RIGHT;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
postMouseEvent(event, ievent);
|
||||
break;
|
||||
|
||||
case NSScrollWheel:
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = EMIE_MOUSE_WHEEL;
|
||||
ievent.MouseInput.Wheel = [(NSEvent *)event deltaY];
|
||||
if (ievent.MouseInput.Wheel < 1.0f)
|
||||
ievent.MouseInput.Wheel *= 10.0f;
|
||||
|
@ -924,7 +922,7 @@ bool CIrrDeviceMacOSX::isWindowMinimized() const
|
|||
return false;
|
||||
}
|
||||
|
||||
void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool pressed)
|
||||
void CIrrDeviceMacOSX::postKeyEvent(void *event, SEvent &ievent, bool pressed)
|
||||
{
|
||||
NSString *str;
|
||||
std::map<int, int>::const_iterator iter;
|
||||
|
@ -947,7 +945,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool press
|
|||
else {
|
||||
// workaround for period character
|
||||
if (c == 0x2E) {
|
||||
mkey = irr::KEY_PERIOD;
|
||||
mkey = KEY_PERIOD;
|
||||
mchar = '.';
|
||||
} else {
|
||||
cStr = (unsigned char *)[str cStringUsingEncoding:NSWindowsCP1252StringEncoding];
|
||||
|
@ -964,8 +962,8 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool press
|
|||
}
|
||||
}
|
||||
|
||||
ievent.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
ievent.KeyInput.Key = (irr::EKEY_CODE)mkey;
|
||||
ievent.EventType = EET_KEY_INPUT_EVENT;
|
||||
ievent.KeyInput.Key = (EKEY_CODE)mkey;
|
||||
ievent.KeyInput.PressedDown = pressed;
|
||||
ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
|
||||
ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
|
||||
|
@ -980,7 +978,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool press
|
|||
}
|
||||
}
|
||||
|
||||
void CIrrDeviceMacOSX::postMouseEvent(void *event, irr::SEvent &ievent)
|
||||
void CIrrDeviceMacOSX::postMouseEvent(void *event, SEvent &ievent)
|
||||
{
|
||||
bool post = true;
|
||||
|
||||
|
@ -1033,9 +1031,9 @@ void CIrrDeviceMacOSX::storeMouseLocation()
|
|||
|
||||
const core::position2di &curr = ((CCursorControl *)CursorControl)->getPosition(true);
|
||||
if (curr.X != x || curr.Y != y) {
|
||||
irr::SEvent ievent;
|
||||
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
||||
SEvent ievent;
|
||||
ievent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
ievent.MouseInput.Event = EMIE_MOUSE_MOVED;
|
||||
ievent.MouseInput.X = x;
|
||||
ievent.MouseInput.Y = y;
|
||||
ievent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
|
@ -1084,119 +1082,119 @@ void CIrrDeviceMacOSX::setWindow(NSWindow *window)
|
|||
|
||||
void CIrrDeviceMacOSX::initKeycodes()
|
||||
{
|
||||
KeyCodes[kVK_UpArrow] = irr::KEY_UP;
|
||||
KeyCodes[kVK_DownArrow] = irr::KEY_DOWN;
|
||||
KeyCodes[kVK_LeftArrow] = irr::KEY_LEFT;
|
||||
KeyCodes[kVK_RightArrow] = irr::KEY_RIGHT;
|
||||
KeyCodes[kVK_F1] = irr::KEY_F1;
|
||||
KeyCodes[kVK_F2] = irr::KEY_F2;
|
||||
KeyCodes[kVK_F3] = irr::KEY_F3;
|
||||
KeyCodes[kVK_F4] = irr::KEY_F4;
|
||||
KeyCodes[kVK_F5] = irr::KEY_F5;
|
||||
KeyCodes[kVK_F6] = irr::KEY_F6;
|
||||
KeyCodes[kVK_F7] = irr::KEY_F7;
|
||||
KeyCodes[kVK_F8] = irr::KEY_F8;
|
||||
KeyCodes[kVK_F9] = irr::KEY_F9;
|
||||
KeyCodes[kVK_F10] = irr::KEY_F10;
|
||||
KeyCodes[kVK_F11] = irr::KEY_F11;
|
||||
KeyCodes[kVK_F12] = irr::KEY_F12;
|
||||
KeyCodes[kVK_F13] = irr::KEY_F13;
|
||||
KeyCodes[kVK_F14] = irr::KEY_F14;
|
||||
KeyCodes[kVK_F15] = irr::KEY_F15;
|
||||
KeyCodes[kVK_F16] = irr::KEY_F16;
|
||||
KeyCodes[kVK_F17] = irr::KEY_F17;
|
||||
KeyCodes[kVK_F18] = irr::KEY_F18;
|
||||
KeyCodes[kVK_F19] = irr::KEY_F19;
|
||||
KeyCodes[kVK_F20] = irr::KEY_F20;
|
||||
KeyCodes[kVK_Home] = irr::KEY_HOME;
|
||||
KeyCodes[kVK_End] = irr::KEY_END;
|
||||
KeyCodes[NSInsertFunctionKey] = irr::KEY_INSERT;
|
||||
KeyCodes[kVK_ForwardDelete] = irr::KEY_DELETE;
|
||||
KeyCodes[kVK_Help] = irr::KEY_HELP;
|
||||
KeyCodes[NSSelectFunctionKey] = irr::KEY_SELECT;
|
||||
KeyCodes[NSPrintFunctionKey] = irr::KEY_PRINT;
|
||||
KeyCodes[NSExecuteFunctionKey] = irr::KEY_EXECUT;
|
||||
KeyCodes[NSPrintScreenFunctionKey] = irr::KEY_SNAPSHOT;
|
||||
KeyCodes[NSPauseFunctionKey] = irr::KEY_PAUSE;
|
||||
KeyCodes[NSScrollLockFunctionKey] = irr::KEY_SCROLL;
|
||||
KeyCodes[kVK_Delete] = irr::KEY_BACK;
|
||||
KeyCodes[kVK_Tab] = irr::KEY_TAB;
|
||||
KeyCodes[kVK_Return] = irr::KEY_RETURN;
|
||||
KeyCodes[kVK_Escape] = irr::KEY_ESCAPE;
|
||||
KeyCodes[kVK_Control] = irr::KEY_CONTROL;
|
||||
KeyCodes[kVK_RightControl] = irr::KEY_RCONTROL;
|
||||
KeyCodes[kVK_Command] = irr::KEY_MENU;
|
||||
KeyCodes[kVK_Shift] = irr::KEY_SHIFT;
|
||||
KeyCodes[kVK_RightShift] = irr::KEY_RSHIFT;
|
||||
KeyCodes[kVK_Space] = irr::KEY_SPACE;
|
||||
KeyCodes[kVK_UpArrow] = KEY_UP;
|
||||
KeyCodes[kVK_DownArrow] = KEY_DOWN;
|
||||
KeyCodes[kVK_LeftArrow] = KEY_LEFT;
|
||||
KeyCodes[kVK_RightArrow] = KEY_RIGHT;
|
||||
KeyCodes[kVK_F1] = KEY_F1;
|
||||
KeyCodes[kVK_F2] = KEY_F2;
|
||||
KeyCodes[kVK_F3] = KEY_F3;
|
||||
KeyCodes[kVK_F4] = KEY_F4;
|
||||
KeyCodes[kVK_F5] = KEY_F5;
|
||||
KeyCodes[kVK_F6] = KEY_F6;
|
||||
KeyCodes[kVK_F7] = KEY_F7;
|
||||
KeyCodes[kVK_F8] = KEY_F8;
|
||||
KeyCodes[kVK_F9] = KEY_F9;
|
||||
KeyCodes[kVK_F10] = KEY_F10;
|
||||
KeyCodes[kVK_F11] = KEY_F11;
|
||||
KeyCodes[kVK_F12] = KEY_F12;
|
||||
KeyCodes[kVK_F13] = KEY_F13;
|
||||
KeyCodes[kVK_F14] = KEY_F14;
|
||||
KeyCodes[kVK_F15] = KEY_F15;
|
||||
KeyCodes[kVK_F16] = KEY_F16;
|
||||
KeyCodes[kVK_F17] = KEY_F17;
|
||||
KeyCodes[kVK_F18] = KEY_F18;
|
||||
KeyCodes[kVK_F19] = KEY_F19;
|
||||
KeyCodes[kVK_F20] = KEY_F20;
|
||||
KeyCodes[kVK_Home] = KEY_HOME;
|
||||
KeyCodes[kVK_End] = KEY_END;
|
||||
KeyCodes[NSInsertFunctionKey] = KEY_INSERT;
|
||||
KeyCodes[kVK_ForwardDelete] = KEY_DELETE;
|
||||
KeyCodes[kVK_Help] = KEY_HELP;
|
||||
KeyCodes[NSSelectFunctionKey] = KEY_SELECT;
|
||||
KeyCodes[NSPrintFunctionKey] = KEY_PRINT;
|
||||
KeyCodes[NSExecuteFunctionKey] = KEY_EXECUT;
|
||||
KeyCodes[NSPrintScreenFunctionKey] = KEY_SNAPSHOT;
|
||||
KeyCodes[NSPauseFunctionKey] = KEY_PAUSE;
|
||||
KeyCodes[NSScrollLockFunctionKey] = KEY_SCROLL;
|
||||
KeyCodes[kVK_Delete] = KEY_BACK;
|
||||
KeyCodes[kVK_Tab] = KEY_TAB;
|
||||
KeyCodes[kVK_Return] = KEY_RETURN;
|
||||
KeyCodes[kVK_Escape] = KEY_ESCAPE;
|
||||
KeyCodes[kVK_Control] = KEY_CONTROL;
|
||||
KeyCodes[kVK_RightControl] = KEY_RCONTROL;
|
||||
KeyCodes[kVK_Command] = KEY_MENU;
|
||||
KeyCodes[kVK_Shift] = KEY_SHIFT;
|
||||
KeyCodes[kVK_RightShift] = KEY_RSHIFT;
|
||||
KeyCodes[kVK_Space] = KEY_SPACE;
|
||||
|
||||
KeyCodes[kVK_ANSI_A] = irr::KEY_KEY_A;
|
||||
KeyCodes[kVK_ANSI_B] = irr::KEY_KEY_B;
|
||||
KeyCodes[kVK_ANSI_C] = irr::KEY_KEY_C;
|
||||
KeyCodes[kVK_ANSI_D] = irr::KEY_KEY_D;
|
||||
KeyCodes[kVK_ANSI_E] = irr::KEY_KEY_E;
|
||||
KeyCodes[kVK_ANSI_F] = irr::KEY_KEY_F;
|
||||
KeyCodes[kVK_ANSI_G] = irr::KEY_KEY_G;
|
||||
KeyCodes[kVK_ANSI_H] = irr::KEY_KEY_H;
|
||||
KeyCodes[kVK_ANSI_I] = irr::KEY_KEY_I;
|
||||
KeyCodes[kVK_ANSI_J] = irr::KEY_KEY_J;
|
||||
KeyCodes[kVK_ANSI_K] = irr::KEY_KEY_K;
|
||||
KeyCodes[kVK_ANSI_L] = irr::KEY_KEY_L;
|
||||
KeyCodes[kVK_ANSI_M] = irr::KEY_KEY_M;
|
||||
KeyCodes[kVK_ANSI_N] = irr::KEY_KEY_N;
|
||||
KeyCodes[kVK_ANSI_O] = irr::KEY_KEY_O;
|
||||
KeyCodes[kVK_ANSI_P] = irr::KEY_KEY_P;
|
||||
KeyCodes[kVK_ANSI_Q] = irr::KEY_KEY_Q;
|
||||
KeyCodes[kVK_ANSI_R] = irr::KEY_KEY_R;
|
||||
KeyCodes[kVK_ANSI_S] = irr::KEY_KEY_S;
|
||||
KeyCodes[kVK_ANSI_T] = irr::KEY_KEY_T;
|
||||
KeyCodes[kVK_ANSI_U] = irr::KEY_KEY_U;
|
||||
KeyCodes[kVK_ANSI_V] = irr::KEY_KEY_V;
|
||||
KeyCodes[kVK_ANSI_W] = irr::KEY_KEY_W;
|
||||
KeyCodes[kVK_ANSI_X] = irr::KEY_KEY_X;
|
||||
KeyCodes[kVK_ANSI_X] = irr::KEY_KEY_X;
|
||||
KeyCodes[kVK_ANSI_Y] = irr::KEY_KEY_Y;
|
||||
KeyCodes[kVK_ANSI_Z] = irr::KEY_KEY_Z;
|
||||
KeyCodes[kVK_ANSI_A] = KEY_KEY_A;
|
||||
KeyCodes[kVK_ANSI_B] = KEY_KEY_B;
|
||||
KeyCodes[kVK_ANSI_C] = KEY_KEY_C;
|
||||
KeyCodes[kVK_ANSI_D] = KEY_KEY_D;
|
||||
KeyCodes[kVK_ANSI_E] = KEY_KEY_E;
|
||||
KeyCodes[kVK_ANSI_F] = KEY_KEY_F;
|
||||
KeyCodes[kVK_ANSI_G] = KEY_KEY_G;
|
||||
KeyCodes[kVK_ANSI_H] = KEY_KEY_H;
|
||||
KeyCodes[kVK_ANSI_I] = KEY_KEY_I;
|
||||
KeyCodes[kVK_ANSI_J] = KEY_KEY_J;
|
||||
KeyCodes[kVK_ANSI_K] = KEY_KEY_K;
|
||||
KeyCodes[kVK_ANSI_L] = KEY_KEY_L;
|
||||
KeyCodes[kVK_ANSI_M] = KEY_KEY_M;
|
||||
KeyCodes[kVK_ANSI_N] = KEY_KEY_N;
|
||||
KeyCodes[kVK_ANSI_O] = KEY_KEY_O;
|
||||
KeyCodes[kVK_ANSI_P] = KEY_KEY_P;
|
||||
KeyCodes[kVK_ANSI_Q] = KEY_KEY_Q;
|
||||
KeyCodes[kVK_ANSI_R] = KEY_KEY_R;
|
||||
KeyCodes[kVK_ANSI_S] = KEY_KEY_S;
|
||||
KeyCodes[kVK_ANSI_T] = KEY_KEY_T;
|
||||
KeyCodes[kVK_ANSI_U] = KEY_KEY_U;
|
||||
KeyCodes[kVK_ANSI_V] = KEY_KEY_V;
|
||||
KeyCodes[kVK_ANSI_W] = KEY_KEY_W;
|
||||
KeyCodes[kVK_ANSI_X] = KEY_KEY_X;
|
||||
KeyCodes[kVK_ANSI_X] = KEY_KEY_X;
|
||||
KeyCodes[kVK_ANSI_Y] = KEY_KEY_Y;
|
||||
KeyCodes[kVK_ANSI_Z] = KEY_KEY_Z;
|
||||
|
||||
KeyCodes[kVK_ANSI_0] = irr::KEY_KEY_0;
|
||||
KeyCodes[kVK_ANSI_1] = irr::KEY_KEY_1;
|
||||
KeyCodes[kVK_ANSI_2] = irr::KEY_KEY_2;
|
||||
KeyCodes[kVK_ANSI_3] = irr::KEY_KEY_3;
|
||||
KeyCodes[kVK_ANSI_4] = irr::KEY_KEY_4;
|
||||
KeyCodes[kVK_ANSI_5] = irr::KEY_KEY_5;
|
||||
KeyCodes[kVK_ANSI_6] = irr::KEY_KEY_6;
|
||||
KeyCodes[kVK_ANSI_7] = irr::KEY_KEY_7;
|
||||
KeyCodes[kVK_ANSI_8] = irr::KEY_KEY_8;
|
||||
KeyCodes[kVK_ANSI_9] = irr::KEY_KEY_9;
|
||||
KeyCodes[kVK_ANSI_0] = KEY_KEY_0;
|
||||
KeyCodes[kVK_ANSI_1] = KEY_KEY_1;
|
||||
KeyCodes[kVK_ANSI_2] = KEY_KEY_2;
|
||||
KeyCodes[kVK_ANSI_3] = KEY_KEY_3;
|
||||
KeyCodes[kVK_ANSI_4] = KEY_KEY_4;
|
||||
KeyCodes[kVK_ANSI_5] = KEY_KEY_5;
|
||||
KeyCodes[kVK_ANSI_6] = KEY_KEY_6;
|
||||
KeyCodes[kVK_ANSI_7] = KEY_KEY_7;
|
||||
KeyCodes[kVK_ANSI_8] = KEY_KEY_8;
|
||||
KeyCodes[kVK_ANSI_9] = KEY_KEY_9;
|
||||
|
||||
KeyCodes[kVK_ANSI_Slash] = irr::KEY_DIVIDE;
|
||||
KeyCodes[kVK_ANSI_Comma] = irr::KEY_COMMA;
|
||||
KeyCodes[kVK_ANSI_Period] = irr::KEY_PERIOD;
|
||||
KeyCodes[kVK_PageUp] = irr::KEY_PRIOR;
|
||||
KeyCodes[kVK_PageDown] = irr::KEY_NEXT;
|
||||
KeyCodes[kVK_ANSI_Slash] = KEY_DIVIDE;
|
||||
KeyCodes[kVK_ANSI_Comma] = KEY_COMMA;
|
||||
KeyCodes[kVK_ANSI_Period] = KEY_PERIOD;
|
||||
KeyCodes[kVK_PageUp] = KEY_PRIOR;
|
||||
KeyCodes[kVK_PageDown] = KEY_NEXT;
|
||||
|
||||
KeyCodes[kVK_ANSI_Keypad0] = irr::KEY_NUMPAD0;
|
||||
KeyCodes[kVK_ANSI_Keypad1] = irr::KEY_NUMPAD1;
|
||||
KeyCodes[kVK_ANSI_Keypad2] = irr::KEY_NUMPAD2;
|
||||
KeyCodes[kVK_ANSI_Keypad3] = irr::KEY_NUMPAD3;
|
||||
KeyCodes[kVK_ANSI_Keypad4] = irr::KEY_NUMPAD4;
|
||||
KeyCodes[kVK_ANSI_Keypad5] = irr::KEY_NUMPAD5;
|
||||
KeyCodes[kVK_ANSI_Keypad6] = irr::KEY_NUMPAD6;
|
||||
KeyCodes[kVK_ANSI_Keypad7] = irr::KEY_NUMPAD7;
|
||||
KeyCodes[kVK_ANSI_Keypad8] = irr::KEY_NUMPAD8;
|
||||
KeyCodes[kVK_ANSI_Keypad9] = irr::KEY_NUMPAD9;
|
||||
KeyCodes[kVK_ANSI_Keypad0] = KEY_NUMPAD0;
|
||||
KeyCodes[kVK_ANSI_Keypad1] = KEY_NUMPAD1;
|
||||
KeyCodes[kVK_ANSI_Keypad2] = KEY_NUMPAD2;
|
||||
KeyCodes[kVK_ANSI_Keypad3] = KEY_NUMPAD3;
|
||||
KeyCodes[kVK_ANSI_Keypad4] = KEY_NUMPAD4;
|
||||
KeyCodes[kVK_ANSI_Keypad5] = KEY_NUMPAD5;
|
||||
KeyCodes[kVK_ANSI_Keypad6] = KEY_NUMPAD6;
|
||||
KeyCodes[kVK_ANSI_Keypad7] = KEY_NUMPAD7;
|
||||
KeyCodes[kVK_ANSI_Keypad8] = KEY_NUMPAD8;
|
||||
KeyCodes[kVK_ANSI_Keypad9] = KEY_NUMPAD9;
|
||||
|
||||
KeyCodes[kVK_ANSI_KeypadDecimal] = irr::KEY_DECIMAL;
|
||||
KeyCodes[kVK_ANSI_KeypadMultiply] = irr::KEY_MULTIPLY;
|
||||
KeyCodes[kVK_ANSI_KeypadPlus] = irr::KEY_PLUS;
|
||||
KeyCodes[kVK_ANSI_KeypadClear] = irr::KEY_OEM_CLEAR;
|
||||
KeyCodes[kVK_ANSI_KeypadDivide] = irr::KEY_DIVIDE;
|
||||
KeyCodes[kVK_ANSI_KeypadEnter] = irr::KEY_RETURN;
|
||||
KeyCodes[kVK_ANSI_KeypadMinus] = irr::KEY_SUBTRACT;
|
||||
KeyCodes[kVK_ANSI_KeypadDecimal] = KEY_DECIMAL;
|
||||
KeyCodes[kVK_ANSI_KeypadMultiply] = KEY_MULTIPLY;
|
||||
KeyCodes[kVK_ANSI_KeypadPlus] = KEY_PLUS;
|
||||
KeyCodes[kVK_ANSI_KeypadClear] = KEY_OEM_CLEAR;
|
||||
KeyCodes[kVK_ANSI_KeypadDivide] = KEY_DIVIDE;
|
||||
KeyCodes[kVK_ANSI_KeypadEnter] = KEY_RETURN;
|
||||
KeyCodes[kVK_ANSI_KeypadMinus] = KEY_SUBTRACT;
|
||||
|
||||
KeyCodes[kVK_ANSI_LeftBracket] = irr::KEY_OEM_4;
|
||||
KeyCodes[kVK_ANSI_Backslash] = irr::KEY_OEM_5;
|
||||
KeyCodes[kVK_ANSI_RightBracket] = irr::KEY_OEM_6;
|
||||
KeyCodes[kVK_ANSI_LeftBracket] = KEY_OEM_4;
|
||||
KeyCodes[kVK_ANSI_Backslash] = KEY_OEM_5;
|
||||
KeyCodes[kVK_ANSI_RightBracket] = KEY_OEM_6;
|
||||
}
|
||||
|
||||
//! Sets if the window should be resizable in windowed mode.
|
||||
|
@ -1456,6 +1454,4 @@ void CIrrDeviceMacOSX::pollJoysticks()
|
|||
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_OSX_DEVICE_
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
#include "CSDLManager.h"
|
||||
|
||||
// Since SDL doesn't have mouse keys as keycodes we need to fall back to EKEY_CODE in some cases.
|
||||
static inline bool is_fake_key(irr::EKEY_CODE key) {
|
||||
static inline bool is_fake_key(EKEY_CODE key) {
|
||||
switch (key) {
|
||||
case irr::KEY_LBUTTON:
|
||||
case irr::KEY_MBUTTON:
|
||||
case irr::KEY_RBUTTON:
|
||||
case irr::KEY_XBUTTON1:
|
||||
case irr::KEY_XBUTTON2:
|
||||
case KEY_LBUTTON:
|
||||
case KEY_MBUTTON:
|
||||
case KEY_RBUTTON:
|
||||
case KEY_XBUTTON1:
|
||||
case KEY_XBUTTON2:
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
@ -46,8 +46,6 @@ static inline bool is_fake_key(irr::EKEY_CODE key) {
|
|||
|
||||
static int SDLDeviceInstances = 0;
|
||||
|
||||
namespace irr
|
||||
{
|
||||
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
|
||||
EM_BOOL CIrrDeviceSDL::MouseUpDownCallback(int eventType, const EmscriptenMouseEvent *event, void *userData)
|
||||
{
|
||||
|
@ -63,8 +61,8 @@ EM_BOOL CIrrDeviceSDL::MouseEnterCallback(int eventType, const EmscriptenMouseEv
|
|||
|
||||
SEvent irrevent;
|
||||
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_ENTER_CANVAS;
|
||||
irrevent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = EMIE_MOUSE_ENTER_CANVAS;
|
||||
This->MouseX = irrevent.MouseInput.X = mouseEvent->canvasX;
|
||||
This->MouseY = irrevent.MouseInput.Y = mouseEvent->canvasY;
|
||||
This->MouseXRel = mouseEvent->movementX; // should be 0 I guess? Or can it enter while pointer is locked()?
|
||||
|
@ -84,8 +82,8 @@ EM_BOOL CIrrDeviceSDL::MouseLeaveCallback(int eventType, const EmscriptenMouseEv
|
|||
|
||||
SEvent irrevent;
|
||||
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_LEAVE_CANVAS;
|
||||
irrevent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = EMIE_MOUSE_LEAVE_CANVAS;
|
||||
This->MouseX = irrevent.MouseInput.X = mouseEvent->canvasX;
|
||||
This->MouseY = irrevent.MouseInput.Y = mouseEvent->canvasY;
|
||||
This->MouseXRel = mouseEvent->movementX; // should be 0 I guess? Or can it enter while pointer is locked()?
|
||||
|
@ -718,8 +716,8 @@ bool CIrrDeviceSDL::run()
|
|||
case SDL_MOUSEMOTION: {
|
||||
SDL_Keymod keymod = SDL_GetModState();
|
||||
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
||||
irrevent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = EMIE_MOUSE_MOVED;
|
||||
|
||||
MouseXRel = static_cast<s32>(SDL_event.motion.xrel * ScaleX);
|
||||
MouseYRel = static_cast<s32>(SDL_event.motion.yrel * ScaleY);
|
||||
|
@ -743,8 +741,8 @@ bool CIrrDeviceSDL::run()
|
|||
case SDL_MOUSEWHEEL: {
|
||||
SDL_Keymod keymod = SDL_GetModState();
|
||||
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL;
|
||||
irrevent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = EMIE_MOUSE_WHEEL;
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 18)
|
||||
irrevent.MouseInput.Wheel = SDL_event.wheel.preciseY;
|
||||
#else
|
||||
|
@ -767,8 +765,8 @@ bool CIrrDeviceSDL::run()
|
|||
case SDL_MOUSEBUTTONUP: {
|
||||
SDL_Keymod keymod = SDL_GetModState();
|
||||
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; // value to be ignored
|
||||
irrevent.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = EMIE_MOUSE_MOVED; // value to be ignored
|
||||
|
||||
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
|
||||
// Handle mouselocking in emscripten in Windowed mode.
|
||||
|
@ -804,31 +802,31 @@ bool CIrrDeviceSDL::run()
|
|||
switch (button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
if (SDL_event.type == SDL_MOUSEBUTTONDOWN) {
|
||||
irrevent.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= irr::EMBSM_LEFT;
|
||||
irrevent.MouseInput.Event = EMIE_LMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= EMBSM_LEFT;
|
||||
} else {
|
||||
irrevent.MouseInput.Event = irr::EMIE_LMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= ~irr::EMBSM_LEFT;
|
||||
irrevent.MouseInput.Event = EMIE_LMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= ~EMBSM_LEFT;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDL_BUTTON_RIGHT:
|
||||
if (SDL_event.type == SDL_MOUSEBUTTONDOWN) {
|
||||
irrevent.MouseInput.Event = irr::EMIE_RMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= irr::EMBSM_RIGHT;
|
||||
irrevent.MouseInput.Event = EMIE_RMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= EMBSM_RIGHT;
|
||||
} else {
|
||||
irrevent.MouseInput.Event = irr::EMIE_RMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= ~irr::EMBSM_RIGHT;
|
||||
irrevent.MouseInput.Event = EMIE_RMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= ~EMBSM_RIGHT;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDL_BUTTON_MIDDLE:
|
||||
if (SDL_event.type == SDL_MOUSEBUTTONDOWN) {
|
||||
irrevent.MouseInput.Event = irr::EMIE_MMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= irr::EMBSM_MIDDLE;
|
||||
irrevent.MouseInput.Event = EMIE_MMOUSE_PRESSED_DOWN;
|
||||
MouseButtonStates |= EMBSM_MIDDLE;
|
||||
} else {
|
||||
irrevent.MouseInput.Event = irr::EMIE_MMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= ~irr::EMBSM_MIDDLE;
|
||||
irrevent.MouseInput.Event = EMIE_MMOUSE_LEFT_UP;
|
||||
MouseButtonStates &= ~EMBSM_MIDDLE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -836,19 +834,19 @@ bool CIrrDeviceSDL::run()
|
|||
// those as keycodes instead. This is relatively hacky but avoids the effort of
|
||||
// adding more mouse events that will be discarded anyway once we switch to SDL
|
||||
case SDL_BUTTON_X1:
|
||||
irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
irrevent.KeyInput.Key = irr::KEY_XBUTTON1;
|
||||
irrevent.EventType = EET_KEY_INPUT_EVENT;
|
||||
irrevent.KeyInput.Key = KEY_XBUTTON1;
|
||||
break;
|
||||
|
||||
case SDL_BUTTON_X2:
|
||||
irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
irrevent.KeyInput.Key = irr::KEY_XBUTTON2;
|
||||
irrevent.EventType = EET_KEY_INPUT_EVENT;
|
||||
irrevent.KeyInput.Key = KEY_XBUTTON2;
|
||||
break;
|
||||
}
|
||||
|
||||
bool shift = (keymod & KMOD_SHIFT) != 0;
|
||||
bool control = (keymod & KMOD_CTRL) != 0;
|
||||
if (irrevent.EventType == irr::EET_MOUSE_INPUT_EVENT && irrevent.MouseInput.Event != irr::EMIE_MOUSE_MOVED) {
|
||||
if (irrevent.EventType == EET_MOUSE_INPUT_EVENT && irrevent.MouseInput.Event != EMIE_MOUSE_MOVED) {
|
||||
irrevent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
irrevent.MouseInput.X = static_cast<s32>(SDL_event.button.x * ScaleX);
|
||||
irrevent.MouseInput.Y = static_cast<s32>(SDL_event.button.y * ScaleY);
|
||||
|
@ -866,7 +864,7 @@ bool CIrrDeviceSDL::run()
|
|||
postEventFromUser(irrevent);
|
||||
}
|
||||
}
|
||||
} else if (irrevent.EventType == irr::EET_KEY_INPUT_EVENT) {
|
||||
} else if (irrevent.EventType == EET_KEY_INPUT_EVENT) {
|
||||
irrevent.KeyInput.Char = 0;
|
||||
irrevent.KeyInput.PressedDown = SDL_event.type == SDL_MOUSEBUTTONDOWN;
|
||||
irrevent.KeyInput.Shift = shift;
|
||||
|
@ -877,9 +875,9 @@ bool CIrrDeviceSDL::run()
|
|||
}
|
||||
|
||||
case SDL_TEXTINPUT: {
|
||||
irrevent.EventType = irr::EET_STRING_INPUT_EVENT;
|
||||
irrevent.EventType = EET_STRING_INPUT_EVENT;
|
||||
irrevent.StringInput.Str = new core::stringw();
|
||||
irr::core::utf8ToWString(*irrevent.StringInput.Str, SDL_event.text.text);
|
||||
core::utf8ToWString(*irrevent.StringInput.Str, SDL_event.text.text);
|
||||
postEventFromUser(irrevent);
|
||||
delete irrevent.StringInput.Str;
|
||||
irrevent.StringInput.Str = NULL;
|
||||
|
@ -906,7 +904,7 @@ bool CIrrDeviceSDL::run()
|
|||
if (SDL_IsTextInputActive() && !keyIsKnownSpecial(key) && (SDL_event.key.keysym.mod & KMOD_CTRL) == 0)
|
||||
break;
|
||||
|
||||
irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
irrevent.EventType = EET_KEY_INPUT_EVENT;
|
||||
irrevent.KeyInput.Key = key;
|
||||
irrevent.KeyInput.PressedDown = (SDL_event.type == SDL_KEYDOWN);
|
||||
irrevent.KeyInput.Shift = (SDL_event.key.keysym.mod & KMOD_SHIFT) != 0;
|
||||
|
@ -946,7 +944,7 @@ bool CIrrDeviceSDL::run()
|
|||
break;
|
||||
|
||||
case SDL_USEREVENT:
|
||||
irrevent.EventType = irr::EET_USER_EVENT;
|
||||
irrevent.EventType = EET_USER_EVENT;
|
||||
irrevent.UserEvent.UserData1 = reinterpret_cast<uintptr_t>(SDL_event.user.data1);
|
||||
irrevent.UserEvent.UserData2 = reinterpret_cast<uintptr_t>(SDL_event.user.data2);
|
||||
|
||||
|
@ -1529,6 +1527,4 @@ void CIrrDeviceSDL::CCursorControl::initCursors()
|
|||
Cursors.emplace_back(nullptr); // ECI_UP
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
class CIrrDeviceSDL : public CIrrDeviceStub
|
||||
{
|
||||
public:
|
||||
|
@ -339,6 +336,4 @@ private:
|
|||
bool IsInBackground;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include "CLogger.h"
|
||||
#include "irrString.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
#ifndef _IRR_COMPILE_WITH_OPENGL_
|
||||
|
@ -176,7 +174,7 @@ u32 CIrrDeviceStub::checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_E
|
|||
{
|
||||
const s32 MAX_MOUSEMOVE = 3;
|
||||
|
||||
irr::u32 clickTime = getTimer()->getRealTime();
|
||||
u32 clickTime = getTimer()->getRealTime();
|
||||
|
||||
if ((clickTime - MouseMultiClicks.LastClickTime) < MouseMultiClicks.DoubleClickTime && core::abs_(MouseMultiClicks.LastClick.X - mouseX) <= MAX_MOUSEMOVE && core::abs_(MouseMultiClicks.LastClick.Y - mouseY) <= MAX_MOUSEMOVE && MouseMultiClicks.CountSuccessiveClicks < 3 && MouseMultiClicks.LastMouseInputEvent == inputEvent) {
|
||||
++MouseMultiClicks.CountSuccessiveClicks;
|
||||
|
@ -378,5 +376,3 @@ bool CIrrDeviceStub::acceptsIME()
|
|||
gui::IGUIElement *elem = GUIEnvironment->getFocus();
|
||||
return elem && elem->acceptsIME();
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "SIrrCreationParameters.h"
|
||||
#include "IContextManager.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
// lots of prototypes:
|
||||
class ILogger;
|
||||
class CLogger;
|
||||
|
@ -159,7 +157,7 @@ public:
|
|||
float getDisplayDensity() const override;
|
||||
|
||||
//! Resize the render window.
|
||||
void setWindowSize(const irr::core::dimension2d<u32> &size) override {}
|
||||
void setWindowSize(const core::dimension2d<u32> &size) override {}
|
||||
|
||||
protected:
|
||||
void createGUIAndScene();
|
||||
|
@ -202,5 +200,3 @@ protected:
|
|||
SIrrlichtCreationParameters CreationParams;
|
||||
bool Close;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
#include "CWGLManager.h"
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
struct SJoystickWin32Control
|
||||
{
|
||||
CIrrDeviceWin32 *Device;
|
||||
|
@ -74,7 +72,7 @@ struct SJoystickWin32Control
|
|||
|
||||
void pollJoysticks();
|
||||
bool activateJoysticks(core::array<SJoystickInfo> &joystickInfo);
|
||||
irr::core::stringc findJoystickName(int index, const JOYCAPS &caps) const;
|
||||
core::stringc findJoystickName(int index, const JOYCAPS &caps) const;
|
||||
};
|
||||
|
||||
SJoystickWin32Control::SJoystickWin32Control(CIrrDeviceWin32 *dev) :
|
||||
|
@ -196,7 +194,7 @@ void SJoystickWin32Control::pollJoysticks()
|
|||
if (!FAILED(ActiveJoysticks[joystick].lpdijoy->GetDeviceState(sizeof(info), &info))) {
|
||||
SEvent event;
|
||||
|
||||
event.EventType = irr::EET_JOYSTICK_INPUT_EVENT;
|
||||
event.EventType = EET_JOYSTICK_INPUT_EVENT;
|
||||
event.JoystickEvent.Joystick = (u8)joystick;
|
||||
|
||||
event.JoystickEvent.POV = (u16)info.rgdwPOV[0];
|
||||
|
@ -292,7 +290,7 @@ void SJoystickWin32Control::pollJoysticks()
|
|||
if (JOYERR_NOERROR == joyGetPosEx(ActiveJoysticks[joystick].Index, &info)) {
|
||||
SEvent event;
|
||||
|
||||
event.EventType = irr::EET_JOYSTICK_INPUT_EVENT;
|
||||
event.EventType = EET_JOYSTICK_INPUT_EVENT;
|
||||
event.JoystickEvent.Joystick = (u8)joystick;
|
||||
|
||||
event.JoystickEvent.POV = (u16)info.dwPOV;
|
||||
|
@ -342,13 +340,13 @@ void SJoystickWin32Control::pollJoysticks()
|
|||
|
||||
/** This function is ported from SDL and released under zlib-license:
|
||||
* Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> */
|
||||
irr::core::stringc SJoystickWin32Control::findJoystickName(int index, const JOYCAPS &caps) const
|
||||
core::stringc SJoystickWin32Control::findJoystickName(int index, const JOYCAPS &caps) const
|
||||
{
|
||||
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
|
||||
// As a default use the name given in the joystick structure.
|
||||
// It is always the same name, independent of joystick.
|
||||
irr::core::stringc result(caps.szPname);
|
||||
core::stringc result(caps.szPname);
|
||||
|
||||
core::stringc key = core::stringc(REGSTR_PATH_JOYCONFIG) + "\\" + caps.szRegKey + "\\" + REGSTR_KEY_JOYCURR;
|
||||
HKEY hTopKey = HKEY_LOCAL_MACHINE;
|
||||
|
@ -469,25 +467,24 @@ bool SJoystickWin32Control::activateJoysticks(core::array<SJoystickInfo> &joysti
|
|||
return false;
|
||||
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
}
|
||||
} // end namespace irr
|
||||
|
||||
namespace
|
||||
{
|
||||
struct SEnvMapper
|
||||
{
|
||||
HWND hWnd;
|
||||
irr::CIrrDeviceWin32 *irrDev;
|
||||
CIrrDeviceWin32 *irrDev;
|
||||
};
|
||||
// NOTE: This is global. We can have more than one Irrlicht Device at same time.
|
||||
irr::core::array<SEnvMapper> EnvMap;
|
||||
core::array<SEnvMapper> EnvMap;
|
||||
|
||||
HKL KEYBOARD_INPUT_HKL = 0;
|
||||
}
|
||||
|
||||
irr::CIrrDeviceWin32 *getDeviceFromHWnd(HWND hWnd)
|
||||
CIrrDeviceWin32 *getDeviceFromHWnd(HWND hWnd)
|
||||
{
|
||||
const irr::u32 end = EnvMap.size();
|
||||
for (irr::u32 i = 0; i < end; ++i) {
|
||||
const u32 end = EnvMap.size();
|
||||
for (u32 i = 0; i < end; ++i) {
|
||||
const SEnvMapper &env = EnvMap[i];
|
||||
if (env.hWnd == hWnd)
|
||||
return env.irrDev;
|
||||
|
@ -502,29 +499,29 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
#define WHEEL_DELTA 120
|
||||
#endif
|
||||
|
||||
irr::CIrrDeviceWin32 *dev = 0;
|
||||
irr::SEvent event;
|
||||
CIrrDeviceWin32 *dev = 0;
|
||||
SEvent event;
|
||||
|
||||
static irr::s32 ClickCount = 0;
|
||||
static s32 ClickCount = 0;
|
||||
if (GetCapture() != hWnd && ClickCount > 0)
|
||||
ClickCount = 0;
|
||||
|
||||
struct messageMap
|
||||
{
|
||||
irr::s32 group;
|
||||
s32 group;
|
||||
UINT winMessage;
|
||||
irr::s32 irrMessage;
|
||||
s32 irrMessage;
|
||||
};
|
||||
|
||||
static messageMap mouseMap[] = {
|
||||
{0, WM_LBUTTONDOWN, irr::EMIE_LMOUSE_PRESSED_DOWN},
|
||||
{1, WM_LBUTTONUP, irr::EMIE_LMOUSE_LEFT_UP},
|
||||
{0, WM_RBUTTONDOWN, irr::EMIE_RMOUSE_PRESSED_DOWN},
|
||||
{1, WM_RBUTTONUP, irr::EMIE_RMOUSE_LEFT_UP},
|
||||
{0, WM_MBUTTONDOWN, irr::EMIE_MMOUSE_PRESSED_DOWN},
|
||||
{1, WM_MBUTTONUP, irr::EMIE_MMOUSE_LEFT_UP},
|
||||
{2, WM_MOUSEMOVE, irr::EMIE_MOUSE_MOVED},
|
||||
{3, WM_MOUSEWHEEL, irr::EMIE_MOUSE_WHEEL},
|
||||
{0, WM_LBUTTONDOWN, EMIE_LMOUSE_PRESSED_DOWN},
|
||||
{1, WM_LBUTTONUP, EMIE_LMOUSE_LEFT_UP},
|
||||
{0, WM_RBUTTONDOWN, EMIE_RMOUSE_PRESSED_DOWN},
|
||||
{1, WM_RBUTTONUP, EMIE_RMOUSE_LEFT_UP},
|
||||
{0, WM_MBUTTONDOWN, EMIE_MMOUSE_PRESSED_DOWN},
|
||||
{1, WM_MBUTTONUP, EMIE_MMOUSE_LEFT_UP},
|
||||
{2, WM_MOUSEMOVE, EMIE_MOUSE_MOVED},
|
||||
{3, WM_MOUSEWHEEL, EMIE_MOUSE_WHEEL},
|
||||
{-1, 0, 0},
|
||||
};
|
||||
|
||||
|
@ -545,8 +542,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
|
||||
event.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
event.MouseInput.Event = (irr::EMOUSE_INPUT_EVENT)m->irrMessage;
|
||||
event.EventType = EET_MOUSE_INPUT_EVENT;
|
||||
event.MouseInput.Event = (EMOUSE_INPUT_EVENT)m->irrMessage;
|
||||
event.MouseInput.X = (short)LOWORD(lParam);
|
||||
event.MouseInput.Y = (short)HIWORD(lParam);
|
||||
event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0);
|
||||
|
@ -555,11 +552,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
event.MouseInput.ButtonStates = wParam & (MK_LBUTTON | MK_RBUTTON);
|
||||
// middle and extra buttons
|
||||
if (wParam & MK_MBUTTON)
|
||||
event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE;
|
||||
event.MouseInput.ButtonStates |= EMBSM_MIDDLE;
|
||||
if (wParam & MK_XBUTTON1)
|
||||
event.MouseInput.ButtonStates |= irr::EMBSM_EXTRA1;
|
||||
event.MouseInput.ButtonStates |= EMBSM_EXTRA1;
|
||||
if (wParam & MK_XBUTTON2)
|
||||
event.MouseInput.ButtonStates |= irr::EMBSM_EXTRA2;
|
||||
event.MouseInput.ButtonStates |= EMBSM_EXTRA2;
|
||||
event.MouseInput.Wheel = 0.f;
|
||||
|
||||
// wheel
|
||||
|
@ -570,20 +567,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
ClientToScreen(hWnd, &p);
|
||||
event.MouseInput.X -= p.x;
|
||||
event.MouseInput.Y -= p.y;
|
||||
event.MouseInput.Wheel = ((irr::f32)((short)HIWORD(wParam))) / (irr::f32)WHEEL_DELTA;
|
||||
event.MouseInput.Wheel = ((f32)((short)HIWORD(wParam))) / (f32)WHEEL_DELTA;
|
||||
}
|
||||
|
||||
dev = getDeviceFromHWnd(hWnd);
|
||||
if (dev) {
|
||||
dev->postEventFromUser(event);
|
||||
|
||||
if (event.MouseInput.Event >= irr::EMIE_LMOUSE_PRESSED_DOWN && event.MouseInput.Event <= irr::EMIE_MMOUSE_PRESSED_DOWN) {
|
||||
irr::u32 clicks = dev->checkSuccessiveClicks(event.MouseInput.X, event.MouseInput.Y, event.MouseInput.Event);
|
||||
if (event.MouseInput.Event >= EMIE_LMOUSE_PRESSED_DOWN && event.MouseInput.Event <= EMIE_MMOUSE_PRESSED_DOWN) {
|
||||
u32 clicks = dev->checkSuccessiveClicks(event.MouseInput.X, event.MouseInput.Y, event.MouseInput.Event);
|
||||
if (clicks == 2) {
|
||||
event.MouseInput.Event = (irr::EMOUSE_INPUT_EVENT)(irr::EMIE_LMOUSE_DOUBLE_CLICK + event.MouseInput.Event - irr::EMIE_LMOUSE_PRESSED_DOWN);
|
||||
event.MouseInput.Event = (EMOUSE_INPUT_EVENT)(EMIE_LMOUSE_DOUBLE_CLICK + event.MouseInput.Event - EMIE_LMOUSE_PRESSED_DOWN);
|
||||
dev->postEventFromUser(event);
|
||||
} else if (clicks == 3) {
|
||||
event.MouseInput.Event = (irr::EMOUSE_INPUT_EVENT)(irr::EMIE_LMOUSE_TRIPLE_CLICK + event.MouseInput.Event - irr::EMIE_LMOUSE_PRESSED_DOWN);
|
||||
event.MouseInput.Event = (EMOUSE_INPUT_EVENT)(EMIE_LMOUSE_TRIPLE_CLICK + event.MouseInput.Event - EMIE_LMOUSE_PRESSED_DOWN);
|
||||
dev->postEventFromUser(event);
|
||||
}
|
||||
}
|
||||
|
@ -608,23 +605,23 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
case WM_KEYUP: {
|
||||
BYTE allKeys[256];
|
||||
|
||||
event.EventType = irr::EET_KEY_INPUT_EVENT;
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)wParam;
|
||||
event.EventType = EET_KEY_INPUT_EVENT;
|
||||
event.KeyInput.Key = (EKEY_CODE)wParam;
|
||||
event.KeyInput.PressedDown = (message == WM_KEYDOWN || message == WM_SYSKEYDOWN);
|
||||
|
||||
if (event.KeyInput.Key == irr::KEY_SHIFT) {
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX);
|
||||
if (event.KeyInput.Key == KEY_SHIFT) {
|
||||
event.KeyInput.Key = (EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX);
|
||||
}
|
||||
if (event.KeyInput.Key == irr::KEY_CONTROL) {
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX);
|
||||
if (event.KeyInput.Key == KEY_CONTROL) {
|
||||
event.KeyInput.Key = (EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX);
|
||||
// some keyboards will just return LEFT for both - left and right keys. So also check extend bit.
|
||||
if (lParam & 0x1000000)
|
||||
event.KeyInput.Key = irr::KEY_RCONTROL;
|
||||
event.KeyInput.Key = KEY_RCONTROL;
|
||||
}
|
||||
if (event.KeyInput.Key == irr::KEY_MENU) {
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX);
|
||||
if (event.KeyInput.Key == KEY_MENU) {
|
||||
event.KeyInput.Key = (EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX);
|
||||
if (lParam & 0x1000000)
|
||||
event.KeyInput.Key = irr::KEY_RMENU;
|
||||
event.KeyInput.Key = KEY_RMENU;
|
||||
}
|
||||
|
||||
GetKeyboardState(allKeys);
|
||||
|
@ -677,7 +674,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_USER:
|
||||
event.EventType = irr::EET_USER_EVENT;
|
||||
event.EventType = EET_USER_EVENT;
|
||||
event.UserEvent.UserData1 = static_cast<size_t>(wParam);
|
||||
event.UserEvent.UserData2 = static_cast<size_t>(lParam);
|
||||
dev = getDeviceFromHWnd(hWnd);
|
||||
|
@ -704,9 +701,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
return DefWindowProcW(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
//! constructor
|
||||
CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters ¶ms) :
|
||||
CIrrDeviceStub(params), HWnd(0), Resized(false),
|
||||
|
@ -958,7 +952,7 @@ void CIrrDeviceWin32::resizeIfNecessary()
|
|||
snprintf_irr(tmp, sizeof(tmp), "Resizing window (%ld %ld)", r.right, r.bottom);
|
||||
os::Printer::log(tmp);
|
||||
|
||||
getVideoDriver()->OnResize(irr::core::dimension2du((u32)r.right, (u32)r.bottom));
|
||||
getVideoDriver()->OnResize(core::dimension2du((u32)r.right, (u32)r.bottom));
|
||||
getWin32CursorControl()->OnResize(getVideoDriver()->getScreenSize());
|
||||
}
|
||||
|
||||
|
@ -1101,7 +1095,7 @@ void CIrrDeviceWin32::OnResized()
|
|||
}
|
||||
|
||||
//! Resize the render window.
|
||||
void CIrrDeviceWin32::setWindowSize(const irr::core::dimension2d<u32> &size)
|
||||
void CIrrDeviceWin32::setWindowSize(const core::dimension2d<u32> &size)
|
||||
{
|
||||
if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen)
|
||||
return;
|
||||
|
@ -1253,7 +1247,7 @@ float CIrrDeviceWin32::getDisplayDensity() const
|
|||
|
||||
// Convert an Irrlicht texture to a Windows cursor
|
||||
// Based on http://www.codeguru.com/cpp/w-p/win32/cursors/article.php/c4529/
|
||||
HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot)
|
||||
{
|
||||
//
|
||||
// create the bitmaps needed for cursors from the texture
|
||||
|
@ -1389,9 +1383,9 @@ gui::ECURSOR_ICON CIrrDeviceWin32::CCursorControl::addIcon(const gui::SCursorSpr
|
|||
cW32.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime;
|
||||
|
||||
for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) {
|
||||
irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
irr::core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
|
||||
HCURSOR hc = Device->TextureToCursor(HWnd, icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot);
|
||||
cW32.Frames.push_back(CursorFrameW32(hc));
|
||||
|
@ -1416,9 +1410,9 @@ void CIrrDeviceWin32::CCursorControl::changeIcon(gui::ECURSOR_ICON iconId, const
|
|||
CursorW32 cW32;
|
||||
cW32.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime;
|
||||
for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) {
|
||||
irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
irr::core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
|
||||
u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
|
||||
core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
|
||||
|
||||
HCURSOR hc = Device->TextureToCursor(HWnd, icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot);
|
||||
cW32.Frames.push_back(CursorFrameW32(hc));
|
||||
|
@ -1439,6 +1433,4 @@ core::dimension2di CIrrDeviceWin32::CCursorControl::getSupportedIconSize() const
|
|||
return result;
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
struct SJoystickWin32Control;
|
||||
|
||||
class CIrrDeviceWin32 : public CIrrDeviceStub
|
||||
|
@ -72,7 +70,7 @@ public:
|
|||
void setResizable(bool resize = false) override;
|
||||
|
||||
//! Resize the render window.
|
||||
void setWindowSize(const irr::core::dimension2d<u32> &size) override;
|
||||
void setWindowSize(const core::dimension2d<u32> &size) override;
|
||||
|
||||
//! Minimizes the window.
|
||||
void minimizeWindow() override;
|
||||
|
@ -113,7 +111,7 @@ public:
|
|||
bool switchToFullScreen();
|
||||
|
||||
// convert an Irrlicht texture to a windows cursor
|
||||
HCURSOR TextureToCursor(HWND hwnd, irr::video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
HCURSOR TextureToCursor(HWND hwnd, video::ITexture *tex, const core::rect<s32> &sourceRect, const core::position2d<s32> &hotspot);
|
||||
|
||||
//! Implementation of the win32 cursor control
|
||||
class CCursorControl : public gui::ICursorControl
|
||||
|
@ -400,6 +398,4 @@ private:
|
|||
bool WindowMaximized;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#include "irrMath.h"
|
||||
#include "irrString.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
|
||||
|
@ -108,4 +106,3 @@ IReadFile *createLimitReadFile(const io::path &fileName, IReadFile *alreadyOpene
|
|||
}
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IReadFile.h"
|
||||
#include "irrString.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
class CUnicodeConverter;
|
||||
|
||||
namespace io
|
||||
|
@ -59,4 +57,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
|
|
@ -4,9 +4,6 @@
|
|||
|
||||
#include "CLogger.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
CLogger::CLogger(IEventReceiver *r) :
|
||||
LogLevel(ELL_INFORMATION), Receiver(r)
|
||||
{}
|
||||
|
@ -58,5 +55,3 @@ void CLogger::setReceiver(IEventReceiver *r)
|
|||
{
|
||||
Receiver = r;
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
#include "irrString.h"
|
||||
#include "IEventReceiver.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
//! Class for logging messages, warnings and errors to stdout
|
||||
class CLogger : public ILogger
|
||||
{
|
||||
|
@ -37,5 +34,3 @@ private:
|
|||
ELOG_LEVEL LogLevel;
|
||||
IEventReceiver *Receiver;
|
||||
};
|
||||
|
||||
} // end namespace
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
#include "CMemoryFile.h"
|
||||
#include "irrString.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
|
||||
|
@ -154,4 +152,3 @@ IWriteFile *createMemoryWriteFile(void *memory, long size, const io::path &fileN
|
|||
}
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
#include "IWriteFile.h"
|
||||
#include "irrString.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace io
|
||||
{
|
||||
|
||||
|
@ -96,4 +93,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#include "IAnimatedMesh.h"
|
||||
#include "IMesh.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -153,4 +151,3 @@ void CMeshCache::clearUnusedMeshes()
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
#include "IMeshCache.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace scene
|
||||
{
|
||||
class CMeshCache : public IMeshCache
|
||||
|
@ -113,4 +110,3 @@ protected:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -178,4 +176,3 @@ SMesh *CMeshManipulator::createMeshCopy(scene::IMesh *mesh) const
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "IMeshManipulator.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -34,4 +32,3 @@ public:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "IMaterialRenderer.h"
|
||||
#include "IFileSystem.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -254,4 +252,3 @@ ISceneNode *CMeshSceneNode::clone(ISceneNode *newParent, ISceneManager *newManag
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "IMeshSceneNode.h"
|
||||
#include "IMesh.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -84,4 +82,3 @@ protected:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
#import <AppKit/NSOpenGL.h>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
// NSOpenGL manager.
|
||||
|
@ -65,6 +63,5 @@ private:
|
|||
NSOpenGLPixelFormat *PixelFormat;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include <mach-o/dyld.h>
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -224,7 +222,6 @@ bool CNSOGLManager::swapBuffers()
|
|||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -354,7 +352,7 @@ ITexture *CNullDriver::addTextureCubemap(const io::path &name, IImage *imagePosX
|
|||
return t;
|
||||
}
|
||||
|
||||
ITexture *CNullDriver::addTextureCubemap(const irr::u32 sideLen, const io::path &name, ECOLOR_FORMAT format)
|
||||
ITexture *CNullDriver::addTextureCubemap(const u32 sideLen, const io::path &name, ECOLOR_FORMAT format)
|
||||
{
|
||||
if (0 == sideLen)
|
||||
return 0;
|
||||
|
@ -628,7 +626,7 @@ void CNullDriver::draw2DImageBatch(const video::ITexture *texture,
|
|||
SColor color,
|
||||
bool useAlphaChannelOfTexture)
|
||||
{
|
||||
const irr::u32 drawCount = core::min_<u32>(positions.size(), sourceRects.size());
|
||||
const u32 drawCount = core::min_<u32>(positions.size(), sourceRects.size());
|
||||
|
||||
for (u32 i = 0; i < drawCount; ++i) {
|
||||
draw2DImage(texture, positions[i], sourceRects[i],
|
||||
|
@ -1659,7 +1657,7 @@ ITexture *CNullDriver::addRenderTargetTextureMs(const core::dimension2d<u32> &si
|
|||
return 0;
|
||||
}
|
||||
|
||||
ITexture *CNullDriver::addRenderTargetTextureCubemap(const irr::u32 sideLen,
|
||||
ITexture *CNullDriver::addRenderTargetTextureCubemap(const u32 sideLen,
|
||||
const io::path &name, const ECOLOR_FORMAT format)
|
||||
{
|
||||
return 0;
|
||||
|
@ -1731,7 +1729,7 @@ core::dimension2du CNullDriver::getMaxTextureSize() const
|
|||
return core::dimension2du(0x10000, 0x10000); // maybe large enough
|
||||
}
|
||||
|
||||
bool CNullDriver::needsTransparentRenderPass(const irr::video::SMaterial &material) const
|
||||
bool CNullDriver::needsTransparentRenderPass(const video::SMaterial &material) const
|
||||
{
|
||||
// TODO: I suspect it would be nice if the material had an enum for further control.
|
||||
// Especially it probably makes sense to allow disabling transparent render pass as soon as material.ZWriteEnable is on.
|
||||
|
@ -1750,4 +1748,3 @@ bool CNullDriver::needsTransparentRenderPass(const irr::video::SMaterial &materi
|
|||
}
|
||||
|
||||
} // end namespace
|
||||
} // end namespace
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
#include "SVertexIndex.h"
|
||||
#include "SExposedVideoData.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
class IWriteFile;
|
||||
|
@ -85,7 +83,7 @@ public:
|
|||
virtual ITexture *addTextureCubemap(const io::path &name, IImage *imagePosX, IImage *imageNegX, IImage *imagePosY,
|
||||
IImage *imageNegY, IImage *imagePosZ, IImage *imageNegZ) override;
|
||||
|
||||
ITexture *addTextureCubemap(const irr::u32 sideLen, const io::path &name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override;
|
||||
ITexture *addTextureCubemap(const u32 sideLen, const io::path &name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override;
|
||||
|
||||
virtual bool setRenderTargetEx(IRenderTarget *target, u16 clearFlag, SColor clearColor = SColor(255, 0, 0, 0),
|
||||
f32 clearDepth = 1.f, u8 clearStencil = 0) override;
|
||||
|
@ -221,7 +219,7 @@ public:
|
|||
const io::path &name, const ECOLOR_FORMAT format = ECF_UNKNOWN) override;
|
||||
|
||||
//! Creates a render target texture for a cubemap
|
||||
ITexture *addRenderTargetTextureCubemap(const irr::u32 sideLen,
|
||||
ITexture *addRenderTargetTextureCubemap(const u32 sideLen,
|
||||
const io::path &name, const ECOLOR_FORMAT format) override;
|
||||
|
||||
//! Creates an 1bit alpha channel of the texture based of an color key.
|
||||
|
@ -535,7 +533,7 @@ public:
|
|||
core::dimension2du getMaxTextureSize() const override;
|
||||
|
||||
//! Used by some SceneNodes to check if a material should be rendered in the transparent render pass
|
||||
bool needsTransparentRenderPass(const irr::video::SMaterial &material) const override;
|
||||
bool needsTransparentRenderPass(const video::SMaterial &material) const override;
|
||||
|
||||
protected:
|
||||
//! deletes all textures
|
||||
|
@ -727,4 +725,3 @@ protected:
|
|||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "coreutil.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -72,11 +70,11 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
|
|||
const c8 *bufPtr = buf;
|
||||
core::stringc grpName, mtlName;
|
||||
bool mtlChanged = false;
|
||||
[[maybe_unused]] irr::u32 lineNr = 1; // only counts non-empty lines, still useful in debugging to locate errors
|
||||
[[maybe_unused]] u32 lineNr = 1; // only counts non-empty lines, still useful in debugging to locate errors
|
||||
core::array<int> faceCorners;
|
||||
faceCorners.reallocate(32); // should be large enough
|
||||
const core::stringc TAG_OFF = "off";
|
||||
irr::u32 degeneratedFaces = 0;
|
||||
u32 degeneratedFaces = 0;
|
||||
|
||||
while (bufPtr != bufEnd) {
|
||||
switch (bufPtr[0]) {
|
||||
|
@ -184,7 +182,7 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
|
|||
u32 wlength = copyWord(vertexWord, linePtr, WORD_BUFFER_LENGTH, endPtr);
|
||||
// this function will also convert obj's 1-based index to c++'s 0-based index
|
||||
retrieveVertexIndices(vertexWord, Idx, vertexWord + wlength + 1, vertexBuffer.size(), textureCoordBuffer.size(), normalsBuffer.size());
|
||||
if (Idx[0] >= 0 && Idx[0] < (irr::s32)vertexBuffer.size())
|
||||
if (Idx[0] >= 0 && Idx[0] < (s32)vertexBuffer.size())
|
||||
v.Pos = vertexBuffer[Idx[0]];
|
||||
else {
|
||||
os::Printer::log("Invalid vertex index in this line", wordBuffer.c_str(), ELL_ERROR);
|
||||
|
@ -192,11 +190,11 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
|
|||
cleanUp();
|
||||
return 0;
|
||||
}
|
||||
if (Idx[1] >= 0 && Idx[1] < (irr::s32)textureCoordBuffer.size())
|
||||
if (Idx[1] >= 0 && Idx[1] < (s32)textureCoordBuffer.size())
|
||||
v.TCoords = textureCoordBuffer[Idx[1]];
|
||||
else
|
||||
v.TCoords.set(0.0f, 0.0f);
|
||||
if (Idx[2] >= 0 && Idx[2] < (irr::s32)normalsBuffer.size())
|
||||
if (Idx[2] >= 0 && Idx[2] < (s32)normalsBuffer.size())
|
||||
v.Normal = normalsBuffer[Idx[2]];
|
||||
else {
|
||||
v.Normal.set(0.0f, 0.0f, 0.0f);
|
||||
|
@ -253,9 +251,9 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file)
|
|||
} // end while(bufPtr && (bufPtr-buf<filesize))
|
||||
|
||||
if (degeneratedFaces > 0) {
|
||||
irr::core::stringc log(degeneratedFaces);
|
||||
core::stringc log(degeneratedFaces);
|
||||
log += " degenerated faces removed in ";
|
||||
log += irr::core::stringc(fullName);
|
||||
log += core::stringc(fullName);
|
||||
os::Printer::log(log.c_str(), ELL_INFORMATION);
|
||||
}
|
||||
|
||||
|
@ -523,4 +521,3 @@ void COBJMeshFileLoader::cleanUp()
|
|||
}
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "irrString.h"
|
||||
#include "CMeshBuffer.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
|
@ -102,4 +100,3 @@ private:
|
|||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "irrMath.h"
|
||||
#include "COpenGLCoreFeature.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
@ -98,4 +96,3 @@ protected:
|
|||
bool FeatureAvailable[IRR_OGLES_Feature_Count];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue