{"action":"created","comment":{"url":"https://api.github.com/repos/minetest/minetest/pulls/comments/76355465","id":76355465,"diff_hunk":"@@ -1104,45 +1105,174 @@ void mapblock_mesh_generate_special(MeshMakeData *data,\n \t\tbreak;}\n \t\tcase NDT_PLANTLIKE:\n \t\t{\n+\t\t\tPseudoRandom rng(x<<8 | z | y<<16);\n+\n \t\t\tTileSpec tile = getNodeTileN(n, p, 0, data);\n \t\t\ttile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;\n \n \t\t\tu16 l = getInteriorLight(n, 1, nodedef);\n \t\t\tvideo::SColor c = MapBlock_LightColor(255, l, f.light_source);\n \n \t\t\tfloat s = BS / 2 * f.visual_scale;\n+\t\t\t// add sqrt(2) visual scale\n+\t\t\tif ((f.param_type_2 == CPT2_MESHOPTIONS) && ((n.param2 & 0x10) != 0))\n+\t\t\t\ts *= 1.41421;\n+\n+\t\t\tfloat random_offset_X = .0;\n+\t\t\tfloat random_offset_Z = .0;\n+\t\t\tif ((f.param_type_2 == CPT2_MESHOPTIONS) && ((n.param2 & 0x8) != 0)) {\n+\t\t\t\trandom_offset_X = BS * ((rng.next() % 16 / 16.0) * 0.29 - 0.145);\n+\t\t\t\trandom_offset_Z = BS * ((rng.next() % 16 / 16.0) * 0.29 - 0.145);\n+\t\t\t}\n \n-\t\t\tfor (int j = 0; j < 2; j++)\n-\t\t\t{\n+\t\t\tfor (int j = 0; j < 4; j++) {\n \t\t\t\tvideo::S3DVertex vertices[4] =\n \t\t\t\t{\n \t\t\t\t\tvideo::S3DVertex(-s,-BS/2, 0, 0,0,0, c, 0,1),\n \t\t\t\t\tvideo::S3DVertex( s,-BS/2, 0, 0,0,0, c, 1,1),\n \t\t\t\t\tvideo::S3DVertex( s,-BS/2 + s*2,0, 0,0,0, c, 1,0),\n \t\t\t\t\tvideo::S3DVertex(-s,-BS/2 + s*2,0, 0,0,0, c, 0,0),\n \t\t\t\t};\n+\n \t\t\t\tfloat rotate_degree = 0;\n+\t\t\t\tu8 p2mesh = 0;\n \t\t\t\tif (f.param_type_2 == CPT2_DEGROTATE)\n \t\t\t\t\trotate_degree = n.param2 * 2;\n-\n-\t\t\t\tif (j == 0) {\n-\t\t\t\t\tfor(u16 i = 0; i < 4; i++)\n-\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(46 + rotate_degree);\n-\t\t\t\t} else if (j == 1) {\n-\t\t\t\t\tfor(u16 i = 0; i < 4; i++)\n-\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(-44 + rotate_degree);\n+\t\t\t\telse if (f.param_type_2 != CPT2_MESHOPTIONS) {\n+\t\t\t\t\tif (j == 0) {\n+\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(46 + rotate_degree);\n+\t\t\t\t\t} else if (j == 1) {\n+\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(-44 + rotate_degree);\n+\t\t\t\t\t}\n+\t\t\t\t} else {\n+\t\t\t\t\tp2mesh = n.param2 & 0x7;\n+\t\t\t\t\tswitch (p2mesh) {\n+\t\t\t\t\tcase 0:\n+\t\t\t\t\t\t// x\n+\t\t\t\t\t\tif (j == 0) {\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(46);\n+\t\t\t\t\t\t} else if (j == 1) {\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(-44);\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tcase 1:\n+\t\t\t\t\t\t// +\n+\t\t\t\t\t\tif (j == 0) {\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(91);\n+\t\t\t\t\t\t} else if (j == 1) {\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(1);\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tcase 2:\n+\t\t\t\t\t\t// *\n+\t\t\t\t\t\tif (j == 0) {\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(121);\n+\t\t\t\t\t\t} else if (j == 1) {\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(241);\n+\t\t\t\t\t\t} else { // (j == 2)\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++)\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(1);\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tcase 3:\n+\t\t\t\t\t\t// #\n+\t\t\t\t\t\tswitch (j) {\n+\t\t\t\t\t\tcase 0:\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++) {\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(1);\n+\t\t\t\t\t\t\t\tvertices[i].Pos.Z += BS/4;\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\tcase 1:\n+\t\t\t\t\t\t\tfor (u16 i = 0; i < 4; i++) {\n+\t\t\t\t\t\t\t\tvertices[i].Pos.rotateXZBy(91);\n+\t\t\t\t\t\t\t\tvertices[i].Pos.X += BS/4;","path":"src/content_mapblock.cpp","position":110,"original_position":110,"commit_id":"d67b1cba4d22ce29cc1a09991d15ba873d34e6ea","original_commit_id":"d67b1cba4d22ce29cc1a09991d15ba873d34e6ea","user":{"login":"paramat","id":3686677,"avatar_url":"https://avatars.githubusercontent.com/u/3686677?v=3","gravatar_id":"","url":"https://api.github.com/users/paramat","html_url":"https://github.com/paramat","followers_url":"https://api.github.com/users/paramat/followers","following_url":"https://api.github.com/users/paramat/following{/other_user}","gists_url":"https://api.github.com/users/paramat/gists{/gist_id}","starred_url":"https://api.github.com/users/paramat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramat/subscriptions","organizations_url":"https://api.github.com/users/paramat/orgs","repos_url":"https://api.github.com/users/paramat/repos","events_url":"https://api.github.com/users/paramat/events{/privacy}","received_events_url":"https://api.github.com/users/paramat/received_events","type":"User","site_admin":false},"body":"and here","created_at":"2016-08-26T02:18:48Z","updated_at":"2016-08-26T02:18:48Z","html_url":"https://github.com/minetest/minetest/pull/3923#discussion_r76355465","pull_request_url":"https://api.github.com/repos/minetest/minetest/pulls/3923","_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest/pulls/comments/76355465"},"html":{"href":"https://github.com/minetest/minetest/pull/3923#discussion_r76355465"},"pull_request":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3923"}}},"pull_request":{"url":"https://api.github.com/repos/minetest/minetest/pulls/3923","id":64259480,"html_url":"https://github.com/minetest/minetest/pull/3923","diff_url":"https://github.com/minetest/minetest/pull/3923.diff","patch_url":"https://github.com/minetest/minetest/pull/3923.patch","issue_url":"https://api.github.com/repos/minetest/minetest/issues/3923","number":3923,"state":"open","locked":false,"title":"Make plantlike drawtype more fun.","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"body":"Adds several new ways that the plantlike drawtype mesh can be changed.\r\n\r\nThis requires paramtype2 = \"meshoptions\" to be set in the node\r\ndefinition. The drawtype for these nodes should be \"plantlike\".\r\n\r\nThese modifications are all done using param2. This field is now\r\na complex bitfield that allows some or more of the combinations to\r\nbe chosen, and the mesh draw code will choose the options based as\r\nneeded for each plantlike node.\r\n\r\nbit layout:\r\nbits 0, 1 and 2 (values 0x1 through 0x7) are for choosing the plant\r\nmesh shape:\r\n  0 - ordinary plantlike plant (\"x\" shaped)\r\n  1 - ordinary plant, but rotated 45 degrees (\"+\" shaped)\r\n  2 - a plant with 3 faces (\"*\" shaped)\r\n  3 - a plant with 4 faces (\"#\" shaped)\r\n  4 through 7 are unused and reserved for future mesh shapes.\r\n\r\nbit 3 (0x8) causes the plant to be randomly offset in the x,z\r\nplane. The plant should fall within the 1x1x1 nodebox if regularly\r\nsized.\r\n\r\nbit 4 (0x10) causes the plant mesh to grow by sqrt(2), and will cause\r\nthe plant mesh to fill out 1x1x1, and appear slightly larger. Texture\r\nmakers will want to make their plant texture 23x16 pixels to have the\r\nbest visual fit in 1x1x1 size.\r\n\r\nbit 5 (0x20) through bit 7 (0x80) are unused and reserved for\r\nfuture use.\r\n\r\n!(https://youtu.be/qWuI664krsI)\r\n\r\n\r\n- [X] - CPT2_MESHOPTIONS\r\n- [X] - don't stretch pixels\r\n- [X] - Reorganize bitfield\r\n- [x] - Docs","created_at":"2016-03-27T07:21:16Z","updated_at":"2016-08-26T02:18:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72e0ca0221fc8514984695ce13b23879862bdb5c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/minetest/minetest/pulls/3923/commits","review_comments_url":"https://api.github.com/repos/minetest/minetest/pulls/3923/comments","review_comment_url":"https://api.github.com/repos/minetest/minetest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/3923/comments","statuses_url":"https://api.github.com/repos/minetest/minetest/statuses/d67b1cba4d22ce29cc1a09991d15ba873d34e6ea","head":{"label":"sofar:plantfun","ref":"plantfun","sha":"d67b1cba4d22ce29cc1a09991d15ba873d34e6ea","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"repo":{"id":29793579,"name":"minetest","full_name":"sofar/minetest","owner":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sofar/minetest","description":"Minetest, an open source infinite-world block sandbox game with survival and crafting. [also https://github.com/minetest/minetest_game]","fork":true,"url":"https://api.github.com/repos/sofar/minetest","forks_url":"https://api.github.com/repos/sofar/minetest/forks","keys_url":"https://api.github.com/repos/sofar/minetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sofar/minetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sofar/minetest/teams","hooks_url":"https://api.github.com/repos/sofar/minetest/hooks","issue_events_url":"https://api.github.com/repos/sofar/minetest/issues/events{/number}","events_url":"https://api.github.com/repos/sofar/minetest/events","assignees_url":"https://api.github.com/repos/sofar/minetest/assignees{/user}","branches_url":"https://api.github.com/repos/sofar/minetest/branches{/branch}","tags_url":"https://api.github.com/repos/sofar/minetest/tags","blobs_url":"https://api.github.com/repos/sofar/minetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sofar/minetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sofar/minetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/sofar/minetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sofar/minetest/statuses/{sha}","languages_url":"https://api.github.com/repos/sofar/minetest/languages","stargazers_url":"https://api.github.com/repos/sofar/minetest/stargazers","contributors_url":"https://api.github.com/repos/sofar/minetest/contributors","subscribers_url":"https://api.github.com/repos/sofar/minetest/subscribers","subscription_url":"https://api.github.com/repos/sofar/minetest/subscription","commits_url":"https://api.github.com/repos/sofar/minetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/sofar/minetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/sofar/minetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/sofar/minetest/issues/comments{/number}","contents_url":"https://api.github.com/repos/sofar/minetest/contents/{+path}","compare_url":"https://api.github.com/repos/sofar/minetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sofar/minetest/merges","archive_url":"https://api.github.com/repos/sofar/minetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sofar/minetest/downloads","issues_url":"https://api.github.com/repos/sofar/minetest/issues{/number}","pulls_url":"https://api.github.com/repos/sofar/minetest/pulls{/number}","milestones_url":"https://api.github.com/repos/sofar/minetest/milestones{/number}","notifications_url":"https://api.github.com/repos/sofar/minetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sofar/minetest/labels{/name}","releases_url":"https://api.github.com/repos/sofar/minetest/releases{/id}","deployments_url":"https://api.github.com/repos/sofar/minetest/deployments","created_at":"2015-01-24T22:13:18Z","updated_at":"2015-01-24T22:13:20Z","pushed_at":"2016-08-24T19:09:50Z","git_url":"git://github.com/sofar/minetest.git","ssh_url":"git@github.com:sofar/minetest.git","clone_url":"https://github.com/sofar/minetest.git","svn_url":"https://github.com/sofar/minetest","homepage":"http://minetest.net/","size":41526,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"minetest:master","ref":"master","sha":"d767f025cb0d5cca29c1f2147d2a0931a088b717","user":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?v=3","gravatar_id":"","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"repo":{"id":2168780,"name":"minetest","full_name":"minetest/minetest","owner":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?v=3","gravatar_id":"","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/minetest/minetest","description":"Minetest, an open source infinite-world block sandbox game with survival and crafting. [also https://github.com/minetest/minetest_game]","fork":false,"url":"https://api.github.com/repos/minetest/minetest","forks_url":"https://api.github.com/repos/minetest/minetest/forks","keys_url":"https://api.github.com/repos/minetest/minetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minetest/minetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minetest/minetest/teams","hooks_url":"https://api.github.com/repos/minetest/minetest/hooks","issue_events_url":"https://api.github.com/repos/minetest/minetest/issues/events{/number}","events_url":"https://api.github.com/repos/minetest/minetest/events","assignees_url":"https://api.github.com/repos/minetest/minetest/assignees{/user}","branches_url":"https://api.github.com/repos/minetest/minetest/branches{/branch}","tags_url":"https://api.github.com/repos/minetest/minetest/tags","blobs_url":"https://api.github.com/repos/minetest/minetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minetest/minetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minetest/minetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/minetest/minetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minetest/minetest/statuses/{sha}","languages_url":"https://api.github.com/repos/minetest/minetest/languages","stargazers_url":"https://api.github.com/repos/minetest/minetest/stargazers","contributors_url":"https://api.github.com/repos/minetest/minetest/contributors","subscribers_url":"https://api.github.com/repos/minetest/minetest/subscribers","subscription_url":"https://api.github.com/repos/minetest/minetest/subscription","commits_url":"https://api.github.com/repos/minetest/minetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/minetest/minetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/minetest/minetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/minetest/minetest/issues/comments{/number}","contents_url":"https://api.github.com/repos/minetest/minetest/contents/{+path}","compare_url":"https://api.github.com/repos/minetest/minetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minetest/minetest/merges","archive_url":"https://api.github.com/repos/minetest/minetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minetest/minetest/downloads","issues_url":"https://api.github.com/repos/minetest/minetest/issues{/number}","pulls_url":"https://api.github.com/repos/minetest/minetest/pulls{/number}","milestones_url":"https://api.github.com/repos/minetest/minetest/milestones{/number}","notifications_url":"https://api.github.com/repos/minetest/minetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minetest/minetest/labels{/name}","releases_url":"https://api.github.com/repos/minetest/minetest/releases{/id}","deployments_url":"https://api.github.com/repos/minetest/minetest/deployments","created_at":"2011-08-07T13:48:36Z","updated_at":"2016-08-25T01:48:34Z","pushed_at":"2016-08-25T19:59:28Z","git_url":"git://github.com/minetest/minetest.git","ssh_url":"git@github.com:minetest/minetest.git","clone_url":"https://github.com/minetest/minetest.git","svn_url":"https://github.com/minetest/minetest","homepage":"http://minetest.net/","size":115695,"stargazers_count":2122,"watchers_count":2122,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":660,"mirror_url":null,"open_issues_count":851,"forks":660,"open_issues":851,"watchers":2122,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3923"},"html":{"href":"https://github.com/minetest/minetest/pull/3923"},"issue":{"href":"https://api.github.com/repos/minetest/minetest/issues/3923"},"comments":{"href":"https://api.github.com/repos/minetest/minetest/issues/3923/comments"},"review_comments":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3923/comments"},"review_comment":{"href":"https://api.github.com/repos/minetest/minetest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3923/commits"},"statuses":{"href":"https://api.github.com/repos/minetest/minetest/statuses/d67b1cba4d22ce29cc1a09991d15ba873d34e6ea"}}}}
{"actor":{"display_login":"paramat"}}