44 bool LoadTexture(
const std::string &filename,
const std::string &name,
Real widthmult,
Real heightmult,
bool enable_force =
false,
bool force_mode =
false,
int mipmaps = -1,
bool use_alpha_color =
false, Ogre::ColourValue alpha_color = Ogre::ColourValue::Black);
45 bool LoadAnimatedTexture(std::vector<std::string> filenames,
const std::string &name,
Real duration,
Real widthmult,
Real heightmult,
bool enable_force =
false,
bool force_mode =
false,
int mipmaps = -1,
bool use_alpha_color =
false, Ogre::ColourValue alpha_color = Ogre::ColourValue::Black);
46 bool LoadAlphaBlendTexture(
const std::string &filename,
const std::string &specular_filename,
const std::string &blend_filename,
const std::string &name,
bool spherical,
Real widthmult,
Real heightmult,
bool enable_force =
false,
bool force_mode =
false,
int mipmaps = -1,
bool use_alpha_color =
false, Ogre::ColourValue alpha_color = Ogre::ColourValue::Black);
47 bool LoadMaterial(
const std::string &filename,
const std::string &name,
Real widthmult,
Real heightmult,
bool enable_force =
false,
bool force_mode =
false);
48 bool UnloadTexture(
const std::string &name,
const std::string &group);
49 bool UnloadMaterial(
const std::string &name,
const std::string &group);
50 bool LoadTextureCropped(
const std::string &filename,
const std::string &name,
int x,
int y,
int width,
int height,
Real widthmult,
Real heightmult,
bool enable_force =
false,
bool force_mode =
false);
51 bool RotateTexture(
const std::string &name,
Real angle);
52 bool RotateAnimTexture(
const std::string &name,
Real speed);
53 bool ScrollTexture(
const std::string &name,
Real x_offset,
Real y_offset);
54 bool ScrollAnimTexture(
const std::string &name,
Real x_speed,
Real y_speed);
55 bool ScaleTexture(
const std::string &name,
Real x_scale,
Real y_scale);
56 bool TransformTexture(
const std::string &name,
const std::string &type,
const std::string &wave_type,
Real base,
Real frequency,
Real phase,
Real amplitude);
57 Real AutoSize(
Real n1,
Real n2,
bool iswidth,
Real offset,
bool enable_force,
bool force_mode);
58 void SetTextureMapping(
int vertindex1,
Vector2 uv1,
int vertindex2,
Vector2 uv2,
int vertindex3,
Vector2 uv3);
59 void SetTextureMapping2(
const std::string &x1,
const std::string &y1,
const std::string &z1,
Vector2 uv1,
const std::string &x2,
const std::string &y2,
const std::string &z2,
Vector2 uv2,
const std::string &x3,
const std::string &y3,
const std::string &z3,
Vector2 uv3);
60 void ResetTextureMapping(
bool todefaults =
false);
61 void SetAutoSize(
bool x,
bool y);
62 void GetAutoSize(
bool &x,
bool &y);
63 void SetTextureOverride(
const std::string &mainneg,
const std::string &mainpos,
const std::string &sideneg,
const std::string &sidepos,
const std::string &top,
const std::string &bottom);
64 void SetTextureFlip(
int mainneg,
int mainpos,
int sideneg,
int sidepos,
int top,
int bottom);
65 void ProcessTextureFlip(
Real tw,
Real th);
66 bool GetTextureTiling(
const std::string &texture,
Real &tw,
Real &th);
67 bool GetTextureForce(
const std::string &texture,
bool &enable_force,
bool &force_mode);
68 bool AddTextToTexture(
const std::string &origname,
const std::string &name,
const std::string &font_filename,
Real font_size,
const std::string &text,
int x1,
int y1,
int x2,
int y2,
const std::string &h_align,
const std::string &v_align,
int ColorR,
int ColorG,
int ColorB,
bool enable_force =
false,
bool force_mode =
false);
69 bool AddTextureOverlay(
const std::string &orig_texture,
const std::string &overlay_texture,
const std::string &name,
int x,
int y,
int width,
int height,
Real widthmult,
Real heightmult,
bool enable_force =
false,
bool force_mode =
false);
70 void FreeTextureImages();
71 int GetTextureCount();
72 int GetMaterialCount();
74 void SetPlanarMapping(
bool flat,
bool FlipX,
bool FlipY,
bool FlipZ,
bool rotate);
75 void GetPlanarMapping(
bool &flat,
bool &FlipX,
bool &FlipY,
bool &FlipZ,
bool &rotate);
77 Ogre::TexturePtr loadChromaKeyedTexture(
const std::string& filename,
const std::string& resGroup,
const std::string& name,
const Ogre::ColourValue& keyCol = Ogre::ColourValue::Black,
int numMipmaps = -1,
Real threshold = 0.003);
78 void SaveTexture(Ogre::TexturePtr texture,
const std::string &filename);
79 std::string ListTextures(
bool show_filename =
false);
80 void IncrementTextureCount();
81 void DecrementTextureCount();
82 void IncrementMaterialCount();
83 void DecrementMaterialCount();
84 void RegisterTextureInfo(
const std::string &name,
const std::string &material_name,
const std::string &filename,
Real widthmult,
Real heightmult,
bool enable_force,
bool force_mode,
size_t tex_size,
size_t mat_size);
85 bool UnregisterTextureInfo(std::string name, std::string material_name =
"");
86 Ogre::MaterialPtr CreateMaterial(
const std::string &name,
const std::string &path);
87 Ogre::MaterialPtr GetMaterialByName(
const std::string &name,
const std::string &group =
"General");
88 Ogre::TextureUnitState* BindTextureToMaterial(Ogre::MaterialPtr mMat, std::string texture_name,
bool has_alpha);
89 Ogre::TextureUnitState* GetTextureUnitState(Ogre::MaterialPtr mMat);
90 std::string GetTextureName(Ogre::MaterialPtr mMat);
91 Ogre::TexturePtr GetTextureByName(
const std::string &name,
const std::string &group =
"General");
92 std::string GetTextureMaterial(
const std::string &name,
bool &result,
bool report =
true,
const std::string &polygon_name =
"");
93 void CopyTexture(Ogre::TexturePtr source, Ogre::TexturePtr destination);
94 void CopyTexture(Ogre::TexturePtr source, Ogre::TexturePtr destination,
const Ogre::Box &srcBox,
const Ogre::Box &dstBox);
95 void FreeTextureBoxes();
96 void SetPlanarRotate(
bool value);
97 bool GetPlanarRotate();
99 void EnableLighting(
const std::string &material_name,
bool value);
100 void EnableShadows(
const std::string &material_name,
bool value);
101 int GetTextureInfoCount();
104 void IncrementTextureUsage(
const std::string &name);
105 void DecrementTextureUsage(
const std::string &name);
106 void SetCulling(
const std::string &material_name,
int mode = 1);
107 Ogre::MaterialPtr
SetCulling(
const std::string &material_name,
const std::string &name,
int mode);
108 size_t GetMemoryUsage();
109 bool GetTextureImage(Ogre::TexturePtr texture);
112 std::string mainnegtex, mainpostex, sidenegtex, sidepostex, toptex,
bottomtex;
115 int mainnegflip, mainposflip, sidenegflip, sideposflip, topflip,
bottomflip;
156 void BackupMapping();
157 bool WriteToTexture(
const std::string &str, Ogre::TexturePtr destTexture,
int destLeft,
int destTop,
int destRight,
int destBottom, Ogre::FontPtr font,
const Ogre::ColourValue &color,
char justify =
'l',
char vert_justify =
't',
bool wordwrap =
true);
158 Ogre::TexturePtr LoadTexture(
const std::string &filename,
int mipmaps,
bool &has_alpha,
bool use_alpha_color =
false, Ogre::ColourValue alpha_color = Ogre::ColourValue::Black);
159 void UnloadMaterials();
std::vector< Real > widthscale
std::vector< std::string > OldMapVerts3
std::vector< TexturePixelBox > textureboxes
std::string prev_material
std::vector< std::string > MapVerts1
Ogre::MaterialPtr SetCulling(const std::string &material_name, const std::string &name, int mode)
std::vector< int > MapIndex
std::vector< Ogre::TexturePtr > manual_textures
std::vector< std::string > OldMapVerts2
std::vector< Vector2 > OldMapUV
std::vector< std::string > OldMapVerts1
std::vector< Vector2 > MapUV
std::vector< std::string > MapVerts2
std::vector< int > OldMapIndex
std::vector< TextureInfo > textureinfo
std::vector< std::string > MapVerts3
std::vector< Real > heightscale