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

ShaderSource and silly example shaders

This commit is contained in:
Kahrl 2012-03-19 02:59:12 +01:00 committed by Perttu Ahola
parent e3258b78e2
commit 22e6fb7056
15 changed files with 945 additions and 2 deletions

View file

@ -33,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodemetadata.h"
#include "nodedef.h"
#include "itemdef.h"
#include "shader.h"
#include <IFileSystem.h>
#include "sha1.h"
#include "base64.h"
@ -228,12 +229,14 @@ Client::Client(
std::string password,
MapDrawControl &control,
IWritableTextureSource *tsrc,
IWritableShaderSource *shsrc,
IWritableItemDefManager *itemdef,
IWritableNodeDefManager *nodedef,
ISoundManager *sound,
MtEventManager *event
):
m_tsrc(tsrc),
m_shsrc(shsrc),
m_itemdef(itemdef),
m_nodedef(nodedef),
m_sound(sound),
@ -2456,6 +2459,9 @@ void Client::afterContentReceived()
if(g_settings->getBool("enable_texture_atlas"))
m_tsrc->buildMainAtlas(this);
// Rebuild shaders
m_shsrc->rebuildShaders();
// Update node aliases
infostream<<"- Updating node aliases"<<std::endl;
m_nodedef->updateAliases(m_itemdef);
@ -2512,6 +2518,10 @@ ITextureSource* Client::getTextureSource()
{
return m_tsrc;
}
IShaderSource* Client::getShaderSource()
{
return m_shsrc;
}
u16 Client::allocateUnknownNodeId(const std::string &name)
{
errorstream<<"Client::allocateUnknownNodeId(): "