GitHub PullRequestReviewCommentEvent at 2014-06-20 09:08:35
Repository: residualvm
Actor: somaen
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/residualvm/residualvm/pulls/comments/14011892","id":14011892,"diff_hunk":"@@ -158,68 +77,118 @@ void memset_l(void *adr, int val, int count) {\n \t\t*p++ = val;\n }\n \n-void ZB_clear(ZBuffer *zb, int clear_z, int z, int clear_color, int r, int g, int b) {\n-\tuint32 color;\n-\tbyte *pp;\n+FrameBuffer::FrameBuffer(int xsize, int ysize, const Graphics::PixelBuffer &frame_buffer) {\n+\tint size;\n \n-\tif (clear_z) {\n-\t\tmemset_l(zb->zbuf, z, zb->xsize * zb->ysize);\n-\t}\n-\tif (clear_color) {\n-\t\tpp = zb->pbuf.getRawBuffer();\n-\t\tfor (int y = 0; y < zb->ysize; y++) {\n-\t\t\tcolor = zb->cmode.RGBToColor(r, g, b);\n-\t\t\tmemset_s(pp, color, zb->xsize);\n-\t\t\tpp = pp + zb->linesize;\n-\t\t}\n+\tthis->xsize = xsize;\n+\tthis->ysize = ysize;\n+\tthis->cmode = frame_buffer.getFormat();\n+\tPSZB = this->pixelbytes = this->cmode.bytesPerPixel;\n+\tthis->pixelbits = this->cmode.bytesPerPixel * 8;\n+\tthis->linesize = (xsize * this->pixelbytes + 3) & ~3;\n+\n+\tsize = this->xsize * this->ysize * sizeof(unsigned int);\n+\n+\tthis->zbuf = (unsigned int *)gl_malloc(size);\n+\n+\tif (!frame_buffer) {\n+\t\tbyte *pbuf = (byte *)gl_malloc(this->ysize * this->linesize);\n+\t\tthis->pbuf.set(this->cmode, pbuf);\n+\t\tthis->frame_buffer_allocated = 1;\n+\t} else {\n+\t\tthis->frame_buffer_allocated = 0;\n+\t\tthis->pbuf = frame_buffer;\n \t}\n+\n+\tthis->current_texture = NULL;\n+\tthis->shadow_mask_buf = NULL;\n+\n+\tthis->buffer.pbuf = this->pbuf.getRawBuffer();\n+\tthis->buffer.zbuf = this->zbuf;\n+\t_blendingEnabled = false;\n+}\n+\n+FrameBuffer::~FrameBuffer() {\n+\tif (frame_buffer_allocated)\n+\t\tpbuf.free();\n+\tgl_free(zbuf);\n }\n \n-Buffer *ZB_genOffscreenBuffer(ZBuffer *zb) {\n+Buffer* FrameBuffer::genOffscreenBuffer() {\n \tBuffer *buf = (Buffer *)gl_malloc(sizeof(Buffer));\n-\tbuf->pbuf = (byte *)gl_malloc(zb->ysize * zb->linesize);\n-\tint size = zb->xsize * zb->ysize * sizeof(unsigned int);\n+\tbuf->pbuf = (byte *)gl_malloc(this->ysize * this->linesize);\n+\tint size = this->xsize * this->ysize * sizeof(unsigned int);\n \tbuf->zbuf = (unsigned int *)gl_malloc(size);\n \n \treturn buf;\n }\n \n-void ZB_delOffscreenBuffer(ZBuffer *zb, Buffer *buf) {\n+void FrameBuffer::delOffscreenBuffer(Buffer *buf) {\n \tgl_free(buf->pbuf);\n \tgl_free(buf->zbuf);\n \tgl_free(buf);\n }\n \n-void ZB_blitOffscreenBuffer(ZBuffer *zb, Buffer *buf) {\n+void FrameBuffer::clear(int clear_z, int z, int clear_color, int r, int g, int b) {","path":"graphics/tinygl/zbuffer.cpp","position":179,"original_position":179,"commit_id":"fd7ace1c4bc415432861c829d382b267e20dfa49","original_commit_id":"fd7ace1c4bc415432861c829d382b267e20dfa49","user":{"login":"somaen","id":543402,"avatar_url":"https://avatars.githubusercontent.com/u/543402?","gravatar_id":"56a5794477b5e955b43be3eac341b358","url":"https://api.github.com/users/somaen","html_url":"https://github.com/somaen","followers_url":"https://api.github.com/users/somaen/followers","following_url":"https://api.github.com/users/somaen/following{/other_user}","gists_url":"https://api.github.com/users/somaen/gists{/gist_id}","starred_url":"https://api.github.com/users/somaen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/somaen/subscriptions","organizations_url":"https://api.github.com/users/somaen/orgs","repos_url":"https://api.github.com/users/somaen/repos","events_url":"https://api.github.com/users/somaen/events{/privacy}","received_events_url":"https://api.github.com/users/somaen/received_events","type":"User","site_admin":false},"body":"in general, camelCase is prefered to under_score_separation","created_at":"2014-06-20T09:08:35Z","updated_at":"2014-06-20T09:08:35Z","html_url":"https://github.com/residualvm/residualvm/pull/937#discussion_r14011892","pull_request_url":"https://api.github.com/repos/residualvm/residualvm/pulls/937","_links":{"self":{"href":"https://api.github.com/repos/residualvm/residualvm/pulls/comments/14011892"},"html":{"href":"https://github.com/residualvm/residualvm/pull/937#discussion_r14011892"},"pull_request":{"href":"https://api.github.com/repos/residualvm/residualvm/pulls/937"}}},"pull_request":{"url":"https://api.github.com/repos/residualvm/residualvm/pulls/937","id":17377363,"html_url":"https://github.com/residualvm/residualvm/pull/937","diff_url":"https://github.com/residualvm/residualvm/pull/937.diff","patch_url":"https://github.com/residualvm/residualvm/pull/937.patch","issue_url":"https://api.github.com/repos/residualvm/residualvm/issues/937","number":937,"state":"open","title":"TINYGL: glBlendFunc Implementation","user":{"login":"subr3v","id":5153412,"avatar_url":"https://avatars.githubusercontent.com/u/5153412?","gravatar_id":"76c3bbee0e912b0afd37d1d3c7ffbcdc","url":"https://api.github.com/users/subr3v","html_url":"https://github.com/subr3v","followers_url":"https://api.github.com/users/subr3v/followers","following_url":"https://api.github.com/users/subr3v/following{/other_user}","gists_url":"https://api.github.com/users/subr3v/gists{/gist_id}","starred_url":"https://api.github.com/users/subr3v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subr3v/subscriptions","organizations_url":"https://api.github.com/users/subr3v/orgs","repos_url":"https://api.github.com/users/subr3v/repos","events_url":"https://api.github.com/users/subr3v/events{/privacy}","received_events_url":"https://api.github.com/users/subr3v/received_events","type":"User","site_admin":false},"body":"This pull request contains all the code for the task \"implementing an openGL compliant version of the function glBlendFunc\".","created_at":"2014-06-19T21:29:26Z","updated_at":"2014-06-20T09:08:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/residualvm/residualvm/pulls/937/commits","review_comments_url":"https://api.github.com/repos/residualvm/residualvm/pulls/937/comments","review_comment_url":"https://api.github.com/repos/residualvm/residualvm/pulls/comments/{number}","comments_url":"https://api.github.com/repos/residualvm/residualvm/issues/937/comments","statuses_url":"https://api.github.com/repos/residualvm/residualvm/statuses/fd7ace1c4bc415432861c829d382b267e20dfa49","head":{"label":"subr3v:glBlend-implementation","ref":"glBlend-implementation","sha":"fd7ace1c4bc415432861c829d382b267e20dfa49","user":{"login":"subr3v","id":5153412,"avatar_url":"https://avatars.githubusercontent.com/u/5153412?","gravatar_id":"76c3bbee0e912b0afd37d1d3c7ffbcdc","url":"https://api.github.com/users/subr3v","html_url":"https://github.com/subr3v","followers_url":"https://api.github.com/users/subr3v/followers","following_url":"https://api.github.com/users/subr3v/following{/other_user}","gists_url":"https://api.github.com/users/subr3v/gists{/gist_id}","starred_url":"https://api.github.com/users/subr3v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subr3v/subscriptions","organizations_url":"https://api.github.com/users/subr3v/orgs","repos_url":"https://api.github.com/users/subr3v/repos","events_url":"https://api.github.com/users/subr3v/events{/privacy}","received_events_url":"https://api.github.com/users/subr3v/received_events","type":"User","site_admin":false},"repo":{"id":19983316,"name":"residualvm","full_name":"subr3v/residualvm","owner":{"login":"subr3v","id":5153412,"avatar_url":"https://avatars.githubusercontent.com/u/5153412?","gravatar_id":"76c3bbee0e912b0afd37d1d3c7ffbcdc","url":"https://api.github.com/users/subr3v","html_url":"https://github.com/subr3v","followers_url":"https://api.github.com/users/subr3v/followers","following_url":"https://api.github.com/users/subr3v/following{/other_user}","gists_url":"https://api.github.com/users/subr3v/gists{/gist_id}","starred_url":"https://api.github.com/users/subr3v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subr3v/subscriptions","organizations_url":"https://api.github.com/users/subr3v/orgs","repos_url":"https://api.github.com/users/subr3v/repos","events_url":"https://api.github.com/users/subr3v/events{/privacy}","received_events_url":"https://api.github.com/users/subr3v/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/subr3v/residualvm","description":"ResidualVM main repository","fork":true,"url":"https://api.github.com/repos/subr3v/residualvm","forks_url":"https://api.github.com/repos/subr3v/residualvm/forks","keys_url":"https://api.github.com/repos/subr3v/residualvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/subr3v/residualvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/subr3v/residualvm/teams","hooks_url":"https://api.github.com/repos/subr3v/residualvm/hooks","issue_events_url":"https://api.github.com/repos/subr3v/residualvm/issues/events{/number}","events_url":"https://api.github.com/repos/subr3v/residualvm/events","assignees_url":"https://api.github.com/repos/subr3v/residualvm/assignees{/user}","branches_url":"https://api.github.com/repos/subr3v/residualvm/branches{/branch}","tags_url":"https://api.github.com/repos/subr3v/residualvm/tags","blobs_url":"https://api.github.com/repos/subr3v/residualvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/subr3v/residualvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/subr3v/residualvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/subr3v/residualvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/subr3v/residualvm/statuses/{sha}","languages_url":"https://api.github.com/repos/subr3v/residualvm/languages","stargazers_url":"https://api.github.com/repos/subr3v/residualvm/stargazers","contributors_url":"https://api.github.com/repos/subr3v/residualvm/contributors","subscribers_url":"https://api.github.com/repos/subr3v/residualvm/subscribers","subscription_url":"https://api.github.com/repos/subr3v/residualvm/subscription","commits_url":"https://api.github.com/repos/subr3v/residualvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/subr3v/residualvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/subr3v/residualvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/subr3v/residualvm/issues/comments/{number}","contents_url":"https://api.github.com/repos/subr3v/residualvm/contents/{+path}","compare_url":"https://api.github.com/repos/subr3v/residualvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/subr3v/residualvm/merges","archive_url":"https://api.github.com/repos/subr3v/residualvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/subr3v/residualvm/downloads","issues_url":"https://api.github.com/repos/subr3v/residualvm/issues{/number}","pulls_url":"https://api.github.com/repos/subr3v/residualvm/pulls{/number}","milestones_url":"https://api.github.com/repos/subr3v/residualvm/milestones{/number}","notifications_url":"https://api.github.com/repos/subr3v/residualvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/subr3v/residualvm/labels{/name}","releases_url":"https://api.github.com/repos/subr3v/residualvm/releases{/id}","created_at":"2014-05-20T14:07:24Z","updated_at":"2014-06-19T21:29:26Z","pushed_at":"2014-06-19T15:30:51Z","git_url":"git://github.com/subr3v/residualvm.git","ssh_url":"git@github.com:subr3v/residualvm.git","clone_url":"https://github.com/subr3v/residualvm.git","svn_url":"https://github.com/subr3v/residualvm","homepage":"http://residualvm.org","size":18031,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"residualvm:master","ref":"master","sha":"c053a688075c309bb0a26d7c68e938e89bd6b5bb","user":{"login":"residualvm","id":679821,"avatar_url":"https://avatars.githubusercontent.com/u/679821?","gravatar_id":"7761a5514fdb424dc90679c290363355","url":"https://api.github.com/users/residualvm","html_url":"https://github.com/residualvm","followers_url":"https://api.github.com/users/residualvm/followers","following_url":"https://api.github.com/users/residualvm/following{/other_user}","gists_url":"https://api.github.com/users/residualvm/gists{/gist_id}","starred_url":"https://api.github.com/users/residualvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/residualvm/subscriptions","organizations_url":"https://api.github.com/users/residualvm/orgs","repos_url":"https://api.github.com/users/residualvm/repos","events_url":"https://api.github.com/users/residualvm/events{/privacy}","received_events_url":"https://api.github.com/users/residualvm/received_events","type":"Organization","site_admin":false},"repo":{"id":1503443,"name":"residualvm","full_name":"residualvm/residualvm","owner":{"login":"residualvm","id":679821,"avatar_url":"https://avatars.githubusercontent.com/u/679821?","gravatar_id":"7761a5514fdb424dc90679c290363355","url":"https://api.github.com/users/residualvm","html_url":"https://github.com/residualvm","followers_url":"https://api.github.com/users/residualvm/followers","following_url":"https://api.github.com/users/residualvm/following{/other_user}","gists_url":"https://api.github.com/users/residualvm/gists{/gist_id}","starred_url":"https://api.github.com/users/residualvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/residualvm/subscriptions","organizations_url":"https://api.github.com/users/residualvm/orgs","repos_url":"https://api.github.com/users/residualvm/repos","events_url":"https://api.github.com/users/residualvm/events{/privacy}","received_events_url":"https://api.github.com/users/residualvm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/residualvm/residualvm","description":"ResidualVM main repository","fork":false,"url":"https://api.github.com/repos/residualvm/residualvm","forks_url":"https://api.github.com/repos/residualvm/residualvm/forks","keys_url":"https://api.github.com/repos/residualvm/residualvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/residualvm/residualvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/residualvm/residualvm/teams","hooks_url":"https://api.github.com/repos/residualvm/residualvm/hooks","issue_events_url":"https://api.github.com/repos/residualvm/residualvm/issues/events{/number}","events_url":"https://api.github.com/repos/residualvm/residualvm/events","assignees_url":"https://api.github.com/repos/residualvm/residualvm/assignees{/user}","branches_url":"https://api.github.com/repos/residualvm/residualvm/branches{/branch}","tags_url":"https://api.github.com/repos/residualvm/residualvm/tags","blobs_url":"https://api.github.com/repos/residualvm/residualvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/residualvm/residualvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/residualvm/residualvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/residualvm/residualvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/residualvm/residualvm/statuses/{sha}","languages_url":"https://api.github.com/repos/residualvm/residualvm/languages","stargazers_url":"https://api.github.com/repos/residualvm/residualvm/stargazers","contributors_url":"https://api.github.com/repos/residualvm/residualvm/contributors","subscribers_url":"https://api.github.com/repos/residualvm/residualvm/subscribers","subscription_url":"https://api.github.com/repos/residualvm/residualvm/subscription","commits_url":"https://api.github.com/repos/residualvm/residualvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/residualvm/residualvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/residualvm/residualvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/residualvm/residualvm/issues/comments/{number}","contents_url":"https://api.github.com/repos/residualvm/residualvm/contents/{+path}","compare_url":"https://api.github.com/repos/residualvm/residualvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/residualvm/residualvm/merges","archive_url":"https://api.github.com/repos/residualvm/residualvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/residualvm/residualvm/downloads","issues_url":"https://api.github.com/repos/residualvm/residualvm/issues{/number}","pulls_url":"https://api.github.com/repos/residualvm/residualvm/pulls{/number}","milestones_url":"https://api.github.com/repos/residualvm/residualvm/milestones{/number}","notifications_url":"https://api.github.com/repos/residualvm/residualvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/residualvm/residualvm/labels{/name}","releases_url":"https://api.github.com/repos/residualvm/residualvm/releases{/id}","created_at":"2011-03-20T15:50:51Z","updated_at":"2014-06-19T22:18:52Z","pushed_at":"2014-06-19T22:18:51Z","git_url":"git://github.com/residualvm/residualvm.git","ssh_url":"git@github.com:residualvm/residualvm.git","clone_url":"https://github.com/residualvm/residualvm.git","svn_url":"https://github.com/residualvm/residualvm","homepage":"http://residualvm.org","size":24580,"stargazers_count":142,"watchers_count":142,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":60,"mirror_url":null,"open_issues_count":114,"forks":60,"open_issues":114,"watchers":142,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/residualvm/residualvm/pulls/937"},"html":{"href":"https://github.com/residualvm/residualvm/pull/937"},"issue":{"href":"https://api.github.com/repos/residualvm/residualvm/issues/937"},"comments":{"href":"https://api.github.com/repos/residualvm/residualvm/issues/937/comments"},"review_comments":{"href":"https://api.github.com/repos/residualvm/residualvm/pulls/937/comments"},"review_comment":{"href":"https://api.github.com/repos/residualvm/residualvm/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/residualvm/residualvm/pulls/937/commits"},"statuses":{"href":"https://api.github.com/repos/residualvm/residualvm/statuses/fd7ace1c4bc415432861c829d382b267e20dfa49"}}}}