From 47f76d8a5122767337f0c7b75c5c44a01c418141 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 14 Dec 2010 00:29:32 +0200 Subject: [PATCH] grass edges workin' --- data/mud_with_grass.png | Bin 0 -> 1597 bytes data/tree_top.png | Bin 0 -> 1024 bytes src/mapblock.cpp | 42 ++++++++++++++++++++-------------------- src/mapblock.h | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 data/mud_with_grass.png create mode 100644 data/tree_top.png diff --git a/data/mud_with_grass.png b/data/mud_with_grass.png new file mode 100644 index 0000000000000000000000000000000000000000..fe0d0af9bfa97a11b02a3a6c806a4ec84f5eae48 GIT binary patch literal 1597 zcmZuw4KS8j6uzq>BA?QRl9ji@Xrn0#yJ|Pf_4i@4lx$L2wl1luwpA=?OIxhNEEbvC zY(M&v*o$b4sJ3MFLqD$nN?TL%Z4K48=5(~$1Wz4x4V&biNXo^#%0UmrI;9TOdd zkREnl<}YrUdXLu-=Pzjy_6UtZzFq;Y!sSDo4_#b%T)h}$lu`g7gkX#%Nn!|5ga9Fe z5JpH6S))ENhA2eey? zgfNV$FfeA~6jV8*i~L?qxq7{L@vAQ4V56A=>TSQ^S_>^(G0 z>2N>-@D5Yx^A=WcQ6mfd(c*DV83Rg1A|^yc0Aqww3?OX6n0Q|pm@#omd=z_5IRi!s z1q?*+1VIW$r^;SMiF z-DD1w5uliWgb9+^ds-twbePKOq}2?I<;=P)9o&XLoA z(a8P?l86DK1c`8tC__LI0Wr3eBVd985eG)e zEf+0PO{NX)(r8zYjL9VkCu$uBQtK*mYQzA7r!9#$@)ywIpnv}sDn)f-kEfP zc~=_JUgS)^+_*NUF}yneS*Kg4vI76@@4cwvma$WVzGked@L-Q+_d3@JmFFt9b=z{k z!#Cqt)%36g-MJQRN3O_^V8!X)xSBVS{SOQGr+(65*70YN;ffnG>k}Lrs&f?P7rOg8 z_s+uq>~l!T>ZmR^Fk7|#Rhld)c~I$jzfa|D+$>L#xyoJIeGDd=*=dD#`N{mQdi|RF z;_JIbhYqFez7S{-?qpZt9G}p0`^tlpb|s7J+K!g9^MulS2 zwwbwu11hX#kQo{jt4aGq9u@S~wsqbs+WaOlQR!1fR_9I*;8ljGH-Z! zStn{`W$fy*i&GDen|ON1nEAH(Jh-j?VSeT`tGbqFzKH|bwha|E*ABeVjft5PJz4%! zh%*0oYu)ZA#_`j_&d>WfP?hRnxN>vd37b08_Qy*$<>i&>S6|y2wYpO2ect}ZkH&64 z8`J6kXhpvBWS6St(?5UOt@pglDR}-@-zGXeXq8{=_K=d@RkF&U{+`YsGG3g`YN~bK zVssyjJUwGIrd&5E{HvyLVMxoXCO5s}-s2^g6v{S7T}feR>SNQDBtH;Zd}hx2g{7Nj z7mT;8PB#lIw6WT2uQL#OJ3?t)RC`Q6u%m2)TXW4L+l`(wV8*NU5Aai$Z|(|?zq&3$ z=S+{G!m<2j_NuiD%JYtX=UqPO-<%~IQgU2ZX;#v0#hQTm!Pa*?Cb*|N zDqm~2dK8D95B@$E&DeP(NV93NPv~H_Ikr&kK4spzHM+iJhTpu%;tLvc>$<`}{doW8 zbSwFj{yTaJc5|mVDo!}i45QXbzE+RV=|;e%#iz84*1mLk;S;;(qW$D3_0ND^eU_d6 HA~f-Ta8&`g literal 0 HcmV?d00001 diff --git a/data/tree_top.png b/data/tree_top.png new file mode 100644 index 0000000000000000000000000000000000000000..2cdd94f80c0c991c90309ffff6f1d91f0ad188c9 GIT binary patch literal 1024 zcmZuvO-R&H5TAC7a?7+LBBAK;Ac>%heL;{LYc(cfBC=qCrA3AVK|~%bN)K6=Z0Zml z!h?r8B++4#1kI=}9t1%W22s|d2cx7S&}sfF$gbOi_ujn6%=>-JdstU{rZ`cS0DxjV zo2vJ{G@6@YzV<%3b_5^}bu|rDezfeg>}GzlXsD`)Ff$P$VhBM21b_hu00Dwm6j5i64SfFV%6+~|+6 z2`Qs^=Mczs=KltS{QfvePzE9JbOTXf0b>8QV!-MYz=5)3{6K8I2Sb=jHk6OIRMb7Y zyl=zX%JPjD_jXm6Tv(1x&i0M{T%2B*nHib;=JD;>AG=-^mrf=oItLq0cKj{+f~Au; z&bQvXn%I1|ZOggm>F-lp-!~>-JZ|dwJwG&_ZvS|tD0Mg m; - m.buildRotateFromTo(v3f(0,0,1), dir); - - for(u16 i=0; i<4; i++){ - m.rotateVect(vertex_pos[i]); + for(u16 i=0; i<4; i++) + { + if(dir == v3s16(0,0,1)) + vertex_pos[i].rotateXZBy(0); + else if(dir == v3s16(0,0,-1)) + vertex_pos[i].rotateXZBy(180); + else if(dir == v3s16(1,0,0)) + vertex_pos[i].rotateXZBy(-90); + else if(dir == v3s16(-1,0,0)) + vertex_pos[i].rotateXZBy(90); + else if(dir == v3s16(0,1,0)) + vertex_pos[i].rotateYZBy(-90); + else if(dir == v3s16(0,-1,0)) + vertex_pos[i].rotateYZBy(90); + vertex_pos[i].X *= scale.X; vertex_pos[i].Y *= scale.Y; vertex_pos[i].Z *= scale.Z; @@ -112,22 +119,15 @@ FastFace * MapBlock::makeFastFace(u16 tile, u8 light, v3f p, u8 alpha = 255; //if(material == CONTENT_WATER || material == CONTENT_OCEAN) - if(tile == CONTENT_WATER || tile == CONTENT_OCEAN) - //if(tile == TILE_WATER) + //TODO: Umm? + //if(tile == CONTENT_WATER || tile == CONTENT_OCEAN) + if(tile == TILE_WATER) { alpha = 128; } video::SColor c = video::SColor(alpha,li,li,li); - /*f->vertices[0] = video::S3DVertex(vertex_pos[0], zerovector, c, - core::vector2d(0,1)); - f->vertices[1] = video::S3DVertex(vertex_pos[1], zerovector, c, - core::vector2d(abs_scale,1)); - f->vertices[2] = video::S3DVertex(vertex_pos[2], zerovector, c, - core::vector2d(abs_scale,0)); - f->vertices[3] = video::S3DVertex(vertex_pos[3], zerovector, c, - core::vector2d(0,0));*/ f->vertices[0] = video::S3DVertex(vertex_pos[0], zerovector, c, core::vector2d(0,1)); f->vertices[1] = video::S3DVertex(vertex_pos[1], zerovector, c, @@ -308,14 +308,14 @@ void MapBlock::updateFastFaceRow(v3s16 startpos, if(mf == 1) { f = makeFastFace(tile0, light, - sp, face_dir_f, scale, + sp, face_dir, scale, posRelative_f); } // If node at sp is less solid (mf == 2) else { f = makeFastFace(tile1, light, - sp+face_dir_f, -1*face_dir_f, scale, + sp+face_dir_f, -face_dir, scale, posRelative_f); } dest.push_back(f); diff --git a/src/mapblock.h b/src/mapblock.h index b9c5ff22..60824938 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -284,7 +284,7 @@ public: } static FastFace * makeFastFace(u16 tile, u8 light, v3f p, - v3f dir, v3f scale, v3f posRelative_f); + v3s16 dir, v3f scale, v3f posRelative_f); u8 getFaceLight(v3s16 p, v3s16 face_dir); -- 2.30.2