From 24e41ab4c892a7cecee2d4e5e625afd83de43034 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 24 Jan 2011 13:32:11 +0200 Subject: [PATCH] Mainly some texture tweaking --- data/coalstone.png | Bin 1557 -> 1523 bytes data/grass.png | Bin 1683 -> 855 bytes data/grass_footsteps.png | Bin 1609 -> 856 bytes data/grass_side.png | Bin 0 -> 1695 bytes data/leaves.png | Bin 913 -> 1652 bytes data/mud_with_grass.png | Bin 1596 -> 0 bytes data/stone.png | Bin 1609 -> 1563 bytes data/water.png | Bin 214 -> 1040 bytes src/constants.h | 2 + src/irrlichtwrapper.cpp | 34 ++++++++++++++++ src/irrlichtwrapper.h | 10 +++++ src/main.cpp | 18 +++++---- src/map.cpp | 6 +-- src/mapblock.cpp | 4 +- src/tile.cpp | 82 ++++++++++++++++++++++++++++++++++----- src/tile.h | 5 +-- 16 files changed, 135 insertions(+), 26 deletions(-) create mode 100644 data/grass_side.png delete mode 100644 data/mud_with_grass.png diff --git a/data/coalstone.png b/data/coalstone.png index c993a02f04648f724961ca602c489a917d54fb86..0c62a192f605f02f7b24079808e034961b037885 100644 GIT binary patch delta 720 zcmV;>0x$iQ4D$=HFav+CNkl}TC{rQ1OegpEk0w{rQsff#NZT|s~-m2%mFqKJP&S@cjWO0$l5Q)f|A zXsbP$&Agg^V<0+d!z;kDvay&GgpF*bGZI^0S?0Vx+)AMJ4H47S>=sj2`2Au5x1q-x z<0Vm@o1QN5C1I~n=B0*6STl?~pR4n77(o)e$Y)adDvp!)_gyZJs+sR6U(+-V2TVMB z4gdoK0}F|d7-fGWbxm7HroSiC05CMvB^s7<{e6Zi7lmR`k|`W#7{)^}o7uFdK8A^= zK0o*AFmH5p3;?=Mbt|gru(Nq7OObRzRK6|F`n^8Chs7eb!M5Rus;WUQ^z`v~iey+f zRhIX4-I)3?4*=@`08kwbXLq&>B?*%XKPZ3g_}Kl!#ln9!qyPZm&l{QLH2{F!pQt}j z%{rO7aD89TnWdFg{D2FWE{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6_(O z>$nIQJS=Amb8wPaaKl-pVYhs2|1w8~u>Fag%qa~oP0Y7^am@Yypo^iVYF&Ip|1#b~ nM}^ojZh35GUwxK`hlk;QrCN3B$;p90S1@?G`njxgN@xNAN!39c diff --git a/src/constants.h b/src/constants.h index 3cb285065..f90b278d2 100644 --- a/src/constants.h +++ b/src/constants.h @@ -32,6 +32,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #define DEBUGFILE "debug.txt" +#define WATER_ALPHA 160 + // Define for simulating the quirks of sending through internet. // Causes the socket class to deliberately drop random packets. // This disables unit testing of socket and connection. diff --git a/src/irrlichtwrapper.cpp b/src/irrlichtwrapper.cpp index fe4ff2771..e26cbfd15 100644 --- a/src/irrlichtwrapper.cpp +++ b/src/irrlichtwrapper.cpp @@ -175,6 +175,40 @@ video::ITexture * CrackTextureMod::make(video::ITexture *original, return newtexture; } +video::ITexture * SideGrassTextureMod::make(video::ITexture *original, + const char *newname, video::IVideoDriver* driver) +{ + // Size of the base image + core::dimension2d dim(16, 16); + // Position to copy the grass to in the base image + core::position2d pos_base(0, 0); + // Position to copy the grass from in the grass image + core::position2d pos_other(0, 0); + + video::IImage *baseimage = driver->createImage(original, pos_base, dim); + assert(baseimage); + + video::IImage *grassimage = driver->createImageFromFile(porting::getDataPath("grass_side.png").c_str()); + assert(grassimage); + + // Then copy the right part of grassimage to baseimage + + grassimage->copyToWithAlpha(baseimage, v2s32(0,0), + core::rect(pos_other, dim), + video::SColor(255,255,255,255), + NULL); + + grassimage->drop(); + + // Create texture from resulting image + + video::ITexture *newtexture = driver->addTexture(newname, baseimage); + + baseimage->drop(); + + return newtexture; +} + video::ITexture * ProgressBarTextureMod::make(video::ITexture *original, const char *newname, video::IVideoDriver* driver) { diff --git a/src/irrlichtwrapper.h b/src/irrlichtwrapper.h index ce54b70c0..97607e579 100644 --- a/src/irrlichtwrapper.h +++ b/src/irrlichtwrapper.h @@ -97,6 +97,16 @@ struct CrackTextureMod: public TextureMod u16 progression; }; +struct SideGrassTextureMod: public TextureMod +{ + SideGrassTextureMod() + { + } + + virtual video::ITexture * make(video::ITexture *original, + const char *newname, video::IVideoDriver* driver); +}; + struct ProgressBarTextureMod: public TextureMod { // value is from 0.0 to 1.0 diff --git a/src/main.cpp b/src/main.cpp index 7c5f6bf3e..092d62988 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -76,9 +76,6 @@ SUGG: Split MapBlockObject serialization to to-client and to-disk - This will allow saving ages of rats on disk but not sending them to clients -SUGG: Implement lighting using VoxelManipulator - - Would it be significantly faster? - SUGG: MovingObject::move and Player::move are basically the same. combine them. @@ -168,6 +165,8 @@ TODO: Make fetching sector's blocks more efficient when rendering sectors that have very large amounts of blocks (on client) - Is this necessary at all? +TODO: Flowing water animation + Configuration: -------------- @@ -231,8 +230,8 @@ Block object server side: - TODO: For incoming blocks, time difference is calculated and objects are stepped according to it. -Map generator: --------------- +Map: +---- NOTE: There are some lighting-related todos and fixmes in ServerMap::emergeBlock. And there always will be. 8) @@ -245,6 +244,8 @@ TODO: Map generator version 2 - Cliffs, arcs - There could be a certain height (to which mountains only reach) where some minerals are found + - Create a system that allows a huge amount of different "map + generator modules/filters" TODO: Change AttributeList to split the area into smaller sections so that searching won't be as heavy. @@ -256,6 +257,10 @@ FIXME: The new pre-sunlight-propagation code messes up with initial TODO: Remove HMParams +TODO: Flowing water to actually contain flow direction information + +TODO: Faster lighting using VoxelManipulator + Doing now: ---------- @@ -1532,8 +1537,7 @@ int main(int argc, char *argv[]) */ init_content_inventory_texture_paths(); - init_tile_texture_paths(); - tile_materials_preload(g_irrlicht); + init_tile_textures(); /* GUI stuff diff --git a/src/map.cpp b/src/map.cpp index 5655ee9ec..09fb154aa 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1624,7 +1624,7 @@ void Map::transformLiquids(core::map & modified_blocks) } // If n2_changed to bottom, don't flow anywhere else - if(to_bottom && flowed) + if(to_bottom && flowed && !is_source) break; }catch(InvalidPositionException &e) @@ -1770,7 +1770,7 @@ ServerMap::ServerMap(std::string savedir, HMParams hmp, MapParams mp): float randmax = 0; float randfactor = 0; - if(myrand()%4 == 0) + if(myrand()%5 == 0) { baseheight = 100; randmax = 50; @@ -2602,7 +2602,7 @@ continue_generating: (float)(myrand()%ued)+0.5 ); s16 min_d = 0; - s16 max_d = 6; + s16 max_d = 4; s16 rs = (myrand()%(max_d-min_d+1))+min_d; v3f vec = rp - orp; diff --git a/src/mapblock.cpp b/src/mapblock.cpp index f18cb2fdd..620c29fdd 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -268,7 +268,7 @@ void MapBlock::makeFastFace(TileSpec tile, u8 light, v3f p, if(tile.id == TILE_WATER) { - alpha = 128; + alpha = WATER_ALPHA; } video::SColor c = video::SColor(alpha,li,li,li); @@ -797,7 +797,7 @@ void MapBlock::updateMesh(u32 daynight_ratio) }catch(InvalidPositionException &e){} u8 l = decode_light(n.getLightBlend(daynight_ratio)); - video::SColor c(128,l,l,l); + video::SColor c(WATER_ALPHA,l,l,l); // Neighbor water levels (key = relative position) // Includes current node diff --git a/src/tile.cpp b/src/tile.cpp index 90de11642..79d68d4c3 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., // A mapping from tiles to paths of textures -const char * g_tile_texture_filenames[TILES_COUNT] = +/*const char * g_tile_texture_filenames[TILES_COUNT] = { NULL, "stone.png", @@ -37,13 +37,19 @@ const char * g_tile_texture_filenames[TILES_COUNT] = "mese.png", "mud.png", "tree_top.png", - "mud_with_grass.png", + "mud.png_sidegrass", "cloud.png", "coalstone.png", "wood.png", -}; +};*/ + +/* + These can either be real paths or generated names of preloaded + textures (like "mud.png_sidegrass") +*/ +std::string g_tile_texture_paths[TILES_COUNT]; -std::string g_tile_texture_path_strings[TILES_COUNT]; +/*std::string g_tile_texture_path_strings[TILES_COUNT]; const char * g_tile_texture_paths[TILES_COUNT] = {0}; void init_tile_texture_paths() @@ -60,30 +66,86 @@ void init_tile_texture_paths() g_tile_texture_path_strings[i].c_str(); } } -} +}*/ const char * tile_texture_path_get(u32 i) { assert(i < TILES_COUNT); - return g_tile_texture_paths[i]; + //return g_tile_texture_paths[i]; + return g_tile_texture_paths[i].c_str(); } // A mapping from tiles to materials // Initialized at run-time. video::SMaterial g_tile_materials[TILES_COUNT]; -void tile_materials_preload(IrrlichtWrapper *irrlicht) +enum TileTextureModID +{ + TTMID_NONE, + TTMID_SIDEGRASS, +}; + +struct TileTextureSpec +{ + const char *filename; + enum TileTextureModID mod; +}; + +/* + Initializes g_tile_texture_paths with paths of textures, + generates generated textures and creates the tile material array. +*/ +void init_tile_textures() { + TileTextureSpec tile_texture_specs[TILES_COUNT] = + { + {NULL, TTMID_NONE}, + {"stone.png", TTMID_NONE}, + {"water.png", TTMID_NONE}, + {"grass.png", TTMID_NONE}, + {"tree.png", TTMID_NONE}, + {"leaves.png", TTMID_NONE}, + {"grass_footsteps.png", TTMID_NONE}, + {"mese.png", TTMID_NONE}, + {"mud.png", TTMID_NONE}, + {"tree_top.png", TTMID_NONE}, + {"mud.png", TTMID_SIDEGRASS}, + {"cloud.png", TTMID_NONE}, + {"coalstone.png", TTMID_NONE}, + {"wood.png", TTMID_NONE}, + }; + + for(s32 i=0; igetTexture(TextureSpec(path + mod_postfix, + path, mod)); + } + g_tile_texture_paths[i] = path + mod_postfix; + } + } + for(s32 i=0; igetTexture(path); + t = g_irrlicht->getTexture(path); assert(t != NULL); } @@ -99,7 +161,7 @@ void tile_materials_preload(IrrlichtWrapper *irrlicht) g_tile_materials[i].setTexture(0, t); } - + g_tile_materials[TILE_WATER].MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA; //g_tile_materials[TILE_WATER].MaterialType = video::EMT_TRANSPARENT_ADD_COLOR; } diff --git a/src/tile.h b/src/tile.h index b6dcb249a..5869c03ee 100644 --- a/src/tile.h +++ b/src/tile.h @@ -99,13 +99,10 @@ struct TileSpec Functions */ -void init_tile_texture_paths(); +void init_tile_textures(); const char * tile_texture_path_get(u32 i); -// Initializes g_tile_materials -void tile_materials_preload(IrrlichtWrapper *irrlicht); - video::SMaterial & tile_material_get(u32 i); #endif -- 2.25.1