{"action":"created","comment":{"url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments/70172408","id":70172408,"diff_hunk":"@@ -0,0 +1,62 @@\n+/*\n+ * Copyright 2016 MovingBlocks\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.terasology.rendering.dag;\n+\n+import com.google.common.collect.Lists;\n+import java.util.List;\n+\n+/**\n+ *\n+ */\n+public class RenderPipelineOptimizer {\n+    private RenderPipeline renderPipeline;\n+\n+    public RenderPipelineOptimizer(RenderPipeline renderPipeline) {\n+        this.renderPipeline = renderPipeline;\n+    }\n+\n+    public List<PipelineTask> optimize() {\n+        List<PipelineTask> taskList = Lists.newArrayList();\n+        for (Object object : renderPipeline) {\n+            // TODO: eliminate redundant steps here\n+\n+            PipelineTask task = generateTask(object);\n+            if (task != null) {\n+                taskList.add(task);\n+            }\n+        }\n+        return taskList;\n+    }\n+\n+    private PipelineTask generateTask(Object object) {\n+        PipelineTask task = null;\n+        if (object instanceof Node) {\n+            task = new NodeTask((Node) object);\n+        } else if (object instanceof StateChange) {\n+            task = generateStateChangeTask((StateChange) object);\n+        }\n+        return task;\n+    }\n+\n+    private PipelineTask generateStateChangeTask(StateChange object) {\n+        PipelineTask task = null;\n+        if (object instanceof WireframeStateChange) {\n+            task = new WireframeTask(object);\n+        }","path":"engine/src/main/java/org/terasology/rendering/dag/RenderPipelineOptimizer.java","position":58,"original_position":58,"commit_id":"bfaac9160c20c3260fa0abaf42604fad3f04e157","original_commit_id":"bfaac9160c20c3260fa0abaf42604fad3f04e157","user":{"login":"emanuele3d","id":6934584,"avatar_url":"https://avatars.githubusercontent.com/u/6934584?v=3","gravatar_id":"","url":"https://api.github.com/users/emanuele3d","html_url":"https://github.com/emanuele3d","followers_url":"https://api.github.com/users/emanuele3d/followers","following_url":"https://api.github.com/users/emanuele3d/following{/other_user}","gists_url":"https://api.github.com/users/emanuele3d/gists{/gist_id}","starred_url":"https://api.github.com/users/emanuele3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanuele3d/subscriptions","organizations_url":"https://api.github.com/users/emanuele3d/orgs","repos_url":"https://api.github.com/users/emanuele3d/repos","events_url":"https://api.github.com/users/emanuele3d/events{/privacy}","received_events_url":"https://api.github.com/users/emanuele3d/received_events","type":"User","site_admin":false},"body":"I'm not quite sure what you are saying here. But don't worry, let's see it in code.","created_at":"2016-07-09T21:45:39Z","updated_at":"2016-07-09T21:45:39Z","html_url":"https://github.com/MovingBlocks/Terasology/pull/2399#discussion_r70172408","pull_request_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399","_links":{"self":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments/70172408"},"html":{"href":"https://github.com/MovingBlocks/Terasology/pull/2399#discussion_r70172408"},"pull_request":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399"}}},"pull_request":{"url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399","id":76736397,"html_url":"https://github.com/MovingBlocks/Terasology/pull/2399","diff_url":"https://github.com/MovingBlocks/Terasology/pull/2399.diff","patch_url":"https://github.com/MovingBlocks/Terasology/pull/2399.patch","issue_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2399","number":2399,"state":"open","locked":false,"title":"[NFM] Architecture for Redundant State Elimination","user":{"login":"tdgunes","id":136392,"avatar_url":"https://avatars.githubusercontent.com/u/136392?v=3","gravatar_id":"","url":"https://api.github.com/users/tdgunes","html_url":"https://github.com/tdgunes","followers_url":"https://api.github.com/users/tdgunes/followers","following_url":"https://api.github.com/users/tdgunes/following{/other_user}","gists_url":"https://api.github.com/users/tdgunes/gists{/gist_id}","starred_url":"https://api.github.com/users/tdgunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdgunes/subscriptions","organizations_url":"https://api.github.com/users/tdgunes/orgs","repos_url":"https://api.github.com/users/tdgunes/repos","events_url":"https://api.github.com/users/tdgunes/events{/privacy}","received_events_url":"https://api.github.com/users/tdgunes/received_events","type":"User","site_admin":false},"body":"\r\n### Contains\r\n\r\nInitial architecture for redundant state elimination, render task creation and so on.\r\n\r\n### How to test\r\n\r\nPlay the game with different video settings and observe any irregularities.","created_at":"2016-07-08T11:05:31Z","updated_at":"2016-07-09T21:45:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e365598ab49aae352d7acba2aa3b302e4caf22b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399/commits","review_comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399/comments","review_comment_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2399/comments","statuses_url":"https://api.github.com/repos/MovingBlocks/Terasology/statuses/bfaac9160c20c3260fa0abaf42604fad3f04e157","head":{"label":"MovingBlocks:dag-pipeline","ref":"dag-pipeline","sha":"bfaac9160c20c3260fa0abaf42604fad3f04e157","user":{"login":"MovingBlocks","id":1292442,"avatar_url":"https://avatars.githubusercontent.com/u/1292442?v=3","gravatar_id":"","url":"https://api.github.com/users/MovingBlocks","html_url":"https://github.com/MovingBlocks","followers_url":"https://api.github.com/users/MovingBlocks/followers","following_url":"https://api.github.com/users/MovingBlocks/following{/other_user}","gists_url":"https://api.github.com/users/MovingBlocks/gists{/gist_id}","starred_url":"https://api.github.com/users/MovingBlocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MovingBlocks/subscriptions","organizations_url":"https://api.github.com/users/MovingBlocks/orgs","repos_url":"https://api.github.com/users/MovingBlocks/repos","events_url":"https://api.github.com/users/MovingBlocks/events{/privacy}","received_events_url":"https://api.github.com/users/MovingBlocks/received_events","type":"Organization","site_admin":false},"repo":{"id":1438007,"name":"Terasology","full_name":"MovingBlocks/Terasology","owner":{"login":"MovingBlocks","id":1292442,"avatar_url":"https://avatars.githubusercontent.com/u/1292442?v=3","gravatar_id":"","url":"https://api.github.com/users/MovingBlocks","html_url":"https://github.com/MovingBlocks","followers_url":"https://api.github.com/users/MovingBlocks/followers","following_url":"https://api.github.com/users/MovingBlocks/following{/other_user}","gists_url":"https://api.github.com/users/MovingBlocks/gists{/gist_id}","starred_url":"https://api.github.com/users/MovingBlocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MovingBlocks/subscriptions","organizations_url":"https://api.github.com/users/MovingBlocks/orgs","repos_url":"https://api.github.com/users/MovingBlocks/repos","events_url":"https://api.github.com/users/MovingBlocks/events{/privacy}","received_events_url":"https://api.github.com/users/MovingBlocks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MovingBlocks/Terasology","description":"Terasology - open source voxel world","fork":false,"url":"https://api.github.com/repos/MovingBlocks/Terasology","forks_url":"https://api.github.com/repos/MovingBlocks/Terasology/forks","keys_url":"https://api.github.com/repos/MovingBlocks/Terasology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MovingBlocks/Terasology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MovingBlocks/Terasology/teams","hooks_url":"https://api.github.com/repos/MovingBlocks/Terasology/hooks","issue_events_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/events{/number}","events_url":"https://api.github.com/repos/MovingBlocks/Terasology/events","assignees_url":"https://api.github.com/repos/MovingBlocks/Terasology/assignees{/user}","branches_url":"https://api.github.com/repos/MovingBlocks/Terasology/branches{/branch}","tags_url":"https://api.github.com/repos/MovingBlocks/Terasology/tags","blobs_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/refs{/sha}","trees_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MovingBlocks/Terasology/statuses/{sha}","languages_url":"https://api.github.com/repos/MovingBlocks/Terasology/languages","stargazers_url":"https://api.github.com/repos/MovingBlocks/Terasology/stargazers","contributors_url":"https://api.github.com/repos/MovingBlocks/Terasology/contributors","subscribers_url":"https://api.github.com/repos/MovingBlocks/Terasology/subscribers","subscription_url":"https://api.github.com/repos/MovingBlocks/Terasology/subscription","commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/commits{/sha}","git_commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/commits{/sha}","comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/comments{/number}","issue_comment_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/comments{/number}","contents_url":"https://api.github.com/repos/MovingBlocks/Terasology/contents/{+path}","compare_url":"https://api.github.com/repos/MovingBlocks/Terasology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MovingBlocks/Terasology/merges","archive_url":"https://api.github.com/repos/MovingBlocks/Terasology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MovingBlocks/Terasology/downloads","issues_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues{/number}","pulls_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls{/number}","milestones_url":"https://api.github.com/repos/MovingBlocks/Terasology/milestones{/number}","notifications_url":"https://api.github.com/repos/MovingBlocks/Terasology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MovingBlocks/Terasology/labels{/name}","releases_url":"https://api.github.com/repos/MovingBlocks/Terasology/releases{/id}","deployments_url":"https://api.github.com/repos/MovingBlocks/Terasology/deployments","created_at":"2011-03-04T03:49:19Z","updated_at":"2016-07-09T13:28:25Z","pushed_at":"2016-07-09T18:44:19Z","git_url":"git://github.com/MovingBlocks/Terasology.git","ssh_url":"git@github.com:MovingBlocks/Terasology.git","clone_url":"https://github.com/MovingBlocks/Terasology.git","svn_url":"https://github.com/MovingBlocks/Terasology","homepage":"http://terasology.org","size":332752,"stargazers_count":1555,"watchers_count":1555,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":633,"mirror_url":null,"open_issues_count":317,"forks":633,"open_issues":317,"watchers":1555,"default_branch":"develop"}},"base":{"label":"MovingBlocks:develop","ref":"develop","sha":"41c20aff77e9d2922d78aea1e57a253ee8089f77","user":{"login":"MovingBlocks","id":1292442,"avatar_url":"https://avatars.githubusercontent.com/u/1292442?v=3","gravatar_id":"","url":"https://api.github.com/users/MovingBlocks","html_url":"https://github.com/MovingBlocks","followers_url":"https://api.github.com/users/MovingBlocks/followers","following_url":"https://api.github.com/users/MovingBlocks/following{/other_user}","gists_url":"https://api.github.com/users/MovingBlocks/gists{/gist_id}","starred_url":"https://api.github.com/users/MovingBlocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MovingBlocks/subscriptions","organizations_url":"https://api.github.com/users/MovingBlocks/orgs","repos_url":"https://api.github.com/users/MovingBlocks/repos","events_url":"https://api.github.com/users/MovingBlocks/events{/privacy}","received_events_url":"https://api.github.com/users/MovingBlocks/received_events","type":"Organization","site_admin":false},"repo":{"id":1438007,"name":"Terasology","full_name":"MovingBlocks/Terasology","owner":{"login":"MovingBlocks","id":1292442,"avatar_url":"https://avatars.githubusercontent.com/u/1292442?v=3","gravatar_id":"","url":"https://api.github.com/users/MovingBlocks","html_url":"https://github.com/MovingBlocks","followers_url":"https://api.github.com/users/MovingBlocks/followers","following_url":"https://api.github.com/users/MovingBlocks/following{/other_user}","gists_url":"https://api.github.com/users/MovingBlocks/gists{/gist_id}","starred_url":"https://api.github.com/users/MovingBlocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MovingBlocks/subscriptions","organizations_url":"https://api.github.com/users/MovingBlocks/orgs","repos_url":"https://api.github.com/users/MovingBlocks/repos","events_url":"https://api.github.com/users/MovingBlocks/events{/privacy}","received_events_url":"https://api.github.com/users/MovingBlocks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MovingBlocks/Terasology","description":"Terasology - open source voxel world","fork":false,"url":"https://api.github.com/repos/MovingBlocks/Terasology","forks_url":"https://api.github.com/repos/MovingBlocks/Terasology/forks","keys_url":"https://api.github.com/repos/MovingBlocks/Terasology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MovingBlocks/Terasology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MovingBlocks/Terasology/teams","hooks_url":"https://api.github.com/repos/MovingBlocks/Terasology/hooks","issue_events_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/events{/number}","events_url":"https://api.github.com/repos/MovingBlocks/Terasology/events","assignees_url":"https://api.github.com/repos/MovingBlocks/Terasology/assignees{/user}","branches_url":"https://api.github.com/repos/MovingBlocks/Terasology/branches{/branch}","tags_url":"https://api.github.com/repos/MovingBlocks/Terasology/tags","blobs_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/refs{/sha}","trees_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MovingBlocks/Terasology/statuses/{sha}","languages_url":"https://api.github.com/repos/MovingBlocks/Terasology/languages","stargazers_url":"https://api.github.com/repos/MovingBlocks/Terasology/stargazers","contributors_url":"https://api.github.com/repos/MovingBlocks/Terasology/contributors","subscribers_url":"https://api.github.com/repos/MovingBlocks/Terasology/subscribers","subscription_url":"https://api.github.com/repos/MovingBlocks/Terasology/subscription","commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/commits{/sha}","git_commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/commits{/sha}","comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/comments{/number}","issue_comment_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/comments{/number}","contents_url":"https://api.github.com/repos/MovingBlocks/Terasology/contents/{+path}","compare_url":"https://api.github.com/repos/MovingBlocks/Terasology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MovingBlocks/Terasology/merges","archive_url":"https://api.github.com/repos/MovingBlocks/Terasology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MovingBlocks/Terasology/downloads","issues_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues{/number}","pulls_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls{/number}","milestones_url":"https://api.github.com/repos/MovingBlocks/Terasology/milestones{/number}","notifications_url":"https://api.github.com/repos/MovingBlocks/Terasology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MovingBlocks/Terasology/labels{/name}","releases_url":"https://api.github.com/repos/MovingBlocks/Terasology/releases{/id}","deployments_url":"https://api.github.com/repos/MovingBlocks/Terasology/deployments","created_at":"2011-03-04T03:49:19Z","updated_at":"2016-07-09T13:28:25Z","pushed_at":"2016-07-09T18:44:19Z","git_url":"git://github.com/MovingBlocks/Terasology.git","ssh_url":"git@github.com:MovingBlocks/Terasology.git","clone_url":"https://github.com/MovingBlocks/Terasology.git","svn_url":"https://github.com/MovingBlocks/Terasology","homepage":"http://terasology.org","size":332752,"stargazers_count":1555,"watchers_count":1555,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":633,"mirror_url":null,"open_issues_count":317,"forks":633,"open_issues":317,"watchers":1555,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399"},"html":{"href":"https://github.com/MovingBlocks/Terasology/pull/2399"},"issue":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2399"},"comments":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2399/comments"},"review_comments":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399/comments"},"review_comment":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2399/commits"},"statuses":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/statuses/bfaac9160c20c3260fa0abaf42604fad3f04e157"}}}}
{"actor":{"display_login":"emanuele3d"}}