Merge lp:~smspillaz/compiz/compiz.feature_1069112.cubeaddon into lp:compiz/0.9.9
- compiz.feature_1069112.cubeaddon
- Merge into 0.9.9
Status: | Superseded |
---|---|
Proposed branch: | lp:~smspillaz/compiz/compiz.feature_1069112.cubeaddon |
Merge into: | lp:compiz/0.9.9 |
Diff against target: |
885 lines (+336/-198) 5 files modified
debian/compiz-plugins.install (+2/-0) plugins/CMakeLists.txt (+0/-1) plugins/cubeaddon/src/cubeaddon.cpp (+316/-183) plugins/cubeaddon/src/cubeaddon.h (+17/-13) plugins/opengl/src/screen.cpp (+1/-1) |
To merge this branch: | bzr merge lp:~smspillaz/compiz/compiz.feature_1069112.cubeaddon |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Daniel van Vugt | Needs Resubmitting | ||
MC Return | Approve | ||
Review via email: mp+141258@code.launchpad.net |
This proposal supersedes a proposal from 2012-12-26.
This proposal has been superseded by a proposal from 2013-01-04.
Commit message
Port cubeaddon plugin to use new OpenGL plugin API.
(LP: #1020823)
Since the arrangement of the vertex data assumes quad usage, and GL_QUADS primitives are not available in OpenGL|ES, the option "deform caps" will be nonfunctional in OpenGL|ES builds.
Description of the change
Port cubeaddon plugin to use new OpenGL plugin API.
Since the arrangement of the vertex data assumes quad usage, and GL_QUADS primitives are not available in OpenGL|ES, the option "deform caps" will be nonfunctional in OpenGL|ES builds.
PS Jenkins bot (ps-jenkins) wrote : | # |
MC Return (mc-return) wrote : | # |
\o/
GREAT JOB! Compiles and works perfectly.
(Had to remove #set (COMPIZ_
Awesome to see long-time Compiz features come back !!!
- 3533. By Sam Spilsbury
-
Adjust buildsystem
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3533
http://
Executed test runs:
FAILURE: http://
Click here to trigger a rebuild:
http://
- 3534. By Sam Spilsbury
-
Install images too
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3534
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
BUILD_GLES fails:
/home/dan/
/home/dan/
make[2]: *** [plugins/
make[1]: *** [plugins/
make[1]: *** Waiting for unfinished jobs....
----
Clang also fails:
In file included from /home/dan/
/home/dan/
'
[
bool glDraw (const GLMatrix&, GLWindowPaintAt
^
/home/dan/
hidden overloaded virtual function 'GLWindowInterf
here
virtual bool glDraw (const GLMatrix &matrix,
In file included from /home/dan/
/home/dan/
'
[
void glDrawTexture (GLTexture *,
^
/home/dan/
hidden overloaded virtual function 'GLWindowInterf
declared here
virtual void glDrawTexture (GLTexture *texture, const GLMatrix &,
2 errors generated.
Sam Spilsbury (smspillaz) wrote : | # |
Ah, thanks. I'll handle that now.
Sam Spilsbury (smspillaz) wrote : | # |
(A note that we really really really really really really really need to have CI do BUILD_GLES and clang, the fact that reviewers are building code is silly)
Sam Spilsbury (smspillaz) wrote : | # |
Fixed.
- 3535. By Sam Spilsbury
-
Merge compiz.fix_1095915
- 3536. By Sam Spilsbury
-
Fix build errors with clang / gles
Daniel van Vugt (vanvugt) wrote : | # |
Not fixed. Latest revision on this branch is 26 December still :)
Sam Spilsbury (smspillaz) wrote : | # |
Ah of course, branch aliases -.-
Really fixed.
Daniel van Vugt (vanvugt) wrote : | # |
gcc 4.7.2 (quantal) BUILD_GLES:
/home/dan/
/home/dan/
Seems to be the same change from:
https:/
so please add a prereq on that one.
- 3537. By Sam Spilsbury
-
Merge compiz.fix_1095915
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3536
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 3538. By Sam Spilsbury
-
Use array instead of vector
- 3539. By Sam Spilsbury
-
Add cubeaddon to compiz-
plugins. install. arm*
Unmerged revisions
Preview Diff
1 | === modified file 'debian/compiz-plugins.install' | |||
2 | --- debian/compiz-plugins.install 2012-08-24 13:41:00 +0000 | |||
3 | +++ debian/compiz-plugins.install 2013-01-04 07:52:23 +0000 | |||
4 | @@ -6,6 +6,8 @@ | |||
5 | 6 | debian/tmp/usr/*/compiz/*copytex.* | 6 | debian/tmp/usr/*/compiz/*copytex.* |
6 | 7 | debian/tmp/usr/*/compiz/*crashhandler.* | 7 | debian/tmp/usr/*/compiz/*crashhandler.* |
7 | 8 | debian/tmp/usr/*/compiz/*cube.* | 8 | debian/tmp/usr/*/compiz/*cube.* |
8 | 9 | debian/tmp/usr/*/compiz/*cubeaddon.* | ||
9 | 10 | debian/tmp/usr/share/compiz/cubeaddon | ||
10 | 9 | debian/tmp/usr/*/compiz/*dbus.* | 11 | debian/tmp/usr/*/compiz/*dbus.* |
11 | 10 | debian/tmp/usr/*/compiz/*extrawm.* | 12 | debian/tmp/usr/*/compiz/*extrawm.* |
12 | 11 | debian/tmp/usr/*/compiz/*fadedesktop.* | 13 | debian/tmp/usr/*/compiz/*fadedesktop.* |
13 | 12 | 14 | ||
14 | === modified file 'plugins/CMakeLists.txt' | |||
15 | --- plugins/CMakeLists.txt 2012-07-20 13:28:42 +0000 | |||
16 | +++ plugins/CMakeLists.txt 2013-01-04 07:52:23 +0000 | |||
17 | @@ -30,7 +30,6 @@ | |||
18 | 30 | set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON) | 30 | set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON) |
19 | 31 | set (COMPIZ_DISABLE_PLUGIN_BLUR ON) | 31 | set (COMPIZ_DISABLE_PLUGIN_BLUR ON) |
20 | 32 | set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON) | 32 | set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON) |
21 | 33 | set (COMPIZ_DISABLE_PLUGIN_CUBEADDON ON) | ||
22 | 34 | set (COMPIZ_DISABLE_PLUGIN_GEARS ON) | 33 | set (COMPIZ_DISABLE_PLUGIN_GEARS ON) |
23 | 35 | set (COMPIZ_DISABLE_PLUGIN_GROUP ON) | 34 | set (COMPIZ_DISABLE_PLUGIN_GROUP ON) |
24 | 36 | set (COMPIZ_DISABLE_PLUGIN_LOGINOUT ON) | 35 | set (COMPIZ_DISABLE_PLUGIN_LOGINOUT ON) |
25 | 37 | 36 | ||
26 | === modified file 'plugins/cubeaddon/src/cubeaddon.cpp' | |||
27 | --- plugins/cubeaddon/src/cubeaddon.cpp 2012-11-18 00:26:33 +0000 | |||
28 | +++ plugins/cubeaddon/src/cubeaddon.cpp 2013-01-04 07:52:23 +0000 | |||
29 | @@ -27,15 +27,7 @@ | |||
30 | 27 | 27 | ||
31 | 28 | COMPIZ_PLUGIN_20090315 (cubeaddon, CubeaddonPluginVTable); | 28 | COMPIZ_PLUGIN_20090315 (cubeaddon, CubeaddonPluginVTable); |
32 | 29 | 29 | ||
42 | 30 | const unsigned short CUBEADDON_GRID_SIZE = 100; | 30 | unsigned short COLORMAX = 0xffff; |
34 | 31 | const unsigned short CAP_ELEMENTS = 15; | ||
35 | 32 | const unsigned int CAP_NVERTEX = (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3); | ||
36 | 33 | const unsigned int CAP_NIDX = (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4); | ||
37 | 34 | |||
38 | 35 | const unsigned int CAP_NIMGVERTEX = (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5); | ||
39 | 36 | const unsigned int CAP_NIMGIDX = (CAP_ELEMENTS * CAP_ELEMENTS * 4); | ||
40 | 37 | |||
41 | 38 | const float RAD2I1024 = 162.9746617f; | ||
43 | 39 | 31 | ||
44 | 40 | /* | 32 | /* |
45 | 41 | * Initiate a CubeCap | 33 | * Initiate a CubeCap |
46 | @@ -118,10 +110,13 @@ | |||
47 | 118 | { | 110 | { |
48 | 119 | if (GL::textureBorderClamp) | 111 | if (GL::textureBorderClamp) |
49 | 120 | { | 112 | { |
50 | 113 | #ifndef USE_GLES | ||
51 | 114 | /* FIXME: Simulate with shaders */ | ||
52 | 121 | glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_S, | 115 | glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_S, |
53 | 122 | GL_CLAMP_TO_BORDER); | 116 | GL_CLAMP_TO_BORDER); |
54 | 123 | glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_T, | 117 | glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_T, |
55 | 124 | GL_CLAMP_TO_BORDER); | 118 | GL_CLAMP_TO_BORDER); |
56 | 119 | #endif | ||
57 | 125 | } | 120 | } |
58 | 126 | else | 121 | else |
59 | 127 | { | 122 | { |
60 | @@ -213,42 +208,62 @@ | |||
61 | 213 | { | 208 | { |
62 | 214 | float i; | 209 | float i; |
63 | 215 | 210 | ||
64 | 216 | glPushMatrix (); | ||
65 | 217 | |||
66 | 218 | glEnable (GL_BLEND); | 211 | glEnable (GL_BLEND); |
67 | 219 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 212 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
68 | 220 | |||
69 | 221 | glLoadIdentity (); | ||
70 | 222 | glTranslatef (0.0, 0.0, -DEFAULT_Z_CAMERA); | ||
71 | 223 | |||
72 | 224 | i = optionGetIntensity () * 2; | 213 | i = optionGetIntensity () * 2; |
73 | 225 | 214 | ||
82 | 226 | glBegin (GL_QUADS); | 215 | GLMatrix transform; |
83 | 227 | glColor4f (0.0, 0.0, 0.0, MAX (0.0, 1.0 - i) ); | 216 | transform.translate (0.0f, 0.0f, -DEFAULT_Z_CAMERA); |
84 | 228 | glVertex2f (0.5, 0.0); | 217 | |
85 | 229 | glVertex2f (-0.5, 0.0); | 218 | GLfloat ground1Vertices[] = |
86 | 230 | glColor4f (0.0, 0.0, 0.0, MIN (1.0, 1.0 - (i - 1.0) ) ); | 219 | { |
87 | 231 | glVertex2f (-0.5, -0.5); | 220 | -0.5, -0.5, 0.0, |
88 | 232 | glVertex2f (0.5, -0.5); | 221 | 0.5, -0.5, 0.0, |
89 | 233 | glEnd (); | 222 | -0.5, 0.0, 0.0, |
90 | 223 | 0.5, 0.0, 0.0 | ||
91 | 224 | }; | ||
92 | 225 | |||
93 | 226 | unsigned short maxG1Color = MAX (0.0f, 1.0f - i) * 65535; | ||
94 | 227 | unsigned short minG1Color = MIN (1.0, 1.0 - (i - 1.0)) * 65535; | ||
95 | 228 | |||
96 | 229 | GLushort ground1Colors[] = | ||
97 | 230 | { | ||
98 | 231 | 0, 0, 0, maxG1Color, | ||
99 | 232 | 0, 0, 0, maxG1Color, | ||
100 | 233 | 0, 0, 0, minG1Color, | ||
101 | 234 | 0, 0, 0, minG1Color | ||
102 | 235 | }; | ||
103 | 236 | |||
104 | 237 | GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); | ||
105 | 238 | streamingBuffer->begin (GL_TRIANGLE_STRIP); | ||
106 | 239 | |||
107 | 240 | streamingBuffer->addVertices (4, ground1Vertices); | ||
108 | 241 | streamingBuffer->addColors (4, ground1Colors); | ||
109 | 242 | if (streamingBuffer->end ()) | ||
110 | 243 | streamingBuffer->render (transform); | ||
111 | 234 | 244 | ||
112 | 235 | if (optionGetGroundSize () > 0.0) | 245 | if (optionGetGroundSize () > 0.0) |
113 | 236 | { | 246 | { |
122 | 237 | glBegin (GL_QUADS); | 247 | GLfloat ground2Vertices[] = |
123 | 238 | glColor4usv (optionGetGroundColor1 () ); | 248 | { |
124 | 239 | glVertex2f (-0.5, -0.5); | 249 | -0.5, -0.5, 0.0, |
125 | 240 | glVertex2f (0.5, -0.5); | 250 | 0.5, -0.5, 0.0, |
126 | 241 | glColor4usv (optionGetGroundColor2 () ); | 251 | -0.5, static_cast <GLfloat> (-0.5 + optionGetGroundSize ()), 0.0, |
127 | 242 | glVertex2f (0.5, -0.5 + optionGetGroundSize () ); | 252 | 0.5, static_cast <GLfloat> (-0.5 + optionGetGroundSize ()), 0.0 |
128 | 243 | glVertex2f (-0.5, -0.5 + optionGetGroundSize () ); | 253 | }; |
129 | 244 | glEnd (); | 254 | |
130 | 255 | streamingBuffer->begin (GL_TRIANGLE_STRIP); | ||
131 | 256 | streamingBuffer->addColors (1, optionGetGroundColor1 ()); | ||
132 | 257 | streamingBuffer->addColors (1, optionGetGroundColor1 ()); | ||
133 | 258 | streamingBuffer->addColors (1, optionGetGroundColor2 ()); | ||
134 | 259 | streamingBuffer->addColors (1, optionGetGroundColor2 ()); | ||
135 | 260 | streamingBuffer->addVertices (4, ground2Vertices); | ||
136 | 261 | if (streamingBuffer->end ()) | ||
137 | 262 | streamingBuffer->render (transform); | ||
138 | 245 | } | 263 | } |
139 | 246 | 264 | ||
140 | 247 | glColor4usv (defaultColor); | ||
141 | 248 | |||
142 | 249 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | 265 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
143 | 250 | glDisable (GL_BLEND); | 266 | glDisable (GL_BLEND); |
144 | 251 | glPopMatrix (); | ||
145 | 252 | } | 267 | } |
146 | 253 | 268 | ||
147 | 254 | bool | 269 | bool |
148 | @@ -410,7 +425,6 @@ | |||
149 | 410 | 425 | ||
150 | 411 | opacity = cubeScreen->desktopOpacity () * color[3] / 0xffff; | 426 | opacity = cubeScreen->desktopOpacity () * color[3] / 0xffff; |
151 | 412 | 427 | ||
152 | 413 | glPushMatrix (); | ||
153 | 414 | glEnable (GL_BLEND); | 428 | glEnable (GL_BLEND); |
154 | 415 | 429 | ||
155 | 416 | if (top) | 430 | if (top) |
156 | @@ -424,31 +438,29 @@ | |||
157 | 424 | cAspect = optionGetBottomAspect (); | 438 | cAspect = optionGetBottomAspect (); |
158 | 425 | } | 439 | } |
159 | 426 | 440 | ||
160 | 427 | |||
161 | 428 | glDisableClientState (GL_TEXTURE_COORD_ARRAY); | ||
162 | 429 | |||
163 | 430 | if (optionGetDeformation () == DeformationSphere && | ||
164 | 431 | optionGetDeformCaps ()) | ||
165 | 432 | glEnableClientState (GL_NORMAL_ARRAY); | ||
166 | 433 | |||
167 | 434 | glVertexPointer (3, GL_FLOAT, 0, mCapFill); | ||
168 | 435 | |||
169 | 436 | glEnable(GL_CULL_FACE); | 441 | glEnable(GL_CULL_FACE); |
170 | 437 | 442 | ||
171 | 438 | for (l = 0; l < ((cubeScreen->invert () == 1) ? 2 : 1); l++) | 443 | for (l = 0; l < ((cubeScreen->invert () == 1) ? 2 : 1); l++) |
172 | 439 | { | 444 | { |
173 | 440 | if (optionGetDeformation () == DeformationSphere && | ||
174 | 441 | optionGetDeformCaps ()) | ||
175 | 442 | { | ||
176 | 443 | glNormalPointer (GL_FLOAT, 0, (l == 0) ? mCapFill : mCapFillNorm); | ||
177 | 444 | } | ||
178 | 445 | else | ||
179 | 446 | glNormal3f (0.0, (l == 0) ? 1.0 : -1.0, 0.0); | ||
180 | 447 | |||
181 | 448 | glCullFace(((l == 1) ^ top) ? cullInv : cullNorm); | 445 | glCullFace(((l == 1) ^ top) ? cullInv : cullNorm); |
182 | 449 | 446 | ||
183 | 450 | for (i = 0; i < size; i++) | 447 | for (i = 0; i < size; i++) |
184 | 451 | { | 448 | { |
185 | 449 | GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); | ||
186 | 450 | |||
187 | 451 | streamingBuffer->begin (GL_TRIANGLE_FAN); | ||
188 | 452 | |||
189 | 453 | if (optionGetDeformation () == DeformationSphere && | ||
190 | 454 | optionGetDeformCaps ()) | ||
191 | 455 | { | ||
192 | 456 | streamingBuffer->addNormals (CAP_NVERTEX / 3, (l == 0) ? mCapFill : mCapFillNorm); | ||
193 | 457 | } | ||
194 | 458 | else | ||
195 | 459 | { | ||
196 | 460 | GLfloat nonDeformNormals[] = { 0.0f, (l == 0) ? 1.0f : -1.0f, 0.0f }; | ||
197 | 461 | streamingBuffer->addNormals (1, nonDeformNormals); | ||
198 | 462 | } | ||
199 | 463 | |||
200 | 452 | sa = sAttrib; | 464 | sa = sAttrib; |
201 | 453 | sTransform = transform; | 465 | sTransform = transform; |
202 | 454 | if (cubeScreen->invert () == 1) | 466 | if (cubeScreen->invert () == 1) |
203 | @@ -468,33 +480,77 @@ | |||
204 | 468 | 480 | ||
205 | 469 | gScreen->glApplyTransform (sa, output, &sTransform); | 481 | gScreen->glApplyTransform (sa, output, &sTransform); |
206 | 470 | 482 | ||
219 | 471 | glLoadMatrixf (sTransform.getMatrix ()); | 483 | GLMatrix cTransform (sTransform); |
220 | 472 | glTranslatef (cubeScreen->outputXOffset (), -cubeScreen->outputYOffset (), 0.0f); | 484 | cTransform.translate (cubeScreen->outputXOffset (), -cubeScreen->outputYOffset (), 0.0f); |
221 | 473 | glScalef (cubeScreen->outputXScale (), cubeScreen->outputYScale (), 1.0f); | 485 | cTransform.scale (cubeScreen->outputXScale (), cubeScreen->outputYScale (), 1.0f); |
222 | 474 | 486 | cTransform.scale (1.0, cInv, 1.0); | |
223 | 475 | glScalef (1.0, cInv, 1.0); | 487 | |
224 | 476 | 488 | float normalizedOpacity = opacity / static_cast <float> (OPAQUE); | |
225 | 477 | glColor4us (color[0] * opacity / 0xffff, | 489 | float premultColors[] = |
226 | 478 | color[1] * opacity / 0xffff, | 490 | { |
227 | 479 | color[2] * opacity / 0xffff, | 491 | (color[0] / OPAQUE) * normalizedOpacity, |
228 | 480 | opacity); | 492 | (color[1] / OPAQUE) * normalizedOpacity, |
229 | 481 | 493 | (color[2] / OPAQUE) * normalizedOpacity | |
230 | 482 | glDrawArrays (GL_TRIANGLE_FAN, 0, CAP_ELEMENTS + 2); | 494 | }; |
231 | 495 | |||
232 | 496 | streamingBuffer->color4f (premultColors[0], | ||
233 | 497 | premultColors[1], | ||
234 | 498 | premultColors[2], | ||
235 | 499 | normalizedOpacity); | ||
236 | 500 | |||
237 | 501 | streamingBuffer->addVertices (CAP_ELEMENTS + 2, mCapFill); | ||
238 | 502 | if (streamingBuffer->end ()) | ||
239 | 503 | streamingBuffer->render (cTransform); | ||
240 | 504 | |||
241 | 483 | if (optionGetDeformation () == DeformationSphere && | 505 | if (optionGetDeformation () == DeformationSphere && |
242 | 484 | optionGetDeformCaps ()) | 506 | optionGetDeformCaps ()) |
245 | 485 | glDrawElements (GL_QUADS, CAP_NIDX, GL_UNSIGNED_SHORT, | 507 | { |
246 | 486 | mCapFillIdx); | 508 | #ifndef USE_GLES |
247 | 509 | streamingBuffer->begin (GL_QUADS); | ||
248 | 510 | streamingBuffer->color4f (premultColors[0], | ||
249 | 511 | premultColors[1], | ||
250 | 512 | premultColors[2], | ||
251 | 513 | normalizedOpacity); | ||
252 | 514 | streamingBuffer->addNormals (CAP_NVERTEX / 3, (l == 0) ? mCapFill : mCapFillNorm); | ||
253 | 515 | |||
254 | 516 | GLushort *idx = mCapFillIdx; | ||
255 | 517 | std::vector <GLfloat> capVertices; | ||
256 | 518 | |||
257 | 519 | capVertices.reserve (CAP_NIDX * 3); | ||
258 | 520 | |||
259 | 521 | for (unsigned int i = 0; i < CAP_NIDX; ++i) | ||
260 | 522 | { | ||
261 | 523 | unsigned int vertexIndex = idx[i] * 3; | ||
262 | 524 | |||
263 | 525 | capVertices.push_back (mCapFill[vertexIndex]); | ||
264 | 526 | capVertices.push_back (mCapFill[vertexIndex + 1]); | ||
265 | 527 | capVertices.push_back (mCapFill[vertexIndex + 2]); | ||
266 | 528 | } | ||
267 | 529 | |||
268 | 530 | streamingBuffer->addVertices (CAP_NIDX, &capVertices[0]); | ||
269 | 531 | |||
270 | 532 | if (streamingBuffer->end ()) | ||
271 | 533 | streamingBuffer->render (cTransform); | ||
272 | 534 | #endif | ||
273 | 535 | } | ||
274 | 487 | 536 | ||
275 | 488 | if (cap->mLoaded) | 537 | if (cap->mLoaded) |
276 | 489 | { | 538 | { |
278 | 490 | float s_gen[4], t_gen[4]; | 539 | GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); |
279 | 491 | GLMatrix texMat = cap->mTexMat; | 540 | GLMatrix texMat = cap->mTexMat; |
280 | 492 | 541 | ||
281 | 493 | if (cubeScreen->invert () != 1) | 542 | if (cubeScreen->invert () != 1) |
282 | 494 | texMat.scale (-1.0, 1.0, 1.0); | 543 | texMat.scale (-1.0, 1.0, 1.0); |
283 | 495 | 544 | ||
286 | 496 | glColor4us (cubeScreen->desktopOpacity (), cubeScreen->desktopOpacity (), | 545 | streamingBuffer->begin (GL_TRIANGLE_FAN); |
287 | 497 | cubeScreen->desktopOpacity (), cubeScreen->desktopOpacity ()); | 546 | |
288 | 547 | float normalizedOpacity = cubeScreen->desktopOpacity () / OPAQUE; | ||
289 | 548 | |||
290 | 549 | streamingBuffer->color4f (normalizedOpacity, | ||
291 | 550 | normalizedOpacity, | ||
292 | 551 | normalizedOpacity, | ||
293 | 552 | normalizedOpacity); | ||
294 | 553 | |||
295 | 498 | cap->mTexture[0]->enable (GLTexture::Good); | 554 | cap->mTexture[0]->enable (GLTexture::Good); |
296 | 499 | 555 | ||
297 | 500 | if (cAspect) | 556 | if (cAspect) |
298 | @@ -525,61 +581,124 @@ | |||
299 | 525 | 581 | ||
300 | 526 | texMat.rotate (-(360.0f / size) * i, 0.0, 0.0, 1.0); | 582 | texMat.rotate (-(360.0f / size) * i, 0.0, 0.0, 1.0); |
301 | 527 | 583 | ||
321 | 528 | s_gen[0] = texMat[0]; | 584 | GLVector sGen (texMat[0], texMat[8], texMat[4], texMat[12]); |
322 | 529 | s_gen[1] = texMat[8]; | 585 | GLVector tGen (texMat[1], texMat[9], texMat[5], texMat[13]); |
323 | 530 | s_gen[2] = texMat[4]; | 586 | |
324 | 531 | s_gen[3] = texMat[12]; | 587 | std::vector <GLfloat> texCoords; |
325 | 532 | t_gen[0] = texMat[1]; | 588 | |
326 | 533 | t_gen[1] = texMat[9]; | 589 | /* Generate texCoords for the top section of the |
327 | 534 | t_gen[2] = texMat[5]; | 590 | * cap */ |
328 | 535 | t_gen[3] = texMat[13]; | 591 | texCoords.reserve ((CAP_ELEMENTS + 2) * 2); |
329 | 536 | 592 | ||
330 | 537 | glTexGenfv(GL_T, GL_OBJECT_PLANE, t_gen); | 593 | for (unsigned int i = 0; i < CAP_ELEMENTS + 2; i++) |
331 | 538 | glTexGenfv(GL_S, GL_OBJECT_PLANE, s_gen); | 594 | { |
332 | 539 | 595 | GLVector v (mCapFill[i * 3], | |
333 | 540 | glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); | 596 | mCapFill[i * 3 + 1], |
334 | 541 | glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); | 597 | mCapFill[i * 3 + 2], |
335 | 542 | 598 | 1.0f); | |
336 | 543 | glEnable(GL_TEXTURE_GEN_S); | 599 | float s = v * sGen; |
337 | 544 | glEnable(GL_TEXTURE_GEN_T); | 600 | float t = v * tGen; |
338 | 545 | 601 | ||
339 | 546 | glDrawArrays (GL_TRIANGLE_FAN, 0, CAP_ELEMENTS + 2); | 602 | texCoords.push_back (s); |
340 | 603 | texCoords.push_back (t); | ||
341 | 604 | } | ||
342 | 605 | |||
343 | 606 | streamingBuffer->addTexCoords (0, CAP_NVERTEX / 3, &texCoords[0]); | ||
344 | 607 | streamingBuffer->addVertices (CAP_NVERTEX / 3, mCapFill); | ||
345 | 608 | streamingBuffer->setMaxVertices (CAP_ELEMENTS + 2); | ||
346 | 609 | if (streamingBuffer->end ()) | ||
347 | 610 | streamingBuffer->render (cTransform); | ||
348 | 611 | |||
349 | 547 | if (optionGetDeformation () == DeformationSphere && | 612 | if (optionGetDeformation () == DeformationSphere && |
350 | 548 | optionGetDeformCaps ()) | 613 | optionGetDeformCaps ()) |
356 | 549 | glDrawElements (GL_QUADS, CAP_NIDX, GL_UNSIGNED_SHORT, | 614 | { |
357 | 550 | mCapFillIdx); | 615 | #ifndef USE_GLES |
358 | 551 | 616 | streamingBuffer->begin (GL_QUADS); | |
359 | 552 | glDisable(GL_TEXTURE_GEN_S); | 617 | streamingBuffer->color4f (normalizedOpacity, |
360 | 553 | glDisable(GL_TEXTURE_GEN_T); | 618 | normalizedOpacity, |
361 | 619 | normalizedOpacity, | ||
362 | 620 | normalizedOpacity); | ||
363 | 621 | streamingBuffer->addNormals (CAP_NVERTEX / 3, (l == 0) ? mCapFill : mCapFillNorm); | ||
364 | 622 | |||
365 | 623 | /* Generate texCoords and vertices for the | ||
366 | 624 | * curvature around the top section of the cap | ||
367 | 625 | * | ||
368 | 626 | * This is a little more inefficient than it should be. | ||
369 | 627 | * | ||
370 | 628 | * The previous implementation used glDrawElements with | ||
371 | 629 | * and IBO to ensure that we didn't send lots of redundant | ||
372 | 630 | * geometry to the GPU, however GLVertexBuffer doesn't have | ||
373 | 631 | * any concept of indexed rendering, and instead takes a vertex | ||
374 | 632 | * buffer with all the geometry. | ||
375 | 633 | * | ||
376 | 634 | * FIXME: This code uses GL_QUADS, so its not compatible with | ||
377 | 635 | * OpenGL|ES at the moment | ||
378 | 636 | */ | ||
379 | 637 | GLushort *idx = mCapFillIdx; | ||
380 | 638 | std::vector <GLfloat> capVertices; | ||
381 | 639 | |||
382 | 640 | /* Clear old texCoords buffer */ | ||
383 | 641 | texCoords.clear (); | ||
384 | 642 | |||
385 | 643 | /* Reserve enough space */ | ||
386 | 644 | capVertices.reserve (CAP_NIDX * 3); | ||
387 | 645 | texCoords.reserve (CAP_NIDX * 2); | ||
388 | 646 | |||
389 | 647 | for (unsigned int i = 0; i < CAP_NIDX; ++i) | ||
390 | 648 | { | ||
391 | 649 | unsigned int vertexIndex = idx[i] * 3; | ||
392 | 650 | |||
393 | 651 | GLVector v (mCapFill[vertexIndex], | ||
394 | 652 | mCapFill[vertexIndex + 1], | ||
395 | 653 | mCapFill[vertexIndex + 2], | ||
396 | 654 | 1.0f); | ||
397 | 655 | |||
398 | 656 | capVertices.push_back (v[GLVector::x]); | ||
399 | 657 | capVertices.push_back (v[GLVector::y]); | ||
400 | 658 | capVertices.push_back (v[GLVector::z]); | ||
401 | 659 | |||
402 | 660 | /* GL_OBJECT_LINEAR is simulated by doing: | ||
403 | 661 | * texCoord.s = dot (vec4 (obj, 1.0), sGenPlane) | ||
404 | 662 | * texCoord.t = dot (vec4 (obj, 1.0), tGenPlane) | ||
405 | 663 | */ | ||
406 | 664 | float s = v * sGen; | ||
407 | 665 | float t = v * tGen; | ||
408 | 666 | |||
409 | 667 | texCoords.push_back (s); | ||
410 | 668 | texCoords.push_back (t); | ||
411 | 669 | } | ||
412 | 670 | |||
413 | 671 | streamingBuffer->addVertices (CAP_NIDX, &capVertices[0]); | ||
414 | 672 | streamingBuffer->addTexCoords (0, CAP_NIDX, &texCoords[0]); | ||
415 | 673 | |||
416 | 674 | if (streamingBuffer->end ()) | ||
417 | 675 | streamingBuffer->render (cTransform); | ||
418 | 676 | #endif | ||
419 | 677 | } | ||
420 | 678 | |||
421 | 554 | cap->mTexture[0]->disable (); | 679 | cap->mTexture[0]->disable (); |
422 | 555 | } | 680 | } |
423 | 556 | } | 681 | } |
424 | 557 | } | 682 | } |
425 | 558 | 683 | ||
426 | 559 | glEnableClientState (GL_TEXTURE_COORD_ARRAY); | ||
427 | 560 | glDisableClientState (GL_NORMAL_ARRAY); | ||
428 | 561 | glDisable (GL_BLEND); | 684 | glDisable (GL_BLEND); |
429 | 562 | glNormal3f (0.0, -1.0, 0.0); | ||
430 | 563 | 685 | ||
431 | 564 | glCullFace (cullNorm); | 686 | glCullFace (cullNorm); |
432 | 565 | if (!wasCulled) | 687 | if (!wasCulled) |
433 | 566 | glDisable (GL_CULL_FACE); | 688 | glDisable (GL_CULL_FACE); |
434 | 567 | |||
435 | 568 | glPopMatrix (); | ||
436 | 569 | |||
437 | 570 | glColor4usv (defaultColor); | ||
438 | 571 | } | 689 | } |
439 | 572 | 690 | ||
440 | 573 | void | 691 | void |
441 | 574 | CubeaddonScreen::cubePaintTop (const GLScreenPaintAttrib &sAttrib, | 692 | CubeaddonScreen::cubePaintTop (const GLScreenPaintAttrib &sAttrib, |
442 | 575 | const GLMatrix &transform, | 693 | const GLMatrix &transform, |
443 | 576 | CompOutput *output, | 694 | CompOutput *output, |
445 | 577 | int size) | 695 | int size, |
446 | 696 | const GLVector &normal) | ||
447 | 578 | { | 697 | { |
448 | 579 | if ((!optionGetDrawBottom () && cubeScreen->invert () == -1) || | 698 | if ((!optionGetDrawBottom () && cubeScreen->invert () == -1) || |
449 | 580 | (!optionGetDrawTop () && cubeScreen->invert () == 1)) | 699 | (!optionGetDrawTop () && cubeScreen->invert () == 1)) |
450 | 581 | { | 700 | { |
452 | 582 | cubeScreen->cubePaintTop (sAttrib, transform, output, size); | 701 | cubeScreen->cubePaintTop (sAttrib, transform, output, size, normal); |
453 | 583 | } | 702 | } |
454 | 584 | 703 | ||
455 | 585 | if (!optionGetDrawTop ()) | 704 | if (!optionGetDrawTop ()) |
456 | @@ -593,12 +712,13 @@ | |||
457 | 593 | CubeaddonScreen::cubePaintBottom (const GLScreenPaintAttrib &sAttrib, | 712 | CubeaddonScreen::cubePaintBottom (const GLScreenPaintAttrib &sAttrib, |
458 | 594 | const GLMatrix &transform, | 713 | const GLMatrix &transform, |
459 | 595 | CompOutput *output, | 714 | CompOutput *output, |
461 | 596 | int size) | 715 | int size, |
462 | 716 | const GLVector &normal) | ||
463 | 597 | { | 717 | { |
464 | 598 | if ((!optionGetDrawBottom () && cubeScreen->invert () == 1) || | 718 | if ((!optionGetDrawBottom () && cubeScreen->invert () == 1) || |
465 | 599 | (!optionGetDrawTop () && cubeScreen->invert () == -1)) | 719 | (!optionGetDrawTop () && cubeScreen->invert () == -1)) |
466 | 600 | { | 720 | { |
468 | 601 | cubeScreen->cubePaintBottom (sAttrib, transform, output, size); | 721 | cubeScreen->cubePaintBottom (sAttrib, transform, output, size, normal); |
469 | 602 | } | 722 | } |
470 | 603 | 723 | ||
471 | 604 | if (!optionGetDrawBottom ()) | 724 | if (!optionGetDrawBottom ()) |
472 | @@ -617,8 +737,8 @@ | |||
473 | 617 | { | 737 | { |
474 | 618 | if (caScreen->mDeform > 0.0) | 738 | if (caScreen->mDeform > 0.0) |
475 | 619 | { | 739 | { |
478 | 620 | GLWindow::Geometry &geometry = gWindow->geometry (); | 740 | GLVertexBuffer *vb = gWindow->vertexBuffer (); |
479 | 621 | int i, oldVCount = geometry.vCount; | 741 | int i, oldVCount = vb->countVertices (); |
480 | 622 | GLfloat *v; | 742 | GLfloat *v; |
481 | 623 | int offX = 0, offY = 0; | 743 | int offX = 0, offY = 0; |
482 | 624 | int sx1, sx2, sw, sy1, sy2, sh; | 744 | int sx1, sx2, sw, sy1, sy2, sh; |
483 | @@ -645,10 +765,12 @@ | |||
484 | 645 | gWindow->glAddGeometry (matrix, region, clip, | 765 | gWindow->glAddGeometry (matrix, region, clip, |
485 | 646 | MIN (CUBEADDON_GRID_SIZE, maxGridWidth), | 766 | MIN (CUBEADDON_GRID_SIZE, maxGridWidth), |
486 | 647 | maxGridHeight); | 767 | maxGridHeight); |
487 | 768 | |||
488 | 769 | vb = gWindow->vertexBuffer (); | ||
489 | 648 | 770 | ||
493 | 649 | v = geometry.vertices; | 771 | v = vb->getVertices (); |
494 | 650 | v += geometry.vertexStride - 3; | 772 | v += vb->getVertexStride () - 3; |
495 | 651 | v += geometry.vertexStride * oldVCount; | 773 | v += vb->getVertexStride () * oldVCount; |
496 | 652 | 774 | ||
497 | 653 | if (!window->onAllViewports ()) | 775 | if (!window->onAllViewports ()) |
498 | 654 | { | 776 | { |
499 | @@ -707,7 +829,7 @@ | |||
500 | 707 | { | 829 | { |
501 | 708 | float lastX = std::numeric_limits <float>::min (), lastZ = 0.0; | 830 | float lastX = std::numeric_limits <float>::min (), lastZ = 0.0; |
502 | 709 | 831 | ||
504 | 710 | for (i = oldVCount; i < geometry.vCount; i++) | 832 | for (i = oldVCount; i < vb->countVertices (); i++) |
505 | 711 | { | 833 | { |
506 | 712 | if (v[0] == lastX) | 834 | if (v[0] == lastX) |
507 | 713 | { | 835 | { |
508 | @@ -728,7 +850,7 @@ | |||
509 | 728 | lastX = v[0]; | 850 | lastX = v[0]; |
510 | 729 | lastZ = v[2]; | 851 | lastZ = v[2]; |
511 | 730 | 852 | ||
513 | 731 | v += geometry.vertexStride; | 853 | v += vb->getVertexStride (); |
514 | 732 | } | 854 | } |
515 | 733 | } | 855 | } |
516 | 734 | else | 856 | else |
517 | @@ -738,20 +860,20 @@ | |||
518 | 738 | last[1][0] = -1000000000.0; | 860 | last[1][0] = -1000000000.0; |
519 | 739 | 861 | ||
520 | 740 | int cLast = 0; | 862 | int cLast = 0; |
522 | 741 | for (i = oldVCount; i < geometry.vCount; i++) | 863 | for (i = oldVCount; i < vb->countVertices (); i++) |
523 | 742 | { | 864 | { |
524 | 743 | if (last[0][0] == v[0] && last[0][1] == v[1]) | 865 | if (last[0][0] == v[0] && last[0][1] == v[1]) |
525 | 744 | { | 866 | { |
526 | 745 | v[0] = last[0][2]; | 867 | v[0] = last[0][2]; |
527 | 746 | v[2] = last[0][3]; | 868 | v[2] = last[0][3]; |
529 | 747 | v += geometry.vertexStride; | 869 | v += vb->getVertexStride (); |
530 | 748 | continue; | 870 | continue; |
531 | 749 | } | 871 | } |
532 | 750 | else if (last[1][0] == v[0] && last[1][1] == v[1]) | 872 | else if (last[1][0] == v[0] && last[1][1] == v[1]) |
533 | 751 | { | 873 | { |
534 | 752 | v[0] = last[1][2]; | 874 | v[0] = last[1][2]; |
535 | 753 | v[2] = last[1][3]; | 875 | v[2] = last[1][3]; |
537 | 754 | v += geometry.vertexStride; | 876 | v += vb->getVertexStride (); |
538 | 755 | continue; | 877 | continue; |
539 | 756 | } | 878 | } |
540 | 757 | 879 | ||
541 | @@ -777,7 +899,7 @@ | |||
542 | 777 | last[cLast][3] = v[2]; | 899 | last[cLast][3] = v[2]; |
543 | 778 | cLast = (cLast + 1) & 1; | 900 | cLast = (cLast + 1) & 1; |
544 | 779 | } | 901 | } |
546 | 780 | v += geometry.vertexStride; | 902 | v += vb->getVertexStride (); |
547 | 781 | } | 903 | } |
548 | 782 | } | 904 | } |
549 | 783 | } | 905 | } |
550 | @@ -788,10 +910,10 @@ | |||
551 | 788 | } | 910 | } |
552 | 789 | 911 | ||
553 | 790 | bool | 912 | bool |
558 | 791 | CubeaddonWindow::glDraw (const GLMatrix &transform, | 913 | CubeaddonWindow::glDraw (const GLMatrix &transform, |
559 | 792 | GLFragment::Attrib &attrib, | 914 | const GLWindowPaintAttrib &attrib, |
560 | 793 | const CompRegion ®ion, | 915 | const CompRegion ®ion, |
561 | 794 | unsigned int mask) | 916 | unsigned int mask) |
562 | 795 | { | 917 | { |
563 | 796 | if (!(mask & PAINT_WINDOW_TRANSFORMED_MASK) && caScreen->mDeform) | 918 | if (!(mask & PAINT_WINDOW_TRANSFORMED_MASK) && caScreen->mDeform) |
564 | 797 | { | 919 | { |
565 | @@ -816,9 +938,10 @@ | |||
566 | 816 | } | 938 | } |
567 | 817 | 939 | ||
568 | 818 | void | 940 | void |
572 | 819 | CubeaddonWindow::glDrawTexture (GLTexture *texture, | 941 | CubeaddonWindow::glDrawTexture (GLTexture *texture, |
573 | 820 | GLFragment::Attrib& attrib, | 942 | const GLMatrix &matrix, |
574 | 821 | unsigned int mask) | 943 | const GLWindowPaintAttrib &attrib, |
575 | 944 | unsigned int mask) | ||
576 | 822 | { | 945 | { |
577 | 823 | if (caScreen->mDeform > 0.0 && caScreen->gScreen->lighting ()) | 946 | if (caScreen->mDeform > 0.0 && caScreen->gScreen->lighting ()) |
578 | 824 | { | 947 | { |
579 | @@ -829,18 +952,20 @@ | |||
580 | 829 | GLfloat *v, *n; | 952 | GLfloat *v, *n; |
581 | 830 | float inv; | 953 | float inv; |
582 | 831 | 954 | ||
584 | 832 | GLWindow::Geometry &geometry = gWindow->geometry (); | 955 | GLVertexBuffer *vb = gWindow->vertexBuffer (); |
585 | 833 | CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode (); | 956 | CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode (); |
586 | 834 | float cDist = cubeScreen->distance (); | 957 | float cDist = cubeScreen->distance (); |
587 | 835 | 958 | ||
588 | 836 | inv = (cubeScreen->invert () == 1) ? 1.0: -1.0; | 959 | inv = (cubeScreen->invert () == 1) ? 1.0: -1.0; |
589 | 837 | ym = (caScreen->optionGetDeformation () == CubeaddonScreen::DeformationCylinder) ? 0.0 : 1.0; | 960 | ym = (caScreen->optionGetDeformation () == CubeaddonScreen::DeformationCylinder) ? 0.0 : 1.0; |
590 | 838 | 961 | ||
592 | 839 | if ((int) caScreen->mWinNormSize < geometry.vCount * 3) | 962 | int vertexCount = vb->countVertices (); |
593 | 963 | |||
594 | 964 | if ((int) caScreen->mWinNormSize < vertexCount * 3) | ||
595 | 840 | { | 965 | { |
596 | 841 | delete [] caScreen->mWinNormals; | 966 | delete [] caScreen->mWinNormals; |
599 | 842 | caScreen->mWinNormals = new GLfloat[geometry.vCount * 3]; | 967 | caScreen->mWinNormals = new GLfloat[vertexCount * 3]; |
600 | 843 | caScreen->mWinNormSize = geometry.vCount * 3; | 968 | caScreen->mWinNormSize = vertexCount * 3; |
601 | 844 | } | 969 | } |
602 | 845 | 970 | ||
603 | 846 | if (!window->onAllViewports ()) | 971 | if (!window->onAllViewports ()) |
604 | @@ -891,12 +1016,12 @@ | |||
605 | 891 | } | 1016 | } |
606 | 892 | } | 1017 | } |
607 | 893 | 1018 | ||
609 | 894 | v = geometry.vertices + (geometry.vertexStride - 3); | 1019 | v = vb->getVertices () + (vb->getVertexStride () - 3); |
610 | 895 | n = caScreen->mWinNormals; | 1020 | n = caScreen->mWinNormals; |
611 | 896 | 1021 | ||
612 | 897 | if (cubeScreen->paintOrder () == FTB) | 1022 | if (cubeScreen->paintOrder () == FTB) |
613 | 898 | { | 1023 | { |
615 | 899 | for (i = 0; i < geometry.vCount; i++) | 1024 | for (i = 0; i < vertexCount; i++) |
616 | 900 | { | 1025 | { |
617 | 901 | x = (((v[0] + offX - sx1) / (float)sw) - 0.5); | 1026 | x = (((v[0] + offX - sx1) / (float)sw) - 0.5); |
618 | 902 | y = (((v[1] + offY - sy1) / (float)sh) - 0.5); | 1027 | y = (((v[1] + offY - sy1) / (float)sh) - 0.5); |
619 | @@ -905,12 +1030,12 @@ | |||
620 | 905 | *(n)++ = y / sh * caScreen->mDeform * ym; | 1030 | *(n)++ = y / sh * caScreen->mDeform * ym; |
621 | 906 | *(n)++ = v[2] + cDist; | 1031 | *(n)++ = v[2] + cDist; |
622 | 907 | 1032 | ||
624 | 908 | v += geometry.vertexStride; | 1033 | v += vb->getVertexStride (); |
625 | 909 | } | 1034 | } |
626 | 910 | } | 1035 | } |
627 | 911 | else | 1036 | else |
628 | 912 | { | 1037 | { |
630 | 913 | for (i = 0; i < geometry.vCount; i++) | 1038 | for (i = 0; i < vertexCount; i++) |
631 | 914 | { | 1039 | { |
632 | 915 | x = (((v[0] + offX - sx1) / (float)sw) - 0.5); | 1040 | x = (((v[0] + offX - sx1) / (float)sw) - 0.5); |
633 | 916 | y = (((v[1] + offY - sy1) / (float)sh) - 0.5); | 1041 | y = (((v[1] + offY - sy1) / (float)sh) - 0.5); |
634 | @@ -919,24 +1044,18 @@ | |||
635 | 919 | *(n)++ = -y / sh * caScreen->mDeform * ym * inv; | 1044 | *(n)++ = -y / sh * caScreen->mDeform * ym * inv; |
636 | 920 | *(n)++ = -(v[2] + cDist); | 1045 | *(n)++ = -(v[2] + cDist); |
637 | 921 | 1046 | ||
639 | 922 | v += geometry.vertexStride; | 1047 | v += vb->getVertexStride (); |
640 | 923 | } | 1048 | } |
641 | 924 | } | 1049 | } |
653 | 925 | 1050 | ||
654 | 926 | glEnable (GL_NORMALIZE); | 1051 | vb->addNormals (caScreen->mWinNormSize / 3, |
655 | 927 | glNormalPointer (GL_FLOAT,0, caScreen->mWinNormals); | 1052 | caScreen->mWinNormals); |
656 | 928 | 1053 | ||
657 | 929 | glEnableClientState (GL_NORMAL_ARRAY); | 1054 | gWindow->glDrawTexture (texture, matrix, attrib, mask); |
647 | 930 | |||
648 | 931 | gWindow->glDrawTexture (texture, attrib, mask); | ||
649 | 932 | |||
650 | 933 | glDisable (GL_NORMALIZE); | ||
651 | 934 | glDisableClientState (GL_NORMAL_ARRAY); | ||
652 | 935 | glNormal3f (0.0, 0.0, -1.0); | ||
658 | 936 | return; | 1055 | return; |
659 | 937 | } | 1056 | } |
660 | 938 | 1057 | ||
662 | 939 | gWindow->glDrawTexture (texture, attrib, mask); | 1058 | gWindow->glDrawTexture (texture, matrix, attrib, mask); |
663 | 940 | } | 1059 | } |
664 | 941 | 1060 | ||
665 | 942 | bool | 1061 | bool |
666 | @@ -956,7 +1075,6 @@ | |||
667 | 956 | CompOutput *output, | 1075 | CompOutput *output, |
668 | 957 | unsigned int mask) | 1076 | unsigned int mask) |
669 | 958 | { | 1077 | { |
670 | 959 | static GLfloat light0Position[] = { -0.5f, 0.5f, -9.0f, 1.0f }; | ||
671 | 960 | GLMatrix sTransform = transform; | 1078 | GLMatrix sTransform = transform; |
672 | 961 | float cDist = cubeScreen->distance (); | 1079 | float cDist = cubeScreen->distance (); |
673 | 962 | float cDist2 = cubeScreen->distance () * cubeScreen->distance (); | 1080 | float cDist2 = cubeScreen->distance () * cubeScreen->distance (); |
674 | @@ -1257,82 +1375,97 @@ | |||
675 | 1257 | rTransform.scale (1.0, -1.0, 1.0); | 1375 | rTransform.scale (1.0, -1.0, 1.0); |
676 | 1258 | } | 1376 | } |
677 | 1259 | 1377 | ||
678 | 1260 | glPushMatrix (); | ||
679 | 1261 | glLoadIdentity (); | ||
680 | 1262 | glScalef (1.0, -1.0, 1.0); | ||
681 | 1263 | glLightfv (GL_LIGHT0, GL_POSITION, light0Position); | ||
682 | 1264 | glPopMatrix (); | ||
683 | 1265 | glCullFace (GL_FRONT); | 1378 | glCullFace (GL_FRONT); |
684 | 1266 | 1379 | ||
685 | 1267 | gScreen->glPaintTransformedOutput (sAttrib, rTransform, | 1380 | gScreen->glPaintTransformedOutput (sAttrib, rTransform, |
686 | 1268 | region, output, mask); | 1381 | region, output, mask); |
687 | 1269 | 1382 | ||
688 | 1270 | glCullFace (GL_BACK); | 1383 | glCullFace (GL_BACK); |
689 | 1271 | glPushMatrix (); | ||
690 | 1272 | glLoadIdentity (); | ||
691 | 1273 | glLightfv (GL_LIGHT0, GL_POSITION, light0Position); | ||
692 | 1274 | glPopMatrix (); | ||
693 | 1275 | 1384 | ||
694 | 1276 | if (optionGetMode () == ModeAbove && mVRot > 0.0) | 1385 | if (optionGetMode () == ModeAbove && mVRot > 0.0) |
695 | 1277 | { | 1386 | { |
696 | 1278 | int j; | 1387 | int j; |
697 | 1279 | float i, c; | 1388 | float i, c; |
698 | 1280 | float v = MIN (1.0, mVRot / 30.0); | 1389 | float v = MIN (1.0, mVRot / 30.0); |
702 | 1281 | float col1[4], col2[4]; | 1390 | unsigned short col1[4], col2[4]; |
703 | 1282 | 1391 | ||
704 | 1283 | glPushMatrix (); | 1392 | GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); |
705 | 1393 | |||
706 | 1394 | GLMatrix gTransform; | ||
707 | 1284 | 1395 | ||
708 | 1285 | glEnable (GL_BLEND); | 1396 | glEnable (GL_BLEND); |
709 | 1286 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 1397 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
710 | 1287 | 1398 | ||
713 | 1288 | glLoadIdentity (); | 1399 | gTransform.translate (0, 0, -DEFAULT_Z_CAMERA); |
712 | 1289 | glTranslatef (0.0, 0.0, -DEFAULT_Z_CAMERA); | ||
714 | 1290 | 1400 | ||
715 | 1291 | i = optionGetIntensity () * 2; | 1401 | i = optionGetIntensity () * 2; |
716 | 1292 | c = optionGetIntensity (); | 1402 | c = optionGetIntensity (); |
717 | 1293 | 1403 | ||
728 | 1294 | glBegin (GL_QUADS); | 1404 | GLfloat vertices[] = |
729 | 1295 | glColor4f (0.0, 0.0, 0.0, | 1405 | { |
730 | 1296 | ((1 - v) * MAX (0.0, 1.0 - i)) + (v * c)); | 1406 | 0.5f, v / 2.0f, 0.0f, |
731 | 1297 | glVertex2f (0.5, v / 2.0); | 1407 | -0.5f, v / 2.0f, 0.0f, |
732 | 1298 | glVertex2f (-0.5, v / 2.0); | 1408 | -0.5f, -0.5f, 0.0f, |
733 | 1299 | glColor4f (0.0, 0.0, 0.0, | 1409 | 0.5f, -0.5f, 0.0f |
734 | 1300 | ((1 - v) * MIN (1.0, 1.0 - (i - 1.0))) + (v * c)); | 1410 | }; |
735 | 1301 | glVertex2f (-0.5, -0.5); | 1411 | |
736 | 1302 | glVertex2f (0.5, -0.5); | 1412 | unsigned short cMax = MAX (0.0, 1.0 - i) + (v * c); |
737 | 1303 | glEnd (); | 1413 | unsigned short cMin = MIN (1.0, 1.0 - (i - 1.0)) + (v * c); |
738 | 1414 | |||
739 | 1415 | GLushort colors[] = | ||
740 | 1416 | { | ||
741 | 1417 | 0, 0, 0, cMax, | ||
742 | 1418 | 0, 0, 0, cMax, | ||
743 | 1419 | 0, 0, 0, cMin, | ||
744 | 1420 | 0, 0, 0, cMin | ||
745 | 1421 | }; | ||
746 | 1422 | |||
747 | 1423 | streamingBuffer->begin (GL_TRIANGLE_STRIP); | ||
748 | 1424 | streamingBuffer->addColors (4, colors); | ||
749 | 1425 | streamingBuffer->addVertices (4, vertices); | ||
750 | 1426 | if (streamingBuffer->end ()) | ||
751 | 1427 | streamingBuffer->render (gTransform); | ||
752 | 1304 | 1428 | ||
753 | 1305 | for (j = 0; j < 4; j++) | 1429 | for (j = 0; j < 4; j++) |
754 | 1306 | { | 1430 | { |
755 | 1307 | col1[j] = (1.0 - v) * optionGetGroundColor1 () [j] + | 1431 | col1[j] = (1.0 - v) * optionGetGroundColor1 () [j] + |
756 | 1308 | (v * (optionGetGroundColor1 () [j] + | 1432 | (v * (optionGetGroundColor1 () [j] + |
757 | 1309 | optionGetGroundColor2 () [j]) * 0.5); | 1433 | optionGetGroundColor2 () [j]) * 0.5); |
758 | 1310 | col1[j] /= 0xffff; | ||
759 | 1311 | col2[j] = (1.0 - v) * optionGetGroundColor2 () [j] + | 1434 | col2[j] = (1.0 - v) * optionGetGroundColor2 () [j] + |
760 | 1312 | (v * (optionGetGroundColor1 () [j] + | 1435 | (v * (optionGetGroundColor1 () [j] + |
761 | 1313 | optionGetGroundColor2 () [j]) * 0.5); | 1436 | optionGetGroundColor2 () [j]) * 0.5); |
762 | 1314 | col2[j] /= 0xffff; | ||
763 | 1315 | } | 1437 | } |
764 | 1316 | 1438 | ||
765 | 1317 | if (optionGetGroundSize () > 0.0) | 1439 | if (optionGetGroundSize () > 0.0) |
766 | 1318 | { | 1440 | { |
777 | 1319 | glBegin (GL_QUADS); | 1441 | GLfloat vertices[] = |
778 | 1320 | glColor4fv (col1); | 1442 | { |
779 | 1321 | glVertex2f (-0.5, -0.5); | 1443 | -0.5f, -0.5f, 0.0f, |
780 | 1322 | glVertex2f (0.5, -0.5); | 1444 | 0.5f, -0.5f, 0.0f, |
781 | 1323 | glColor4fv (col2); | 1445 | 0.5f, -0.5f + |
782 | 1324 | glVertex2f (0.5, -0.5 + | 1446 | static_cast <GLfloat> (((1 - v) * optionGetGroundSize ()) + v), |
783 | 1325 | ((1 - v) * optionGetGroundSize ()) + v); | 1447 | -0.5f, -0.5f + |
784 | 1326 | glVertex2f (-0.5, -0.5 + | 1448 | static_cast <GLfloat> (((1 - v) * optionGetGroundSize ()) + v) |
785 | 1327 | ((1 - v) * optionGetGroundSize ()) + v); | 1449 | }; |
786 | 1328 | glEnd (); | 1450 | |
787 | 1451 | GLushort colors[] = | ||
788 | 1452 | { | ||
789 | 1453 | col1[0], col1[1], col1[2], col1[3], | ||
790 | 1454 | col1[0], col1[1], col1[2], col1[3], | ||
791 | 1455 | col2[0], col2[1], col2[2], col2[3], | ||
792 | 1456 | col2[0], col2[1], col2[2], col2[3] | ||
793 | 1457 | }; | ||
794 | 1458 | |||
795 | 1459 | streamingBuffer->begin (GL_TRIANGLE_STRIP); | ||
796 | 1460 | streamingBuffer->addVertices (4, vertices); | ||
797 | 1461 | streamingBuffer->addColors (4, colors); | ||
798 | 1462 | |||
799 | 1463 | if (streamingBuffer->end ()) | ||
800 | 1464 | streamingBuffer->render (gTransform); | ||
801 | 1329 | } | 1465 | } |
802 | 1330 | 1466 | ||
803 | 1331 | glColor4usv (defaultColor); | ||
804 | 1332 | |||
805 | 1333 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | 1467 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
806 | 1334 | glDisable (GL_BLEND); | 1468 | glDisable (GL_BLEND); |
807 | 1335 | glPopMatrix (); | ||
808 | 1336 | } | 1469 | } |
809 | 1337 | else | 1470 | else |
810 | 1338 | drawBasicGround (); | 1471 | drawBasicGround (); |
811 | 1339 | 1472 | ||
812 | === modified file 'plugins/cubeaddon/src/cubeaddon.h' | |||
813 | --- plugins/cubeaddon/src/cubeaddon.h 2012-09-07 22:37:20 +0000 | |||
814 | +++ plugins/cubeaddon/src/cubeaddon.h 2013-01-04 07:52:23 +0000 | |||
815 | @@ -39,15 +39,15 @@ | |||
816 | 39 | 39 | ||
817 | 40 | #include "cubeaddon_options.h" | 40 | #include "cubeaddon_options.h" |
818 | 41 | 41 | ||
828 | 42 | extern const unsigned short CUBEADDON_GRID_SIZE; | 42 | const unsigned short CUBEADDON_GRID_SIZE = 100; |
829 | 43 | extern const unsigned short CAP_ELEMENTS; | 43 | const unsigned short CAP_ELEMENTS = 15; |
830 | 44 | extern const unsigned int CAP_NVERTEX; | 44 | const unsigned int CAP_NVERTEX = (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3); |
831 | 45 | extern const unsigned int CAP_NIDX; | 45 | const unsigned int CAP_NIDX = (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4); |
832 | 46 | 46 | ||
833 | 47 | extern const unsigned int CAP_NIMGVERTEX; | 47 | const unsigned int CAP_NIMGVERTEX = (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5); |
834 | 48 | extern const unsigned int CAP_NIMGIDX; | 48 | const unsigned int CAP_NIMGIDX = (CAP_ELEMENTS * CAP_ELEMENTS * 4); |
835 | 49 | 49 | ||
836 | 50 | extern const float RAD2I1024 = 162.9746617f; | 50 | const float RAD2I1024 = 162.9746617f; |
837 | 51 | 51 | ||
838 | 52 | class CubeaddonScreen : | 52 | class CubeaddonScreen : |
839 | 53 | public CompositeScreenInterface, | 53 | public CompositeScreenInterface, |
840 | @@ -76,11 +76,13 @@ | |||
841 | 76 | void cubePaintTop (const GLScreenPaintAttrib &sAttrib, | 76 | void cubePaintTop (const GLScreenPaintAttrib &sAttrib, |
842 | 77 | const GLMatrix &transform, | 77 | const GLMatrix &transform, |
843 | 78 | CompOutput *output, | 78 | CompOutput *output, |
845 | 79 | int size); | 79 | int size, |
846 | 80 | const GLVector &normal); | ||
847 | 80 | void cubePaintBottom (const GLScreenPaintAttrib &sAttrib, | 81 | void cubePaintBottom (const GLScreenPaintAttrib &sAttrib, |
848 | 81 | const GLMatrix &transform, | 82 | const GLMatrix &transform, |
849 | 82 | CompOutput *output, | 83 | CompOutput *output, |
851 | 83 | int size); | 84 | int size, |
852 | 85 | const GLVector &normal); | ||
853 | 84 | bool cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib, | 86 | bool cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib, |
854 | 85 | const GLMatrix &transform, | 87 | const GLMatrix &transform, |
855 | 86 | CompOutput *output, | 88 | CompOutput *output, |
856 | @@ -165,12 +167,14 @@ | |||
857 | 165 | public: | 167 | public: |
858 | 166 | CubeaddonWindow (CompWindow *); | 168 | CubeaddonWindow (CompWindow *); |
859 | 167 | 169 | ||
861 | 168 | bool glDraw (const GLMatrix&, GLFragment::Attrib&, | 170 | bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&, |
862 | 169 | const CompRegion&, unsigned int); | 171 | const CompRegion&, unsigned int); |
863 | 170 | void glAddGeometry (const GLTexture::MatrixList&, | 172 | void glAddGeometry (const GLTexture::MatrixList&, |
864 | 171 | const CompRegion&, const CompRegion&, | 173 | const CompRegion&, const CompRegion&, |
865 | 172 | unsigned int, unsigned int); | 174 | unsigned int, unsigned int); |
867 | 173 | void glDrawTexture (GLTexture *, GLFragment::Attrib& attrib, | 175 | void glDrawTexture (GLTexture *, |
868 | 176 | const GLMatrix &matrix, | ||
869 | 177 | const GLWindowPaintAttrib& attrib, | ||
870 | 174 | unsigned int); | 178 | unsigned int); |
871 | 175 | 179 | ||
872 | 176 | CompWindow *window; | 180 | CompWindow *window; |
873 | 177 | 181 | ||
874 | === modified file 'plugins/opengl/src/screen.cpp' | |||
875 | --- plugins/opengl/src/screen.cpp 2013-01-01 09:41:41 +0000 | |||
876 | +++ plugins/opengl/src/screen.cpp 2013-01-04 07:52:23 +0000 | |||
877 | @@ -544,7 +544,7 @@ | |||
878 | 544 | GL::getProgramiv = glGetProgramiv; | 544 | GL::getProgramiv = glGetProgramiv; |
879 | 545 | GL::getProgramInfoLog = glGetProgramInfoLog; | 545 | GL::getProgramInfoLog = glGetProgramInfoLog; |
880 | 546 | GL::createShader = glCreateShader; | 546 | GL::createShader = glCreateShader; |
882 | 547 | GL::shaderSource = glShaderSource; | 547 | GL::shaderSource = (GL::GLShaderSourceProc) glShaderSource; |
883 | 548 | GL::compileShader = glCompileShader; | 548 | GL::compileShader = glCompileShader; |
884 | 549 | GL::createProgram = glCreateProgram; | 549 | GL::createProgram = glCreateProgram; |
885 | 550 | GL::attachShader = glAttachShader; | 550 | GL::attachShader = glAttachShader; |
FAILED: Continuous integration, rev:3532 jenkins. qa.ubuntu. com/job/ compiz- ci/333/ jenkins. qa.ubuntu. com/job/ compiz- ci/./build= pbuilder, distribution= quantal, flavor= amd64/333/ console
http://
Executed test runs:
FAILURE: http://
Click here to trigger a rebuild: jenkins. qa.ubuntu. com/job/ compiz- ci/333/ /rebuild/?
http://