-
Notifications
You must be signed in to change notification settings - Fork 87
[NOSQUASH] Move stuff from renderingengine #181
Conversation
cb2723a
to
af9c734
Compare
Why not? |
I'm not entirely sure. It's also worth noting that
( I'm also not sure what Should we maybe just assume a logical density of 96 screen coordinates per inch, and return the logical ppi density? |
3588273
to
f01f00c
Compare
Thanks for the explanations! To get the same results as we get on non-SDL backends, I've decided to take window size / drawable size, as this is the same as in the X11 backend, according to:
Minetest also has its (Also rebased.) This is ready for review now. Someone should test with a windows device. |
f01f00c
to
7ba8b1f
Compare
Tested. Window iconX11: still works on DeviceLinux, and with minetest/minetest#13348 it now also works on DeviceSDL. Display densityX11: no changes; that’s expected. |
This should be done in another PR. I wouldn't even be able to test it. Thanks for testing! |
source/Irrlicht/CIrrDeviceLinux.cpp
Outdated
@@ -1178,6 +1248,59 @@ void CIrrDeviceLinux::setWindowCaption(const wchar_t* text) | |||
} | |||
|
|||
|
|||
//! Sets the window icon. | |||
bool CIrrDeviceLinux::setWindowIcon(const std::string &path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should take an IImage
IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Note though that win32 will now also require the (unused by win32) icon image file to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of now that doesn't work, the file is not installed on Windows.
(assuming you didn't change that in the relevant PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Windows installations would also need the file for the SDL driver.)
assuming you didn't change that in the relevant PR
I didn't. Idk how to fix this, and I couldn't test.
fbd151f
to
af8ed66
Compare
btw here is my untested version of bool CImage::copyToNoScaling(void *target, ECOLOR_FORMAT format, u32 pitch) const
{
if (IImage::isCompressedFormat(Format))
{
os::Printer::log("IImage::copyToNoScaling method doesn't work with compressed images.", ELL_WARNING);
return false;
}
if (!target || !Size.Width || !Size.Height)
return false;
const u32 bpp=getBitsPerPixelFromFormat(format)/8;
if (0==pitch)
pitch = Size.Width*bpp;
if (Format == format && pitch == Pitch) {
memcpy(target, Data, (size_t)Size.Height*pitch);
return true;
}
if (!CColorConverter::canConvertFormat(Format, format))
return false;
u8* tgtpos = (u8*) target;
const u8* srcpos = Data;
for (u32 y = 0; y < Size.Height; ++y) {
CColorConverter::convert_viaFormat(srcpos, Format, Size.Width, tgtpos, format);
tgtpos += pitch;
srcpos += Pitch;
}
return true;
} |
af8ed66
to
e2bd994
Compare
Fixed the comment. |
classhint->res_name = const_cast<char *>("Minetest"); | ||
classhint->res_class = const_cast<char *>("Minetest"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically speaking, those names do not belong to the framework. However, IrrlichtMt is basically modified to fit to Minetest's needs.
Thing is - I would like to use IrrlichtMt over stock Irrlicht for an unrelated project to benefit from the well-maintained code. However, if keeping it generalized is too much effort, I would understand that decision as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have strong doubts about the usefulness of using irrlichtmt for another application, as there will always be annoying breaking changes for you.
But if you do still want to do this, you can also just choose the SDL driver, it takes these names from the executable's filename.
=> It's not worth doing imo, sorry.
Tested on Linux/X11 (the classic) with the Minetest PR and could not find any issues. Also based on the buildbot results and numberZero's testing I will give an approval after clarifying the comment above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Moves the platform dependent stuff from renderingengine.cpp. Also implements the stuff for SDL (2nd commit).
This fixes the remaining point in #137.
I don't know how to implementgetDisplayDensity
properly.SDL_GetDisplayDPI
doesn't seem to be what we need. Please help.FYI, this doesn't break anything if merged without minetest/minetest#13348. (The X11 setup stuff is done twice, but that doesn't seem to hurt.)
(The X11 class name and the windows icon thing are hardcoded to minetest's values. I don't think passing the values to irrlicht is worth doing, as we're planning to drop non-SDL backends anyway.)
It would be nice if someone could test this with Windows.