]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/tile.h
Remove unused ITextSceneNode header (#11476)
[dragonfireclient.git] / src / client / tile.h
index 6436a93d3501d60700fc968624f633ee973a1ac2..fcdc46460ccfe542e1c9d0b830d7317e1ad2b4e1 100644 (file)
@@ -25,8 +25,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <string>
 #include <vector>
 #include <SMaterial.h>
-#include <memory>
 #include "util/numeric.h"
+#include "config.h"
+
+#if ENABLE_GLES
+#include <IVideoDriver.h>
+#endif
 
 class IGameDef;
 struct TileSpec;
@@ -59,29 +63,10 @@ std::string getImagePath(std::string path);
 
        Utilizes a thread-safe cache.
 */
-std::string getTexturePath(const std::string &filename);
+std::string getTexturePath(const std::string &filename, bool *is_base_pack = nullptr);
 
 void clearTextureNameCache();
 
-/*
-       ITextureSource::generateTextureFromMesh parameters
-*/
-namespace irr {namespace scene {class IMesh;}}
-struct TextureFromMeshParams
-{
-       scene::IMesh *mesh = nullptr;
-       core::dimension2d<u32> dim;
-       std::string rtt_texture_name;
-       bool delete_texture_on_shutdown;
-       v3f camera_position;
-       v3f camera_lookat;
-       core::CMatrix4<f32> camera_projection_matrix;
-       video::SColorf ambient_light;
-       v3f light_position;
-       video::SColorf light_color;
-       f32 light_radius;
-};
-
 /*
        TextureSource creates and caches textures.
 */
@@ -119,8 +104,6 @@ class ITextureSource : public ISimpleTextureSource
         */
        virtual Palette* getPalette(const std::string &name) = 0;
        virtual bool isKnownSourceImage(const std::string &name)=0;
-       virtual video::ITexture* generateTextureFromMesh(
-                       const TextureFromMeshParams &params)=0;
        virtual video::ITexture* getNormalTexture(const std::string &name)=0;
        virtual video::SColor getTextureAverageColor(const std::string &name)=0;
        virtual video::ITexture *getShaderFlagsTexture(bool normalmap_present)=0;
@@ -139,8 +122,6 @@ class IWritableTextureSource : public ITextureSource
        virtual video::ITexture* getTexture(
                        const std::string &name, u32 *id = nullptr)=0;
        virtual bool isKnownSourceImage(const std::string &name)=0;
-       virtual video::ITexture* generateTextureFromMesh(
-                       const TextureFromMeshParams &params)=0;
 
        virtual void processQueue()=0;
        virtual void insertSourceImage(const std::string &name, video::IImage *img)=0;
@@ -152,8 +133,8 @@ class IWritableTextureSource : public ITextureSource
 
 IWritableTextureSource *createTextureSource();
 
-#ifdef __ANDROID__
-video::IImage * Align2Npot2(video::IImage * image, video::IVideoDriver* driver);
+#if ENABLE_GLES
+video::IImage *Align2Npot2(video::IImage *image, video::IVideoDriver *driver);
 #endif
 
 enum MaterialType{
@@ -163,7 +144,12 @@ enum MaterialType{
        TILE_MATERIAL_LIQUID_OPAQUE,
        TILE_MATERIAL_WAVING_LEAVES,
        TILE_MATERIAL_WAVING_PLANTS,
-       TILE_MATERIAL_OPAQUE
+       TILE_MATERIAL_OPAQUE,
+       TILE_MATERIAL_WAVING_LIQUID_BASIC,
+       TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT,
+       TILE_MATERIAL_WAVING_LIQUID_OPAQUE,
+       TILE_MATERIAL_PLAIN,
+       TILE_MATERIAL_PLAIN_ALPHA
 };
 
 // Material flags
@@ -227,16 +213,19 @@ struct TileLayer
                switch (material_type) {
                case TILE_MATERIAL_OPAQUE:
                case TILE_MATERIAL_LIQUID_OPAQUE:
+               case TILE_MATERIAL_WAVING_LIQUID_OPAQUE:
                        material.MaterialType = video::EMT_SOLID;
                        break;
                case TILE_MATERIAL_BASIC:
                case TILE_MATERIAL_WAVING_LEAVES:
                case TILE_MATERIAL_WAVING_PLANTS:
+               case TILE_MATERIAL_WAVING_LIQUID_BASIC:
                        material.MaterialTypeParam = 0.5;
                        material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
                        break;
                case TILE_MATERIAL_ALPHA:
                case TILE_MATERIAL_LIQUID_TRANSPARENT:
+               case TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT:
                        material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
                        break;
                default:
@@ -281,7 +270,7 @@ struct TileLayer
        u32 texture_id = 0;
 
        u16 animation_frame_length_ms = 0;
-       u8 animation_frame_count = 1;
+       u16 animation_frame_count = 1;
 
        u8 material_type = TILE_MATERIAL_BASIC;
        u8 material_flags =
@@ -293,7 +282,7 @@ struct TileLayer
        //! If true, the tile has its own color.
        bool has_color = false;
 
-       std::shared_ptr<std::vector<FrameSpec>> frames = nullptr;
+       std::vector<FrameSpec> *frames = nullptr;
 
        /*!
         * The color of the tile, or if the tile does not own
@@ -309,10 +298,7 @@ struct TileLayer
  */
 struct TileSpec
 {
-       TileSpec() {
-               for (auto &layer : layers)
-                       layer = TileLayer();
-       }
+       TileSpec() = default;
 
        /*!
         * Returns true if this tile can be merged with the other tile.
@@ -339,4 +325,4 @@ struct TileSpec
        TileLayer layers[MAX_TILE_LAYERS];
 };
 
-const std::vector<std::string> &getTextureDirs();
+std::vector<std::string> getTextureDirs();