From 804b2647ced20b8af1e632f1e99d54f905fa8ce0 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 11 Feb 2011 16:43:26 +0200 Subject: new texture stuff quite working --- src/tile.cpp | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 101 insertions(+), 4 deletions(-) (limited to 'src/tile.cpp') diff --git a/src/tile.cpp b/src/tile.cpp index 7b19b3651..415830a87 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -626,8 +626,23 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, dstream<<"INFO: getTextureIdDirect(): generating special " <<"modification \""<drop(); } } + /* + [combine:WxH:X,Y=filename:X,Y=filename2 + Creates a bigger texture from an amount of smaller ones + */ else if(part_of_name.substr(0,8) == "[combine") { - // "[combine:16x128:0,0=stone.png:0,16=grass.png" Strfnd sf(part_of_name); sf.next(":"); u32 w0 = stoi(sf.next("x")); @@ -713,6 +731,10 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, } } } + /* + [progressbarN + Adds a progress bar, 0.0 <= N <= 1.0 + */ else if(part_of_name.substr(0,12) == "[progressbar") { if(baseimg == NULL) @@ -726,8 +748,13 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, float value = stof(part_of_name.substr(12)); make_progressbar(value, baseimg); } - // "[noalpha:filename.png" - // Use an image without it's alpha channel + /* + "[noalpha:filename.png" + Use an image without it's alpha channel. + Used for the leaves texture when in old leaves mode, so + that the transparent parts don't look completely black + when simple alpha channel is used for rendering. + */ else if(part_of_name.substr(0,8) == "[noalpha") { if(baseimg != NULL) @@ -771,6 +798,76 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, image->drop(); } } + /* + [inventorycube{topimage{leftimage{rightimage + In every subimage, replace ^ with &. + Create an "inventory cube". + NOTE: This should be used only on its own. + Example (a grass block (not actually used in game): + "[inventorycube{grass.png{mud.png&grass_side.png{mud.png&grass_side.png" + */ + else if(part_of_name.substr(0,14) == "[inventorycube") + { + if(baseimg != NULL) + { + dstream<<"WARNING: getTextureIdDirect(): baseimg!=NULL " + <<"for part_of_name="<queryFeature(video::EVDF_RENDER_TO_TARGET) == false) + { + dstream<<"WARNING: getTextureIdDirect(): EVDF_RENDER_TO_TARGET" + " not supported"<addRenderTargetTexture(dim, rtt_name.c_str()); + assert(rtt); + + + + img_top->drop(); + img_left->drop(); + img_right->drop(); + + //TODO + assert(0); +#endif + } else { dstream<<"WARNING: getTextureIdDirect(): Invalid " -- cgit v1.2.3