{"action":"created","comment":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/comments/63474620","id":63474620,"diff_hunk":"@@ -16,8 +16,361 @@\n \n #include \"map_element.h\"\n #include \"../../addresses.h\"\n+#include \"../../game.h\"\n+#include \"../../interface/viewport.h\"\n+#include \"../../paint/paint.h\"\n+#include \"../../paint/supports.h\"\n #include \"../../world/map.h\"\n+#include \"../../world/scenery.h\"\n \n void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) {\n-\tRCT2_CALLPROC_X(0x6DFF47, 0, 0, direction, height, (int)mapElement, 0, 0);\n+\t//RCT2_CALLPROC_X(0x6DFF47, 0, 0, direction, height, (int)mapElement, 0, 0); return;\n+\tRCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_SCENERY;\n+\tRCT2_GLOBAL(0x009DEA52, sint16) = 0;\n+\tRCT2_GLOBAL(0x009DEA54, sint16) = 0;\n+\tint ebx = 0;\n+\tif (RCT2_GLOBAL(0x009DEA6F, uint8) & 1) {\n+\t\trct_map_element *mapElement2 = RCT2_GLOBAL(0x00F63674, rct_map_element*);\n+\t\twhile (mapElement2 != mapElement) {\n+\t\t\tmapElement2++;\n+\t\t\tif ((mapElement2 - 1) != (rct_map_element*)0xFFFFFFFF) {\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\tebx = 0x21700000;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tif (mapElement->flags & MAP_ELEMENT_FLAG_GHOST) {\n+\t\tRCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE;\n+\t\tebx = RCT2_ADDRESS(0x993CC4, uint32_t)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8)];\n+\t}\n+\tuint32 dword_F64EB0 = ebx;\n+\t\n+\trct_scenery_entry *entry = (rct_scenery_entry*)gSmallSceneryEntries[mapElement->properties.scenery.type];;\n+\tebx = entry->image + direction;\n+\tRCT2_GLOBAL(0x00F64ED6, uint16) = 2;\n+\tRCT2_GLOBAL(0x00F64ED8, uint16) = 2;\n+\tint ecx;\n+\tsint8 x_offset = 0;\n+\tsint8 y_offset = 0;\n+\tif (entry->small_scenery.flags & SMALL_SCENERY_FLAG_FULL_TILE) {\n+\t\tif (entry->small_scenery.flags & SMALL_SCENERY_FLAG24) {\n+\t\t\t// 6DFFE3:\n+\t\t\tRCT2_GLOBAL(0x009DEA52, sint16) = RCT2_ADDRESS(0x009A3E7C, uint16)[direction * 4];\n+\t\t\tRCT2_GLOBAL(0x009DEA54, sint16) = RCT2_ADDRESS(0x009A3E7E, uint16)[direction * 4];\n+\t\t\tRCT2_GLOBAL(0x00F64ED6, uint16) = RCT2_ADDRESS(0x009A3E8C, uint16)[direction * 4];\n+\t\t\tRCT2_GLOBAL(0x00F64ED8, uint16) = RCT2_ADDRESS(0x009A3E8E, uint16)[direction * 4];\n+\t\t\tx_offset = 3;\n+\t\t\ty_offset = 3;\n+\t\t} else {\n+\t\t\tx_offset = 15;\n+\t\t\ty_offset = 15;\n+\t\t\tif (entry->small_scenery.flags & SMALL_SCENERY_FLAG_VOFFSET_CENTRE) {\n+\t\t\t\tx_offset = 3;\n+\t\t\t\ty_offset = 3;\n+\t\t\t\tRCT2_GLOBAL(0x00F64ED6, uint16) = 26;\n+\t\t\t\tRCT2_GLOBAL(0x00F64ED8, uint16) = 26;\n+\t\t\t\tif (entry->small_scenery.flags & SMALL_SCENERY_FLAG_ALLOW_WALLS) {\n+\t\t\t\t\tx_offset = 1;\n+\t\t\t\t\ty_offset = 1;\n+\t\t\t\t\tRCT2_GLOBAL(0x00F64ED6, uint16) = 30;\n+\t\t\t\t\tRCT2_GLOBAL(0x00F64ED8, uint16) = 30;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t} else {\n+\t\t// 6DFFC2:\n+\t\tecx = ((mapElement->type >> 6) + get_current_rotation()) & 3;\n+\t\tx_offset = RCT2_ADDRESS(0x009A3E74, sint8)[ecx * 2];\n+\t\ty_offset = RCT2_ADDRESS(0x009A3E75, sint8)[ecx * 2];\n+\t}\n+\t// 6E0074:\n+\tRCT2_GLOBAL(0x009DEA52, sint16) = x_offset;\n+\tRCT2_GLOBAL(0x009DEA54, sint16) = y_offset;\n+\tRCT2_GLOBAL(0x009DEA56, sint16) = height;\n+\tsint8 bblz = entry->small_scenery.height - 4;\n+\tif (bblz > 0x80) {","path":"src/paint/map_element/scenery.c","position":78,"original_position":78,"commit_id":"5ae809148dada4addccdea4314892c52626cb173","original_commit_id":"5ae809148dada4addccdea4314892c52626cb173","user":{"login":"janisozaur","id":550290,"avatar_url":"https://avatars.githubusercontent.com/u/550290?v=3","gravatar_id":"","url":"https://api.github.com/users/janisozaur","html_url":"https://github.com/janisozaur","followers_url":"https://api.github.com/users/janisozaur/followers","following_url":"https://api.github.com/users/janisozaur/following{/other_user}","gists_url":"https://api.github.com/users/janisozaur/gists{/gist_id}","starred_url":"https://api.github.com/users/janisozaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janisozaur/subscriptions","organizations_url":"https://api.github.com/users/janisozaur/orgs","repos_url":"https://api.github.com/users/janisozaur/repos","events_url":"https://api.github.com/users/janisozaur/events{/privacy}","received_events_url":"https://api.github.com/users/janisozaur/received_events","type":"User","site_admin":false},"body":"```\r\n/home/janisozaur/workspace/OpenRCT2/src/paint/map_element/scenery.c:92:11: warning: comparison of constant 128 with expression of type 'sint8' (aka 'signed char') is always false\r\n      [-Wtautological-constant-out-of-range-compare]\r\n        if (bblz > 0x80) {\r\n            ~~~~ ^ ~~~~\r\n1 warning generated\r\n```","created_at":"2016-05-17T07:23:17Z","updated_at":"2016-05-17T07:23:17Z","html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/3639#discussion_r63474620","pull_request_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639","_links":{"self":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/comments/63474620"},"html":{"href":"https://github.com/OpenRCT2/OpenRCT2/pull/3639#discussion_r63474620"},"pull_request":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639"}}},"pull_request":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639","id":70281678,"html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/3639","diff_url":"https://github.com/OpenRCT2/OpenRCT2/pull/3639.diff","patch_url":"https://github.com/OpenRCT2/OpenRCT2/pull/3639.patch","issue_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/3639","number":3639,"state":"open","locked":false,"title":"Decompile scenery_paint","user":{"login":"zsilencer","id":5456638,"avatar_url":"https://avatars.githubusercontent.com/u/5456638?v=3","gravatar_id":"","url":"https://api.github.com/users/zsilencer","html_url":"https://github.com/zsilencer","followers_url":"https://api.github.com/users/zsilencer/followers","following_url":"https://api.github.com/users/zsilencer/following{/other_user}","gists_url":"https://api.github.com/users/zsilencer/gists{/gist_id}","starred_url":"https://api.github.com/users/zsilencer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsilencer/subscriptions","organizations_url":"https://api.github.com/users/zsilencer/orgs","repos_url":"https://api.github.com/users/zsilencer/repos","events_url":"https://api.github.com/users/zsilencer/events{/privacy}","received_events_url":"https://api.github.com/users/zsilencer/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-17T00:07:19Z","updated_at":"2016-05-17T07:23:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ff5ab17c04b9f4e7c363f9490a81f517ccca403","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639/commits","review_comments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639/comments","review_comment_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/3639/comments","statuses_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/statuses/5ae809148dada4addccdea4314892c52626cb173","head":{"label":"zsilencer:paint-setup/scenery","ref":"paint-setup/scenery","sha":"5ae809148dada4addccdea4314892c52626cb173","user":{"login":"zsilencer","id":5456638,"avatar_url":"https://avatars.githubusercontent.com/u/5456638?v=3","gravatar_id":"","url":"https://api.github.com/users/zsilencer","html_url":"https://github.com/zsilencer","followers_url":"https://api.github.com/users/zsilencer/followers","following_url":"https://api.github.com/users/zsilencer/following{/other_user}","gists_url":"https://api.github.com/users/zsilencer/gists{/gist_id}","starred_url":"https://api.github.com/users/zsilencer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsilencer/subscriptions","organizations_url":"https://api.github.com/users/zsilencer/orgs","repos_url":"https://api.github.com/users/zsilencer/repos","events_url":"https://api.github.com/users/zsilencer/events{/privacy}","received_events_url":"https://api.github.com/users/zsilencer/received_events","type":"User","site_admin":false},"repo":{"id":23203097,"name":"OpenRCT2","full_name":"zsilencer/OpenRCT2","owner":{"login":"zsilencer","id":5456638,"avatar_url":"https://avatars.githubusercontent.com/u/5456638?v=3","gravatar_id":"","url":"https://api.github.com/users/zsilencer","html_url":"https://github.com/zsilencer","followers_url":"https://api.github.com/users/zsilencer/followers","following_url":"https://api.github.com/users/zsilencer/following{/other_user}","gists_url":"https://api.github.com/users/zsilencer/gists{/gist_id}","starred_url":"https://api.github.com/users/zsilencer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsilencer/subscriptions","organizations_url":"https://api.github.com/users/zsilencer/orgs","repos_url":"https://api.github.com/users/zsilencer/repos","events_url":"https://api.github.com/users/zsilencer/events{/privacy}","received_events_url":"https://api.github.com/users/zsilencer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zsilencer/OpenRCT2","description":"An open source clone of Roller Coaster Tycoon 2 built by decompiling the original game one bit at a time.","fork":true,"url":"https://api.github.com/repos/zsilencer/OpenRCT2","forks_url":"https://api.github.com/repos/zsilencer/OpenRCT2/forks","keys_url":"https://api.github.com/repos/zsilencer/OpenRCT2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zsilencer/OpenRCT2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zsilencer/OpenRCT2/teams","hooks_url":"https://api.github.com/repos/zsilencer/OpenRCT2/hooks","issue_events_url":"https://api.github.com/repos/zsilencer/OpenRCT2/issues/events{/number}","events_url":"https://api.github.com/repos/zsilencer/OpenRCT2/events","assignees_url":"https://api.github.com/repos/zsilencer/OpenRCT2/assignees{/user}","branches_url":"https://api.github.com/repos/zsilencer/OpenRCT2/branches{/branch}","tags_url":"https://api.github.com/repos/zsilencer/OpenRCT2/tags","blobs_url":"https://api.github.com/repos/zsilencer/OpenRCT2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zsilencer/OpenRCT2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zsilencer/OpenRCT2/git/refs{/sha}","trees_url":"https://api.github.com/repos/zsilencer/OpenRCT2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zsilencer/OpenRCT2/statuses/{sha}","languages_url":"https://api.github.com/repos/zsilencer/OpenRCT2/languages","stargazers_url":"https://api.github.com/repos/zsilencer/OpenRCT2/stargazers","contributors_url":"https://api.github.com/repos/zsilencer/OpenRCT2/contributors","subscribers_url":"https://api.github.com/repos/zsilencer/OpenRCT2/subscribers","subscription_url":"https://api.github.com/repos/zsilencer/OpenRCT2/subscription","commits_url":"https://api.github.com/repos/zsilencer/OpenRCT2/commits{/sha}","git_commits_url":"https://api.github.com/repos/zsilencer/OpenRCT2/git/commits{/sha}","comments_url":"https://api.github.com/repos/zsilencer/OpenRCT2/comments{/number}","issue_comment_url":"https://api.github.com/repos/zsilencer/OpenRCT2/issues/comments{/number}","contents_url":"https://api.github.com/repos/zsilencer/OpenRCT2/contents/{+path}","compare_url":"https://api.github.com/repos/zsilencer/OpenRCT2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zsilencer/OpenRCT2/merges","archive_url":"https://api.github.com/repos/zsilencer/OpenRCT2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zsilencer/OpenRCT2/downloads","issues_url":"https://api.github.com/repos/zsilencer/OpenRCT2/issues{/number}","pulls_url":"https://api.github.com/repos/zsilencer/OpenRCT2/pulls{/number}","milestones_url":"https://api.github.com/repos/zsilencer/OpenRCT2/milestones{/number}","notifications_url":"https://api.github.com/repos/zsilencer/OpenRCT2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zsilencer/OpenRCT2/labels{/name}","releases_url":"https://api.github.com/repos/zsilencer/OpenRCT2/releases{/id}","deployments_url":"https://api.github.com/repos/zsilencer/OpenRCT2/deployments","created_at":"2014-08-21T21:08:11Z","updated_at":"2015-05-07T01:15:22Z","pushed_at":"2016-05-17T00:03:05Z","git_url":"git://github.com/zsilencer/OpenRCT2.git","ssh_url":"git@github.com:zsilencer/OpenRCT2.git","clone_url":"https://github.com/zsilencer/OpenRCT2.git","svn_url":"https://github.com/zsilencer/OpenRCT2","homepage":null,"size":34727,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"OpenRCT2:develop","ref":"develop","sha":"680c33d30f0b00d49d43129920bd6a8e8920e54f","user":{"login":"OpenRCT2","id":8473908,"avatar_url":"https://avatars.githubusercontent.com/u/8473908?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRCT2","html_url":"https://github.com/OpenRCT2","followers_url":"https://api.github.com/users/OpenRCT2/followers","following_url":"https://api.github.com/users/OpenRCT2/following{/other_user}","gists_url":"https://api.github.com/users/OpenRCT2/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRCT2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRCT2/subscriptions","organizations_url":"https://api.github.com/users/OpenRCT2/orgs","repos_url":"https://api.github.com/users/OpenRCT2/repos","events_url":"https://api.github.com/users/OpenRCT2/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRCT2/received_events","type":"Organization","site_admin":false},"repo":{"id":18348651,"name":"OpenRCT2","full_name":"OpenRCT2/OpenRCT2","owner":{"login":"OpenRCT2","id":8473908,"avatar_url":"https://avatars.githubusercontent.com/u/8473908?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRCT2","html_url":"https://github.com/OpenRCT2","followers_url":"https://api.github.com/users/OpenRCT2/followers","following_url":"https://api.github.com/users/OpenRCT2/following{/other_user}","gists_url":"https://api.github.com/users/OpenRCT2/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRCT2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRCT2/subscriptions","organizations_url":"https://api.github.com/users/OpenRCT2/orgs","repos_url":"https://api.github.com/users/OpenRCT2/repos","events_url":"https://api.github.com/users/OpenRCT2/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRCT2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenRCT2/OpenRCT2","description":"An open source re-implementation of Roller Coaster Tycoon 2.","fork":false,"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2","forks_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/forks","keys_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/teams","hooks_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/hooks","issue_events_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/events{/number}","events_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/events","assignees_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/assignees{/user}","branches_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/branches{/branch}","tags_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/tags","blobs_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/languages","stargazers_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/stargazers","contributors_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/contributors","subscribers_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/subscribers","subscription_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/subscription","commits_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/contents/{+path}","compare_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/merges","archive_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/downloads","issues_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues{/number}","pulls_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/labels{/name}","releases_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/releases{/id}","deployments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/deployments","created_at":"2014-04-01T23:32:25Z","updated_at":"2016-05-17T00:11:39Z","pushed_at":"2016-05-17T07:06:14Z","git_url":"git://github.com/OpenRCT2/OpenRCT2.git","ssh_url":"git@github.com:OpenRCT2/OpenRCT2.git","clone_url":"https://github.com/OpenRCT2/OpenRCT2.git","svn_url":"https://github.com/OpenRCT2/OpenRCT2","homepage":"http://openrct2.website","size":61313,"stargazers_count":1817,"watchers_count":1817,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":334,"mirror_url":null,"open_issues_count":503,"forks":334,"open_issues":503,"watchers":1817,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639"},"html":{"href":"https://github.com/OpenRCT2/OpenRCT2/pull/3639"},"issue":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/3639"},"comments":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/3639/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/3639/commits"},"statuses":{"href":"https://api.github.com/repos/OpenRCT2/OpenRCT2/statuses/5ae809148dada4addccdea4314892c52626cb173"}}}}