Minetest  5.4.0
tile.cpp File Reference
#include "tile.h"
#include <algorithm>
#include <ICameraSceneNode.h>
#include <IrrCompileConfig.h>
#include "util/string.h"
#include "util/container.h"
#include "util/thread.h"
#include "filesys.h"
#include "settings.h"
#include "mesh.h"
#include "gamedef.h"
#include "util/strfnd.h"
#include "imagefilters.h"
#include "guiscalingfilter.h"
#include "renderingengine.h"
+ Include dependency graph for tile.cpp:

Classes

struct  TextureInfo
 
class  SourceImageCache
 
class  TextureSource
 

Functions

static bool replace_ext (std::string &path, const char *ext)
 
std::string getImagePath (std::string path)
 
std::string getTexturePath (const std::string &filename, bool *is_base_pack)
 
void clearTextureNameCache ()
 
IWritableTextureSourcecreateTextureSource ()
 
static void blit_with_alpha (video::IImage *src, video::IImage *dst, v2s32 src_pos, v2s32 dst_pos, v2u32 size)
 
static void blit_with_alpha_overlay (video::IImage *src, video::IImage *dst, v2s32 src_pos, v2s32 dst_pos, v2u32 size)
 
static void apply_colorize (video::IImage *dst, v2u32 dst_pos, v2u32 size, const video::SColor &color, int ratio, bool keep_alpha)
 
static void apply_multiplication (video::IImage *dst, v2u32 dst_pos, v2u32 size, const video::SColor &color)
 
static void apply_mask (video::IImage *mask, video::IImage *dst, v2s32 mask_pos, v2s32 dst_pos, v2u32 size)
 
static void draw_crack (video::IImage *crack, video::IImage *dst, bool use_overlay, s32 frame_count, s32 progression, video::IVideoDriver *driver, u8 tiles=1)
 
void brighten (video::IImage *image)
 
u32 parseImageTransform (const std::string &s)
 
core::dimension2d< u32 > imageTransformDimension (u32 transform, core::dimension2d< u32 > dim)
 
void imageTransform (u32 transform, video::IImage *src, video::IImage *dst)
 
static void applyShadeFactor (video::SColor &color, u32 factor)
 
static video::IImage * createInventoryCubeImage (video::IImage *top, video::IImage *left, video::IImage *right)
 
static std::string unescape_string (const std::string &str, const char esc='\\')
 
static video::SColor blitPixel (const video::SColor &src_c, const video::SColor &dst_c, u32 ratio)
 
video::IImage * create_crack_image (video::IImage *crack, s32 frame_index, core::dimension2d< u32 > size, u8 tiles, video::IVideoDriver *driver)
 
std::vector< std::string > getTextureDirs ()
 

Variables

MutexedMap< std::string, std::string > g_texturename_to_path_cache
 

Function Documentation

◆ apply_colorize()

static void apply_colorize ( video::IImage *  dst,
v2u32  dst_pos,
v2u32  size,
const video::SColor &  color,
int  ratio,
bool  keep_alpha 
)
static

Referenced by TextureSource::generateImagePart().

+ Here is the caller graph for this function:

◆ apply_mask()

static void apply_mask ( video::IImage *  mask,
video::IImage *  dst,
v2s32  mask_pos,
v2s32  dst_pos,
v2u32  size 
)
static

Referenced by TextureSource::generateImagePart().

+ Here is the caller graph for this function:

◆ apply_multiplication()

static void apply_multiplication ( video::IImage *  dst,
v2u32  dst_pos,
v2u32  size,
const video::SColor &  color 
)
static

Referenced by TextureSource::generateImagePart().

+ Here is the caller graph for this function:

◆ applyShadeFactor()

static void applyShadeFactor ( video::SColor &  color,
u32  factor 
)
inlinestatic

Referenced by createInventoryCubeImage().

+ Here is the caller graph for this function:

◆ blit_with_alpha()

static void blit_with_alpha ( video::IImage *  src,
video::IImage *  dst,
v2s32  src_pos,
v2s32  dst_pos,
v2u32  size 
)
static

References blitPixel().

Referenced by draw_crack(), TextureSource::generateImage(), and TextureSource::generateImagePart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blit_with_alpha_overlay()

static void blit_with_alpha_overlay ( video::IImage *  src,
video::IImage *  dst,
v2s32  src_pos,
v2s32  dst_pos,
v2u32  size 
)
static

References blitPixel().

Referenced by draw_crack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blitPixel()

static video::SColor blitPixel ( const video::SColor &  src_c,
const video::SColor &  dst_c,
u32  ratio 
)
inlinestatic

Referenced by blit_with_alpha(), and blit_with_alpha_overlay().

+ Here is the caller graph for this function:

◆ brighten()

void brighten ( video::IImage *  image)

Referenced by TextureSource::generateImagePart().

+ Here is the caller graph for this function:

◆ clearTextureNameCache()

void clearTextureNameCache ( )

References g_texturename_to_path_cache.

Referenced by Game::extendedResourceCleanup().

+ Here is the caller graph for this function:

◆ create_crack_image()

video::IImage* create_crack_image ( video::IImage *  crack,
s32  frame_index,
core::dimension2d< u32 >  size,
u8  tiles,
video::IVideoDriver *  driver 
)

Referenced by draw_crack().

+ Here is the caller graph for this function:

◆ createInventoryCubeImage()

static video::IImage* createInventoryCubeImage ( video::IImage *  top,
video::IImage *  left,
video::IImage *  right 
)
static

References applyShadeFactor(), RenderingEngine::get_video_driver(), npot2(), and sanity_check.

Referenced by TextureSource::generateImagePart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTextureSource()

IWritableTextureSource* createTextureSource ( )

Referenced by Game::init().

+ Here is the caller graph for this function:

◆ draw_crack()

static void draw_crack ( video::IImage *  crack,
video::IImage *  dst,
bool  use_overlay,
s32  frame_count,
s32  progression,
video::IVideoDriver *  driver,
u8  tiles = 1 
)
static

References blit_with_alpha(), blit_with_alpha_overlay(), and create_crack_image().

Referenced by TextureSource::generateImagePart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImagePath()

std::string getImagePath ( std::string  path)

References fs::PathExists(), removeStringEnd(), and replace_ext().

Referenced by findSubgame(), and getTexturePath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTextureDirs()

std::vector<std::string> getTextureDirs ( )

References g_settings, Settings::get(), and fs::GetRecursiveDirs().

Referenced by Client::afterContentReceived(), and getTexturePath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTexturePath()

std::string getTexturePath ( const std::string &  filename,
bool *  is_base_pack 
)

References DIR_DELIM, g_texturename_to_path_cache, getImagePath(), getTextureDirs(), and porting::path_share.

Referenced by SourceImageCache::getOrLoad(), SourceImageCache::insert(), and TextureSource::isKnownSourceImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ imageTransform()

void imageTransform ( u32  transform,
video::IImage *  src,
video::IImage *  dst 
)

References imageTransformDimension().

Referenced by TextureSource::generateImagePart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ imageTransformDimension()

core::dimension2d< u32 > imageTransformDimension ( u32  transform,
core::dimension2d< u32 >  dim 
)

Referenced by TextureSource::generateImagePart(), and imageTransform().

+ Here is the caller graph for this function:

◆ parseImageTransform()

u32 parseImageTransform ( const std::string &  s)

References lowercase().

Referenced by TextureSource::generateImagePart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replace_ext()

static bool replace_ext ( std::string &  path,
const char *  ext 
)
static

Referenced by getImagePath().

+ Here is the caller graph for this function:

◆ unescape_string()

static std::string unescape_string ( const std::string &  str,
const char  esc = '\\' 
)
static

Referenced by TextureSource::generateImagePart().

+ Here is the caller graph for this function:

Variable Documentation

◆ g_texturename_to_path_cache

MutexedMap<std::string, std::string> g_texturename_to_path_cache