ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 24 00 00 00 24 08 06 00 00 00 e1 00 98 | .PNG........IHDR...$...$........ |
0020 | 98 00 00 00 01 73 52 47 42 00 ae ce 1c e9 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 93 | .....sRGB.........bKGD.......... |
0040 | 00 00 00 09 70 48 59 73 00 00 0d d7 00 00 0d d7 01 42 28 9b 78 00 00 00 07 74 49 4d 45 07 de 01 | ....pHYs.........B(.x....tIME... |
0060 | 04 17 01 02 b8 9e 8c 80 00 00 08 56 49 44 41 54 58 c3 ed 58 6b 50 94 d7 19 7e ce 77 db 6f af 2c | ...........VIDATX..XkP...~.w.o., |
0080 | 2c 97 e5 ba cb 65 41 bc 80 88 17 30 12 51 f1 56 1d 13 1d 33 a6 26 c1 0b 36 53 6d 9d 6a 32 4d db | ,....eA....0.Q.V...3.&..6Sm.j2M. |
00a0 | 69 3b 49 d3 a6 99 a4 4d 73 19 db 44 3b 76 62 ab a6 8e 12 35 9d 06 63 c6 36 14 15 51 51 41 50 50 | i;I....Ms..D;vb....5..c.6..QQAPP |
00c0 | 50 5c 58 81 75 dd 95 bd b1 bb df ad 3f ec 88 44 10 8c da e9 8f be 3f cf 79 bf ef 3c e7 3d cf fb | P\X.u.......?..D......?.y..<.=.. |
00e0 | 3e e7 3d c0 ff ed 11 58 e9 6a f0 93 d6 30 b3 01 90 c7 bd d6 88 0b 4c ac a0 57 b2 0c f5 2b 95 51 | >.=....X.j...0........L..W...+.Q |
0100 | d1 85 3c c4 21 87 b1 ee cc 0e a1 fe bf 0e 68 f2 6a a6 94 f0 e4 23 9d 19 66 5d 22 89 22 04 90 44 | ..<.!.........h.j....#..f]"."..D |
7.....I..Z.w-..;{.B..?.>.\H-P.H. |
01e0 | c3 8f 9c e1 fd 1e c2 4d a9 d0 11 6d dc e0 93 d7 9a 28 2a 69 22 ab 93 25 a5 a8 27 c8 ac ca 4c e7 | .......M...m.....(*i"..%..'...L. |
0200 | 5a 3a 9a 85 2b df 88 43 0f 62 ac 9a 80 66 86 07 4e 2b 44 c7 85 89 2d 29 cc bf 00 00 53 d6 32 65 | Z:..+..C.b...f..N+D...-)....S.2e |
0220 | 85 eb e8 f6 c9 15 ec e6 51 03 52 00 59 8a 10 65 44 34 c3 78 28 0a d0 73 46 42 c3 d6 30 f2 3b ad | ........Q.R.Y..eD4.x(..sFB..0.;. |
0240 | a4 0c 16 12 cd 89 df 7e 6e 21 b7 5c a6 94 bd e6 7c 2a 83 30 ca cf 46 cd 21 a5 5f fc 8d d7 ce d8 | .......~n!.\....|*.0..F.!._..... |
RenderingCorePlain::RenderingCorePlain(
IrrlichtDevice *_device, Client *_client, Hud *_hud)
: RenderingCore(_device, _client, _hud)
{
scale = g_settings->getU16("undersampling");
}
void RenderingCorePlain::initTextures()
{
if (scale <= 1)
return;
v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)};
lowres = driver->addRenderTargetTexture(
size, "render_lowres", video::ECF_A8R8G8B8);
}
void RenderingCorePlain::clearTextures()
{
if (scale <= 1)
return;
driver->removeTexture(lowres);
}
void RenderingCorePlain::beforeDraw()
{
if (scale <= 1)
return;
driver->setRenderTarget(lowres, true, true, skycolor);
}
void RenderingCorePlain::upscale()
{
if (scale <= 1)
return;
driver->setRenderTarget(0, true, true);
v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)};
v2u32 dest_size{scale * size.X, scale * size.Y};
driver->draw2DImage(lowres, core::rect<s32>(0, 0, dest_size.X, dest_size.Y),
core::rect<s32>(0, 0, size.X, size.Y));
}
void RenderingCorePlain::drawAll()
{
draw3D();
drawPostFx();
upscale();
drawHUD();
}