1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Chat console, including a number of rebases and modifications.

Defaults modified from original: alpha=200, key=F10
This commit is contained in:
Kahrl 2011-12-03 09:01:14 +01:00 committed by Perttu Ahola
parent 0053651814
commit 967f25461b
17 changed files with 1941 additions and 146 deletions

View file

@ -403,6 +403,7 @@ Doing currently:
#include "game.h"
#include "keycode.h"
#include "tile.h"
#include "chat.h"
#include "defaultsettings.h"
#include "gettext.h"
#include "settings.h"
@ -940,20 +941,20 @@ void drawMenuBackground(video::IVideoDriver* driver)
driver->getTexture(getTexturePath("menubg.png").c_str());
if(bgtexture)
{
s32 texturesize = 128;
s32 tiled_y = screensize.Height / texturesize + 1;
s32 tiled_x = screensize.Width / texturesize + 1;
s32 scaledsize = 128;
for(s32 y=0; y<tiled_y; y++)
for(s32 x=0; x<tiled_x; x++)
{
core::rect<s32> rect(0,0,texturesize,texturesize);
rect += v2s32(x*texturesize, y*texturesize);
driver->draw2DImage(bgtexture, rect,
core::rect<s32>(core::position2d<s32>(0,0),
core::dimension2di(bgtexture->getSize())),
NULL, NULL, true);
}
// The important difference between destsize and screensize is
// that destsize is rounded to whole scaled pixels.
// These formulas use component-wise multiplication and division of v2u32.
v2u32 texturesize = bgtexture->getSize();
v2u32 sourcesize = texturesize * screensize / scaledsize + v2u32(1,1);
v2u32 destsize = scaledsize * sourcesize / texturesize;
// Default texture wrapping mode in Irrlicht is ETC_REPEAT.
driver->draw2DImage(bgtexture,
core::rect<s32>(0, 0, destsize.X, destsize.Y),
core::rect<s32>(0, 0, sourcesize.X, sourcesize.Y),
NULL, NULL, true);
}
video::ITexture *logotexture =
@ -1479,6 +1480,8 @@ int main(int argc, char *argv[])
GUI stuff
*/
ChatBackend chat_backend;
/*
If an error occurs, this is set to something and the
menu-game loop is restarted. It is then displayed before
@ -1663,7 +1666,8 @@ int main(int argc, char *argv[])
address,
port,
error_message,
configpath
configpath,
chat_backend
);
} //try