{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/67614387","id":67614387,"diff_hunk":"@@ -443,6 +431,114 @@ void shadowcasting_3d_2d( int iterations )\n     REQUIRE( passed );\n }\n \n+\n+// T, O and V are 'T'ransparent, 'O'paque and 'V'isible.\n+// X marks the player location, which is not set to visible by this algorithm.\n+#define T LIGHT_TRANSPARENCY_CLEAR\n+#define O LIGHT_TRANSPARENCY_SOLID\n+#define V LIGHT_TRANSPARENCY_CLEAR\n+#define X LIGHT_TRANSPARENCY_SOLID\n+\n+struct grid_overlay {\n+    std::vector<std::vector<float>> data;\n+    point offset;\n+    float default_value;\n+\n+    grid_overlay( point offset, float default_value ) {\n+        this->offset = offset;\n+        this->default_value = default_value;\n+    }\n+\n+    int height() const {\n+        return data.size();\n+    }\n+    int width() const {\n+        if( data.empty() ) {\n+            return 0;\n+        }\n+        return data[0].size();\n+    }\n+\n+    float get_global( int x, int y ) const {\n+        if( y > offset.y && y < offset.y + height() &&\n+            x > offset.x && x < offset.x + width() ) {","path":"tests/shadowcasting_test.cpp","position":119,"original_position":119,"commit_id":"ffd6ced45149ba3a098d0cfe9cf606092b32b264","original_commit_id":"ffd6ced45149ba3a098d0cfe9cf606092b32b264","user":{"login":"codemime","id":11905613,"avatar_url":"https://avatars.githubusercontent.com/u/11905613?v=3","gravatar_id":"","url":"https://api.github.com/users/codemime","html_url":"https://github.com/codemime","followers_url":"https://api.github.com/users/codemime/followers","following_url":"https://api.github.com/users/codemime/following{/other_user}","gists_url":"https://api.github.com/users/codemime/gists{/gist_id}","starred_url":"https://api.github.com/users/codemime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codemime/subscriptions","organizations_url":"https://api.github.com/users/codemime/orgs","repos_url":"https://api.github.com/users/codemime/repos","events_url":"https://api.github.com/users/codemime/events{/privacy}","received_events_url":"https://api.github.com/users/codemime/received_events","type":"User","site_admin":false},"body":"These conditions won't allow `data[0, 0]`.","created_at":"2016-06-19T10:20:27Z","updated_at":"2016-06-19T10:20:27Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/17225#discussion_r67614387","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/67614387"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/17225#discussion_r67614387"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225","id":74267986,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/17225","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/17225.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/17225.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/17225","number":17225,"state":"open","locked":false,"title":"[CR] Initial stab at a spot checker for FoV scenarios.","user":{"login":"kevingranade","id":860276,"avatar_url":"https://avatars.githubusercontent.com/u/860276?v=3","gravatar_id":"","url":"https://api.github.com/users/kevingranade","html_url":"https://github.com/kevingranade","followers_url":"https://api.github.com/users/kevingranade/followers","following_url":"https://api.github.com/users/kevingranade/following{/other_user}","gists_url":"https://api.github.com/users/kevingranade/gists{/gist_id}","starred_url":"https://api.github.com/users/kevingranade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevingranade/subscriptions","organizations_url":"https://api.github.com/users/kevingranade/orgs","repos_url":"https://api.github.com/users/kevingranade/repos","events_url":"https://api.github.com/users/kevingranade/events{/privacy}","received_events_url":"https://api.github.com/users/kevingranade/received_events","type":"User","site_admin":false},"body":"As pointed out in  #16794, the shadowcasting implementation has a few remaining issues, so I added a unit test that I plan on using as a template for various spot-checks of the FoV system (whether it be this one or some future implementation).\r\n\r\nVery messy code, but I wanted to put it up for discussion and feedback.","created_at":"2016-06-17T16:15:04Z","updated_at":"2016-06-19T10:20:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b459093a313de5d669dcf2aa1cd40237802f3de","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225/comments","review_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/17225/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/ffd6ced45149ba3a098d0cfe9cf606092b32b264","head":{"label":"kevingranade:fov-unit-test-enhancement","ref":"fov-unit-test-enhancement","sha":"ffd6ced45149ba3a098d0cfe9cf606092b32b264","user":{"login":"kevingranade","id":860276,"avatar_url":"https://avatars.githubusercontent.com/u/860276?v=3","gravatar_id":"","url":"https://api.github.com/users/kevingranade","html_url":"https://github.com/kevingranade","followers_url":"https://api.github.com/users/kevingranade/followers","following_url":"https://api.github.com/users/kevingranade/following{/other_user}","gists_url":"https://api.github.com/users/kevingranade/gists{/gist_id}","starred_url":"https://api.github.com/users/kevingranade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevingranade/subscriptions","organizations_url":"https://api.github.com/users/kevingranade/orgs","repos_url":"https://api.github.com/users/kevingranade/repos","events_url":"https://api.github.com/users/kevingranade/events{/privacy}","received_events_url":"https://api.github.com/users/kevingranade/received_events","type":"User","site_admin":false},"repo":{"id":9759215,"name":"Cataclysm-DDA","full_name":"kevingranade/Cataclysm-DDA","owner":{"login":"kevingranade","id":860276,"avatar_url":"https://avatars.githubusercontent.com/u/860276?v=3","gravatar_id":"","url":"https://api.github.com/users/kevingranade","html_url":"https://github.com/kevingranade","followers_url":"https://api.github.com/users/kevingranade/followers","following_url":"https://api.github.com/users/kevingranade/following{/other_user}","gists_url":"https://api.github.com/users/kevingranade/gists{/gist_id}","starred_url":"https://api.github.com/users/kevingranade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevingranade/subscriptions","organizations_url":"https://api.github.com/users/kevingranade/orgs","repos_url":"https://api.github.com/users/kevingranade/repos","events_url":"https://api.github.com/users/kevingranade/events{/privacy}","received_events_url":"https://api.github.com/users/kevingranade/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kevingranade/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA","forks_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/releases{/id}","deployments_url":"https://api.github.com/repos/kevingranade/Cataclysm-DDA/deployments","created_at":"2013-04-29T22:15:31Z","updated_at":"2015-03-21T16:31:24Z","pushed_at":"2016-06-19T03:37:35Z","git_url":"git://github.com/kevingranade/Cataclysm-DDA.git","ssh_url":"git@github.com:kevingranade/Cataclysm-DDA.git","clone_url":"https://github.com/kevingranade/Cataclysm-DDA.git","svn_url":"https://github.com/kevingranade/Cataclysm-DDA","homepage":"http://www.cataclysm.glyphgryph.com/","size":785691,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"CleverRaven:master","ref":"master","sha":"7bf96a126b4935d92e71e8a78f15698b742c0a70","user":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"repo":{"id":5973855,"name":"Cataclysm-DDA","full_name":"CleverRaven/Cataclysm-DDA","owner":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":false,"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA","forks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/releases{/id}","deployments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/deployments","created_at":"2012-09-26T22:57:43Z","updated_at":"2016-06-17T13:57:06Z","pushed_at":"2016-06-19T09:11:35Z","git_url":"git://github.com/CleverRaven/Cataclysm-DDA.git","ssh_url":"git@github.com:CleverRaven/Cataclysm-DDA.git","clone_url":"https://github.com/CleverRaven/Cataclysm-DDA.git","svn_url":"https://github.com/CleverRaven/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":1051438,"stargazers_count":977,"watchers_count":977,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":896,"mirror_url":null,"open_issues_count":1269,"forks":896,"open_issues":1269,"watchers":977,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/17225"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/17225"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/17225/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225/comments"},"review_comment":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/17225/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/ffd6ced45149ba3a098d0cfe9cf606092b32b264"}}}}
{"actor":{"display_login":"codemime"}}