Merge lp:~bryanfritt/compiz/more_ezoom_and_100percent_grid into lp:compiz/0.9.12
- more_ezoom_and_100percent_grid
- Merge into 0.9.12
Status: | Rejected | ||||||||
---|---|---|---|---|---|---|---|---|---|
Rejected by: | Sam Spilsbury | ||||||||
Proposed branch: | lp:~bryanfritt/compiz/more_ezoom_and_100percent_grid | ||||||||
Merge into: | lp:compiz/0.9.12 | ||||||||
Diff against target: |
2917 lines (+1136/-630) 42 files modified
VERSION (+1/-1) debian/changelog (+22/-0) debian/compiz-dev.install (+1/-0) debian/compiz-gnome.install (+1/-1) debian/compiz-plugins.install (+2/-0) debian/compiz-plugins.install.armel (+2/-0) debian/compiz-plugins.install.armhf (+2/-0) debian/compizconfig (+5/-0) debian/unity-lowgfx.ini (+44/-0) plugins/CMakeLists.txt (+0/-1) plugins/animation/include/animation/animeffect.h (+5/-2) plugins/animation/include/animation/grid.h (+0/-1) plugins/animation/include/animation/multi.h (+19/-9) plugins/animation/src/animation.cpp (+17/-24) plugins/animation/src/glide.cpp (+1/-1) plugins/animation/src/grid.cpp (+0/-6) plugins/animation/src/private.h (+1/-1) plugins/animationaddon/CMakeLists.txt (+1/-4) plugins/animationaddon/include/animationaddon/animationaddon.h (+17/-11) plugins/animationaddon/src/airplane.cpp (+47/-36) plugins/animationaddon/src/animationaddon.cpp (+2/-2) plugins/animationaddon/src/dissolve.cpp (+11/-2) plugins/animationaddon/src/particle.cpp (+52/-40) plugins/animationaddon/src/polygon.cpp (+259/-250) plugins/animationaddon/src/private.h (+3/-2) plugins/composite/src/privates.h (+2/-9) plugins/composite/src/window.cpp (+11/-45) plugins/expo/expo.xml.in (+5/-1) plugins/expo/src/expo.cpp (+12/-4) plugins/ezoom/ezoom.xml.in (+191/-22) plugins/ezoom/src/ezoom.cpp (+110/-20) plugins/ezoom/src/ezoom.h (+16/-3) plugins/grid/src/grid.cpp (+112/-93) plugins/opengl/include/opengl/matrix.h (+27/-0) plugins/opengl/include/opengl/opengl.h (+6/-0) plugins/opengl/include/opengl/vertexbuffer.h (+20/-2) plugins/opengl/src/paint.cpp (+1/-10) plugins/opengl/src/privatevertexbuffer.h (+6/-2) plugins/opengl/src/vertexbuffer.cpp (+77/-22) plugins/opengl/src/window.cpp (+15/-0) plugins/scale/scale.xml.in (+5/-0) plugins/scale/src/scale.cpp (+5/-3) |
||||||||
To merge this branch: | bzr merge lp:~bryanfritt/compiz/more_ezoom_and_100percent_grid | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Compiz Maintainers | Pending | ||
Review via email: mp+298444@code.launchpad.net |
Commit message
Added in 100% to Grid's 'Cycle Through Multiple Sizes' and
Added in more 'Specific Zoom' levels to eZoom
Description of the change
Added in 100% to Grid's 'Cycle Through Multiple Sizes' and
Added in more 'Specific Zoom' levels to eZoom
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
- 4055. By BryanFRitt
-
reformated changed lines using the "Compiz Development/ CodingStyle"
http://wiki.compiz. org/Development /CodingStyle
BryanFRitt (bryanfritt) wrote : | # |
I changed the code changes to more towards the "Compiz Development/ CodingStyle"; but I started playing with the .bzrignore file and wasn't sure what to do with it to get it back to normal or whatever I should do with it. What should I do with it?
.bzrignore (+0/-1)
- 4056. By BryanFRitt
-
set .bzrignore back to saying '.bzr-repo'
- 4057. By BryanFRitt
-
added newline to .bzr-repo
to revert it to what it was before I messed with it. - 4058. By BryanFRitt
-
rolled back the .bzrignore file
bzr revert .bzrignore --revision 4053
an attept make it say that I didn't modify the file
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Please resubmit the propsal against lp:compiz (as this is trying to merge on lp:compiz/0.9.12).
- 4059. By BryanFRitt
-
ran `bzr merge lp:compiz`
BryanFRitt (bryanfritt) wrote : | # |
"Please resubmit the proposal against lp:compiz (as this is trying to merge on lp:compiz/0.9.12)." [corrected spelling of 'proposal']
Ok... done...
From my 'more_ezoom_
BryanFRitt (bryanfritt) wrote : | # |
Is there anything else I need to do?
Sam Spilsbury (smspillaz) wrote : | # |
I think this has been resubmitted.
Unmerged revisions
- 4060. By BryanFRitt
-
implemented some formatting changes suggested by Marco Trevisan (Treviño) (3v1n0)
- 4059. By BryanFRitt
-
ran `bzr merge lp:compiz`
- 4058. By BryanFRitt
-
rolled back the .bzrignore file
bzr revert .bzrignore --revision 4053
an attept make it say that I didn't modify the file - 4057. By BryanFRitt
-
added newline to .bzr-repo
to revert it to what it was before I messed with it. - 4056. By BryanFRitt
-
set .bzrignore back to saying '.bzr-repo'
- 4055. By BryanFRitt
-
reformated changed lines using the "Compiz Development/ CodingStyle"
http://wiki.compiz. org/Development /CodingStyle - 4054. By BryanFRitt
-
indentation changes, and added a comment about relatively prime numbers
- 4053. By BryanFRitt
-
new branch with
old 'ezoom' plugin change that added more zoom levels and
new 'grid' plugin change that added 100% to the sizes that 'Cycle Through Multiple Sizes' goes through
Preview Diff
1 | === modified file 'VERSION' | |||
2 | --- VERSION 2015-08-19 15:50:54 +0000 | |||
3 | +++ VERSION 2016-07-14 15:55:30 +0000 | |||
4 | @@ -1,1 +1,1 @@ | |||
6 | 1 | 0.9.12.2 | 1 | 0.9.13.0 |
7 | 2 | 2 | ||
8 | === modified file 'debian/changelog' | |||
9 | --- debian/changelog 2016-06-21 13:11:16 +0000 | |||
10 | +++ debian/changelog 2016-07-14 15:55:30 +0000 | |||
11 | @@ -1,3 +1,25 @@ | |||
12 | 1 | compiz (1:0.9.13.0+16.10.20160705-0ubuntu1) yakkety; urgency=medium | ||
13 | 2 | |||
14 | 3 | [ Eleni Maria Stea ] | ||
15 | 4 | * Added options for no animation in expo and scale plugins. They skip | ||
16 | 5 | the intermediate fading steps that force several redraws. | ||
17 | 6 | |||
18 | 7 | [ Marco Trevisan (Treviño) ] | ||
19 | 8 | * Composite: use C++ goodness for managing damaging rectangles | ||
20 | 9 | * debian: add unity-lowgfx profile to compizconfig (LP: #1598770) | ||
21 | 10 | |||
22 | 11 | -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 05 Jul 2016 01:12:10 +0000 | ||
23 | 12 | |||
24 | 13 | compiz (1:0.9.13.0+16.10.20160628-0ubuntu1) yakkety; urgency=medium | ||
25 | 14 | |||
26 | 15 | [ Marco Trevisan (Treviño) ] | ||
27 | 16 | * New upstream release 0.9.13.0 | ||
28 | 17 | |||
29 | 18 | [ Sam Spilsbury smspillaz@gmail.com ] | ||
30 | 19 | * animationaddon: Port the animationaddon plugin to use modern GL API. | ||
31 | 20 | |||
32 | 21 | -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 28 Jun 2016 14:57:42 +0000 | ||
33 | 22 | |||
34 | 1 | compiz (1:0.9.12.2+16.10.20160621-0ubuntu1) yakkety; urgency=medium | 23 | compiz (1:0.9.12.2+16.10.20160621-0ubuntu1) yakkety; urgency=medium |
35 | 2 | 24 | ||
36 | 3 | [ Alberts Muktupāvels ] | 25 | [ Alberts Muktupāvels ] |
37 | 4 | 26 | ||
38 | === modified file 'debian/compiz-dev.install' | |||
39 | --- debian/compiz-dev.install 2014-11-24 22:25:07 +0000 | |||
40 | +++ debian/compiz-dev.install 2016-07-14 15:55:30 +0000 | |||
41 | @@ -1,6 +1,7 @@ | |||
42 | 1 | debian/tmp/usr/include/compiz/[!d]* | 1 | debian/tmp/usr/include/compiz/[!d]* |
43 | 2 | debian/tmp/usr/lib/*/libcompiz_core.so | 2 | debian/tmp/usr/lib/*/libcompiz_core.so |
44 | 3 | debian/tmp/usr/lib/*/pkgconfig/compiz-animation.pc | 3 | debian/tmp/usr/lib/*/pkgconfig/compiz-animation.pc |
45 | 4 | debian/tmp/usr/lib/*/pkgconfig/compiz-animationaddon.pc | ||
46 | 4 | debian/tmp/usr/lib/*/pkgconfig/compiz-compiztoolbox.pc | 5 | debian/tmp/usr/lib/*/pkgconfig/compiz-compiztoolbox.pc |
47 | 5 | debian/tmp/usr/lib/*/pkgconfig/compiz-composite.pc | 6 | debian/tmp/usr/lib/*/pkgconfig/compiz-composite.pc |
48 | 6 | debian/tmp/usr/lib/*/pkgconfig/compiz-cube.pc | 7 | debian/tmp/usr/lib/*/pkgconfig/compiz-cube.pc |
49 | 7 | 8 | ||
50 | === modified file 'debian/compiz-gnome.install' | |||
51 | --- debian/compiz-gnome.install 2015-12-10 16:34:35 +0000 | |||
52 | +++ debian/compiz-gnome.install 2016-07-14 15:55:30 +0000 | |||
53 | @@ -1,6 +1,6 @@ | |||
54 | 1 | debian/65compiz_profile-on-session /etc/X11/Xsession.d | 1 | debian/65compiz_profile-on-session /etc/X11/Xsession.d |
55 | 2 | debian/profile_upgrades/*.upgrade usr/share/compizconfig/upgrades | 2 | debian/profile_upgrades/*.upgrade usr/share/compizconfig/upgrades |
57 | 3 | debian/unity.ini /etc/compizconfig/ | 3 | debian/unity*.ini /etc/compizconfig/ |
58 | 4 | postinst/convert-files/*.convert usr/lib/compiz/migration/ | 4 | postinst/convert-files/*.convert usr/lib/compiz/migration/ |
59 | 5 | usr/bin/gtk-window-decorator | 5 | usr/bin/gtk-window-decorator |
60 | 6 | usr/lib/*/compizconfig/backends/libgsettings.so | 6 | usr/lib/*/compizconfig/backends/libgsettings.so |
61 | 7 | 7 | ||
62 | === modified file 'debian/compiz-plugins.install' | |||
63 | --- debian/compiz-plugins.install 2016-05-13 09:45:31 +0000 | |||
64 | +++ debian/compiz-plugins.install 2016-07-14 15:55:30 +0000 | |||
65 | @@ -2,6 +2,8 @@ | |||
66 | 2 | usr/share/compiz/*addhelper.* | 2 | usr/share/compiz/*addhelper.* |
67 | 3 | usr/lib/*/compiz/*annotate.* | 3 | usr/lib/*/compiz/*annotate.* |
68 | 4 | usr/share/compiz/*annotate.* | 4 | usr/share/compiz/*annotate.* |
69 | 5 | usr/lib/*/compiz/*animationaddon.* | ||
70 | 6 | usr/share/compiz/*animationaddon.* | ||
71 | 5 | usr/lib/*/compiz/*bench.* | 7 | usr/lib/*/compiz/*bench.* |
72 | 6 | usr/share/compiz/*bench.* | 8 | usr/share/compiz/*bench.* |
73 | 7 | usr/lib/*/compiz/*blur.* | 9 | usr/lib/*/compiz/*blur.* |
74 | 8 | 10 | ||
75 | === modified file 'debian/compiz-plugins.install.armel' | |||
76 | --- debian/compiz-plugins.install.armel 2014-12-02 14:42:34 +0000 | |||
77 | +++ debian/compiz-plugins.install.armel 2016-07-14 15:55:30 +0000 | |||
78 | @@ -2,6 +2,8 @@ | |||
79 | 2 | usr/share/compiz/*addhelper.* | 2 | usr/share/compiz/*addhelper.* |
80 | 3 | usr/lib/*/compiz/*annotate.* | 3 | usr/lib/*/compiz/*annotate.* |
81 | 4 | usr/share/compiz/*annotate.* | 4 | usr/share/compiz/*annotate.* |
82 | 5 | usr/lib/*/compiz/*animationaddon.* | ||
83 | 6 | usr/share/compiz/*animationaddon.* | ||
84 | 5 | usr/lib/*/compiz/*clone.* | 7 | usr/lib/*/compiz/*clone.* |
85 | 6 | usr/share/compiz/*clone.* | 8 | usr/share/compiz/*clone.* |
86 | 7 | usr/lib/*/compiz/*crashhandler.* | 9 | usr/lib/*/compiz/*crashhandler.* |
87 | 8 | 10 | ||
88 | === modified file 'debian/compiz-plugins.install.armhf' | |||
89 | --- debian/compiz-plugins.install.armhf 2014-12-02 14:42:34 +0000 | |||
90 | +++ debian/compiz-plugins.install.armhf 2016-07-14 15:55:30 +0000 | |||
91 | @@ -2,6 +2,8 @@ | |||
92 | 2 | usr/share/compiz/*addhelper.* | 2 | usr/share/compiz/*addhelper.* |
93 | 3 | usr/lib/*/compiz/*annotate.* | 3 | usr/lib/*/compiz/*annotate.* |
94 | 4 | usr/share/compiz/*annotate.* | 4 | usr/share/compiz/*annotate.* |
95 | 5 | usr/lib/*/compiz/*animationaddon.* | ||
96 | 6 | usr/share/compiz/*animationaddon.* | ||
97 | 5 | usr/lib/*/compiz/*clone.* | 7 | usr/lib/*/compiz/*clone.* |
98 | 6 | usr/share/compiz/*clone.* | 8 | usr/share/compiz/*clone.* |
99 | 7 | usr/lib/*/compiz/*crashhandler.* | 9 | usr/lib/*/compiz/*crashhandler.* |
100 | 8 | 10 | ||
101 | === modified file 'debian/compizconfig' | |||
102 | --- debian/compizconfig 2015-02-04 22:20:18 +0000 | |||
103 | +++ debian/compizconfig 2016-07-14 15:55:30 +0000 | |||
104 | @@ -20,3 +20,8 @@ | |||
105 | 20 | plugin_list_autosort = true | 20 | plugin_list_autosort = true |
106 | 21 | profile = unity | 21 | profile = unity |
107 | 22 | 22 | ||
108 | 23 | [general_ubuntu-lowgfx] | ||
109 | 24 | backend = gsettings | ||
110 | 25 | integration = true | ||
111 | 26 | plugin_list_autosort = true | ||
112 | 27 | profile = unity-lowgfx | ||
113 | 23 | 28 | ||
114 | === added file 'debian/unity-lowgfx.ini' | |||
115 | --- debian/unity-lowgfx.ini 1970-01-01 00:00:00 +0000 | |||
116 | +++ debian/unity-lowgfx.ini 2016-07-14 15:55:30 +0000 | |||
117 | @@ -0,0 +1,44 @@ | |||
118 | 1 | [core] | ||
119 | 2 | s0_active_plugins = core;composite;opengl;copytex;compiztoolbox;vpswitch;snap;mousepoll;resize;place;move;wall;grid;regex;imgpng;session;fade;unitymtgrabhandles;workarounds;scale;expo;ezoom;unityshell | ||
120 | 3 | |||
121 | 4 | [ezoom] | ||
122 | 5 | s0_speed = 100 | ||
123 | 6 | |||
124 | 7 | [expo] | ||
125 | 8 | s0_expo_animation = 3 | ||
126 | 9 | |||
127 | 10 | [fade] | ||
128 | 11 | s0_fade_mode = 1 | ||
129 | 12 | s0_fade_time = 1 | ||
130 | 13 | |||
131 | 14 | [grid] | ||
132 | 15 | s0_animation_duration = 1 | ||
133 | 16 | |||
134 | 17 | [resize] | ||
135 | 18 | s0_mode = 2 | ||
136 | 19 | |||
137 | 20 | [opengl] | ||
138 | 21 | s0_texture_filter = 0 | ||
139 | 22 | |||
140 | 23 | [scale] | ||
141 | 24 | s0_skip_animation = true | ||
142 | 25 | |||
143 | 26 | [unityshell] | ||
144 | 27 | s0_low_graphics_mode = true | ||
145 | 28 | s0_dash_blur_experimental = 0 | ||
146 | 29 | |||
147 | 30 | s0_override_decoration_theme = true | ||
148 | 31 | s0_shadow_x_offset = 1 | ||
149 | 32 | s0_shadow_y_offset = 1 | ||
150 | 33 | s0_active_shadow_radius = 3 | ||
151 | 34 | s0_inactive_shadow_radius = 2 | ||
152 | 35 | |||
153 | 36 | s0_menus_fadein = 0 | ||
154 | 37 | s0_menus_fadeout = 0 | ||
155 | 38 | s0_menus_discovery_fadein = 0 | ||
156 | 39 | s0_menus_discovery_fadeout = 0 | ||
157 | 40 | |||
158 | 41 | s0_autohide_animation = 1 | ||
159 | 42 | |||
160 | 43 | [wall] | ||
161 | 44 | s0_slide_duration = 0 | ||
162 | 0 | 45 | ||
163 | === modified file 'plugins/CMakeLists.txt' | |||
164 | --- plugins/CMakeLists.txt 2016-05-13 06:42:58 +0000 | |||
165 | +++ plugins/CMakeLists.txt 2016-07-14 15:55:30 +0000 | |||
166 | @@ -10,7 +10,6 @@ | |||
167 | 10 | include_directories (${COMPIZ_INTERNAL_INCLUDES}) | 10 | include_directories (${COMPIZ_INTERNAL_INCLUDES}) |
168 | 11 | 11 | ||
169 | 12 | # temporarily disable plugins that aren't ported yet | 12 | # temporarily disable plugins that aren't ported yet |
170 | 13 | set (COMPIZ_DISABLE_PLUGIN_ANIMATIONADDON ON) | ||
171 | 14 | set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON) | 13 | set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON) |
172 | 15 | set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON) | 14 | set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON) |
173 | 16 | set (COMPIZ_DISABLE_PLUGIN_GROUP ON) | 15 | set (COMPIZ_DISABLE_PLUGIN_GROUP ON) |
174 | 17 | 16 | ||
175 | === modified file 'plugins/animation/include/animation/animeffect.h' | |||
176 | --- plugins/animation/include/animation/animeffect.h 2015-03-01 21:55:10 +0000 | |||
177 | +++ plugins/animation/include/animation/animeffect.h 2016-07-14 15:55:30 +0000 | |||
178 | @@ -142,7 +142,7 @@ | |||
179 | 142 | virtual void updateAttrib (GLWindowPaintAttrib &) {} | 142 | virtual void updateAttrib (GLWindowPaintAttrib &) {} |
180 | 143 | virtual void updateTransform (GLMatrix &) {} | 143 | virtual void updateTransform (GLMatrix &) {} |
181 | 144 | virtual void prePaintWindow () {} | 144 | virtual void prePaintWindow () {} |
183 | 145 | virtual void postPaintWindow () {} | 145 | virtual void postPaintWindow (const GLMatrix &) {} |
184 | 146 | virtual bool postPaintWindowUsed () { return false; } | 146 | virtual bool postPaintWindowUsed () { return false; } |
185 | 147 | 147 | ||
186 | 148 | /// Returns true if the animation is still in progress. | 148 | /// Returns true if the animation is still in progress. |
187 | @@ -174,7 +174,10 @@ | |||
188 | 174 | const CompRegion &clip, | 174 | const CompRegion &clip, |
189 | 175 | unsigned int maxGridWidth, | 175 | unsigned int maxGridWidth, |
190 | 176 | unsigned int maxGridHeight); | 176 | unsigned int maxGridHeight); |
192 | 177 | virtual void drawGeometry (); | 177 | virtual void drawGeometry (GLTexture *texture, |
193 | 178 | const GLMatrix &transform, | ||
194 | 179 | const GLWindowPaintAttrib &attrib, | ||
195 | 180 | unsigned int mask); | ||
196 | 178 | 181 | ||
197 | 179 | virtual bool paintWindowUsed () { return false; } | 182 | virtual bool paintWindowUsed () { return false; } |
198 | 180 | virtual bool paintWindow (GLWindow *gWindow, | 183 | virtual bool paintWindow (GLWindow *gWindow, |
199 | 181 | 184 | ||
200 | === modified file 'plugins/animation/include/animation/grid.h' | |||
201 | --- plugins/animation/include/animation/grid.h 2012-08-14 06:33:22 +0000 | |||
202 | +++ plugins/animation/include/animation/grid.h 2016-07-14 15:55:30 +0000 | |||
203 | @@ -101,6 +101,5 @@ | |||
204 | 101 | const CompRegion &clip, | 101 | const CompRegion &clip, |
205 | 102 | unsigned int maxGridWidth, | 102 | unsigned int maxGridWidth, |
206 | 103 | unsigned int maxGridHeight); | 103 | unsigned int maxGridHeight); |
207 | 104 | void drawGeometry (); | ||
208 | 105 | }; | 104 | }; |
209 | 106 | #endif | 105 | #endif |
210 | 107 | 106 | ||
211 | === modified file 'plugins/animation/include/animation/multi.h' | |||
212 | --- plugins/animation/include/animation/multi.h 2013-04-25 11:07:54 +0000 | |||
213 | +++ plugins/animation/include/animation/multi.h 2016-07-14 15:55:30 +0000 | |||
214 | @@ -1,6 +1,8 @@ | |||
215 | 1 | #ifndef ANIMATION_MULTI_H | 1 | #ifndef ANIMATION_MULTI_H |
216 | 2 | #define ANIMATION_MULTI_H | 2 | #define ANIMATION_MULTI_H |
217 | 3 | #include "animation.h" | 3 | #include "animation.h" |
218 | 4 | #include <opengl/opengl.h> | ||
219 | 5 | #include <composite/composite.h> | ||
220 | 4 | /// Special class, allows multiple copies of an animation to happen | 6 | /// Special class, allows multiple copies of an animation to happen |
221 | 5 | /// at any one time. Create your "single copy" animation class first | 7 | /// at any one time. Create your "single copy" animation class first |
222 | 6 | /// and then create a new animation which derives from this template | 8 | /// and then create a new animation which derives from this template |
223 | @@ -140,9 +142,8 @@ | |||
224 | 140 | foreach (SingleAnim *a, animList) | 142 | foreach (SingleAnim *a, animList) |
225 | 141 | { | 143 | { |
226 | 142 | setCurrAnimNumber (mAWindow, count); | 144 | setCurrAnimNumber (mAWindow, count); |
230 | 143 | GLWindowPaintAttrib attr (attrib); | 145 | mGlPaintAttribs[count] = attrib; |
231 | 144 | a->updateAttrib (attr); | 146 | a->updateAttrib (mGlPaintAttribs[count]); |
229 | 145 | mGlPaintAttribs.at (count) = attr; | ||
232 | 146 | ++count; | 147 | ++count; |
233 | 147 | } | 148 | } |
234 | 148 | } | 149 | } |
235 | @@ -172,14 +173,14 @@ | |||
236 | 172 | } | 173 | } |
237 | 173 | } | 174 | } |
238 | 174 | 175 | ||
240 | 175 | void postPaintWindow () | 176 | void postPaintWindow (const GLMatrix &transform) |
241 | 176 | { | 177 | { |
242 | 177 | int count = 0; | 178 | int count = 0; |
243 | 178 | foreach (SingleAnim *a, animList) | 179 | foreach (SingleAnim *a, animList) |
244 | 179 | { | 180 | { |
245 | 180 | setCurrAnimNumber (mAWindow, count); | 181 | setCurrAnimNumber (mAWindow, count); |
246 | 181 | ++count; | 182 | ++count; |
248 | 182 | a->postPaintWindow (); | 183 | a->postPaintWindow (transform); |
249 | 183 | } | 184 | } |
250 | 184 | } | 185 | } |
251 | 185 | 186 | ||
252 | @@ -377,11 +378,20 @@ | |||
253 | 377 | ++count; | 378 | ++count; |
254 | 378 | 379 | ||
255 | 379 | if (animList.at (currentAnim)->paintWindowUsed ()) | 380 | if (animList.at (currentAnim)->paintWindowUsed ()) |
258 | 380 | status |= animList.at (currentAnim)->paintWindow | 381 | status |= animList.at (currentAnim)->paintWindow (gWindow, |
259 | 381 | (gWindow, wAttrib, wTransform, region, mask); | 382 | wAttrib, |
260 | 383 | wTransform, | ||
261 | 384 | region, | ||
262 | 385 | mask); | ||
263 | 382 | else | 386 | else |
266 | 383 | status |= gWindow->glPaint | 387 | { |
267 | 384 | (wAttrib, wTransform, region, mask); | 388 | unsigned int index = gWindow->glPaintGetCurrentIndex (); |
268 | 389 | status |= gWindow->glPaint (wAttrib, | ||
269 | 390 | wTransform, | ||
270 | 391 | region, | ||
271 | 392 | mask); | ||
272 | 393 | gWindow->glPaintSetCurrentIndex (index); | ||
273 | 394 | } | ||
274 | 385 | } | 395 | } |
275 | 386 | 396 | ||
276 | 387 | return status; | 397 | return status; |
277 | 388 | 398 | ||
278 | === modified file 'plugins/animation/src/animation.cpp' | |||
279 | --- plugins/animation/src/animation.cpp 2015-03-16 18:45:33 +0000 | |||
280 | +++ plugins/animation/src/animation.cpp 2016-07-14 15:55:30 +0000 | |||
281 | @@ -1632,20 +1632,20 @@ | |||
282 | 1632 | if (mCurAnimation) | 1632 | if (mCurAnimation) |
283 | 1633 | mCurAnimation->setCurPaintAttrib (attrib); | 1633 | mCurAnimation->setCurPaintAttrib (attrib); |
284 | 1634 | 1634 | ||
286 | 1635 | gWindow->glDrawTexture (texture, transform, attrib, mask); | 1635 | if (mCurAnimation) |
287 | 1636 | { | ||
288 | 1637 | if (mCurAnimation->initialized ()) | ||
289 | 1638 | mCurAnimation->drawGeometry (texture, transform, attrib, mask); | ||
290 | 1639 | } | ||
291 | 1640 | else | ||
292 | 1641 | gWindow->glDrawTexture (texture, transform, attrib, mask); | ||
293 | 1636 | } | 1642 | } |
294 | 1637 | 1643 | ||
295 | 1638 | #if 0 // Not ported yet | 1644 | #if 0 // Not ported yet |
296 | 1639 | void | 1645 | void |
297 | 1640 | PrivateAnimWindow::glDrawGeometry () | 1646 | PrivateAnimWindow::glDrawGeometry () |
298 | 1641 | { | 1647 | { |
306 | 1642 | if (mCurAnimation) | 1648 | |
300 | 1643 | { | ||
301 | 1644 | if (mCurAnimation->initialized ()) | ||
302 | 1645 | mCurAnimation->drawGeometry (); | ||
303 | 1646 | } | ||
304 | 1647 | else | ||
305 | 1648 | gWindow->glDrawGeometry (); | ||
307 | 1649 | } | 1649 | } |
308 | 1650 | #endif | 1650 | #endif |
309 | 1651 | 1651 | ||
310 | @@ -1658,11 +1658,15 @@ | |||
311 | 1658 | } | 1658 | } |
312 | 1659 | 1659 | ||
313 | 1660 | void | 1660 | void |
315 | 1661 | Animation::drawGeometry () | 1661 | Animation::drawGeometry (GLTexture *texture, |
316 | 1662 | const GLMatrix &transform, | ||
317 | 1663 | const GLWindowPaintAttrib &attrib, | ||
318 | 1664 | unsigned int mask) | ||
319 | 1662 | { | 1665 | { |
323 | 1663 | #if 0 // Not ported yet | 1666 | GLWindow::get (mAWindow->mWindow)->glDrawTexture (texture, |
324 | 1664 | mAWindow->priv->gWindow->glDrawGeometry (); | 1667 | transform, |
325 | 1665 | #endif | 1668 | attrib, |
326 | 1669 | mask); | ||
327 | 1666 | } | 1670 | } |
328 | 1667 | 1671 | ||
329 | 1668 | bool | 1672 | bool |
330 | @@ -1731,18 +1735,7 @@ | |||
331 | 1731 | status = gWindow->glPaint (wAttrib, wTransform, region, mask); | 1735 | status = gWindow->glPaint (wAttrib, wTransform, region, mask); |
332 | 1732 | 1736 | ||
333 | 1733 | if (mCurAnimation->postPaintWindowUsed ()) | 1737 | if (mCurAnimation->postPaintWindowUsed ()) |
346 | 1734 | { | 1738 | mCurAnimation->postPaintWindow (wTransform); |
335 | 1735 | #if 0 // Not ported yet | ||
336 | 1736 | // Transform to make post-paint coincide with the window | ||
337 | 1737 | glPushMatrix (); | ||
338 | 1738 | glLoadMatrixf (wTransform.getMatrix ()); | ||
339 | 1739 | #endif | ||
340 | 1740 | mCurAnimation->postPaintWindow (); | ||
341 | 1741 | |||
342 | 1742 | #if 0 // Not ported yet | ||
343 | 1743 | glPopMatrix (); | ||
344 | 1744 | #endif | ||
345 | 1745 | } | ||
347 | 1746 | 1739 | ||
348 | 1747 | return status; | 1740 | return status; |
349 | 1748 | } | 1741 | } |
350 | 1749 | 1742 | ||
351 | === modified file 'plugins/animation/src/glide.cpp' | |||
352 | --- plugins/animation/src/glide.cpp 2015-03-02 08:48:27 +0000 | |||
353 | +++ plugins/animation/src/glide.cpp 2016-07-14 15:55:30 +0000 | |||
354 | @@ -167,7 +167,7 @@ | |||
355 | 167 | } | 167 | } |
356 | 168 | 168 | ||
357 | 169 | void | 169 | void |
359 | 170 | GlideAnim::postPaintWindow () | 170 | GlideAnim::postPaintWindow (const GLMatrix &transform) |
360 | 171 | { | 171 | { |
361 | 172 | if (90 < glideModRotAngle && | 172 | if (90 < glideModRotAngle && |
362 | 173 | glideModRotAngle < 270) | 173 | glideModRotAngle < 270) |
363 | 174 | 174 | ||
364 | === modified file 'plugins/animation/src/grid.cpp' | |||
365 | --- plugins/animation/src/grid.cpp 2013-07-24 17:36:47 +0000 | |||
366 | +++ plugins/animation/src/grid.cpp 2016-07-14 15:55:30 +0000 | |||
367 | @@ -388,12 +388,6 @@ | |||
368 | 388 | } | 388 | } |
369 | 389 | } | 389 | } |
370 | 390 | 390 | ||
371 | 391 | void | ||
372 | 392 | GridAnim::drawGeometry () | ||
373 | 393 | { | ||
374 | 394 | // Deprecated | ||
375 | 395 | } | ||
376 | 396 | |||
377 | 397 | GridTransformAnim::GridTransformAnim (CompWindow *w, | 391 | GridTransformAnim::GridTransformAnim (CompWindow *w, |
378 | 398 | WindowEvent curWindowEvent, | 392 | WindowEvent curWindowEvent, |
379 | 399 | float duration, | 393 | float duration, |
380 | 400 | 394 | ||
381 | === modified file 'plugins/animation/src/private.h' | |||
382 | --- plugins/animation/src/private.h 2013-10-31 15:59:14 +0000 | |||
383 | +++ plugins/animation/src/private.h 2016-07-14 15:55:30 +0000 | |||
384 | @@ -588,7 +588,7 @@ | |||
385 | 588 | 588 | ||
386 | 589 | void prePaintWindow (); | 589 | void prePaintWindow (); |
387 | 590 | inline bool postPaintWindowUsed () { return true; } | 590 | inline bool postPaintWindowUsed () { return true; } |
389 | 591 | void postPaintWindow (); | 591 | void postPaintWindow (const GLMatrix &); |
390 | 592 | void adjustDuration (); | 592 | void adjustDuration (); |
391 | 593 | bool zoomToIcon (); | 593 | bool zoomToIcon (); |
392 | 594 | void applyTransform (); | 594 | void applyTransform (); |
393 | 595 | 595 | ||
394 | === modified file 'plugins/animationaddon/CMakeLists.txt' | |||
395 | --- plugins/animationaddon/CMakeLists.txt 2012-05-21 08:50:26 +0000 | |||
396 | +++ plugins/animationaddon/CMakeLists.txt 2016-07-14 15:55:30 +0000 | |||
397 | @@ -1,7 +1,4 @@ | |||
398 | 1 | find_package (Compiz REQUIRED) | 1 | find_package (Compiz REQUIRED) |
399 | 2 | include (CompizPlugin) | 2 | include (CompizPlugin) |
400 | 3 | include (FindOpenGL) | ||
401 | 4 | 3 | ||
405 | 5 | if (OPENGL_GLU_FOUND) | 4 | compiz_plugin (animationaddon PLUGINDEPS composite opengl animation) |
403 | 6 | compiz_plugin (animationaddon PLUGINDEPS composite opengl animation LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR}) | ||
404 | 7 | endif (OPENGL_GLU_FOUND) | ||
406 | 8 | 5 | ||
407 | === modified file 'plugins/animationaddon/include/animationaddon/animationaddon.h' | |||
408 | --- plugins/animationaddon/include/animationaddon/animationaddon.h 2010-01-27 16:32:40 +0000 | |||
409 | +++ plugins/animationaddon/include/animationaddon/animationaddon.h 2016-07-14 15:55:30 +0000 | |||
410 | @@ -97,7 +97,7 @@ | |||
411 | 97 | GLuint blendMode); | 97 | GLuint blendMode); |
412 | 98 | ~ParticleSystem (); | 98 | ~ParticleSystem (); |
413 | 99 | 99 | ||
415 | 100 | void draw (int offsetX = 0, int offsetY = 0); | 100 | void draw (const GLMatrix &transform, int offsetX = 0, int offsetY = 0); |
416 | 101 | void update (float time); | 101 | void update (float time); |
417 | 102 | vector<Particle> &particles () { return mParticles; } | 102 | vector<Particle> &particles () { return mParticles; } |
418 | 103 | void activate () { mActive = true; } | 103 | void activate () { mActive = true; } |
419 | @@ -120,8 +120,8 @@ | |||
420 | 120 | 120 | ||
421 | 121 | vector<GLfloat> mVerticesCache; | 121 | vector<GLfloat> mVerticesCache; |
422 | 122 | vector<GLfloat> mCoordsCache; | 122 | vector<GLfloat> mCoordsCache; |
425 | 123 | vector<GLfloat> mColorsCache; | 123 | vector<GLushort> mColorsCache; |
426 | 124 | vector<GLfloat> mDColorsCache; | 124 | vector<GLushort> mDColorsCache; |
427 | 125 | }; | 125 | }; |
428 | 126 | 126 | ||
429 | 127 | class ParticleAnim : | 127 | class ParticleAnim : |
430 | @@ -135,7 +135,7 @@ | |||
431 | 135 | const AnimEffect info, | 135 | const AnimEffect info, |
432 | 136 | const CompRect &icon); | 136 | const CompRect &icon); |
433 | 137 | ~ParticleAnim () {} | 137 | ~ParticleAnim () {} |
435 | 138 | void postPaintWindow (); | 138 | void postPaintWindow (const GLMatrix &); |
436 | 139 | bool postPaintWindowUsed () { return true; } | 139 | bool postPaintWindowUsed () { return true; } |
437 | 140 | void updateBB (CompOutput &output); | 140 | void updateBB (CompOutput &output); |
438 | 141 | bool updateBBUsed () { return true; } | 141 | bool updateBBUsed () { return true; } |
439 | @@ -259,14 +259,17 @@ | |||
440 | 259 | 259 | ||
441 | 260 | void step (); | 260 | void step (); |
442 | 261 | void prePaintWindow (); | 261 | void prePaintWindow (); |
444 | 262 | void postPaintWindow (); | 262 | void postPaintWindow (const GLMatrix &); |
445 | 263 | bool postPaintWindowUsed () { return true; } | 263 | bool postPaintWindowUsed () { return true; } |
446 | 264 | void addGeometry (const GLTexture::MatrixList &matrix, | 264 | void addGeometry (const GLTexture::MatrixList &matrix, |
447 | 265 | const CompRegion ®ion, | 265 | const CompRegion ®ion, |
448 | 266 | const CompRegion &clipRegion, | 266 | const CompRegion &clipRegion, |
449 | 267 | unsigned int maxGridWidth, | 267 | unsigned int maxGridWidth, |
450 | 268 | unsigned int maxGridHeight); | 268 | unsigned int maxGridHeight); |
452 | 269 | void drawGeometry (); | 269 | void drawGeometry (GLTexture *texture, |
453 | 270 | const GLMatrix &transform, | ||
454 | 271 | const GLWindowPaintAttrib &attrib, | ||
455 | 272 | unsigned int mask); | ||
456 | 270 | virtual void updateBB (CompOutput &output); | 273 | virtual void updateBB (CompOutput &output); |
457 | 271 | bool updateBBUsed () { return true; } | 274 | bool updateBBUsed () { return true; } |
458 | 272 | bool prePreparePaint (int msSinceLastPaint); | 275 | bool prePreparePaint (int msSinceLastPaint); |
459 | @@ -274,7 +277,8 @@ | |||
460 | 274 | 277 | ||
461 | 275 | virtual void stepPolygon (PolygonObject *p, | 278 | virtual void stepPolygon (PolygonObject *p, |
462 | 276 | float forwardProgress); | 279 | float forwardProgress); |
464 | 277 | virtual void transformPolygon (const PolygonObject *p) {} | 280 | virtual void transformPolygon (GLMatrix &matrix, |
465 | 281 | const PolygonObject *p) {} | ||
466 | 278 | 282 | ||
467 | 279 | /// For effects that have decel. motion | 283 | /// For effects that have decel. motion |
468 | 280 | virtual bool deceleratingMotion () { return false; } | 284 | virtual bool deceleratingMotion () { return false; } |
469 | @@ -301,7 +305,8 @@ | |||
470 | 301 | void processIntersectingPolygons (); | 305 | void processIntersectingPolygons (); |
471 | 302 | virtual void freePolygonObjects (); | 306 | virtual void freePolygonObjects (); |
472 | 303 | void freeClipsPolygons (); | 307 | void freeClipsPolygons (); |
474 | 304 | void prepareDrawingForAttrib (GLFragment::Attrib &attrib); | 308 | void prepareDrawingForAttrib (GLWindowPaintAttrib &attrib, |
475 | 309 | GLVertexBuffer &vertexBuffer); | ||
476 | 305 | 310 | ||
477 | 306 | int mNumDrawGeometryCalls; | 311 | int mNumDrawGeometryCalls; |
478 | 307 | int mNumClipsPassed; /**< # of clips passed to animAddWindowGeometry so far | 312 | int mNumClipsPassed; /**< # of clips passed to animAddWindowGeometry so far |
479 | @@ -327,15 +332,16 @@ | |||
480 | 327 | bool mIncludeShadows; ///< Whether to include shadows in polygon | 332 | bool mIncludeShadows; ///< Whether to include shadows in polygon |
481 | 328 | 333 | ||
482 | 329 | private: | 334 | private: |
484 | 330 | inline void drawPolygonClipIntersection (const PolygonObject *p, | 335 | inline void drawPolygonClipIntersection (GLTexture *texture, |
485 | 336 | const GLMatrix &transform, | ||
486 | 337 | const PolygonObject *p, | ||
487 | 331 | const Clip4Polygons &c, | 338 | const Clip4Polygons &c, |
488 | 332 | const GLfloat *vertexTexCoords, | 339 | const GLfloat *vertexTexCoords, |
489 | 333 | int pass, | 340 | int pass, |
490 | 334 | float forwardProgress, | 341 | float forwardProgress, |
491 | 335 | GLdouble clipPlane[4][4], | ||
492 | 336 | const CompOutput &output, | 342 | const CompOutput &output, |
493 | 337 | float newOpacity, | 343 | float newOpacity, |
494 | 338 | bool decelerates, | 344 | bool decelerates, |
496 | 339 | GLfloat skewMat[16]); | 345 | GLMatrix &skewMat); |
497 | 340 | }; | 346 | }; |
498 | 341 | #endif | 347 | #endif |
499 | 342 | 348 | ||
500 | === modified file 'plugins/animationaddon/src/airplane.cpp' | |||
501 | --- plugins/animationaddon/src/airplane.cpp 2013-02-27 11:33:10 +0000 | |||
502 | +++ plugins/animationaddon/src/airplane.cpp 2016-07-14 15:55:30 +0000 | |||
503 | @@ -271,8 +271,8 @@ | |||
504 | 271 | pv[22] = topLeftY; | 271 | pv[22] = topLeftY; |
505 | 272 | pv[23] = -halfThick; | 272 | pv[23] = -halfThick; |
506 | 273 | 273 | ||
509 | 274 | // 16 indices for 4 sides (for quad strip) | 274 | // 24 indices for 4 sides (for triangle strip) |
510 | 275 | p->sideIndices = (GLushort *) calloc (4 * 4, sizeof (GLushort)); | 275 | p->sideIndices = (GLushort *) calloc (6 * 4, sizeof (GLushort)); |
511 | 276 | if (!p->sideIndices) | 276 | if (!p->sideIndices) |
512 | 277 | { | 277 | { |
513 | 278 | compLogMessage ("animation", CompLogLevelError, | 278 | compLogMessage ("animation", CompLogLevelError, |
514 | @@ -287,22 +287,30 @@ | |||
515 | 287 | ind[id++] = 0; | 287 | ind[id++] = 0; |
516 | 288 | ind[id++] = 7; | 288 | ind[id++] = 7; |
517 | 289 | ind[id++] = 6; | 289 | ind[id++] = 6; |
534 | 290 | ind[id++] = 1; | 290 | ind[id++] = 0; |
535 | 291 | 291 | ind[id++] = 1; | |
536 | 292 | ind[id++] = 1; | 292 | ind[id++] = 6; |
537 | 293 | ind[id++] = 6; | 293 | |
538 | 294 | ind[id++] = 5; | 294 | ind[id++] = 1; |
539 | 295 | ind[id++] = 2; | 295 | ind[id++] = 6; |
540 | 296 | 296 | ind[id++] = 5; | |
541 | 297 | ind[id++] = 2; | 297 | ind[id++] = 1; |
542 | 298 | ind[id++] = 5; | 298 | ind[id++] = 2; |
543 | 299 | ind[id++] = 4; | 299 | ind[id++] = 5; |
544 | 300 | ind[id++] = 3; | 300 | |
545 | 301 | 301 | ind[id++] = 2; | |
546 | 302 | ind[id++] = 3; | 302 | ind[id++] = 5; |
547 | 303 | ind[id++] = 4; | 303 | ind[id++] = 4; |
548 | 304 | ind[id++] = 7; | 304 | ind[id++] = 2; |
549 | 305 | ind[id++] = 0; | 305 | ind[id++] = 3; |
550 | 306 | ind[id++] = 4; | ||
551 | 307 | |||
552 | 308 | ind[id++] = 3; | ||
553 | 309 | ind[id++] = 4; | ||
554 | 310 | ind[id++] = 7; | ||
555 | 311 | ind[id++] = 3; | ||
556 | 312 | ind[id++] = 0; | ||
557 | 313 | ind[id++] = 7; | ||
558 | 306 | 314 | ||
559 | 307 | if (i < 4) | 315 | if (i < 4) |
560 | 308 | { | 316 | { |
561 | @@ -318,6 +326,8 @@ | |||
562 | 318 | p->boundingBox.x2 = ceil (p->centerPos.x () + bottomRightX); | 326 | p->boundingBox.x2 = ceil (p->centerPos.x () + bottomRightX); |
563 | 319 | p->boundingBox.y2 = ceil (p->centerPos.y () + bottomLeftY); | 327 | p->boundingBox.y2 = ceil (p->centerPos.y () + bottomLeftY); |
564 | 320 | } | 328 | } |
565 | 329 | |||
566 | 330 | p->normals = NULL; | ||
567 | 321 | 331 | ||
568 | 322 | i++; | 332 | i++; |
569 | 323 | } | 333 | } |
570 | @@ -692,41 +702,42 @@ | |||
571 | 692 | } | 702 | } |
572 | 693 | 703 | ||
573 | 694 | void | 704 | void |
575 | 695 | AirplaneAnim::transformPolygon (const PolygonObject *pol) | 705 | AirplaneAnim::transformPolygon (GLMatrix &matrix, |
576 | 706 | const PolygonObject *pol) | ||
577 | 696 | { | 707 | { |
578 | 697 | AirplanePolygonObject *p = (AirplanePolygonObject *) pol; | 708 | AirplanePolygonObject *p = (AirplanePolygonObject *) pol; |
579 | 698 | 709 | ||
583 | 699 | glRotatef (p->flyRotation.x (), 1, 0, 0); //rotate on axis X | 710 | matrix.rotate (p->flyRotation.x (), 1, 0, 0); //rotate on axis X |
584 | 700 | glRotatef (-p->flyRotation.y (), 0, 1, 0); // rotate on axis Y | 711 | matrix.rotate (-p->flyRotation.y (), 0, 1, 0); // rotate on axis Y |
585 | 701 | glRotatef (p->flyRotation.z (), 0, 0, 1); // rotate on axis Z | 712 | matrix.rotate (p->flyRotation.z (), 0, 0, 1); // rotate on axis Z |
586 | 702 | 713 | ||
589 | 703 | glScalef (1.0 / (1.0 + p->flyScale), | 714 | matrix.scale (1.0 / (1.0 + p->flyScale), |
590 | 704 | 1.0 / (1.0 + p->flyScale), 1.0 / (1.0 + p->flyScale)); | 715 | 1.0 / (1.0 + p->flyScale), 1.0 / (1.0 + p->flyScale)); |
591 | 705 | 716 | ||
592 | 706 | // Move by "rotation axis offset A" | 717 | // Move by "rotation axis offset A" |
595 | 707 | glTranslatef (p->rotAxisOffsetA.x (), p->rotAxisOffsetA.y (), | 718 | matrix.translate (p->rotAxisOffsetA.x (), p->rotAxisOffsetA.y (), |
596 | 708 | p->rotAxisOffsetA.z ()); | 719 | p->rotAxisOffsetA.z ()); |
597 | 709 | 720 | ||
598 | 710 | // Rotate by desired angle A | 721 | // Rotate by desired angle A |
601 | 711 | glRotatef (p->rotAngleA, p->rotAxisA.x (), p->rotAxisA.y (), | 722 | matrix.rotate (p->rotAngleA, p->rotAxisA.x (), p->rotAxisA.y (), |
602 | 712 | p->rotAxisA.z ()); | 723 | p->rotAxisA.z ()); |
603 | 713 | 724 | ||
604 | 714 | // Move back to center from A | 725 | // Move back to center from A |
607 | 715 | glTranslatef (-p->rotAxisOffsetA.x (), -p->rotAxisOffsetA.y (), | 726 | matrix.translate (-p->rotAxisOffsetA.x (), -p->rotAxisOffsetA.y (), |
608 | 716 | -p->rotAxisOffsetA.z ()); | 727 | -p->rotAxisOffsetA.z ()); |
609 | 717 | 728 | ||
610 | 718 | 729 | ||
611 | 719 | // Move by "rotation axis offset B" | 730 | // Move by "rotation axis offset B" |
614 | 720 | glTranslatef (p->rotAxisOffsetB.x (), p->rotAxisOffsetB.y (), | 731 | matrix.translate (p->rotAxisOffsetB.x (), p->rotAxisOffsetB.y (), |
615 | 721 | p->rotAxisOffsetB.z ()); | 732 | p->rotAxisOffsetB.z ()); |
616 | 722 | 733 | ||
617 | 723 | // Rotate by desired angle B | 734 | // Rotate by desired angle B |
620 | 724 | glRotatef (p->rotAngleB, p->rotAxisB.x (), p->rotAxisB.y (), | 735 | matrix.rotate (p->rotAngleB, p->rotAxisB.x (), p->rotAxisB.y (), |
621 | 725 | p->rotAxisB.z ()); | 736 | p->rotAxisB.z ()); |
622 | 726 | 737 | ||
623 | 727 | // Move back to center from B | 738 | // Move back to center from B |
626 | 728 | glTranslatef (-p->rotAxisOffsetB.x (), -p->rotAxisOffsetB.y (), | 739 | matrix.translate (-p->rotAxisOffsetB.x (), -p->rotAxisOffsetB.y (), |
627 | 729 | -p->rotAxisOffsetB.z ()); | 740 | -p->rotAxisOffsetB.z ()); |
628 | 730 | } | 741 | } |
629 | 731 | 742 | ||
630 | 732 | 743 | ||
631 | 733 | 744 | ||
632 | === modified file 'plugins/animationaddon/src/animationaddon.cpp' | |||
633 | --- plugins/animationaddon/src/animationaddon.cpp 2013-05-09 13:43:07 +0000 | |||
634 | +++ plugins/animationaddon/src/animationaddon.cpp 2016-07-14 15:55:30 +0000 | |||
635 | @@ -81,7 +81,7 @@ | |||
636 | 81 | #include "private.h" | 81 | #include "private.h" |
637 | 82 | 82 | ||
638 | 83 | class AnimAddonPluginVTable : | 83 | class AnimAddonPluginVTable : |
640 | 84 | public CompPlugin::VTableForScreenAndWindow<AnimAddonScreen, AnimAddonWindow> | 84 | public CompPlugin::VTableForScreenAndWindow<AnimAddonScreen, AnimAddonWindow, ANIMATIONADDON_ABI> |
641 | 85 | { | 85 | { |
642 | 86 | public: | 86 | public: |
643 | 87 | bool init (); | 87 | bool init (); |
644 | @@ -232,7 +232,7 @@ | |||
645 | 232 | } | 232 | } |
646 | 233 | 233 | ||
647 | 234 | AnimAddonWindow::AnimAddonWindow (CompWindow *w) : | 234 | AnimAddonWindow::AnimAddonWindow (CompWindow *w) : |
649 | 235 | PluginClassHandler<AnimAddonWindow, CompWindow> (w), | 235 | PluginClassHandler<AnimAddonWindow, CompWindow, ANIMATIONADDON_ABI> (w), |
650 | 236 | mWindow (w), | 236 | mWindow (w), |
651 | 237 | aWindow (AnimWindow::get (w)) | 237 | aWindow (AnimWindow::get (w)) |
652 | 238 | { | 238 | { |
653 | 239 | 239 | ||
654 | === modified file 'plugins/animationaddon/src/dissolve.cpp' | |||
655 | --- plugins/animationaddon/src/dissolve.cpp 2010-08-23 03:24:20 +0000 | |||
656 | +++ plugins/animationaddon/src/dissolve.cpp 2016-07-14 15:55:30 +0000 | |||
657 | @@ -33,7 +33,7 @@ | |||
658 | 33 | float o = 0.2; | 33 | float o = 0.2; |
659 | 34 | float factor = (4 - layer) * o; | 34 | float factor = (4 - layer) * o; |
660 | 35 | 35 | ||
662 | 36 | attrib.opacity *= o / (1.0 - factor); | 36 | attrib.opacity *= (o / (1.0 - factor)) * (1.0 - getDissolveSingleProgress ()); |
663 | 37 | } | 37 | } |
664 | 38 | 38 | ||
665 | 39 | void | 39 | void |
666 | @@ -62,5 +62,14 @@ | |||
667 | 62 | void | 62 | void |
668 | 63 | DissolveSingleAnim::updateBB (CompOutput &output) | 63 | DissolveSingleAnim::updateBB (CompOutput &output) |
669 | 64 | { | 64 | { |
671 | 65 | mAWindow->expandBBWithWindow (); | 65 | CompRect outRect (mAWindow->mWindow->outputRect ()); |
672 | 66 | |||
673 | 67 | Box windowBox = | ||
674 | 68 | { | ||
675 | 69 | static_cast <short int> (outRect.x () - 4), | ||
676 | 70 | static_cast <short int> (outRect.x () + outRect.width () + 4), | ||
677 | 71 | static_cast <short int> (outRect.y () - 4), | ||
678 | 72 | static_cast <short int> (outRect.y () + outRect.height () + 4) | ||
679 | 73 | }; | ||
680 | 74 | mAWindow->expandBBWithBox (windowBox); | ||
681 | 66 | } | 75 | } |
682 | 67 | 76 | ||
683 | === modified file 'plugins/animationaddon/src/particle.cpp' | |||
684 | --- plugins/animationaddon/src/particle.cpp 2013-02-27 11:33:10 +0000 | |||
685 | +++ plugins/animationaddon/src/particle.cpp 2016-07-14 15:55:30 +0000 | |||
686 | @@ -81,7 +81,7 @@ | |||
687 | 81 | } | 81 | } |
688 | 82 | 82 | ||
689 | 83 | void | 83 | void |
691 | 84 | ParticleSystem::draw (int offsetX, int offsetY) | 84 | ParticleSystem::draw (const GLMatrix &transform, int offsetX, int offsetY) |
692 | 85 | { | 85 | { |
693 | 86 | // TODO | 86 | // TODO |
694 | 87 | // The part below should ideally be done in ParticleSystem constructor | 87 | // The part below should ideally be done in ParticleSystem constructor |
695 | @@ -95,9 +95,8 @@ | |||
696 | 95 | GL_RGBA, GL_UNSIGNED_BYTE, fireTex); | 95 | GL_RGBA, GL_UNSIGNED_BYTE, fireTex); |
697 | 96 | glBindTexture (GL_TEXTURE_2D, 0); | 96 | glBindTexture (GL_TEXTURE_2D, 0); |
698 | 97 | 97 | ||
702 | 98 | 98 | GLMatrix translatedMatrix (transform); | |
703 | 99 | glPushMatrix (); | 99 | //translatedMatrix.translate (offsetX - mX, offsetY - mY, 0); |
701 | 100 | glTranslated (offsetX - mX, offsetY - mY, 0); | ||
704 | 101 | 100 | ||
705 | 102 | glEnable (GL_BLEND); | 101 | glEnable (GL_BLEND); |
706 | 103 | if (mTex) | 102 | if (mTex) |
707 | @@ -105,26 +104,27 @@ | |||
708 | 105 | glBindTexture (GL_TEXTURE_2D, mTex); | 104 | glBindTexture (GL_TEXTURE_2D, mTex); |
709 | 106 | glEnable (GL_TEXTURE_2D); | 105 | glEnable (GL_TEXTURE_2D); |
710 | 107 | } | 106 | } |
711 | 108 | mGScreen->setTexEnvMode (GL_MODULATE); | ||
712 | 109 | 107 | ||
716 | 110 | mVerticesCache.resize (4 * 3 * mParticles.size ()); | 108 | mVerticesCache.resize (6 * 3 * mParticles.size ()); |
717 | 111 | mCoordsCache.resize (4 * 2 * mParticles.size ()); | 109 | mCoordsCache.resize (6 * 2 * mParticles.size ()); |
718 | 112 | mColorsCache.resize (4 * 4 * mParticles.size ()); | 110 | mColorsCache.resize (6 * 4 * mParticles.size ()); |
719 | 113 | if (mDarkenAmount > 0) | 111 | if (mDarkenAmount > 0) |
721 | 114 | mDColorsCache.resize (4 * 4 * mParticles.size ()); | 112 | mDColorsCache.resize (6 * 4 * mParticles.size ()); |
722 | 115 | 113 | ||
724 | 116 | GLfloat *dcolors = &mDColorsCache[0]; | 114 | GLushort *dcolors = &mDColorsCache[0]; |
725 | 117 | GLfloat *vertices = &mVerticesCache[0]; | 115 | GLfloat *vertices = &mVerticesCache[0]; |
726 | 118 | GLfloat *coords = &mCoordsCache[0]; | 116 | GLfloat *coords = &mCoordsCache[0]; |
728 | 119 | GLfloat *colors = &mColorsCache[0]; | 117 | GLushort *colors = &mColorsCache[0]; |
729 | 120 | 118 | ||
731 | 121 | int cornersSize = sizeof (GLfloat) * 8; | 119 | int cornersSize = sizeof (GLfloat) * 12; |
732 | 122 | int colorSize = sizeof (GLfloat) * 4; | 120 | int colorSize = sizeof (GLfloat) * 4; |
733 | 123 | 121 | ||
735 | 124 | GLfloat cornerCoords[8] = {0.0, 0.0, | 122 | GLfloat cornerCoords[12] = {0.0, 0.0, |
736 | 125 | 0.0, 1.0, | 123 | 0.0, 1.0, |
737 | 126 | 1.0, 1.0, | 124 | 1.0, 1.0, |
739 | 127 | 1.0, 0.0}; | 125 | 1.0, 1.0, |
740 | 126 | 1.0, 0.0, | ||
741 | 127 | 0.0, 0.0}; | ||
742 | 128 | 128 | ||
743 | 129 | int numActive = 0; | 129 | int numActive = 0; |
744 | 130 | 130 | ||
745 | @@ -133,7 +133,7 @@ | |||
746 | 133 | if (part.life <= 0.0f) // Ignore dead particles | 133 | if (part.life <= 0.0f) // Ignore dead particles |
747 | 134 | continue; | 134 | continue; |
748 | 135 | 135 | ||
750 | 136 | numActive += 4; | 136 | numActive += 6; |
751 | 137 | 137 | ||
752 | 138 | float w = part.width / 2; | 138 | float w = part.width / 2; |
753 | 139 | float h = part.height / 2; | 139 | float h = part.height / 2; |
754 | @@ -154,24 +154,34 @@ | |||
755 | 154 | vertices[8] = part.z; | 154 | vertices[8] = part.z; |
756 | 155 | 155 | ||
757 | 156 | vertices[9] = part.x + w; | 156 | vertices[9] = part.x + w; |
759 | 157 | vertices[10] = part.y - h; | 157 | vertices[10] = part.y + h; |
760 | 158 | vertices[11] = part.z; | 158 | vertices[11] = part.z; |
761 | 159 | 159 | ||
763 | 160 | vertices += 12; | 160 | vertices[12] = part.x + w; |
764 | 161 | vertices[13] = part.y - h; | ||
765 | 162 | vertices[14] = part.z; | ||
766 | 163 | |||
767 | 164 | vertices[15] = part.x - w; | ||
768 | 165 | vertices[16] = part.y - h; | ||
769 | 166 | vertices[17] = part.z; | ||
770 | 167 | |||
771 | 168 | vertices += 18; | ||
772 | 161 | 169 | ||
773 | 162 | memcpy (coords, cornerCoords, cornersSize); | 170 | memcpy (coords, cornerCoords, cornersSize); |
774 | 163 | 171 | ||
776 | 164 | coords += 8; | 172 | coords += 12; |
777 | 165 | 173 | ||
782 | 166 | colors[0] = part.r; | 174 | colors[0] = part.r * COLOR; |
783 | 167 | colors[1] = part.g; | 175 | colors[1] = part.g * COLOR; |
784 | 168 | colors[2] = part.b; | 176 | colors[2] = part.b * COLOR; |
785 | 169 | colors[3] = part.life * part.a; | 177 | colors[3] = part.life * part.a * COLOR; |
786 | 170 | memcpy (colors + 4, colors, colorSize); | 178 | memcpy (colors + 4, colors, colorSize); |
787 | 171 | memcpy (colors + 8, colors, colorSize); | 179 | memcpy (colors + 8, colors, colorSize); |
788 | 172 | memcpy (colors + 12, colors, colorSize); | 180 | memcpy (colors + 12, colors, colorSize); |
789 | 181 | memcpy (colors + 16, colors, colorSize); | ||
790 | 182 | memcpy (colors + 20, colors, colorSize); | ||
791 | 173 | 183 | ||
793 | 174 | colors += 16; | 184 | colors += 24; |
794 | 175 | 185 | ||
795 | 176 | if (mDarkenAmount > 0) | 186 | if (mDarkenAmount > 0) |
796 | 177 | { | 187 | { |
797 | @@ -182,34 +192,35 @@ | |||
798 | 182 | memcpy (dcolors + 4, dcolors, colorSize); | 192 | memcpy (dcolors + 4, dcolors, colorSize); |
799 | 183 | memcpy (dcolors + 8, dcolors, colorSize); | 193 | memcpy (dcolors + 8, dcolors, colorSize); |
800 | 184 | memcpy (dcolors + 12, dcolors, colorSize); | 194 | memcpy (dcolors + 12, dcolors, colorSize); |
801 | 195 | memcpy (dcolors + 16, dcolors, colorSize); | ||
802 | 196 | memcpy (dcolors + 20, dcolors, colorSize); | ||
803 | 185 | 197 | ||
805 | 186 | dcolors += 16; | 198 | dcolors += 24; |
806 | 187 | } | 199 | } |
807 | 188 | } | 200 | } |
808 | 189 | 201 | ||
813 | 190 | glEnableClientState (GL_COLOR_ARRAY); | 202 | GLVertexBuffer *stream = GLVertexBuffer::streamingBuffer (); |
810 | 191 | |||
811 | 192 | glTexCoordPointer (2, GL_FLOAT, 2 * sizeof (GLfloat), &mCoordsCache[0]); | ||
812 | 193 | glVertexPointer (3, GL_FLOAT, 3 * sizeof (GLfloat), &mVerticesCache[0]); | ||
814 | 194 | 203 | ||
815 | 195 | // darken the background | 204 | // darken the background |
816 | 196 | if (mDarkenAmount > 0) | 205 | if (mDarkenAmount > 0) |
817 | 197 | { | 206 | { |
818 | 198 | glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); | 207 | glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); |
821 | 199 | glColorPointer (4, GL_FLOAT, 4 * sizeof (GLfloat), &mDColorsCache[0]); | 208 | stream->begin (GL_TRIANGLES); |
822 | 200 | glDrawArrays (GL_QUADS, 0, numActive); | 209 | stream->addTexCoords (0, numActive, &mCoordsCache[0]); |
823 | 210 | stream->addVertices (numActive, &mVerticesCache[0]); | ||
824 | 211 | stream->addColors (numActive, &mDColorsCache[0]); | ||
825 | 212 | if (stream->end ()) | ||
826 | 213 | stream->render (translatedMatrix); | ||
827 | 201 | } | 214 | } |
828 | 202 | // draw particles | 215 | // draw particles |
829 | 203 | glBlendFunc (GL_SRC_ALPHA, mBlendMode); | 216 | glBlendFunc (GL_SRC_ALPHA, mBlendMode); |
830 | 204 | 217 | ||
839 | 205 | glColorPointer (4, GL_FLOAT, 4 * sizeof (GLfloat), &mColorsCache[0]); | 218 | stream->begin (GL_TRIANGLES); |
840 | 206 | glDrawArrays (GL_QUADS, 0, numActive); | 219 | stream->addTexCoords (0, numActive, &mCoordsCache[0]); |
841 | 207 | glDisableClientState (GL_COLOR_ARRAY); | 220 | stream->addVertices (numActive, &mVerticesCache[0]); |
842 | 208 | 221 | stream->addColors (numActive, &mColorsCache[0]); | |
843 | 209 | glPopMatrix (); | 222 | if (stream->end ()) |
844 | 210 | glColor4usv (defaultColor); | 223 | stream->render (translatedMatrix); |
837 | 211 | |||
838 | 212 | mGScreen->setTexEnvMode (GL_REPLACE); | ||
845 | 213 | 224 | ||
846 | 214 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | 225 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
847 | 215 | glDisable (GL_TEXTURE_2D); | 226 | glDisable (GL_TEXTURE_2D); |
848 | @@ -217,12 +228,13 @@ | |||
849 | 217 | } | 228 | } |
850 | 218 | 229 | ||
851 | 219 | void | 230 | void |
853 | 220 | ParticleAnim::postPaintWindow () | 231 | ParticleAnim::postPaintWindow (const GLMatrix &transform) |
854 | 221 | { | 232 | { |
855 | 222 | foreach (ParticleSystem &ps, mParticleSystems) | 233 | foreach (ParticleSystem &ps, mParticleSystems) |
856 | 223 | if (ps.active ()) | 234 | if (ps.active ()) |
857 | 224 | // offset by window pos. | 235 | // offset by window pos. |
859 | 225 | ps.draw (mWindow->x () - mWindow->output ().left, | 236 | ps.draw (transform, |
860 | 237 | mWindow->x () - mWindow->output ().left, | ||
861 | 226 | mWindow->y () - mWindow->output ().top); | 238 | mWindow->y () - mWindow->output ().top); |
862 | 227 | } | 239 | } |
863 | 228 | 240 | ||
864 | 229 | 241 | ||
865 | === modified file 'plugins/animationaddon/src/polygon.cpp' | |||
866 | --- plugins/animationaddon/src/polygon.cpp 2013-02-27 11:33:10 +0000 | |||
867 | +++ plugins/animationaddon/src/polygon.cpp 2016-07-14 15:55:30 +0000 | |||
868 | @@ -34,7 +34,6 @@ | |||
869 | 34 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 34 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
870 | 35 | */ | 35 | */ |
871 | 36 | 36 | ||
872 | 37 | #include <GL/glu.h> | ||
873 | 38 | #include "private.h" | 37 | #include "private.h" |
874 | 39 | 38 | ||
875 | 40 | static const unsigned short MIN_WINDOW_GRID_SIZE = 10; | 39 | static const unsigned short MIN_WINDOW_GRID_SIZE = 10; |
876 | @@ -256,8 +255,8 @@ | |||
877 | 256 | pv[22] = -halfH; | 255 | pv[22] = -halfH; |
878 | 257 | pv[23] = -halfThick; | 256 | pv[23] = -halfThick; |
879 | 258 | 257 | ||
882 | 259 | // 16 indices for 4 sides (for quads) | 258 | // 24 indices for 4 sides (for triangles) |
883 | 260 | p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort)); | 259 | p->sideIndices = (GLushort *)calloc (6 * 4, sizeof (GLushort)); |
884 | 261 | if (!p->sideIndices) | 260 | if (!p->sideIndices) |
885 | 262 | { | 261 | { |
886 | 263 | compLogMessage ("animationaddon", CompLogLevelError, | 262 | compLogMessage ("animationaddon", CompLogLevelError, |
887 | @@ -275,6 +274,8 @@ | |||
888 | 275 | ind[id++] = 6; // First vertex | 274 | ind[id++] = 6; // First vertex |
889 | 276 | ind[id++] = 1; | 275 | ind[id++] = 1; |
890 | 277 | ind[id++] = 0; | 276 | ind[id++] = 0; |
891 | 277 | ind[id++] = 6; | ||
892 | 278 | ind[id++] = 0; | ||
893 | 278 | ind[id++] = 7; | 279 | ind[id++] = 7; |
894 | 279 | nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal | 280 | nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal |
895 | 280 | nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face. | 281 | nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face. |
896 | @@ -284,16 +285,20 @@ | |||
897 | 284 | ind[id++] = 1; | 285 | ind[id++] = 1; |
898 | 285 | ind[id++] = 6; | 286 | ind[id++] = 6; |
899 | 286 | ind[id++] = 5; | 287 | ind[id++] = 5; |
900 | 288 | ind[id++] = 5; | ||
901 | 287 | ind[id++] = 2; | 289 | ind[id++] = 2; |
902 | 290 | ind[id++] = 1; | ||
903 | 288 | nor[1 * 3 + 0] = 0; | 291 | nor[1 * 3 + 0] = 0; |
904 | 289 | nor[1 * 3 + 1] = 1; | 292 | nor[1 * 3 + 1] = 1; |
905 | 290 | nor[1 * 3 + 2] = 0; | 293 | nor[1 * 3 + 2] = 0; |
906 | 291 | 294 | ||
907 | 292 | // Right face | 295 | // Right face |
908 | 296 | ind[id++] = 5; | ||
909 | 293 | ind[id++] = 2; | 297 | ind[id++] = 2; |
910 | 298 | ind[id++] = 3; | ||
911 | 294 | ind[id++] = 5; | 299 | ind[id++] = 5; |
912 | 300 | ind[id++] = 3; | ||
913 | 295 | ind[id++] = 4; | 301 | ind[id++] = 4; |
914 | 296 | ind[id++] = 3; | ||
915 | 297 | nor[2 * 3 + 0] = 1; | 302 | nor[2 * 3 + 0] = 1; |
916 | 298 | nor[2 * 3 + 1] = 0; | 303 | nor[2 * 3 + 1] = 0; |
917 | 299 | nor[2 * 3 + 2] = 0; | 304 | nor[2 * 3 + 2] = 0; |
918 | @@ -302,7 +307,9 @@ | |||
919 | 302 | ind[id++] = 7; | 307 | ind[id++] = 7; |
920 | 303 | ind[id++] = 0; | 308 | ind[id++] = 0; |
921 | 304 | ind[id++] = 3; | 309 | ind[id++] = 3; |
922 | 310 | ind[id++] = 3; | ||
923 | 305 | ind[id++] = 4; | 311 | ind[id++] = 4; |
924 | 312 | ind[id++] = 7; | ||
925 | 306 | nor[7 * 3 + 0] = 0; | 313 | nor[7 * 3 + 0] = 0; |
926 | 307 | nor[7 * 3 + 1] = -1; | 314 | nor[7 * 3 + 1] = -1; |
927 | 308 | nor[7 * 3 + 2] = 0; | 315 | nor[7 * 3 + 2] = 0; |
928 | @@ -541,8 +548,8 @@ | |||
929 | 541 | pv[34] = topY; | 548 | pv[34] = topY; |
930 | 542 | pv[35] = -halfThick; | 549 | pv[35] = -halfThick; |
931 | 543 | 550 | ||
934 | 544 | // 24 indices per 6 sides (for quads) | 551 | // 36 indices per 6 sides (for triangles) |
935 | 545 | p->sideIndices = (GLushort *)calloc (4 * 6, sizeof (GLushort)); | 552 | p->sideIndices = (GLushort *)calloc (6 * 6, sizeof (GLushort)); |
936 | 546 | if (!p->sideIndices) | 553 | if (!p->sideIndices) |
937 | 547 | { | 554 | { |
938 | 548 | compLogMessage ("animationaddon", CompLogLevelError, | 555 | compLogMessage ("animationaddon", CompLogLevelError, |
939 | @@ -562,7 +569,9 @@ | |||
940 | 562 | ind[id++] = 11; // First vertex | 569 | ind[id++] = 11; // First vertex |
941 | 563 | ind[id++] = 10; | 570 | ind[id++] = 10; |
942 | 564 | ind[id++] = 1; | 571 | ind[id++] = 1; |
943 | 572 | ind[id++] = 1; | ||
944 | 565 | ind[id++] = 0; | 573 | ind[id++] = 0; |
945 | 574 | ind[id++] = 11; | ||
946 | 566 | nor[11 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal | 575 | nor[11 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal |
947 | 567 | nor[11 * 3 + 1] = -1; // in a polygon, vertex 11 for this face. | 576 | nor[11 * 3 + 1] = -1; // in a polygon, vertex 11 for this face. |
948 | 568 | nor[11 * 3 + 2] = 0; | 577 | nor[11 * 3 + 2] = 0; |
949 | @@ -573,7 +582,9 @@ | |||
950 | 573 | ind[id++] = 1; | 582 | ind[id++] = 1; |
951 | 574 | ind[id++] = 10; | 583 | ind[id++] = 10; |
952 | 575 | ind[id++] = 9; | 584 | ind[id++] = 9; |
953 | 585 | ind[id++] = 9; | ||
954 | 576 | ind[id++] = 2; | 586 | ind[id++] = 2; |
955 | 587 | ind[id++] = 1; | ||
956 | 577 | nor[1 * 3 + 0] = -1; | 588 | nor[1 * 3 + 0] = -1; |
957 | 578 | nor[1 * 3 + 1] = 0; | 589 | nor[1 * 3 + 1] = 0; |
958 | 579 | nor[1 * 3 + 2] = 0; | 590 | nor[1 * 3 + 2] = 0; |
959 | @@ -582,7 +593,9 @@ | |||
960 | 582 | ind[id++] = 2; | 593 | ind[id++] = 2; |
961 | 583 | ind[id++] = 9; | 594 | ind[id++] = 9; |
962 | 584 | ind[id++] = 8; | 595 | ind[id++] = 8; |
963 | 596 | ind[id++] = 8; | ||
964 | 585 | ind[id++] = 3; | 597 | ind[id++] = 3; |
965 | 598 | ind[id++] = 2; | ||
966 | 586 | nor[2 * 3 + 0] = -1; | 599 | nor[2 * 3 + 0] = -1; |
967 | 587 | nor[2 * 3 + 1] = 1; | 600 | nor[2 * 3 + 1] = 1; |
968 | 588 | nor[2 * 3 + 2] = 0; | 601 | nor[2 * 3 + 2] = 0; |
969 | @@ -593,7 +606,9 @@ | |||
970 | 593 | ind[id++] = 3; | 606 | ind[id++] = 3; |
971 | 594 | ind[id++] = 8; | 607 | ind[id++] = 8; |
972 | 595 | ind[id++] = 7; | 608 | ind[id++] = 7; |
973 | 609 | ind[id++] = 7; | ||
974 | 596 | ind[id++] = 4; | 610 | ind[id++] = 4; |
975 | 611 | ind[id++] = 3; | ||
976 | 597 | nor[3 * 3 + 0] = 1; | 612 | nor[3 * 3 + 0] = 1; |
977 | 598 | nor[3 * 3 + 1] = 1; | 613 | nor[3 * 3 + 1] = 1; |
978 | 599 | nor[3 * 3 + 2] = 0; | 614 | nor[3 * 3 + 2] = 0; |
979 | @@ -604,7 +619,9 @@ | |||
980 | 604 | ind[id++] = 4; | 619 | ind[id++] = 4; |
981 | 605 | ind[id++] = 7; | 620 | ind[id++] = 7; |
982 | 606 | ind[id++] = 6; | 621 | ind[id++] = 6; |
983 | 622 | ind[id++] = 6; | ||
984 | 607 | ind[id++] = 5; | 623 | ind[id++] = 5; |
985 | 624 | ind[id++] = 4; | ||
986 | 608 | nor[4 * 3 + 0] = 1; | 625 | nor[4 * 3 + 0] = 1; |
987 | 609 | nor[4 * 3 + 1] = 0; | 626 | nor[4 * 3 + 1] = 0; |
988 | 610 | nor[4 * 3 + 2] = 0; | 627 | nor[4 * 3 + 2] = 0; |
989 | @@ -613,7 +630,9 @@ | |||
990 | 613 | ind[id++] = 5; | 630 | ind[id++] = 5; |
991 | 614 | ind[id++] = 6; | 631 | ind[id++] = 6; |
992 | 615 | ind[id++] = 11; | 632 | ind[id++] = 11; |
993 | 633 | ind[id++] = 11; | ||
994 | 616 | ind[id++] = 0; | 634 | ind[id++] = 0; |
995 | 635 | ind[id++] = 5; | ||
996 | 617 | nor[5 * 3 + 0] = 1; | 636 | nor[5 * 3 + 0] = 1; |
997 | 618 | nor[5 * 3 + 1] = -1; | 637 | nor[5 * 3 + 1] = -1; |
998 | 619 | nor[5 * 3 + 2] = 0; | 638 | nor[5 * 3 + 2] = 0; |
999 | @@ -946,8 +965,8 @@ | |||
1000 | 946 | pv[22] = -shards[yc][xc].centerY + shards[yc][xc].pt3Y; | 965 | pv[22] = -shards[yc][xc].centerY + shards[yc][xc].pt3Y; |
1001 | 947 | pv[23] = -halfThick; | 966 | pv[23] = -halfThick; |
1002 | 948 | 967 | ||
1005 | 949 | // 16 indices for 4 sides (for quads) | 968 | // 24 indices for 4 sides (for triangles) |
1006 | 950 | p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort)); | 969 | p->sideIndices = (GLushort *)calloc (6 * 4, sizeof (GLushort)); |
1007 | 951 | if (!p->sideIndices) | 970 | if (!p->sideIndices) |
1008 | 952 | { | 971 | { |
1009 | 953 | compLogMessage ("animationaddon", | 972 | compLogMessage ("animationaddon", |
1010 | @@ -965,7 +984,9 @@ | |||
1011 | 965 | ind[id++] = 6; // First vertex | 984 | ind[id++] = 6; // First vertex |
1012 | 966 | ind[id++] = 1; | 985 | ind[id++] = 1; |
1013 | 967 | ind[id++] = 0; | 986 | ind[id++] = 0; |
1014 | 987 | ind[id++] = 6; | ||
1015 | 968 | ind[id++] = 7; | 988 | ind[id++] = 7; |
1016 | 989 | ind[id++] = 0; | ||
1017 | 969 | nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal | 990 | nor[6 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal |
1018 | 970 | nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face. | 991 | nor[6 * 3 + 1] = 0; // in a polygon, vertex 6 for this face. |
1019 | 971 | nor[6 * 3 + 2] = 0; | 992 | nor[6 * 3 + 2] = 0; |
1020 | @@ -974,7 +995,9 @@ | |||
1021 | 974 | ind[id++] = 1; | 995 | ind[id++] = 1; |
1022 | 975 | ind[id++] = 6; | 996 | ind[id++] = 6; |
1023 | 976 | ind[id++] = 5; | 997 | ind[id++] = 5; |
1024 | 998 | ind[id++] = 1; | ||
1025 | 977 | ind[id++] = 2; | 999 | ind[id++] = 2; |
1026 | 1000 | ind[id++] = 5; | ||
1027 | 978 | nor[1 * 3 + 0] = 0; | 1001 | nor[1 * 3 + 0] = 0; |
1028 | 979 | nor[1 * 3 + 1] = 1; | 1002 | nor[1 * 3 + 1] = 1; |
1029 | 980 | nor[1 * 3 + 2] = 0; | 1003 | nor[1 * 3 + 2] = 0; |
1030 | @@ -983,7 +1006,9 @@ | |||
1031 | 983 | ind[id++] = 2; | 1006 | ind[id++] = 2; |
1032 | 984 | ind[id++] = 5; | 1007 | ind[id++] = 5; |
1033 | 985 | ind[id++] = 4; | 1008 | ind[id++] = 4; |
1034 | 1009 | ind[id++] = 2; | ||
1035 | 986 | ind[id++] = 3; | 1010 | ind[id++] = 3; |
1036 | 1011 | ind[id++] = 4; | ||
1037 | 987 | nor[2 * 3 + 0] = 1; | 1012 | nor[2 * 3 + 0] = 1; |
1038 | 988 | nor[2 * 3 + 1] = 0; | 1013 | nor[2 * 3 + 1] = 0; |
1039 | 989 | nor[2 * 3 + 2] = 0; | 1014 | nor[2 * 3 + 2] = 0; |
1040 | @@ -992,7 +1017,9 @@ | |||
1041 | 992 | ind[id++] = 7; | 1017 | ind[id++] = 7; |
1042 | 993 | ind[id++] = 0; | 1018 | ind[id++] = 0; |
1043 | 994 | ind[id++] = 3; | 1019 | ind[id++] = 3; |
1044 | 1020 | ind[id++] = 7; | ||
1045 | 995 | ind[id++] = 4; | 1021 | ind[id++] = 4; |
1046 | 1022 | ind[id++] = 3; | ||
1047 | 996 | nor[7 * 3 + 0] = 0; | 1023 | nor[7 * 3 + 0] = 0; |
1048 | 997 | nor[7 * 3 + 1] = -1; | 1024 | nor[7 * 3 + 1] = -1; |
1049 | 998 | nor[7 * 3 + 2] = 0; | 1025 | nor[7 * 3 + 2] = 0; |
1050 | @@ -1067,8 +1094,11 @@ | |||
1051 | 1067 | if (!matrix.size ()) | 1094 | if (!matrix.size ()) |
1052 | 1068 | return; | 1095 | return; |
1053 | 1069 | 1096 | ||
1056 | 1070 | GLWindow::Geometry &geometry = GLWindow::get (mWindow)->geometry (); | 1097 | /* Force glDrawTexture to be called by pushing a single vertex into the |
1057 | 1071 | geometry.vCount = 1; // Force glDrawGeometry to be called | 1098 | * window's vertex buffer */ |
1058 | 1099 | GLWindow *gWindow = GLWindow::get (mWindow); | ||
1059 | 1100 | GLfloat vertexData[3] = {0.0f, 0.0f, 0.0f}; | ||
1060 | 1101 | gWindow->vertexBuffer ()->addVertices (1, vertexData); | ||
1061 | 1072 | 1102 | ||
1062 | 1073 | bool dontStoreClips = true; | 1103 | bool dontStoreClips = true; |
1063 | 1074 | 1104 | ||
1064 | @@ -1298,56 +1328,62 @@ | |||
1065 | 1298 | } | 1328 | } |
1066 | 1299 | 1329 | ||
1067 | 1300 | void | 1330 | void |
1104 | 1301 | PolygonAnim::prepareDrawingForAttrib (GLFragment::Attrib &attrib) | 1331 | PolygonAnim::prepareDrawingForAttrib (GLWindowPaintAttrib &attrib, |
1105 | 1302 | { | 1332 | GLVertexBuffer &vertexBuffer) |
1106 | 1303 | if (GL::canDoSaturated && attrib.getSaturation () != COLOR) | 1333 | { |
1107 | 1304 | { | 1334 | // Disabled for now until lighting can be re-written |
1108 | 1305 | GLfloat constant[4]; | 1335 | // attrib.brightness *= 0.76; |
1109 | 1306 | 1336 | GLushort color = (attrib.brightness * attrib.opacity) >> 16; | |
1110 | 1307 | if (GL::canDoSlightlySaturated && attrib.getSaturation () > 0) | 1337 | GLfloat colorNormalized = color / static_cast <GLfloat> (COLOR); |
1111 | 1308 | { | 1338 | |
1112 | 1309 | constant[3] = attrib.getOpacity () / 65535.0f; | 1339 | vertexBuffer.color4f (colorNormalized, |
1113 | 1310 | constant[0] = constant[1] = constant[2] = constant[3] * | 1340 | colorNormalized, |
1114 | 1311 | attrib.getBrightness () / 65535.0f; | 1341 | colorNormalized, |
1115 | 1312 | 1342 | attrib.opacity / static_cast <GLfloat> (COLOR)); | |
1116 | 1313 | glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant); | 1343 | } |
1117 | 1314 | } | 1344 | |
1118 | 1315 | else | 1345 | namespace |
1119 | 1316 | { | 1346 | { |
1120 | 1317 | constant[3] = attrib.getOpacity () / 65535.0f; | 1347 | enum class Winding : int |
1121 | 1318 | constant[0] = constant[1] = constant[2] = constant[3] * | 1348 | { |
1122 | 1319 | attrib.getBrightness () / 65535.0f; | 1349 | Clockwise = 0, |
1123 | 1320 | 1350 | Counterclockwise = 1 | |
1124 | 1321 | constant[0] = 0.5f + 0.5f * RED_SATURATION_WEIGHT * constant[0]; | 1351 | }; |
1125 | 1322 | constant[1] = 0.5f + 0.5f * GREEN_SATURATION_WEIGHT * constant[1]; | 1352 | |
1126 | 1323 | constant[2] = 0.5f + 0.5f * BLUE_SATURATION_WEIGHT * constant[2]; | 1353 | /* This function assumes that indices is large enough to |
1127 | 1324 | 1354 | * hold a polygon of nSides sides */ | |
1128 | 1325 | glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant); | 1355 | unsigned int determineIndicesForPolygon (GLushort *indices, |
1129 | 1326 | } | 1356 | GLushort nSides, |
1130 | 1327 | } | 1357 | Winding direction) |
1131 | 1328 | else | 1358 | { |
1132 | 1329 | { | 1359 | unsigned int index = 0; |
1133 | 1330 | attrib.setBrightness (0.76 * attrib.getBrightness ()); | 1360 | bool front = direction == Winding::Counterclockwise; |
1134 | 1331 | 1361 | ||
1135 | 1332 | GLushort color = | 1362 | for (GLushort i = 2; i < nSides; ++i) |
1136 | 1333 | (attrib.getOpacity () * attrib.getBrightness ()) >> 16; | 1363 | { |
1137 | 1334 | 1364 | indices[index] = 0; | |
1138 | 1335 | mGScreen->setTexEnvMode (GL_MODULATE); | 1365 | indices[index + 1] = (front ? (i - 1) : i); |
1139 | 1336 | glColor4us (color, color, color, attrib.getOpacity ()); | 1366 | indices[index + 2] = (front ? i : (i - 1)); |
1140 | 1367 | |||
1141 | 1368 | index += 3; | ||
1142 | 1369 | } | ||
1143 | 1370 | |||
1144 | 1371 | return index; | ||
1145 | 1337 | } | 1372 | } |
1146 | 1338 | } | 1373 | } |
1147 | 1339 | 1374 | ||
1148 | 1340 | inline void | 1375 | inline void |
1150 | 1341 | PolygonAnim::drawPolygonClipIntersection (const PolygonObject *p, | 1376 | PolygonAnim::drawPolygonClipIntersection (GLTexture *texture, |
1151 | 1377 | const GLMatrix &transform, | ||
1152 | 1378 | const PolygonObject *p, | ||
1153 | 1342 | const Clip4Polygons &c, | 1379 | const Clip4Polygons &c, |
1154 | 1343 | const GLfloat *vertexTexCoords, | 1380 | const GLfloat *vertexTexCoords, |
1155 | 1344 | int pass, | 1381 | int pass, |
1156 | 1345 | float forwardProgress, | 1382 | float forwardProgress, |
1157 | 1346 | GLdouble clipPlanes[4][4], | ||
1158 | 1347 | const CompOutput &output, | 1383 | const CompOutput &output, |
1159 | 1348 | float newOpacity, | 1384 | float newOpacity, |
1160 | 1349 | bool decelerates, | 1385 | bool decelerates, |
1162 | 1350 | GLfloat skewMat[16]) | 1386 | GLMatrix &skewMat) |
1163 | 1351 | { | 1387 | { |
1164 | 1352 | int nSides = p->nSides; | 1388 | int nSides = p->nSides; |
1165 | 1353 | float newOpacityPolygon = newOpacity; | 1389 | float newOpacityPolygon = newOpacity; |
1166 | @@ -1386,52 +1422,56 @@ | |||
1167 | 1386 | else if (newOpacityPolygon > 0.9999) // if fully opaque | 1422 | else if (newOpacityPolygon > 0.9999) // if fully opaque |
1168 | 1387 | return; // draw only non-opaque ones in pass 1 | 1423 | return; // draw only non-opaque ones in pass 1 |
1169 | 1388 | 1424 | ||
1171 | 1389 | glPushMatrix (); | 1425 | GLMatrix polygonTransform (transform); |
1172 | 1390 | 1426 | ||
1173 | 1391 | if (mCorrectPerspective == CorrectPerspectivePolygon) | 1427 | if (mCorrectPerspective == CorrectPerspectivePolygon) |
1175 | 1392 | getPerspectiveCorrectionMat (p, skewMat, NULL, output); | 1428 | getPerspectiveCorrectionMat (p, NULL, &skewMat, output); |
1176 | 1393 | 1429 | ||
1177 | 1394 | if (mCorrectPerspective != CorrectPerspectiveNone) | 1430 | if (mCorrectPerspective != CorrectPerspectiveNone) |
1179 | 1395 | glMultMatrixf (skewMat); | 1431 | polygonTransform *= skewMat; |
1180 | 1396 | 1432 | ||
1181 | 1397 | // Center | 1433 | // Center |
1185 | 1398 | glTranslatef (p->centerPos.x (), | 1434 | polygonTransform.translate (p->centerPos.x (), |
1186 | 1399 | p->centerPos.y (), | 1435 | p->centerPos.y (), |
1187 | 1400 | p->centerPos.z ()); | 1436 | p->centerPos.z ()); |
1188 | 1401 | 1437 | ||
1189 | 1402 | // Scale z first | 1438 | // Scale z first |
1191 | 1403 | glScalef (1.0f, 1.0f, 1.0f / ::screen->width ()); | 1439 | polygonTransform.scale (1.0f, 1.0f, 1.0f / ::screen->width ()); |
1192 | 1404 | 1440 | ||
1194 | 1405 | transformPolygon (p); | 1441 | transformPolygon (polygonTransform, p); |
1195 | 1406 | 1442 | ||
1196 | 1407 | // Move by "rotation axis offset" | 1443 | // Move by "rotation axis offset" |
1200 | 1408 | glTranslatef (p->rotAxisOffset.x (), | 1444 | polygonTransform.translate (p->rotAxisOffset.x (), |
1201 | 1409 | p->rotAxisOffset.y (), | 1445 | p->rotAxisOffset.y (), |
1202 | 1410 | p->rotAxisOffset.z ()); | 1446 | p->rotAxisOffset.z ()); |
1203 | 1411 | 1447 | ||
1204 | 1412 | // Rotate by desired angle | 1448 | // Rotate by desired angle |
1207 | 1413 | glRotatef (p->rotAngle, | 1449 | polygonTransform.rotate (p->rotAngle, |
1208 | 1414 | p->rotAxis.x (), p->rotAxis.y (), p->rotAxis.z ()); | 1450 | p->rotAxis.x (), |
1209 | 1451 | p->rotAxis.y (), | ||
1210 | 1452 | p->rotAxis.z ()); | ||
1211 | 1415 | 1453 | ||
1212 | 1416 | // Move back to center | 1454 | // Move back to center |
1216 | 1417 | glTranslatef (-p->rotAxisOffset.x (), | 1455 | polygonTransform.translate (-p->rotAxisOffset.x (), |
1217 | 1418 | -p->rotAxisOffset.y (), | 1456 | -p->rotAxisOffset.y (), |
1218 | 1419 | -p->rotAxisOffset.z ()); | 1457 | -p->rotAxisOffset.z ()); |
1219 | 1420 | 1458 | ||
1220 | 1421 | // Scale back | 1459 | // Scale back |
1234 | 1422 | glScalef (1.0f, 1.0f, ::screen->width ()); | 1460 | polygonTransform.scale (1.0f, 1.0f, ::screen->width ()); |
1235 | 1423 | 1461 | ||
1236 | 1424 | clipPlanes[0][3] = -(c.boxf.x1 - p->centerPosStart.x ()); | 1462 | // clipPlanes[0][3] = -(c.boxf.x1 - p->centerPosStart.x ()); |
1237 | 1425 | clipPlanes[1][3] = -(c.boxf.y1 - p->centerPosStart.y ()); | 1463 | // clipPlanes[1][3] = -(c.boxf.y1 - p->centerPosStart.y ()); |
1238 | 1426 | clipPlanes[2][3] = (c.boxf.x2 - p->centerPosStart.x ()); | 1464 | // clipPlanes[2][3] = (c.boxf.x2 - p->centerPosStart.x ()); |
1239 | 1427 | clipPlanes[3][3] = (c.boxf.y2 - p->centerPosStart.y ()); | 1465 | // clipPlanes[3][3] = (c.boxf.y2 - p->centerPosStart.y ()); |
1240 | 1428 | glClipPlane (GL_CLIP_PLANE0, clipPlanes[0]); | 1466 | // Clip planes are not supported on Modern OpenGL |
1241 | 1429 | glClipPlane (GL_CLIP_PLANE1, clipPlanes[1]); | 1467 | // |
1242 | 1430 | glClipPlane (GL_CLIP_PLANE2, clipPlanes[2]); | 1468 | // glClipPlane (GL_CLIP_PLANE0, clipPlanes[0]); |
1243 | 1431 | glClipPlane (GL_CLIP_PLANE3, clipPlanes[3]); | 1469 | // glClipPlane (GL_CLIP_PLANE1, clipPlanes[1]); |
1244 | 1432 | 1470 | // glClipPlane (GL_CLIP_PLANE2, clipPlanes[2]); | |
1245 | 1433 | for (int k = 0; k < 4; k++) | 1471 | // glClipPlane (GL_CLIP_PLANE3, clipPlanes[3]); |
1246 | 1434 | glEnable (GL_CLIP_PLANE0 + k); | 1472 | // for (int k = 0; k < 4; k++) |
1247 | 1473 | // glEnable (GL_CLIP_PLANE0 + k); | ||
1248 | 1474 | |||
1249 | 1435 | bool fadeBackAndSides = | 1475 | bool fadeBackAndSides = |
1250 | 1436 | mBackAndSidesFadeDur > 0 && | 1476 | mBackAndSidesFadeDur > 0 && |
1251 | 1437 | forwardProgress <= mBackAndSidesFadeDur; | 1477 | forwardProgress <= mBackAndSidesFadeDur; |
1252 | @@ -1445,56 +1485,92 @@ | |||
1253 | 1445 | (forwardProgress / mBackAndSidesFadeDur); | 1485 | (forwardProgress / mBackAndSidesFadeDur); |
1254 | 1446 | } | 1486 | } |
1255 | 1447 | 1487 | ||
1258 | 1448 | GLFragment::Attrib attrib = mCurPaintAttrib; | 1488 | GLWindowPaintAttrib attrib = mCurPaintAttrib; |
1259 | 1449 | attrib.setOpacity (newOpacityPolygon2 * OPAQUE); | 1489 | attrib.opacity = newOpacityPolygon2 * OPAQUE; |
1260 | 1450 | 1490 | ||
1262 | 1451 | prepareDrawingForAttrib (attrib); | 1491 | GLVertexBuffer *streamingVertexBuffer = GLVertexBuffer::streamingBuffer (); |
1263 | 1452 | 1492 | ||
1264 | 1453 | // Draw back face | 1493 | // Draw back face |
1272 | 1454 | glVertexPointer (3, GL_FLOAT, 0, p->vertices + 3 * nSides); | 1494 | glActiveTexture (GL_TEXTURE0); |
1273 | 1455 | if (mThickness > 0) | 1495 | texture->enable (GLTexture::Fast); |
1274 | 1456 | glNormalPointer (GL_FLOAT, 0, p->normals + 3 * nSides); | 1496 | streamingVertexBuffer->begin (GL_TRIANGLES); |
1275 | 1457 | else | 1497 | streamingVertexBuffer->addVertices (nSides, p->vertices + 3 * nSides); |
1276 | 1458 | glNormal3f (0.0f, 0.0f, -1.0f); | 1498 | if (p->normals) |
1277 | 1459 | glTexCoordPointer (2, GL_FLOAT, 0, &vertexTexCoords[2 * nSides]); | 1499 | streamingVertexBuffer->addNormals (nSides, p->normals + 3 * nSides); |
1278 | 1460 | glDrawArrays (GL_POLYGON, 0, nSides); | 1500 | streamingVertexBuffer->addTexCoords (0, nSides, &vertexTexCoords[2 * nSides]); |
1279 | 1501 | if (streamingVertexBuffer->end ()) | ||
1280 | 1502 | { | ||
1281 | 1503 | GLushort indices[64]; | ||
1282 | 1504 | unsigned int nIndices = determineIndicesForPolygon (indices, | ||
1283 | 1505 | nSides, | ||
1284 | 1506 | Winding::Counterclockwise); | ||
1285 | 1507 | streamingVertexBuffer->render (polygonTransform, | ||
1286 | 1508 | attrib, | ||
1287 | 1509 | indices, | ||
1288 | 1510 | nIndices); | ||
1289 | 1511 | } | ||
1290 | 1461 | 1512 | ||
1298 | 1462 | // Vertex coords | 1513 | // GL_QUADS uses a different vertex normal than the first |
1299 | 1463 | glVertexPointer (3, GL_FLOAT, 0, p->vertices); | 1514 | // so I use GL_TRIANGLES to make sure the normals are right. |
1300 | 1464 | if (mThickness > 0) | 1515 | texture->disable (); |
1301 | 1465 | glNormalPointer (GL_FLOAT, 0, p->normals); | 1516 | streamingVertexBuffer->begin (GL_TRIANGLES); |
1302 | 1466 | else | 1517 | streamingVertexBuffer->addVertices (p->nVertices, p->vertices); |
1303 | 1467 | glNormal3f (0.0f, 0.0f, 1.0f); | 1518 | prepareDrawingForAttrib (attrib, *streamingVertexBuffer); |
1304 | 1468 | glTexCoordPointer (2, GL_FLOAT, 0, vertexTexCoords); | 1519 | if (mThickness > 0 && p->normals) |
1305 | 1520 | streamingVertexBuffer->addNormals (nSides, p->normals); | ||
1306 | 1469 | 1521 | ||
1307 | 1470 | // Draw quads for sides | 1522 | // Draw quads for sides |
1309 | 1471 | for (int k = 0; k < nSides; k++) | 1523 | if (streamingVertexBuffer->end ()) |
1310 | 1472 | { | 1524 | { |
1316 | 1473 | // GL_QUADS uses a different vertex normal than the first | 1525 | for (int k = 0; k < nSides; k++) |
1317 | 1474 | // so I use GL_POLYGON to make sure the normals are right. | 1526 | streamingVertexBuffer->render (polygonTransform, |
1318 | 1475 | glDrawElements (GL_POLYGON, 4, | 1527 | attrib, |
1319 | 1476 | GL_UNSIGNED_SHORT, | 1528 | p->sideIndices + k * 6, |
1320 | 1477 | p->sideIndices + k * 4); | 1529 | 6); |
1321 | 1478 | } | 1530 | } |
1322 | 1479 | 1531 | ||
1323 | 1532 | streamingVertexBuffer->colorDefault (); | ||
1324 | 1533 | |||
1325 | 1534 | texture->enable (GLTexture::Fast); | ||
1326 | 1535 | streamingVertexBuffer->begin (GL_TRIANGLES); | ||
1327 | 1480 | // if opacity was changed just above | 1536 | // if opacity was changed just above |
1328 | 1481 | if (fadeBackAndSides) | 1537 | if (fadeBackAndSides) |
1329 | 1482 | { | 1538 | { |
1330 | 1483 | // Go back to normal opacity for front face | 1539 | // Go back to normal opacity for front face |
1331 | 1484 | attrib = mCurPaintAttrib; | 1540 | attrib = mCurPaintAttrib; |
1341 | 1485 | attrib.setOpacity (newOpacityPolygon * OPAQUE); | 1541 | attrib.opacity = newOpacityPolygon * OPAQUE; |
1342 | 1486 | prepareDrawingForAttrib (attrib); | 1542 | } |
1343 | 1487 | } | 1543 | streamingVertexBuffer->addVertices (nSides, p->vertices); |
1344 | 1488 | // Draw front face | 1544 | if (p->normals) |
1345 | 1489 | glDrawArrays (GL_POLYGON, 0, nSides); | 1545 | streamingVertexBuffer->addNormals (nSides, p->normals); |
1346 | 1490 | for (int k = 0; k < 4; k++) | 1546 | streamingVertexBuffer->addTexCoords (0, nSides, vertexTexCoords); |
1347 | 1491 | glDisable (GL_CLIP_PLANE0 + k); | 1547 | if (streamingVertexBuffer->end ()) |
1348 | 1492 | 1548 | { | |
1349 | 1493 | glPopMatrix (); | 1549 | GLushort indices[64]; |
1350 | 1550 | unsigned int nIndices = determineIndicesForPolygon (indices, | ||
1351 | 1551 | nSides, | ||
1352 | 1552 | Winding::Counterclockwise); | ||
1353 | 1553 | streamingVertexBuffer->render (polygonTransform, | ||
1354 | 1554 | attrib, | ||
1355 | 1555 | indices, | ||
1356 | 1556 | nIndices); | ||
1357 | 1557 | } | ||
1358 | 1558 | |||
1359 | 1559 | streamingVertexBuffer->colorDefault (); | ||
1360 | 1560 | |||
1361 | 1561 | texture->disable (); | ||
1362 | 1562 | |||
1363 | 1563 | // Clip planes are not supported on Modern OpenGL | ||
1364 | 1564 | // | ||
1365 | 1565 | // for (int k = 0; k < 4; k++) | ||
1366 | 1566 | // glDisable (GL_CLIP_PLANE0 + k); | ||
1367 | 1494 | } | 1567 | } |
1368 | 1495 | 1568 | ||
1369 | 1496 | void | 1569 | void |
1371 | 1497 | PolygonAnim::drawGeometry () | 1570 | PolygonAnim::drawGeometry (GLTexture *texture, |
1372 | 1571 | const GLMatrix &transform, | ||
1373 | 1572 | const GLWindowPaintAttrib &attrib, | ||
1374 | 1573 | unsigned int mask) | ||
1375 | 1498 | { | 1574 | { |
1376 | 1499 | mNumDrawGeometryCalls++; | 1575 | mNumDrawGeometryCalls++; |
1377 | 1500 | 1576 | ||
1378 | @@ -1540,96 +1616,52 @@ | |||
1379 | 1540 | 1616 | ||
1380 | 1541 | // OpenGL stuff starts here | 1617 | // OpenGL stuff starts here |
1381 | 1542 | 1618 | ||
1417 | 1543 | GLboolean normalArrayWas = false; | 1619 | // Lighting will require special shaders, which aren't |
1418 | 1544 | 1620 | // implemented right now, so disable it. | |
1419 | 1545 | if (mThickness > 0) | 1621 | // |
1420 | 1546 | { | 1622 | // if (mDoLighting) |
1421 | 1547 | glPushAttrib (GL_NORMALIZE); | 1623 | // { |
1422 | 1548 | glEnable (GL_NORMALIZE); | 1624 | // glPushAttrib (GL_SHADE_MODEL); |
1423 | 1549 | 1625 | // glShadeModel (GL_FLAT); | |
1424 | 1550 | normalArrayWas = glIsEnabled (GL_NORMAL_ARRAY); | 1626 | // |
1425 | 1551 | glEnableClientState (GL_NORMAL_ARRAY); | 1627 | // glPushAttrib (GL_LIGHT0); |
1426 | 1552 | } | 1628 | // glPushAttrib (GL_COLOR_MATERIAL); |
1427 | 1553 | 1629 | // glPushAttrib (GL_LIGHTING); | |
1428 | 1554 | if (mDoLighting) | 1630 | // glEnable (GL_COLOR_MATERIAL); |
1429 | 1555 | { | 1631 | // glEnable (GL_LIGHTING); |
1430 | 1556 | glPushAttrib (GL_SHADE_MODEL); | 1632 | // |
1431 | 1557 | glShadeModel (GL_FLAT); | 1633 | // GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 0.3f }; |
1432 | 1558 | 1634 | // GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f }; | |
1433 | 1559 | glPushAttrib (GL_LIGHT0); | 1635 | // GLfloat light0Position[] = { -0.5f, 0.5f, 9.0f, 0.0f }; |
1434 | 1560 | glPushAttrib (GL_COLOR_MATERIAL); | 1636 | // |
1435 | 1561 | glPushAttrib (GL_LIGHTING); | 1637 | // glLightfv (GL_LIGHT0, GL_AMBIENT, ambientLight); |
1436 | 1562 | glEnable (GL_COLOR_MATERIAL); | 1638 | // glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseLight); |
1437 | 1563 | glEnable (GL_LIGHTING); | 1639 | // glLightfv (GL_LIGHT0, GL_POSITION, light0Position); |
1438 | 1564 | 1640 | // } | |
1404 | 1565 | GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 0.3f }; | ||
1405 | 1566 | GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f }; | ||
1406 | 1567 | GLfloat light0Position[] = { -0.5f, 0.5f, 9.0f, 0.0f }; | ||
1407 | 1568 | |||
1408 | 1569 | glLightfv (GL_LIGHT0, GL_AMBIENT, ambientLight); | ||
1409 | 1570 | glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseLight); | ||
1410 | 1571 | glLightfv (GL_LIGHT0, GL_POSITION, light0Position); | ||
1411 | 1572 | } | ||
1412 | 1573 | |||
1413 | 1574 | glPushMatrix (); | ||
1414 | 1575 | |||
1415 | 1576 | glPushAttrib (GL_STENCIL_BUFFER_BIT); | ||
1416 | 1577 | glDisable (GL_STENCIL_TEST); | ||
1439 | 1578 | 1641 | ||
1440 | 1579 | if (mDoDepthTest) | 1642 | if (mDoDepthTest) |
1441 | 1580 | { | 1643 | { |
1442 | 1581 | // Depth test | 1644 | // Depth test |
1443 | 1582 | glPushAttrib (GL_DEPTH_FUNC); | ||
1444 | 1583 | glPushAttrib (GL_DEPTH_TEST); | ||
1445 | 1584 | glDepthFunc (GL_LEQUAL); | 1645 | glDepthFunc (GL_LEQUAL); |
1446 | 1646 | glDepthMask (GL_TRUE); | ||
1447 | 1585 | glEnable (GL_DEPTH_TEST); | 1647 | glEnable (GL_DEPTH_TEST); |
1448 | 1586 | } | 1648 | } |
1449 | 1587 | 1649 | ||
1450 | 1588 | // Clip planes | 1650 | // Clip planes |
1483 | 1589 | GLdouble clipPlanes[4][4] = {{ 1, 0, 0, 0 }, | 1651 | // GLdouble clipPlanes[4][4] = {{ 1, 0, 0, 0 }, |
1484 | 1590 | { 0, 1, 0, 0 }, | 1652 | // { 0, 1, 0, 0 }, |
1485 | 1591 | { -1, 0, 0, 0 }, | 1653 | // { -1, 0, 0, 0 }, |
1486 | 1592 | { 0, -1, 0, 0 }}; | 1654 | // { 0, -1, 0, 0 }}; |
1487 | 1593 | 1655 | ||
1488 | 1594 | // Save old color values | 1656 | float opacity = mCurPaintAttrib.opacity / 65535.0; |
1457 | 1595 | GLfloat oldColor[4]; | ||
1458 | 1596 | |||
1459 | 1597 | glGetFloatv (GL_CURRENT_COLOR, oldColor); | ||
1460 | 1598 | |||
1461 | 1599 | // Determine where we are called from in paint.c's drawWindowTexture | ||
1462 | 1600 | // to find out how we should change the opacity | ||
1463 | 1601 | GLint prevActiveTexture = GL_TEXTURE0_ARB; | ||
1464 | 1602 | bool saturationFull = true; | ||
1465 | 1603 | |||
1466 | 1604 | if (GL::canDoSaturated && mCurPaintAttrib.getSaturation () != COLOR) | ||
1467 | 1605 | { | ||
1468 | 1606 | saturationFull = false; | ||
1469 | 1607 | if (GL::canDoSlightlySaturated && | ||
1470 | 1608 | mCurPaintAttrib.getSaturation () > 0) | ||
1471 | 1609 | { | ||
1472 | 1610 | if (mCurPaintAttrib.getOpacity () < OPAQUE || | ||
1473 | 1611 | mCurPaintAttrib.getBrightness () != BRIGHT) | ||
1474 | 1612 | prevActiveTexture = GL_TEXTURE3_ARB; | ||
1475 | 1613 | else | ||
1476 | 1614 | prevActiveTexture = GL_TEXTURE2_ARB; | ||
1477 | 1615 | } | ||
1478 | 1616 | else | ||
1479 | 1617 | prevActiveTexture = GL_TEXTURE1_ARB; | ||
1480 | 1618 | } | ||
1481 | 1619 | |||
1482 | 1620 | float opacity = mCurPaintAttrib.getOpacity () / 65535.0; | ||
1489 | 1621 | 1657 | ||
1490 | 1622 | float newOpacity = opacity; | 1658 | float newOpacity = opacity; |
1491 | 1623 | float fadePassedBy; | 1659 | float fadePassedBy; |
1492 | 1624 | 1660 | ||
1493 | 1625 | bool decelerates = deceleratingMotion (); | 1661 | bool decelerates = deceleratingMotion (); |
1494 | 1626 | 1662 | ||
1495 | 1627 | glPushAttrib (GL_BLEND); | ||
1496 | 1628 | glEnable (GL_BLEND); | 1663 | glEnable (GL_BLEND); |
1497 | 1629 | 1664 | ||
1498 | 1630 | if (saturationFull) | ||
1499 | 1631 | mGScreen->setTexEnvMode (GL_MODULATE); | ||
1500 | 1632 | |||
1501 | 1633 | // if fade-out duration is not specified per polygon | 1665 | // if fade-out duration is not specified per polygon |
1502 | 1634 | if (mAllFadeDuration > -1.0f) | 1666 | if (mAllFadeDuration > -1.0f) |
1503 | 1635 | { | 1667 | { |
1504 | @@ -1657,9 +1689,9 @@ | |||
1505 | 1657 | static_cast<ExtensionPluginAnimAddon*> (getExtensionPluginInfo ())-> | 1689 | static_cast<ExtensionPluginAnimAddon*> (getExtensionPluginInfo ())-> |
1506 | 1658 | output (); | 1690 | output (); |
1507 | 1659 | 1691 | ||
1509 | 1660 | GLfloat skewMat[16]; | 1692 | GLMatrix skewMat; |
1510 | 1661 | if (mCorrectPerspective == CorrectPerspectiveWindow) | 1693 | if (mCorrectPerspective == CorrectPerspectiveWindow) |
1512 | 1662 | getPerspectiveCorrectionMat (NULL, skewMat, NULL, *output); | 1694 | getPerspectiveCorrectionMat (NULL, NULL, &skewMat, *output); |
1513 | 1663 | 1695 | ||
1514 | 1664 | // pass: 0: draw opaque ones | 1696 | // pass: 0: draw opaque ones |
1515 | 1665 | // 1: draw transparent ones | 1697 | // 1: draw transparent ones |
1516 | @@ -1673,10 +1705,12 @@ | |||
1517 | 1673 | const GLfloat *vTexCoords = &c->polygonVertexTexCoords[0]; | 1705 | const GLfloat *vTexCoords = &c->polygonVertexTexCoords[0]; |
1518 | 1674 | foreach (const PolygonObject *p, mPolygons) | 1706 | foreach (const PolygonObject *p, mPolygons) |
1519 | 1675 | { | 1707 | { |
1521 | 1676 | drawPolygonClipIntersection (p, *c, | 1708 | drawPolygonClipIntersection (texture, |
1522 | 1709 | transform, | ||
1523 | 1710 | p, *c, | ||
1524 | 1677 | vTexCoords, | 1711 | vTexCoords, |
1525 | 1678 | pass, forwardProgress, | 1712 | pass, forwardProgress, |
1527 | 1679 | clipPlanes, *output, | 1713 | *output, |
1528 | 1680 | newOpacity, | 1714 | newOpacity, |
1529 | 1681 | decelerates, | 1715 | decelerates, |
1530 | 1682 | skewMat); | 1716 | skewMat); |
1531 | @@ -1688,10 +1722,12 @@ | |||
1532 | 1688 | foreach (const PolygonClipInfo *pci, | 1722 | foreach (const PolygonClipInfo *pci, |
1533 | 1689 | c->intersectingPolygonInfos) | 1723 | c->intersectingPolygonInfos) |
1534 | 1690 | { | 1724 | { |
1536 | 1691 | drawPolygonClipIntersection (pci->p, *c, | 1725 | drawPolygonClipIntersection (texture, |
1537 | 1726 | transform, | ||
1538 | 1727 | pci->p, *c, | ||
1539 | 1692 | &pci->vertexTexCoords[0], | 1728 | &pci->vertexTexCoords[0], |
1540 | 1693 | pass, forwardProgress, | 1729 | pass, forwardProgress, |
1542 | 1694 | clipPlanes, *output, | 1730 | *output, |
1543 | 1695 | newOpacity, | 1731 | newOpacity, |
1544 | 1696 | decelerates, | 1732 | decelerates, |
1545 | 1697 | skewMat); | 1733 | skewMat); |
1546 | @@ -1702,45 +1738,24 @@ | |||
1547 | 1702 | // Restore | 1738 | // Restore |
1548 | 1703 | // ----------------------------------------- | 1739 | // ----------------------------------------- |
1549 | 1704 | 1740 | ||
1554 | 1705 | // Restore old color values | 1741 | glDisable (GL_BLEND); |
1551 | 1706 | glColor4f (oldColor[0], oldColor[1], oldColor[2], oldColor[3]); | ||
1552 | 1707 | |||
1553 | 1708 | glPopAttrib (); // GL_BLEND | ||
1555 | 1709 | 1742 | ||
1556 | 1710 | if (mDoDepthTest) | 1743 | if (mDoDepthTest) |
1557 | 1711 | { | 1744 | { |
1590 | 1712 | glPopAttrib (); // GL_DEPTH_TEST | 1745 | glDisable (GL_DEPTH_TEST); |
1591 | 1713 | glPopAttrib (); // GL_DEPTH_FUNC | 1746 | glDepthMask (GL_FALSE); |
1592 | 1714 | } | 1747 | } |
1593 | 1715 | 1748 | ||
1594 | 1716 | glPopAttrib (); // GL_STENCIL_BUFFER_BIT | 1749 | // Lighting will require special shaders whcih |
1595 | 1717 | 1750 | // are not implemented for now. | |
1596 | 1718 | // Restore texture stuff | 1751 | // |
1597 | 1719 | if (saturationFull) | 1752 | // if (mDoLighting) |
1598 | 1720 | mGScreen->setTexEnvMode (GL_REPLACE); | 1753 | // { |
1599 | 1721 | 1754 | // glPopAttrib (); // GL_LIGHTING | |
1600 | 1722 | glPopMatrix (); | 1755 | // glPopAttrib (); // GL_COLOR_MATERIAL |
1601 | 1723 | (GL::activeTexture) (prevActiveTexture); | 1756 | // glPopAttrib (); // GL_LIGHT0 |
1602 | 1724 | 1757 | // glPopAttrib (); // GL_SHADE_MODEL | |
1603 | 1725 | if (mDoLighting) | 1758 | // } |
1572 | 1726 | { | ||
1573 | 1727 | glPopAttrib (); // GL_LIGHTING | ||
1574 | 1728 | glPopAttrib (); // GL_COLOR_MATERIAL | ||
1575 | 1729 | glPopAttrib (); // GL_LIGHT0 | ||
1576 | 1730 | glPopAttrib (); // GL_SHADE_MODEL | ||
1577 | 1731 | } | ||
1578 | 1732 | |||
1579 | 1733 | if (mThickness > 0) | ||
1580 | 1734 | { | ||
1581 | 1735 | glPopAttrib (); // GL_NORMALIZE | ||
1582 | 1736 | |||
1583 | 1737 | if (normalArrayWas) | ||
1584 | 1738 | glEnableClientState (GL_NORMAL_ARRAY); | ||
1585 | 1739 | else | ||
1586 | 1740 | glDisableClientState (GL_NORMAL_ARRAY); | ||
1587 | 1741 | } | ||
1588 | 1742 | else | ||
1589 | 1743 | glNormal3f (0.0f, 0.0f, -1.0f); | ||
1604 | 1744 | 1759 | ||
1605 | 1745 | if (mClipsUpdated) // set the end mark for this group of clips | 1760 | if (mClipsUpdated) // set the end mark for this group of clips |
1606 | 1746 | mLastClipInGroup.push_back (lastClip); | 1761 | mLastClipInGroup.push_back (lastClip); |
1607 | @@ -1760,7 +1775,7 @@ | |||
1608 | 1760 | } | 1775 | } |
1609 | 1761 | 1776 | ||
1610 | 1762 | void | 1777 | void |
1612 | 1763 | PolygonAnim::postPaintWindow () | 1778 | PolygonAnim::postPaintWindow (const GLMatrix &) |
1613 | 1764 | { | 1779 | { |
1614 | 1765 | if (mClipsUpdated && // clips should be dropped only in the 1st step | 1780 | if (mClipsUpdated && // clips should be dropped only in the 1st step |
1615 | 1766 | mNumDrawGeometryCalls == 0) // if clips not drawn | 1781 | mNumDrawGeometryCalls == 0) // if clips not drawn |
1616 | @@ -1842,20 +1857,7 @@ | |||
1617 | 1842 | 1857 | ||
1618 | 1843 | prepareTransform (output, wTransform, wTransform2); | 1858 | prepareTransform (output, wTransform, wTransform2); |
1619 | 1844 | 1859 | ||
1634 | 1845 | const float *screenProjection = gScreen->projectionMatrix (); | 1860 | GLMatrix *screenProjection = gScreen->projectionMatrix (); |
1621 | 1846 | GLdouble dModel[16]; | ||
1622 | 1847 | GLdouble dProjection[16]; | ||
1623 | 1848 | for (int i = 0; i < 16; i++) | ||
1624 | 1849 | { | ||
1625 | 1850 | dProjection[i] = screenProjection[i]; | ||
1626 | 1851 | } | ||
1627 | 1852 | GLint viewport[4] = | ||
1628 | 1853 | {output.region ()->extents.x1, | ||
1629 | 1854 | output.region ()->extents.y1, | ||
1630 | 1855 | output.width (), | ||
1631 | 1856 | output.height ()}; | ||
1632 | 1857 | GLdouble px, py, pz; | ||
1633 | 1858 | |||
1635 | 1859 | GLMatrix *modelViewTransform = &wTransform; | 1861 | GLMatrix *modelViewTransform = &wTransform; |
1636 | 1860 | 1862 | ||
1637 | 1861 | GLMatrix skewMat; | 1863 | GLMatrix skewMat; |
1638 | @@ -1878,9 +1880,6 @@ | |||
1639 | 1878 | 1880 | ||
1640 | 1879 | // if modelViewTransform == wTransform2, then | 1881 | // if modelViewTransform == wTransform2, then |
1641 | 1880 | // it changes for each polygon | 1882 | // it changes for each polygon |
1642 | 1881 | const float *modelViewMatrix = modelViewTransform->getMatrix (); | ||
1643 | 1882 | for (int j = 0; j < 16; j++) | ||
1644 | 1883 | dModel[j] = modelViewMatrix[j]; | ||
1645 | 1884 | 1883 | ||
1646 | 1885 | Point3d center = p->centerPos; | 1884 | Point3d center = p->centerPos; |
1647 | 1886 | float radius = p->boundSphereRadius + 2; | 1885 | float radius = p->boundSphereRadius + 2; |
1648 | @@ -1924,13 +1923,16 @@ | |||
1649 | 1924 | Point3d *pnt = cubeCorners; | 1923 | Point3d *pnt = cubeCorners; |
1650 | 1925 | for (int j = 0; j < N_POINTS; j++, pnt++) | 1924 | for (int j = 0; j < N_POINTS; j++, pnt++) |
1651 | 1926 | { | 1925 | { |
1656 | 1927 | if (!gluProject (pnt->x (), pnt->y (), pnt->z (), | 1926 | namespace com = compiz::opengl::matrix; |
1657 | 1928 | dModel, dProjection, viewport, | 1927 | CompPoint p (com::projectIntoViewport(*screenProjection, |
1658 | 1929 | &px, &py, &pz)) | 1928 | *modelViewTransform, |
1659 | 1930 | return; | 1929 | output, |
1660 | 1930 | GLVector (pnt->x (), | ||
1661 | 1931 | pnt->y (), | ||
1662 | 1932 | pnt->z ()))); | ||
1663 | 1931 | 1933 | ||
1666 | 1932 | py = ::screen->height () - py; | 1934 | p.setY (::screen->height () - p.y ()); |
1667 | 1933 | mAWindow->expandBBWithPoint (px + 0.5, py + 0.5); | 1935 | mAWindow->expandBBWithPoint (p.x () + 0.5, p.y () + 0.5); |
1668 | 1934 | } | 1936 | } |
1669 | 1935 | #undef N_POINTS | 1937 | #undef N_POINTS |
1670 | 1936 | } | 1938 | } |
1671 | @@ -1988,9 +1990,16 @@ | |||
1672 | 1988 | } | 1990 | } |
1673 | 1989 | } | 1991 | } |
1674 | 1990 | } | 1992 | } |
1675 | 1993 | |||
1676 | 1991 | if (depthUsed) | 1994 | if (depthUsed) |
1677 | 1992 | { | 1995 | { |
1678 | 1996 | #ifdef USE_GLES | ||
1679 | 1997 | glClearDepthf (1000.0f); | ||
1680 | 1998 | #else | ||
1681 | 1993 | glClearDepth (1000.0f); | 1999 | glClearDepth (1000.0f); |
1682 | 2000 | #endif | ||
1683 | 2001 | glDepthMask (GL_TRUE); | ||
1684 | 1994 | glClear (GL_DEPTH_BUFFER_BIT); | 2002 | glClear (GL_DEPTH_BUFFER_BIT); |
1685 | 2003 | glDepthMask (GL_FALSE); | ||
1686 | 1995 | } | 2004 | } |
1687 | 1996 | } | 2005 | } |
1688 | 1997 | 2006 | ||
1689 | === modified file 'plugins/animationaddon/src/private.h' | |||
1690 | --- plugins/animationaddon/src/private.h 2013-10-31 15:59:14 +0000 | |||
1691 | +++ plugins/animationaddon/src/private.h 2016-07-14 15:55:30 +0000 | |||
1692 | @@ -70,7 +70,7 @@ | |||
1693 | 70 | }; | 70 | }; |
1694 | 71 | 71 | ||
1695 | 72 | class AnimAddonWindow : | 72 | class AnimAddonWindow : |
1697 | 73 | public PluginClassHandler<AnimAddonWindow, CompWindow> | 73 | public PluginClassHandler<AnimAddonWindow, CompWindow, ANIMATIONADDON_ABI> |
1698 | 74 | { | 74 | { |
1699 | 75 | public: | 75 | public: |
1700 | 76 | AnimAddonWindow (CompWindow *); | 76 | AnimAddonWindow (CompWindow *); |
1701 | @@ -224,7 +224,8 @@ | |||
1702 | 224 | init (); | 224 | init (); |
1703 | 225 | 225 | ||
1704 | 226 | void | 226 | void |
1706 | 227 | transformPolygon (const PolygonObject *p); | 227 | transformPolygon (GLMatrix &matrix, |
1707 | 228 | const PolygonObject *p); | ||
1708 | 228 | 229 | ||
1709 | 229 | bool | 230 | bool |
1710 | 230 | tesselateIntoAirplane (); | 231 | tesselateIntoAirplane (); |
1711 | 231 | 232 | ||
1712 | === modified file 'plugins/composite/src/privates.h' | |||
1713 | --- plugins/composite/src/privates.h 2013-02-28 03:39:31 +0000 | |||
1714 | +++ plugins/composite/src/privates.h 2016-07-14 15:55:30 +0000 | |||
1715 | @@ -142,7 +142,6 @@ | |||
1716 | 142 | { | 142 | { |
1717 | 143 | public: | 143 | public: |
1718 | 144 | PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw); | 144 | PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw); |
1719 | 145 | ~PrivateCompositeWindow (); | ||
1720 | 146 | 145 | ||
1721 | 147 | void windowNotify (CompWindowNotify n); | 146 | void windowNotify (CompWindowNotify n); |
1722 | 148 | void resizeNotify (int dx, int dy, int dwidth, int dheight); | 147 | void resizeNotify (int dx, int dy, int dwidth, int dheight); |
1723 | @@ -156,11 +155,7 @@ | |||
1724 | 156 | void allowFurtherRebindAttempts (); | 155 | void allowFurtherRebindAttempts (); |
1725 | 157 | bool frozen (); | 156 | bool frozen (); |
1726 | 158 | 157 | ||
1732 | 159 | static void handleDamageRect (CompositeWindow *w, | 158 | static void handleDamageRect (CompositeWindow *w, XRectangle const& rect); |
1728 | 160 | int x, | ||
1729 | 161 | int y, | ||
1730 | 162 | int width, | ||
1731 | 163 | int height); | ||
1733 | 164 | 159 | ||
1734 | 165 | public: | 160 | public: |
1735 | 166 | CompWindow *window; | 161 | CompWindow *window; |
1736 | @@ -179,9 +174,7 @@ | |||
1737 | 179 | unsigned short brightness; | 174 | unsigned short brightness; |
1738 | 180 | unsigned short saturation; | 175 | unsigned short saturation; |
1739 | 181 | 176 | ||
1743 | 182 | XRectangle *damageRects; | 177 | std::vector<XRectangle> damageRects; |
1741 | 183 | int sizeDamage; | ||
1742 | 184 | int nDamage; | ||
1744 | 185 | 178 | ||
1745 | 186 | private: | 179 | private: |
1746 | 187 | 180 | ||
1747 | 188 | 181 | ||
1748 | === modified file 'plugins/composite/src/window.cpp' | |||
1749 | --- plugins/composite/src/window.cpp 2013-04-13 13:53:39 +0000 | |||
1750 | +++ plugins/composite/src/window.cpp 2016-07-14 15:55:30 +0000 | |||
1751 | @@ -115,20 +115,11 @@ | |||
1752 | 115 | overlayWindow (false), | 115 | overlayWindow (false), |
1753 | 116 | opacity (OPAQUE), | 116 | opacity (OPAQUE), |
1754 | 117 | brightness (BRIGHT), | 117 | brightness (BRIGHT), |
1759 | 118 | saturation (COLOR), | 118 | saturation (COLOR) |
1756 | 119 | damageRects (0), | ||
1757 | 120 | sizeDamage (0), | ||
1758 | 121 | nDamage (0) | ||
1760 | 122 | { | 119 | { |
1761 | 123 | WindowInterface::setHandler (w); | 120 | WindowInterface::setHandler (w); |
1762 | 124 | } | 121 | } |
1763 | 125 | 122 | ||
1764 | 126 | PrivateCompositeWindow::~PrivateCompositeWindow () | ||
1765 | 127 | { | ||
1766 | 128 | if (sizeDamage) | ||
1767 | 129 | free (damageRects); | ||
1768 | 130 | } | ||
1769 | 131 | |||
1770 | 132 | bool | 123 | bool |
1771 | 133 | PrivateCompositeWindow::bind () | 124 | PrivateCompositeWindow::bind () |
1772 | 134 | { | 125 | { |
1773 | @@ -405,32 +396,14 @@ | |||
1774 | 405 | CompositeWindow::processDamage (XDamageNotifyEvent *de) | 396 | CompositeWindow::processDamage (XDamageNotifyEvent *de) |
1775 | 406 | { | 397 | { |
1776 | 407 | if (priv->window->syncWait ()) | 398 | if (priv->window->syncWait ()) |
1792 | 408 | { | 399 | priv->damageRects.push_back (de->area); |
1778 | 409 | if (priv->nDamage == priv->sizeDamage) | ||
1779 | 410 | { | ||
1780 | 411 | priv->damageRects = (XRectangle *) realloc (priv->damageRects, | ||
1781 | 412 | (priv->sizeDamage + 1) * | ||
1782 | 413 | sizeof (XRectangle)); | ||
1783 | 414 | priv->sizeDamage += 1; | ||
1784 | 415 | } | ||
1785 | 416 | |||
1786 | 417 | priv->damageRects[priv->nDamage].x = de->area.x; | ||
1787 | 418 | priv->damageRects[priv->nDamage].y = de->area.y; | ||
1788 | 419 | priv->damageRects[priv->nDamage].width = de->area.width; | ||
1789 | 420 | priv->damageRects[priv->nDamage].height = de->area.height; | ||
1790 | 421 | priv->nDamage++; | ||
1791 | 422 | } | ||
1793 | 423 | else | 400 | else |
1796 | 424 | priv->handleDamageRect (this, de->area.x, de->area.y, | 401 | priv->handleDamageRect (this, de->area); |
1795 | 425 | de->area.width, de->area.height); | ||
1797 | 426 | } | 402 | } |
1798 | 427 | 403 | ||
1799 | 428 | void | 404 | void |
1800 | 429 | PrivateCompositeWindow::handleDamageRect (CompositeWindow *w, | 405 | PrivateCompositeWindow::handleDamageRect (CompositeWindow *w, |
1805 | 430 | int x, | 406 | XRectangle const& rect) |
1802 | 431 | int y, | ||
1803 | 432 | int width, | ||
1804 | 433 | int height) | ||
1806 | 434 | { | 407 | { |
1807 | 435 | if (!w->priv->redirected) | 408 | if (!w->priv->redirected) |
1808 | 436 | return; | 409 | return; |
1809 | @@ -440,15 +413,15 @@ | |||
1810 | 440 | if (!w->priv->damaged) | 413 | if (!w->priv->damaged) |
1811 | 441 | w->priv->damaged = initial = true; | 414 | w->priv->damaged = initial = true; |
1812 | 442 | 415 | ||
1814 | 443 | if (!w->damageRect (initial, CompRect (x, y, width, height))) | 416 | if (!w->damageRect (initial, CompRect (rect.x, rect.y, rect.width, rect.height))) |
1815 | 444 | { | 417 | { |
1816 | 445 | const CompWindow::Geometry &geom = w->priv->window->geometry (); | 418 | const CompWindow::Geometry &geom = w->priv->window->geometry (); |
1817 | 446 | 419 | ||
1820 | 447 | x += geom.x () + geom.border (); | 420 | int x = rect.x + geom.x () + geom.border (); |
1821 | 448 | y += geom.y () + geom.border (); | 421 | int y = rect.y + geom.y () + geom.border (); |
1822 | 449 | 422 | ||
1823 | 450 | w->priv->cScreen->damageRegion (CompRegion (CompRect | 423 | w->priv->cScreen->damageRegion (CompRegion (CompRect |
1825 | 451 | (x, y, width, height))); | 424 | (x, y, rect.width, rect.height))); |
1826 | 452 | } | 425 | } |
1827 | 453 | 426 | ||
1828 | 454 | if (initial) | 427 | if (initial) |
1829 | @@ -565,17 +538,10 @@ | |||
1830 | 565 | 538 | ||
1831 | 566 | case CompWindowNotifySyncAlarm: | 539 | case CompWindowNotifySyncAlarm: |
1832 | 567 | { | 540 | { |
1834 | 568 | XRectangle *rects; | 541 | for (XRectangle const& rect : damageRects) |
1835 | 542 | PrivateCompositeWindow::handleDamageRect (cWindow, rect); | ||
1836 | 569 | 543 | ||
1846 | 570 | rects = damageRects; | 544 | damageRects.clear(); |
1838 | 571 | while (nDamage--) | ||
1839 | 572 | { | ||
1840 | 573 | PrivateCompositeWindow::handleDamageRect (cWindow, | ||
1841 | 574 | rects[nDamage].x, | ||
1842 | 575 | rects[nDamage].y, | ||
1843 | 576 | rects[nDamage].width, | ||
1844 | 577 | rects[nDamage].height); | ||
1845 | 578 | } | ||
1847 | 579 | break; | 545 | break; |
1848 | 580 | } | 546 | } |
1849 | 581 | 547 | ||
1850 | 582 | 548 | ||
1851 | === modified file 'plugins/expo/expo.xml.in' | |||
1852 | --- plugins/expo/expo.xml.in 2016-05-10 07:21:00 +0000 | |||
1853 | +++ plugins/expo/expo.xml.in 2016-07-14 15:55:30 +0000 | |||
1854 | @@ -95,7 +95,7 @@ | |||
1855 | 95 | <_long>The animation used when initiating or leaving Expo.</_long> | 95 | <_long>The animation used when initiating or leaving Expo.</_long> |
1856 | 96 | <default>0</default> | 96 | <default>0</default> |
1857 | 97 | <min>0</min> | 97 | <min>0</min> |
1859 | 98 | <max>2</max> | 98 | <max>3</max> |
1860 | 99 | <desc> | 99 | <desc> |
1861 | 100 | <value>0</value> | 100 | <value>0</value> |
1862 | 101 | <_name>Zoom</_name> | 101 | <_name>Zoom</_name> |
1863 | @@ -108,6 +108,10 @@ | |||
1864 | 108 | <value>2</value> | 108 | <value>2</value> |
1865 | 109 | <_name>Vortex</_name> | 109 | <_name>Vortex</_name> |
1866 | 110 | </desc> | 110 | </desc> |
1867 | 111 | <desc> | ||
1868 | 112 | <value>3</value> | ||
1869 | 113 | <_name>None</_name> | ||
1870 | 114 | </desc> | ||
1871 | 111 | </option> | 115 | </option> |
1872 | 112 | </group> | 116 | </group> |
1873 | 113 | <group> | 117 | <group> |
1874 | 114 | 118 | ||
1875 | === modified file 'plugins/expo/src/expo.cpp' | |||
1876 | --- plugins/expo/src/expo.cpp 2016-05-16 06:23:55 +0000 | |||
1877 | +++ plugins/expo/src/expo.cpp 2016-07-14 15:55:30 +0000 | |||
1878 | @@ -402,10 +402,18 @@ | |||
1879 | 402 | float val = (static_cast <float> (msSinceLastPaint) / 1000.0f) / | 402 | float val = (static_cast <float> (msSinceLastPaint) / 1000.0f) / |
1880 | 403 | optionGetZoomTime (); | 403 | optionGetZoomTime (); |
1881 | 404 | 404 | ||
1886 | 405 | if (expoMode) | 405 | if (optionGetExpoAnimation() != ExpoScreen::ExpoAnimationNone) { |
1887 | 406 | expoCam = MIN (1.0, expoCam + val); | 406 | if (expoMode) |
1888 | 407 | else | 407 | expoCam = MIN (1.0, expoCam + val); |
1889 | 408 | expoCam = MAX (0.0, expoCam - val); | 408 | else |
1890 | 409 | expoCam = MAX (0.0, expoCam - val); | ||
1891 | 410 | } | ||
1892 | 411 | else { | ||
1893 | 412 | if (expoMode) | ||
1894 | 413 | expoCam = 1; | ||
1895 | 414 | else | ||
1896 | 415 | expoCam = 0; | ||
1897 | 416 | } | ||
1898 | 409 | 417 | ||
1899 | 410 | if (expoCam) | 418 | if (expoCam) |
1900 | 411 | { | 419 | { |
1901 | 412 | 420 | ||
1902 | === modified file 'plugins/ezoom/ezoom.xml.in' (properties changed: -x to +x) | |||
1903 | --- plugins/ezoom/ezoom.xml.in 2015-10-26 17:15:43 +0000 | |||
1904 | +++ plugins/ezoom/ezoom.xml.in 2016-07-14 15:55:30 +0000 | |||
1905 | @@ -81,49 +81,218 @@ | |||
1906 | 81 | </group> | 81 | </group> |
1907 | 82 | <group> | 82 | <group> |
1908 | 83 | <_short>Specific Zoom</_short> | 83 | <_short>Specific Zoom</_short> |
1909 | 84 | <option type="bool" name="spec_target_focus"> | ||
1910 | 85 | <_short>Target Focused Window on Specific Zoom</_short> | ||
1911 | 86 | <_long>Check this to target the focused window when jumping to a specific zoom level. Uncheck this to target the mouse.</_long> | ||
1912 | 87 | <default>true</default> | ||
1913 | 88 | </option> | ||
1914 | 89 | <option type="float" name="zoom_specific_1"> | ||
1915 | 90 | <_short>Specific Zoom 1</_short> | ||
1916 | 91 | <_long>Zoom level to go to when triggering hotkey 1</_long> | ||
1917 | 92 | <default>1.0</default> | ||
1918 | 93 | <min>0.1</min> | ||
1919 | 94 | <max>1.0</max> | ||
1920 | 95 | <precision>0.01</precision> | ||
1921 | 96 | </option> | ||
1922 | 84 | <option type="key" name="zoom_specific_1_key"> | 97 | <option type="key" name="zoom_specific_1_key"> |
1924 | 85 | <_short>Zoom Specific Level 1</_short> | 98 | <_short>Zoom to Specific Zoom 1</_short> |
1925 | 86 | <_long>Zoom to the specific zoom level 1</_long> | 99 | <_long>Zoom to the specific zoom level 1</_long> |
1926 | 87 | <default></default> | 100 | <default></default> |
1927 | 88 | </option> | 101 | </option> |
1931 | 89 | <option type="float" name="zoom_spec1"> | 102 | <option type="float" name="zoom_specific_2"> |
1932 | 90 | <_short>Specific zoom factor 1</_short> | 103 | <_short>Specific Zoom 2</_short> |
1933 | 91 | <_long>Zoom level to go to when triggering hotkey 1</_long> | 104 | <_long>Zoom level to go to when triggering hotkey 2</_long> |
1934 | 92 | <default>1.0</default> | 105 | <default>1.0</default> |
1935 | 93 | <min>0.1</min> | 106 | <min>0.1</min> |
1936 | 94 | <max>1.0</max> | 107 | <max>1.0</max> |
1937 | 95 | <precision>0.01</precision> | 108 | <precision>0.01</precision> |
1938 | 96 | </option> | 109 | </option> |
1939 | 97 | <option type="key" name="zoom_specific_2_key"> | 110 | <option type="key" name="zoom_specific_2_key"> |
1941 | 98 | <_short>Zoom Specific Level 2</_short> | 111 | <_short>Zoom to Specific Zoom 2</_short> |
1942 | 99 | <_long>Zoom to the specific zoom level 2</_long> | 112 | <_long>Zoom to the specific zoom level 2</_long> |
1943 | 100 | <default></default> | 113 | <default></default> |
1944 | 101 | </option> | 114 | </option> |
1949 | 102 | <option type="float" name="zoom_spec2"> | 115 | <option type="float" name="zoom_specific_3"> |
1950 | 103 | <_short>Specific zoom factor 2</_short> | 116 | <_short>Specific Zoom 3</_short> |
1951 | 104 | <_long>Zoom level to go to when triggering hotkey 2</_long> | 117 | <_long>Zoom level to go to when triggering hotkey 3</_long> |
1952 | 105 | <default>0.5</default> | 118 | <default>1.0</default> |
1953 | 106 | <min>0.1</min> | 119 | <min>0.1</min> |
1954 | 107 | <max>1.0</max> | 120 | <max>1.0</max> |
1955 | 108 | <precision>0.01</precision> | 121 | <precision>0.01</precision> |
1956 | 109 | </option> | 122 | </option> |
1957 | 110 | <option type="key" name="zoom_specific_3_key"> | 123 | <option type="key" name="zoom_specific_3_key"> |
1959 | 111 | <_short>Zoom Specific Level 3</_short> | 124 | <_short>Zoom to Specific Zoom 3</_short> |
1960 | 112 | <_long>Zoom to the specific zoom level 3</_long> | 125 | <_long>Zoom to the specific zoom level 3</_long> |
1961 | 113 | <default></default> | 126 | <default></default> |
1962 | 114 | </option> | 127 | </option> |
1975 | 115 | <option type="float" name="zoom_spec3"> | 128 | <option type="float" name="zoom_specific_4"> |
1976 | 116 | <_short>Specific zoom factor 3</_short> | 129 | <_short>Specific Zoom 4</_short> |
1977 | 117 | <_long>Zoom level to go to when triggering hotkey 3</_long> | 130 | <_long>Zoom level to go to when triggering hotkey 4</_long> |
1978 | 118 | <default>0.2</default> | 131 | <default>1.0</default> |
1979 | 119 | <min>0.1</min> | 132 | <min>0.1</min> |
1980 | 120 | <max>1.0</max> | 133 | <max>1.0</max> |
1981 | 121 | <precision>0.01</precision> | 134 | <precision>0.01</precision> |
1982 | 122 | </option> | 135 | </option> |
1983 | 123 | <option type="bool" name="spec_target_focus"> | 136 | <option type="key" name="zoom_specific_4_key"> |
1984 | 124 | <_short>Target Focused Window on Specific level</_short> | 137 | <_short>Zoom to Specific Zoom 4</_short> |
1985 | 125 | <_long>Enable this to target the focused window when jumping to a specific zoom level. Disable to target mouse.</_long> | 138 | <_long>Zoom to the specific zoom level 4</_long> |
1986 | 126 | <default>true</default> | 139 | <default></default> |
1987 | 140 | </option> | ||
1988 | 141 | <option type="float" name="zoom_specific_5"> | ||
1989 | 142 | <_short>Specific Zoom 5</_short> | ||
1990 | 143 | <_long>Zoom level to go to when triggering hotkey 5</_long> | ||
1991 | 144 | <default>1.0</default> | ||
1992 | 145 | <min>0.1</min> | ||
1993 | 146 | <max>1.0</max> | ||
1994 | 147 | <precision>0.01</precision> | ||
1995 | 148 | </option> | ||
1996 | 149 | <option type="key" name="zoom_specific_5_key"> | ||
1997 | 150 | <_short>Zoom to Specific Zoom 5</_short> | ||
1998 | 151 | <_long>Zoom to the specific zoom level 5</_long> | ||
1999 | 152 | <default></default> | ||
2000 | 153 | </option> | ||
2001 | 154 | <option type="float" name="zoom_specific_6"> | ||
2002 | 155 | <_short>Specific Zoom 6</_short> | ||
2003 | 156 | <_long>Zoom level to go to when triggering hotkey 6</_long> | ||
2004 | 157 | <default>1.0</default> | ||
2005 | 158 | <min>0.1</min> | ||
2006 | 159 | <max>1.0</max> | ||
2007 | 160 | <precision>0.01</precision> | ||
2008 | 161 | </option> | ||
2009 | 162 | <option type="key" name="zoom_specific_6_key"> | ||
2010 | 163 | <_short>Zoom to Specific Zoom 6</_short> | ||
2011 | 164 | <_long>Zoom to the specific zoom level 6</_long> | ||
2012 | 165 | <default></default> | ||
2013 | 166 | </option> | ||
2014 | 167 | <option type="float" name="zoom_specific_7"> | ||
2015 | 168 | <_short>Specific Zoom 7</_short> | ||
2016 | 169 | <_long>Zoom level to go to when triggering hotkey 7</_long> | ||
2017 | 170 | <default>1.0</default> | ||
2018 | 171 | <min>0.1</min> | ||
2019 | 172 | <max>1.0</max> | ||
2020 | 173 | <precision>0.01</precision> | ||
2021 | 174 | </option> | ||
2022 | 175 | <option type="key" name="zoom_specific_7_key"> | ||
2023 | 176 | <_short>Zoom to Specific Zoom 7</_short> | ||
2024 | 177 | <_long>Zoom to the specific zoom level 7</_long> | ||
2025 | 178 | <default></default> | ||
2026 | 179 | </option> | ||
2027 | 180 | <option type="float" name="zoom_specific_8"> | ||
2028 | 181 | <_short>Specific Zoom 8</_short> | ||
2029 | 182 | <_long>Zoom level to go to when triggering hotkey 8</_long> | ||
2030 | 183 | <default>1.0</default> | ||
2031 | 184 | <min>0.1</min> | ||
2032 | 185 | <max>1.0</max> | ||
2033 | 186 | <precision>0.01</precision> | ||
2034 | 187 | </option> | ||
2035 | 188 | <option type="key" name="zoom_specific_8_key"> | ||
2036 | 189 | <_short>Zoom to Specific Zoom 8</_short> | ||
2037 | 190 | <_long>Zoom to the specific zoom level 8</_long> | ||
2038 | 191 | <default></default> | ||
2039 | 192 | </option> | ||
2040 | 193 | <option type="float" name="zoom_specific_9"> | ||
2041 | 194 | <_short>Specific Zoom 9</_short> | ||
2042 | 195 | <_long>Zoom level to go to when triggering hotkey 9</_long> | ||
2043 | 196 | <default>1.0</default> | ||
2044 | 197 | <min>0.1</min> | ||
2045 | 198 | <max>1.0</max> | ||
2046 | 199 | <precision>0.01</precision> | ||
2047 | 200 | </option> | ||
2048 | 201 | <option type="key" name="zoom_specific_9_key"> | ||
2049 | 202 | <_short>Zoom to Specific Zoom 9</_short> | ||
2050 | 203 | <_long>Zoom to the specific zoom level 9</_long> | ||
2051 | 204 | <default></default> | ||
2052 | 205 | </option> | ||
2053 | 206 | <option type="float" name="zoom_specific_10"> | ||
2054 | 207 | <_short>Specific Zoom 10</_short> | ||
2055 | 208 | <_long>Zoom level to go to when triggering hotkey 10</_long> | ||
2056 | 209 | <default>1.0</default> | ||
2057 | 210 | <min>0.1</min> | ||
2058 | 211 | <max>1.0</max> | ||
2059 | 212 | <precision>0.01</precision> | ||
2060 | 213 | </option> | ||
2061 | 214 | <option type="key" name="zoom_specific_10_key"> | ||
2062 | 215 | <_short>Zoom to Specific Zoom 10</_short> | ||
2063 | 216 | <_long>Zoom to the specific zoom level 10</_long> | ||
2064 | 217 | <default></default> | ||
2065 | 218 | </option> | ||
2066 | 219 | <option type="float" name="zoom_specific_11"> | ||
2067 | 220 | <_short>Specific Zoom 11</_short> | ||
2068 | 221 | <_long>Zoom level to go to when triggering hotkey 11</_long> | ||
2069 | 222 | <default>1.0</default> | ||
2070 | 223 | <min>0.1</min> | ||
2071 | 224 | <max>1.0</max> | ||
2072 | 225 | <precision>0.01</precision> | ||
2073 | 226 | </option> | ||
2074 | 227 | <option type="key" name="zoom_specific_11_key"> | ||
2075 | 228 | <_short>Zoom to Specific Zoom 11</_short> | ||
2076 | 229 | <_long>Zoom to the specific zoom level 11</_long> | ||
2077 | 230 | <default></default> | ||
2078 | 231 | </option> | ||
2079 | 232 | <option type="float" name="zoom_specific_12"> | ||
2080 | 233 | <_short>Specific Zoom 12</_short> | ||
2081 | 234 | <_long>Zoom level to go to when triggering hotkey 12</_long> | ||
2082 | 235 | <default>1.0</default> | ||
2083 | 236 | <min>0.1</min> | ||
2084 | 237 | <max>1.0</max> | ||
2085 | 238 | <precision>0.01</precision> | ||
2086 | 239 | </option> | ||
2087 | 240 | <option type="key" name="zoom_specific_12_key"> | ||
2088 | 241 | <_short>Zoom to Specific Zoom 12</_short> | ||
2089 | 242 | <_long>Zoom to the specific zoom level 12</_long> | ||
2090 | 243 | <default></default> | ||
2091 | 244 | </option> | ||
2092 | 245 | <option type="float" name="zoom_specific_13"> | ||
2093 | 246 | <_short>Specific Zoom 13</_short> | ||
2094 | 247 | <_long>Zoom level to go to when triggering hotkey 13</_long> | ||
2095 | 248 | <default>1.0</default> | ||
2096 | 249 | <min>0.1</min> | ||
2097 | 250 | <max>1.0</max> | ||
2098 | 251 | <precision>0.01</precision> | ||
2099 | 252 | </option> | ||
2100 | 253 | <option type="key" name="zoom_specific_13_key"> | ||
2101 | 254 | <_short>Zoom to Specific Zoom 13</_short> | ||
2102 | 255 | <_long>Zoom to the specific zoom level 13</_long> | ||
2103 | 256 | <default></default> | ||
2104 | 257 | </option> | ||
2105 | 258 | <option type="float" name="zoom_specific_14"> | ||
2106 | 259 | <_short>Specific Zoom 14</_short> | ||
2107 | 260 | <_long>Zoom level to go to when triggering hotkey 14</_long> | ||
2108 | 261 | <default>1.0</default> | ||
2109 | 262 | <min>0.1</min> | ||
2110 | 263 | <max>1.0</max> | ||
2111 | 264 | <precision>0.01</precision> | ||
2112 | 265 | </option> | ||
2113 | 266 | <option type="key" name="zoom_specific_14_key"> | ||
2114 | 267 | <_short>Zoom to Specific Zoom 14</_short> | ||
2115 | 268 | <_long>Zoom to the specific zoom level 14</_long> | ||
2116 | 269 | <default></default> | ||
2117 | 270 | </option> | ||
2118 | 271 | <option type="float" name="zoom_specific_15"> | ||
2119 | 272 | <_short>Specific Zoom 15</_short> | ||
2120 | 273 | <_long>Zoom level to go to when triggering hotkey 15</_long> | ||
2121 | 274 | <default>1.0</default> | ||
2122 | 275 | <min>0.1</min> | ||
2123 | 276 | <max>1.0</max> | ||
2124 | 277 | <precision>0.01</precision> | ||
2125 | 278 | </option> | ||
2126 | 279 | <option type="key" name="zoom_specific_15_key"> | ||
2127 | 280 | <_short>Zoom to Specific Zoom 15</_short> | ||
2128 | 281 | <_long>Zoom to the specific zoom level 15</_long> | ||
2129 | 282 | <default></default> | ||
2130 | 283 | </option> | ||
2131 | 284 | <option type="float" name="zoom_specific_16"> | ||
2132 | 285 | <_short>Specific Zoom 16</_short> | ||
2133 | 286 | <_long>Zoom level to go to when triggering hotkey 16</_long> | ||
2134 | 287 | <default>1.0</default> | ||
2135 | 288 | <min>0.1</min> | ||
2136 | 289 | <max>1.0</max> | ||
2137 | 290 | <precision>0.01</precision> | ||
2138 | 291 | </option> | ||
2139 | 292 | <option type="key" name="zoom_specific_16_key"> | ||
2140 | 293 | <_short>Zoom to Specific Zoom 16</_short> | ||
2141 | 294 | <_long>Zoom to the specific zoom level 16</_long> | ||
2142 | 295 | <default></default> | ||
2143 | 127 | </option> | 296 | </option> |
2144 | 128 | </group> | 297 | </group> |
2145 | 129 | <group> | 298 | <group> |
2146 | 130 | 299 | ||
2147 | === modified file 'plugins/ezoom/src/ezoom.cpp' (properties changed: -x to +x) | |||
2148 | --- plugins/ezoom/src/ezoom.cpp 2014-10-22 16:01:27 +0000 | |||
2149 | +++ plugins/ezoom/src/ezoom.cpp 2016-07-14 15:55:30 +0000 | |||
2150 | @@ -1591,16 +1591,68 @@ | |||
2151 | 1591 | 1591 | ||
2152 | 1592 | switch (target) | 1592 | switch (target) |
2153 | 1593 | { | 1593 | { |
2164 | 1594 | case ZoomTargetFirst: | 1594 | case ZoomTarget1: |
2165 | 1595 | zoom_level = optionGetZoomSpec1 (); | 1595 | zoom_level = optionGetZoomSpecific1 (); |
2166 | 1596 | break; | 1596 | break; |
2167 | 1597 | 1597 | ||
2168 | 1598 | case ZoomTargetSecond: | 1598 | case ZoomTarget2: |
2169 | 1599 | zoom_level = optionGetZoomSpec2 (); | 1599 | zoom_level = optionGetZoomSpecific2 (); |
2170 | 1600 | break; | 1600 | break; |
2171 | 1601 | 1601 | ||
2172 | 1602 | case ZoomTargetThird: | 1602 | case ZoomTarget3: |
2173 | 1603 | zoom_level = optionGetZoomSpec3 (); | 1603 | zoom_level = optionGetZoomSpecific3 (); |
2174 | 1604 | break; | ||
2175 | 1605 | |||
2176 | 1606 | case ZoomTarget4: | ||
2177 | 1607 | zoom_level = optionGetZoomSpecific4 (); | ||
2178 | 1608 | break; | ||
2179 | 1609 | |||
2180 | 1610 | case ZoomTarget5: | ||
2181 | 1611 | zoom_level = optionGetZoomSpecific5 (); | ||
2182 | 1612 | break; | ||
2183 | 1613 | |||
2184 | 1614 | case ZoomTarget6: | ||
2185 | 1615 | zoom_level = optionGetZoomSpecific6 (); | ||
2186 | 1616 | break; | ||
2187 | 1617 | |||
2188 | 1618 | case ZoomTarget7: | ||
2189 | 1619 | zoom_level = optionGetZoomSpecific7 (); | ||
2190 | 1620 | break; | ||
2191 | 1621 | |||
2192 | 1622 | case ZoomTarget8: | ||
2193 | 1623 | zoom_level = optionGetZoomSpecific8 (); | ||
2194 | 1624 | break; | ||
2195 | 1625 | |||
2196 | 1626 | case ZoomTarget9: | ||
2197 | 1627 | zoom_level = optionGetZoomSpecific9 (); | ||
2198 | 1628 | break; | ||
2199 | 1629 | |||
2200 | 1630 | case ZoomTarget10: | ||
2201 | 1631 | zoom_level = optionGetZoomSpecific10 (); | ||
2202 | 1632 | break; | ||
2203 | 1633 | |||
2204 | 1634 | case ZoomTarget11: | ||
2205 | 1635 | zoom_level = optionGetZoomSpecific11 (); | ||
2206 | 1636 | break; | ||
2207 | 1637 | |||
2208 | 1638 | case ZoomTarget12: | ||
2209 | 1639 | zoom_level = optionGetZoomSpecific12 (); | ||
2210 | 1640 | break; | ||
2211 | 1641 | |||
2212 | 1642 | case ZoomTarget13: | ||
2213 | 1643 | zoom_level = optionGetZoomSpecific13 (); | ||
2214 | 1644 | break; | ||
2215 | 1645 | |||
2216 | 1646 | case ZoomTarget14: | ||
2217 | 1647 | zoom_level = optionGetZoomSpecific14 (); | ||
2218 | 1648 | break; | ||
2219 | 1649 | |||
2220 | 1650 | case ZoomTarget15: | ||
2221 | 1651 | zoom_level = optionGetZoomSpecific15 (); | ||
2222 | 1652 | break; | ||
2223 | 1653 | |||
2224 | 1654 | case ZoomTarget16: | ||
2225 | 1655 | zoom_level = optionGetZoomSpecific16 (); | ||
2226 | 1604 | break; | 1656 | break; |
2227 | 1605 | 1657 | ||
2228 | 1606 | default: | 1658 | default: |
2229 | @@ -1966,16 +2018,54 @@ | |||
2230 | 1966 | optionSetZoomOutKeyInitiate (boost::bind (&EZoomScreen::zoomOut, this, _1, | 2018 | optionSetZoomOutKeyInitiate (boost::bind (&EZoomScreen::zoomOut, this, _1, |
2231 | 1967 | _2, _3)); | 2019 | _2, _3)); |
2232 | 1968 | 2020 | ||
2243 | 1969 | optionSetZoomSpecific1KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | 2021 | optionSetZoomSpecific1KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, |
2244 | 1970 | this, _1, _2, _3, | 2022 | this, _1, _2, _3, |
2245 | 1971 | ZoomTargetFirst)); | 2023 | ZoomTarget1)); |
2246 | 1972 | optionSetZoomSpecific2KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | 2024 | optionSetZoomSpecific2KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, |
2247 | 1973 | this, _1, _2, _3, | 2025 | this, _1, _2, _3, |
2248 | 1974 | ZoomTargetSecond)); | 2026 | ZoomTarget2)); |
2249 | 1975 | optionSetZoomSpecific3KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | 2027 | optionSetZoomSpecific3KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, |
2250 | 1976 | this, _1, _2, _3, | 2028 | this, _1, _2, _3, |
2251 | 1977 | ZoomTargetThird)); | 2029 | ZoomTarget3)); |
2252 | 1978 | 2030 | optionSetZoomSpecific4KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | |
2253 | 2031 | this, _1, _2, _3, | ||
2254 | 2032 | ZoomTarget4)); | ||
2255 | 2033 | optionSetZoomSpecific5KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2256 | 2034 | this, _1, _2, _3, | ||
2257 | 2035 | ZoomTarget5)); | ||
2258 | 2036 | optionSetZoomSpecific6KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2259 | 2037 | this, _1, _2, _3, | ||
2260 | 2038 | ZoomTarget6)); | ||
2261 | 2039 | optionSetZoomSpecific7KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2262 | 2040 | this, _1, _2, _3, | ||
2263 | 2041 | ZoomTarget7)); | ||
2264 | 2042 | optionSetZoomSpecific8KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2265 | 2043 | this, _1, _2, _3, | ||
2266 | 2044 | ZoomTarget8)); | ||
2267 | 2045 | optionSetZoomSpecific9KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2268 | 2046 | this, _1, _2, _3, | ||
2269 | 2047 | ZoomTarget9)); | ||
2270 | 2048 | optionSetZoomSpecific10KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2271 | 2049 | this, _1, _2, _3, | ||
2272 | 2050 | ZoomTarget10)); | ||
2273 | 2051 | optionSetZoomSpecific11KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2274 | 2052 | this, _1, _2, _3, | ||
2275 | 2053 | ZoomTarget11)); | ||
2276 | 2054 | optionSetZoomSpecific12KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2277 | 2055 | this, _1, _2, _3, | ||
2278 | 2056 | ZoomTarget12)); | ||
2279 | 2057 | optionSetZoomSpecific13KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2280 | 2058 | this, _1, _2, _3, | ||
2281 | 2059 | ZoomTarget13)); | ||
2282 | 2060 | optionSetZoomSpecific14KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2283 | 2061 | this, _1, _2, _3, | ||
2284 | 2062 | ZoomTarget14)); | ||
2285 | 2063 | optionSetZoomSpecific15KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2286 | 2064 | this, _1, _2, _3, | ||
2287 | 2065 | ZoomTarget15)); | ||
2288 | 2066 | optionSetZoomSpecific16KeyInitiate (boost::bind (&EZoomScreen::zoomSpecific, | ||
2289 | 2067 | this, _1, _2, _3, | ||
2290 | 2068 | ZoomTarget16)); | ||
2291 | 1979 | optionSetPanLeftKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1, | 2069 | optionSetPanLeftKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1, |
2292 | 1980 | _2, _3, -1, 0)); | 2070 | _2, _3, -1, 0)); |
2293 | 1981 | optionSetPanRightKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1, | 2071 | optionSetPanRightKeyInitiate (boost::bind (&EZoomScreen::zoomPan, this, _1, |
2294 | 1982 | 2072 | ||
2295 | === modified file 'plugins/ezoom/src/ezoom.h' (properties changed: -x to +x) | |||
2296 | --- plugins/ezoom/src/ezoom.h 2013-05-15 15:44:02 +0000 | |||
2297 | +++ plugins/ezoom/src/ezoom.h 2016-07-14 15:55:30 +0000 | |||
2298 | @@ -51,9 +51,22 @@ | |||
2299 | 51 | 51 | ||
2300 | 52 | enum SpecificZoomTarget | 52 | enum SpecificZoomTarget |
2301 | 53 | { | 53 | { |
2305 | 54 | ZoomTargetFirst = 0, | 54 | ZoomTarget1 = 0, |
2306 | 55 | ZoomTargetSecond, | 55 | ZoomTarget2, |
2307 | 56 | ZoomTargetThird | 56 | ZoomTarget3, |
2308 | 57 | ZoomTarget4, | ||
2309 | 58 | ZoomTarget5, | ||
2310 | 59 | ZoomTarget6, | ||
2311 | 60 | ZoomTarget7, | ||
2312 | 61 | ZoomTarget8, | ||
2313 | 62 | ZoomTarget9, | ||
2314 | 63 | ZoomTarget10, | ||
2315 | 64 | ZoomTarget11, | ||
2316 | 65 | ZoomTarget12, | ||
2317 | 66 | ZoomTarget13, | ||
2318 | 67 | ZoomTarget14, | ||
2319 | 68 | ZoomTarget15, | ||
2320 | 69 | ZoomTarget16 | ||
2321 | 57 | }; | 70 | }; |
2322 | 58 | 71 | ||
2323 | 59 | class EZoomScreen : | 72 | class EZoomScreen : |
2324 | 60 | 73 | ||
2325 | === modified file 'plugins/grid/src/grid.cpp' (properties changed: -x to +x) | |||
2326 | --- plugins/grid/src/grid.cpp 2015-04-06 13:14:51 +0000 | |||
2327 | +++ plugins/grid/src/grid.cpp 2016-07-14 15:55:30 +0000 | |||
2328 | @@ -250,110 +250,129 @@ | |||
2329 | 250 | !optionGetCycleSizes ())) && | 250 | !optionGetCycleSizes ())) && |
2330 | 251 | gw->lastTarget & where) | 251 | gw->lastTarget & where) |
2331 | 252 | { | 252 | { |
2332 | 253 | /* TODO: | ||
2333 | 254 | * instead of just using what was here | ||
2334 | 255 | * decide on how to deal with rounding/truncating/off by one, | ||
2335 | 256 | * might be helpful in cases like using a windowed virtual machine | ||
2336 | 257 | * with a relatively prime number for width, | ||
2337 | 258 | * examples 631, 797, 1021, 1279, 1439, 1913, 2039, 2557, 3833, ... NextPrime[{N}, -1] | ||
2338 | 259 | */ | ||
2339 | 260 | int slotWidth12 = workarea.width () / 8; | ||
2340 | 261 | int slotWidth17 = (workarea.width () / 6); | ||
2341 | 253 | int slotWidth25 = workarea.width () / 4; | 262 | int slotWidth25 = workarea.width () / 4; |
2342 | 254 | int slotWidth33 = (workarea.width () / 3) + cw->border ().left; | 263 | int slotWidth33 = (workarea.width () / 3) + cw->border ().left; |
2344 | 255 | int slotWidth17 = slotWidth33 - slotWidth25; | 264 | int slotWidth50 = (workarea.width () / 2); |
2345 | 256 | int slotWidth66 = workarea.width () - slotWidth33; | 265 | int slotWidth66 = workarea.width () - slotWidth33; |
2346 | 257 | int slotWidth75 = workarea.width () - slotWidth25; | 266 | int slotWidth75 = workarea.width () - slotWidth25; |
2347 | 267 | int slotWidth100 = workarea.width (); | ||
2348 | 268 | int slotWidth37 = slotWidth75 / 2; | ||
2349 | 258 | 269 | ||
2350 | 259 | if (props.numCellsX == 2) /* keys (1, 4, 7, 3, 6, 9) */ | 270 | if (props.numCellsX == 2) /* keys (1, 4, 7, 3, 6, 9) */ |
2351 | 260 | { | 271 | { |
2397 | 261 | if ((currentRect.width () == desiredRect.width () && | 272 | if ((currentRect.width () == desiredRect.width () && |
2398 | 262 | currentRect.x () == desiredRect.x ()) || | 273 | currentRect.x () == desiredRect.x ()) || |
2399 | 263 | (gw->resizeCount < 1) || (gw->resizeCount > 5)) | 274 | (gw->resizeCount < 1) || (gw->resizeCount > 6)) |
2400 | 264 | gw->resizeCount = 3; | 275 | { |
2401 | 265 | 276 | gw->resizeCount = 2; | |
2402 | 266 | /* tricky, have to allow for window constraints when | 277 | } |
2403 | 267 | * computing what the 33% and 66% offsets would be | 278 | /* tricky, have to allow for window constraints when |
2404 | 268 | */ | 279 | * computing what the 33% and 66% offsets would be |
2405 | 269 | switch (gw->resizeCount) | 280 | */ |
2406 | 270 | { | 281 | switch (gw->resizeCount) |
2407 | 271 | case 1: | 282 | { |
2408 | 272 | desiredSlot.setWidth (slotWidth66); | 283 | case 1: |
2409 | 273 | desiredSlot.setX (workarea.x () + | 284 | desiredSlot.setWidth (slotWidth50); |
2410 | 274 | props.gravityRight * slotWidth33); | 285 | desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth50); |
2411 | 275 | ++gw->resizeCount; | 286 | ++gw->resizeCount; |
2412 | 276 | break; | 287 | break; |
2413 | 277 | 288 | ||
2414 | 278 | case 2: | 289 | case 2: |
2415 | 279 | ++gw->resizeCount; | 290 | desiredSlot.setWidth (slotWidth33); |
2416 | 280 | break; | 291 | desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth66); |
2417 | 281 | 292 | ++gw->resizeCount; | |
2418 | 282 | case 3: | 293 | break; |
2419 | 283 | desiredSlot.setWidth (slotWidth33); | 294 | |
2420 | 284 | desiredSlot.setX (workarea.x () + | 295 | case 3: |
2421 | 285 | props.gravityRight * slotWidth66); | 296 | desiredSlot.setWidth (slotWidth25); |
2422 | 286 | ++gw->resizeCount; | 297 | desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth75); |
2423 | 287 | break; | 298 | ++gw->resizeCount; |
2424 | 288 | 299 | break; | |
2425 | 289 | case 4: | 300 | |
2426 | 290 | desiredSlot.setWidth (slotWidth25); | 301 | case 4: |
2427 | 291 | desiredSlot.setX (workarea.x () + | 302 | desiredSlot.setWidth (slotWidth100); |
2428 | 292 | props.gravityRight * slotWidth75); | 303 | desiredSlot.setX (workarea.x ()); |
2429 | 293 | ++gw->resizeCount; | 304 | ++gw->resizeCount; |
2430 | 294 | break; | 305 | break; |
2431 | 295 | 306 | ||
2432 | 296 | case 5: | 307 | case 5: |
2433 | 297 | desiredSlot.setWidth (slotWidth75); | 308 | desiredSlot.setWidth (slotWidth75); |
2434 | 298 | desiredSlot.setX (workarea.x () + | 309 | desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth25); |
2435 | 299 | props.gravityRight * slotWidth25); | 310 | ++gw->resizeCount; |
2436 | 300 | ++gw->resizeCount; | 311 | break; |
2437 | 301 | break; | 312 | |
2438 | 302 | 313 | case 6: | |
2439 | 303 | default: | 314 | desiredSlot.setWidth (slotWidth66); |
2440 | 304 | break; | 315 | desiredSlot.setX (workarea.x () + props.gravityRight * slotWidth33); |
2441 | 305 | } | 316 | ++gw->resizeCount; |
2442 | 317 | break; | ||
2443 | 318 | |||
2444 | 319 | default: | ||
2445 | 320 | break; | ||
2446 | 321 | } | ||
2447 | 306 | } | 322 | } |
2448 | 307 | else /* keys (2, 5, 8) */ | 323 | else /* keys (2, 5, 8) */ |
2449 | 308 | { | 324 | { |
2453 | 309 | if ((currentRect.width () == desiredRect.width () && | 325 | if ((currentRect.width () == desiredRect.width () && |
2454 | 310 | currentRect.x () == desiredRect.x ()) || | 326 | currentRect.x () == desiredRect.x ()) || |
2455 | 311 | (gw->resizeCount < 1) || (gw->resizeCount > 5)) | 327 | (gw->resizeCount < 1) || (gw->resizeCount > 6)) |
2456 | 328 | { | ||
2457 | 329 | gw->resizeCount = 2; | ||
2458 | 330 | } | ||
2459 | 331 | switch (gw->resizeCount) | ||
2460 | 332 | { | ||
2461 | 333 | case 1: | ||
2462 | 334 | desiredSlot.setWidth (slotWidth100); | ||
2463 | 335 | desiredSlot.setX (workarea.x ()); | ||
2464 | 336 | ++gw->resizeCount; | ||
2465 | 337 | break; | ||
2466 | 338 | |||
2467 | 339 | case 2: | ||
2468 | 340 | desiredSlot.setWidth (slotWidth75); | ||
2469 | 341 | desiredSlot.setX (workarea.x () + slotWidth12); | ||
2470 | 342 | ++gw->resizeCount; | ||
2471 | 343 | break; | ||
2472 | 344 | |||
2473 | 345 | case 3: | ||
2474 | 346 | desiredSlot.setWidth (slotWidth66); | ||
2475 | 347 | desiredSlot.setX (workarea.x () + slotWidth17); | ||
2476 | 348 | ++gw->resizeCount; | ||
2477 | 349 | break; | ||
2478 | 350 | |||
2479 | 351 | case 4: | ||
2480 | 352 | desiredSlot.setWidth ((slotWidth50)); | ||
2481 | 353 | desiredSlot.setX (workarea.x () + slotWidth25); | ||
2482 | 354 | ++gw->resizeCount; | ||
2483 | 355 | break; | ||
2484 | 356 | |||
2485 | 357 | case 5: | ||
2486 | 358 | desiredSlot.setWidth (slotWidth33 - (cw->border ().left + cw->border ().right)); | ||
2487 | 359 | desiredSlot.setX (workarea.x () + slotWidth33); | ||
2488 | 360 | ++gw->resizeCount; | ||
2489 | 361 | break; | ||
2490 | 362 | |||
2491 | 363 | case 6: | ||
2492 | 364 | desiredSlot.setWidth ((slotWidth25)); | ||
2493 | 365 | desiredSlot.setX (workarea.x () + slotWidth37); | ||
2494 | 366 | ++gw->resizeCount; | ||
2495 | 367 | break; | ||
2496 | 368 | |||
2497 | 369 | default: | ||
2498 | 370 | break; | ||
2499 | 371 | } | ||
2500 | 372 | } | ||
2501 | 373 | if (gw->resizeCount > 6){ | ||
2502 | 312 | gw->resizeCount = 1; | 374 | gw->resizeCount = 1; |
2547 | 313 | 375 | } | |
2504 | 314 | switch (gw->resizeCount) | ||
2505 | 315 | { | ||
2506 | 316 | case 1: | ||
2507 | 317 | desiredSlot.setWidth (workarea.width () - | ||
2508 | 318 | (slotWidth17 * 2)); | ||
2509 | 319 | desiredSlot.setX (workarea.x () + slotWidth17); | ||
2510 | 320 | ++gw->resizeCount; | ||
2511 | 321 | break; | ||
2512 | 322 | |||
2513 | 323 | case 2: | ||
2514 | 324 | desiredSlot.setWidth ((slotWidth25 * 2) + | ||
2515 | 325 | (slotWidth17 * 2)); | ||
2516 | 326 | desiredSlot.setX (workarea.x () + | ||
2517 | 327 | (slotWidth25 - slotWidth17)); | ||
2518 | 328 | ++gw->resizeCount; | ||
2519 | 329 | break; | ||
2520 | 330 | |||
2521 | 331 | case 3: | ||
2522 | 332 | desiredSlot.setWidth ((slotWidth25 * 2)); | ||
2523 | 333 | desiredSlot.setX (workarea.x () + slotWidth25); | ||
2524 | 334 | ++gw->resizeCount; | ||
2525 | 335 | break; | ||
2526 | 336 | |||
2527 | 337 | case 4: | ||
2528 | 338 | desiredSlot.setWidth (slotWidth33 - | ||
2529 | 339 | (cw->border ().left + | ||
2530 | 340 | cw->border ().right)); | ||
2531 | 341 | desiredSlot.setX (workarea.x () + slotWidth33); | ||
2532 | 342 | ++gw->resizeCount; | ||
2533 | 343 | break; | ||
2534 | 344 | |||
2535 | 345 | case 5: | ||
2536 | 346 | ++gw->resizeCount; | ||
2537 | 347 | break; | ||
2538 | 348 | |||
2539 | 349 | default: | ||
2540 | 350 | break; | ||
2541 | 351 | } | ||
2542 | 352 | } | ||
2543 | 353 | |||
2544 | 354 | if (gw->resizeCount == 6) | ||
2545 | 355 | gw->resizeCount = 1; | ||
2546 | 356 | |||
2548 | 357 | desiredRect = constrainSize (cw, desiredSlot); | 376 | desiredRect = constrainSize (cw, desiredSlot); |
2549 | 358 | } | 377 | } |
2550 | 359 | 378 | ||
2551 | 360 | 379 | ||
2552 | === modified file 'plugins/opengl/include/opengl/matrix.h' | |||
2553 | --- plugins/opengl/include/opengl/matrix.h 2012-08-02 11:57:41 +0000 | |||
2554 | +++ plugins/opengl/include/opengl/matrix.h 2016-07-14 15:55:30 +0000 | |||
2555 | @@ -26,6 +26,8 @@ | |||
2556 | 26 | #ifndef _GLMATRIX_H | 26 | #ifndef _GLMATRIX_H |
2557 | 27 | #define _GLMATRIX_H | 27 | #define _GLMATRIX_H |
2558 | 28 | 28 | ||
2559 | 29 | #include <core/point.h> | ||
2560 | 30 | #include <core/rect.h> | ||
2561 | 29 | #include <opengl/vector.h> | 31 | #include <opengl/vector.h> |
2562 | 30 | 32 | ||
2563 | 31 | class CompOutput; | 33 | class CompOutput; |
2564 | @@ -65,4 +67,29 @@ | |||
2565 | 65 | float m[16]; | 67 | float m[16]; |
2566 | 66 | }; | 68 | }; |
2567 | 67 | 69 | ||
2568 | 70 | namespace compiz | ||
2569 | 71 | { | ||
2570 | 72 | namespace opengl | ||
2571 | 73 | { | ||
2572 | 74 | namespace matrix | ||
2573 | 75 | { | ||
2574 | 76 | /* This function returns co-ordinates into viewport space. In order | ||
2575 | 77 | * to convert into something like damage rectangles please remember | ||
2576 | 78 | * to flip on the y axis. */ | ||
2577 | 79 | inline CompPoint projectIntoViewport (const GLMatrix &modelview, | ||
2578 | 80 | const GLMatrix &projection, | ||
2579 | 81 | const CompRect &vp, | ||
2580 | 82 | const GLVector &vector) | ||
2581 | 83 | { | ||
2582 | 84 | GLVector projected (projection * modelview * vector); | ||
2583 | 85 | projected.homogenize (); | ||
2584 | 86 | projected[0] = projected[0] * 0.5 + 0.5; | ||
2585 | 87 | projected[1] = projected[1] * 0.5 + 0.5; | ||
2586 | 88 | return CompPoint (projected[0] * vp.width () + vp.x (), | ||
2587 | 89 | projected[1] * vp.height () + vp.y ()); | ||
2588 | 90 | } | ||
2589 | 91 | } | ||
2590 | 92 | } | ||
2591 | 93 | } | ||
2592 | 94 | |||
2593 | 68 | #endif | 95 | #endif |
2594 | 69 | 96 | ||
2595 | === modified file 'plugins/opengl/include/opengl/opengl.h' | |||
2596 | --- plugins/opengl/include/opengl/opengl.h 2016-05-13 07:57:01 +0000 | |||
2597 | +++ plugins/opengl/include/opengl/opengl.h 2016-07-14 15:55:30 +0000 | |||
2598 | @@ -1036,6 +1036,12 @@ | |||
2599 | 1036 | std::string vertex_shader, | 1036 | std::string vertex_shader, |
2600 | 1037 | std::string fragment_shader); | 1037 | std::string fragment_shader); |
2601 | 1038 | 1038 | ||
2602 | 1039 | /** | ||
2603 | 1040 | * Use this if overriding glDrawTexture completely - used to clear | ||
2604 | 1041 | * out any internal shader caches. | ||
2605 | 1042 | */ | ||
2606 | 1043 | void clearShaders (); | ||
2607 | 1044 | |||
2608 | 1039 | GLTexture *getIcon (int width, int height); | 1045 | GLTexture *getIcon (int width, int height); |
2609 | 1040 | 1046 | ||
2610 | 1041 | WRAPABLE_HND (0, GLWindowInterface, bool, glPaint, | 1047 | WRAPABLE_HND (0, GLWindowInterface, bool, glPaint, |
2611 | 1042 | 1048 | ||
2612 | === modified file 'plugins/opengl/include/opengl/vertexbuffer.h' | |||
2613 | --- plugins/opengl/include/opengl/vertexbuffer.h 2016-05-12 06:16:56 +0000 | |||
2614 | +++ plugins/opengl/include/opengl/vertexbuffer.h 2016-07-14 15:55:30 +0000 | |||
2615 | @@ -113,12 +113,30 @@ | |||
2616 | 113 | 113 | ||
2617 | 114 | int render (const GLMatrix &modelview); | 114 | int render (const GLMatrix &modelview); |
2618 | 115 | 115 | ||
2619 | 116 | int render (const GLushort *indices, | ||
2620 | 117 | GLuint nIndices); | ||
2621 | 118 | |||
2622 | 119 | int render (const GLMatrix &modelview, | ||
2623 | 120 | const GLushort *indices, | ||
2624 | 121 | GLuint nIndices); | ||
2625 | 122 | |||
2626 | 116 | int render (const GLMatrix &modelview, | 123 | int render (const GLMatrix &modelview, |
2627 | 117 | const GLWindowPaintAttrib &attrib); | 124 | const GLWindowPaintAttrib &attrib); |
2628 | 118 | 125 | ||
2629 | 126 | int render (const GLMatrix &modelview, | ||
2630 | 127 | const GLWindowPaintAttrib &attrib, | ||
2631 | 128 | const GLushort *indices, | ||
2632 | 129 | GLuint nIndices); | ||
2633 | 130 | |||
2634 | 119 | int render (const GLMatrix &projection, | 131 | int render (const GLMatrix &projection, |
2637 | 120 | const GLMatrix &modelview, | 132 | const GLMatrix &modelview, |
2638 | 121 | const GLWindowPaintAttrib &attrib); | 133 | const GLWindowPaintAttrib &attrib); |
2639 | 134 | |||
2640 | 135 | int render (const GLMatrix &projection, | ||
2641 | 136 | const GLMatrix &modelview, | ||
2642 | 137 | const GLWindowPaintAttrib &attrib, | ||
2643 | 138 | const GLushort *indices, | ||
2644 | 139 | GLuint nIndices); | ||
2645 | 122 | 140 | ||
2646 | 123 | void setVertexOffset (GLuint vOffset); | 141 | void setVertexOffset (GLuint vOffset); |
2647 | 124 | void setMaxVertices (GLint vMax); | 142 | void setMaxVertices (GLint vMax); |
2648 | 125 | 143 | ||
2649 | === modified file 'plugins/opengl/src/paint.cpp' | |||
2650 | --- plugins/opengl/src/paint.cpp 2016-05-17 02:52:47 +0000 | |||
2651 | +++ plugins/opengl/src/paint.cpp 2016-07-14 15:55:30 +0000 | |||
2652 | @@ -1298,16 +1298,7 @@ | |||
2653 | 1298 | priv->vertexBuffer->render (transform, attrib); | 1298 | priv->vertexBuffer->render (transform, attrib); |
2654 | 1299 | #endif | 1299 | #endif |
2655 | 1300 | 1300 | ||
2666 | 1301 | for (std::list<const GLShaderData*>::const_iterator it = priv->shaders.begin(); | 1301 | clearShaders (); |
2657 | 1302 | it != priv->shaders.end(); | ||
2658 | 1303 | ++it) | ||
2659 | 1304 | { | ||
2660 | 1305 | if ((*it)->isCached != true) | ||
2661 | 1306 | { | ||
2662 | 1307 | delete *it; | ||
2663 | 1308 | } | ||
2664 | 1309 | } | ||
2665 | 1310 | priv->shaders.clear (); | ||
2667 | 1311 | texture->disable (); | 1302 | texture->disable (); |
2668 | 1312 | 1303 | ||
2669 | 1313 | if (mask & PAINT_WINDOW_BLEND_MASK) | 1304 | if (mask & PAINT_WINDOW_BLEND_MASK) |
2670 | 1314 | 1305 | ||
2671 | === modified file 'plugins/opengl/src/privatevertexbuffer.h' | |||
2672 | --- plugins/opengl/src/privatevertexbuffer.h 2013-10-31 15:59:14 +0000 | |||
2673 | +++ plugins/opengl/src/privatevertexbuffer.h 2016-07-14 15:55:30 +0000 | |||
2674 | @@ -109,10 +109,14 @@ | |||
2675 | 109 | 109 | ||
2676 | 110 | int render (const GLMatrix *projection, | 110 | int render (const GLMatrix *projection, |
2677 | 111 | const GLMatrix *modelview, | 111 | const GLMatrix *modelview, |
2679 | 112 | const GLWindowPaintAttrib *attrib); | 112 | const GLWindowPaintAttrib *attrib, |
2680 | 113 | const GLushort *indices, | ||
2681 | 114 | GLuint nIndices); | ||
2682 | 113 | int legacyRender (const GLMatrix &projection, | 115 | int legacyRender (const GLMatrix &projection, |
2683 | 114 | const GLMatrix &modelview, | 116 | const GLMatrix &modelview, |
2685 | 115 | const GLWindowPaintAttrib &attrib); | 117 | const GLWindowPaintAttrib &attrib, |
2686 | 118 | const GLushort *indices, | ||
2687 | 119 | GLuint nIndices); | ||
2688 | 116 | 120 | ||
2689 | 117 | public: | 121 | public: |
2690 | 118 | static GLVertexBuffer *streamingBuffer; | 122 | static GLVertexBuffer *streamingBuffer; |
2691 | 119 | 123 | ||
2692 | === modified file 'plugins/opengl/src/vertexbuffer.cpp' | |||
2693 | --- plugins/opengl/src/vertexbuffer.cpp 2016-05-12 05:17:55 +0000 | |||
2694 | +++ plugins/opengl/src/vertexbuffer.cpp 2016-07-14 15:55:30 +0000 | |||
2695 | @@ -343,7 +343,16 @@ | |||
2696 | 343 | int GLVertexBuffer::render () | 343 | int GLVertexBuffer::render () |
2697 | 344 | { | 344 | { |
2698 | 345 | if (enabled ()) | 345 | if (enabled ()) |
2700 | 346 | return priv->render (NULL, NULL, NULL); | 346 | return priv->render (NULL, NULL, NULL, NULL, 0); |
2701 | 347 | else | ||
2702 | 348 | return -1; | ||
2703 | 349 | } | ||
2704 | 350 | |||
2705 | 351 | int GLVertexBuffer::render (const GLushort *indices, | ||
2706 | 352 | GLuint nIndices) | ||
2707 | 353 | { | ||
2708 | 354 | if (enabled ()) | ||
2709 | 355 | return priv->render (NULL, NULL, NULL, indices, nIndices); | ||
2710 | 347 | else | 356 | else |
2711 | 348 | return -1; | 357 | return -1; |
2712 | 349 | } | 358 | } |
2713 | @@ -355,15 +364,42 @@ | |||
2714 | 355 | return render (modelview, attrib); | 364 | return render (modelview, attrib); |
2715 | 356 | } | 365 | } |
2716 | 357 | 366 | ||
2717 | 367 | int GLVertexBuffer::render (const GLMatrix &modelview, | ||
2718 | 368 | const GLushort *indices, | ||
2719 | 369 | GLuint nIndices) | ||
2720 | 370 | { | ||
2721 | 371 | const GLWindowPaintAttrib attrib = { OPAQUE, BRIGHT, COLOR, 0, 0, 0, 0 }; | ||
2722 | 372 | |||
2723 | 373 | return render (modelview, attrib, indices, nIndices); | ||
2724 | 374 | } | ||
2725 | 375 | |||
2726 | 358 | int GLVertexBuffer::render (const GLMatrix &modelview, | 376 | int GLVertexBuffer::render (const GLMatrix &modelview, |
2727 | 359 | const GLWindowPaintAttrib &attrib) | 377 | const GLWindowPaintAttrib &attrib) |
2728 | 360 | { | 378 | { |
2729 | 361 | GLScreen *gScreen = GLScreen::get (screen); | 379 | GLScreen *gScreen = GLScreen::get (screen); |
2730 | 362 | GLMatrix *projection = gScreen->projectionMatrix (); | 380 | GLMatrix *projection = gScreen->projectionMatrix (); |
2731 | 363 | 381 | ||
2735 | 364 | return render (*projection, modelview, attrib); | 382 | return render (*projection, modelview, attrib, NULL, 0); |
2736 | 365 | } | 383 | } |
2737 | 366 | 384 | ||
2738 | 385 | |||
2739 | 386 | int GLVertexBuffer::render (const GLMatrix &modelview, | ||
2740 | 387 | const GLWindowPaintAttrib &attrib, | ||
2741 | 388 | const GLushort *indices, | ||
2742 | 389 | GLuint nIndices) | ||
2743 | 390 | { | ||
2744 | 391 | GLScreen *gScreen = GLScreen::get (screen); | ||
2745 | 392 | GLMatrix *projection = gScreen->projectionMatrix (); | ||
2746 | 393 | |||
2747 | 394 | return render (*projection, modelview, attrib, indices, nIndices); | ||
2748 | 395 | } | ||
2749 | 396 | |||
2750 | 397 | int GLVertexBuffer::render (const GLMatrix &projection, | ||
2751 | 398 | const GLMatrix &modelview, | ||
2752 | 399 | const GLWindowPaintAttrib &attrib) | ||
2753 | 400 | { | ||
2754 | 401 | return render (projection, modelview, attrib, NULL, 0); | ||
2755 | 402 | } | ||
2756 | 367 | 403 | ||
2757 | 368 | #if 0 | 404 | #if 0 |
2758 | 369 | #define PRINT_MATRIX(m) printMatrix ((m), #m) | 405 | #define PRINT_MATRIX(m) printMatrix ((m), #m) |
2759 | @@ -378,9 +414,11 @@ | |||
2760 | 378 | #define PRINT_MATRIX(m) | 414 | #define PRINT_MATRIX(m) |
2761 | 379 | #endif | 415 | #endif |
2762 | 380 | 416 | ||
2766 | 381 | int GLVertexBuffer::render (const GLMatrix &projection, | 417 | int GLVertexBuffer::render (const GLMatrix &projection, |
2767 | 382 | const GLMatrix &modelview, | 418 | const GLMatrix &modelview, |
2768 | 383 | const GLWindowPaintAttrib &attrib) | 419 | const GLWindowPaintAttrib &attrib, |
2769 | 420 | const GLushort *indices, | ||
2770 | 421 | GLuint nIndices) | ||
2771 | 384 | { | 422 | { |
2772 | 385 | if (!priv->vertexData.size ()) | 423 | if (!priv->vertexData.size ()) |
2773 | 386 | return -1; | 424 | return -1; |
2774 | @@ -389,9 +427,9 @@ | |||
2775 | 389 | PRINT_MATRIX(projection); | 427 | PRINT_MATRIX(projection); |
2776 | 390 | 428 | ||
2777 | 391 | if (enabled ()) | 429 | if (enabled ()) |
2779 | 392 | return priv->render (&projection, &modelview, &attrib); | 430 | return priv->render (&projection, &modelview, &attrib, indices, nIndices); |
2780 | 393 | else | 431 | else |
2782 | 394 | return priv->legacyRender (projection, modelview, attrib); | 432 | return priv->legacyRender (projection, modelview, attrib, indices, nIndices); |
2783 | 395 | } | 433 | } |
2784 | 396 | 434 | ||
2785 | 397 | PrivateVertexBuffer::PrivateVertexBuffer () : | 435 | PrivateVertexBuffer::PrivateVertexBuffer () : |
2786 | @@ -431,9 +469,11 @@ | |||
2787 | 431 | } | 469 | } |
2788 | 432 | } | 470 | } |
2789 | 433 | 471 | ||
2793 | 434 | int PrivateVertexBuffer::render (const GLMatrix *projection, | 472 | int PrivateVertexBuffer::render (const GLMatrix *projection, |
2794 | 435 | const GLMatrix *modelview, | 473 | const GLMatrix *modelview, |
2795 | 436 | const GLWindowPaintAttrib *attrib) | 474 | const GLWindowPaintAttrib *attrib, |
2796 | 475 | const GLushort *indices, | ||
2797 | 476 | GLuint nIndices) | ||
2798 | 437 | { | 477 | { |
2799 | 438 | GLfloat attribs[3] = {1, 1, 1}; | 478 | GLfloat attribs[3] = {1, 1, 1}; |
2800 | 439 | GLint positionIndex = -1; | 479 | GLint positionIndex = -1; |
2801 | @@ -552,11 +592,16 @@ | |||
2802 | 552 | tmpProgram->setUniform3f ("paintAttrib", attribs[0], attribs[1], attribs[2]); | 592 | tmpProgram->setUniform3f ("paintAttrib", attribs[0], attribs[1], attribs[2]); |
2803 | 553 | } | 593 | } |
2804 | 554 | 594 | ||
2810 | 555 | 595 | const GLuint nVerticesToDraw = maxVertices > 0 ? | |
2811 | 556 | glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ? | 596 | std::min (static_cast <int> (vertexData.size () / 3), |
2812 | 557 | std::min (static_cast <int> (vertexData.size () / 3), | 597 | maxVertices) : |
2813 | 558 | maxVertices) : | 598 | vertexData.size () / 3; |
2814 | 559 | vertexData.size () / 3); | 599 | |
2815 | 600 | if (nIndices && indices) | ||
2816 | 601 | glDrawElements (primitiveType, nIndices, GL_UNSIGNED_SHORT, indices); | ||
2817 | 602 | else | ||
2818 | 603 | glDrawArrays (primitiveType, vertexOffset, nVerticesToDraw); | ||
2819 | 604 | |||
2820 | 560 | for (int i = 0; i < 4; ++i) | 605 | for (int i = 0; i < 4; ++i) |
2821 | 561 | { | 606 | { |
2822 | 562 | if (texCoordIndex[i] != -1) | 607 | if (texCoordIndex[i] != -1) |
2823 | @@ -578,7 +623,9 @@ | |||
2824 | 578 | 623 | ||
2825 | 579 | int PrivateVertexBuffer::legacyRender (const GLMatrix &projection, | 624 | int PrivateVertexBuffer::legacyRender (const GLMatrix &projection, |
2826 | 580 | const GLMatrix &modelview, | 625 | const GLMatrix &modelview, |
2828 | 581 | const GLWindowPaintAttrib &attrib) | 626 | const GLWindowPaintAttrib &attrib, |
2829 | 627 | const GLushort *indices, | ||
2830 | 628 | GLuint nIndices) | ||
2831 | 582 | { | 629 | { |
2832 | 583 | #ifndef USE_GLES | 630 | #ifndef USE_GLES |
2833 | 584 | glMatrixMode (GL_PROJECTION); | 631 | glMatrixMode (GL_PROJECTION); |
2834 | @@ -626,10 +673,18 @@ | |||
2835 | 626 | glTexCoordPointer (2, GL_FLOAT, 0, &textureData[i][0]); | 673 | glTexCoordPointer (2, GL_FLOAT, 0, &textureData[i][0]); |
2836 | 627 | } | 674 | } |
2837 | 628 | 675 | ||
2842 | 629 | glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ? | 676 | const GLuint nVerticesToDraw = maxVertices > 0 ? |
2843 | 630 | std::min (static_cast <int> (vertexData.size () / 3), | 677 | std::min (static_cast <int> (vertexData.size () / 3), |
2844 | 631 | maxVertices) : | 678 | maxVertices) : |
2845 | 632 | vertexData.size () / 3); | 679 | vertexData.size () / 3; |
2846 | 680 | |||
2847 | 681 | if (indices && nIndices) | ||
2848 | 682 | glDrawElements (primitiveType, | ||
2849 | 683 | nIndices, | ||
2850 | 684 | GL_UNSIGNED_SHORT, | ||
2851 | 685 | indices); | ||
2852 | 686 | else | ||
2853 | 687 | glDrawArrays (primitiveType, vertexOffset, nVerticesToDraw); | ||
2854 | 633 | 688 | ||
2855 | 634 | glDisableClientState (GL_VERTEX_ARRAY); | 689 | glDisableClientState (GL_VERTEX_ARRAY); |
2856 | 635 | glDisableClientState (GL_NORMAL_ARRAY); | 690 | glDisableClientState (GL_NORMAL_ARRAY); |
2857 | 636 | 691 | ||
2858 | === modified file 'plugins/opengl/src/window.cpp' | |||
2859 | --- plugins/opengl/src/window.cpp 2016-05-13 06:41:03 +0000 | |||
2860 | +++ plugins/opengl/src/window.cpp 2016-07-14 15:55:30 +0000 | |||
2861 | @@ -375,6 +375,21 @@ | |||
2862 | 375 | } | 375 | } |
2863 | 376 | 376 | ||
2864 | 377 | void | 377 | void |
2865 | 378 | GLWindow::clearShaders () | ||
2866 | 379 | { | ||
2867 | 380 | for (std::list<const GLShaderData*>::const_iterator it = priv->shaders.begin(); | ||
2868 | 381 | it != priv->shaders.end(); | ||
2869 | 382 | ++it) | ||
2870 | 383 | { | ||
2871 | 384 | if ((*it)->isCached != true) | ||
2872 | 385 | { | ||
2873 | 386 | delete *it; | ||
2874 | 387 | } | ||
2875 | 388 | } | ||
2876 | 389 | priv->shaders.clear (); | ||
2877 | 390 | } | ||
2878 | 391 | |||
2879 | 392 | void | ||
2880 | 378 | PrivateGLWindow::updateFrameRegion (CompRegion ®ion) | 393 | PrivateGLWindow::updateFrameRegion (CompRegion ®ion) |
2881 | 379 | { | 394 | { |
2882 | 380 | window->updateFrameRegion (region); | 395 | window->updateFrameRegion (region); |
2883 | 381 | 396 | ||
2884 | === modified file 'plugins/scale/scale.xml.in' | |||
2885 | --- plugins/scale/scale.xml.in 2016-04-27 15:47:55 +0000 | |||
2886 | +++ plugins/scale/scale.xml.in 2016-07-14 15:55:30 +0000 | |||
2887 | @@ -139,6 +139,11 @@ | |||
2888 | 139 | <_name>On all output devices</_name> | 139 | <_name>On all output devices</_name> |
2889 | 140 | </desc> | 140 | </desc> |
2890 | 141 | </option> | 141 | </option> |
2891 | 142 | <option name="skip_animation" type="bool"> | ||
2892 | 143 | <_short>Skip Animation</_short> | ||
2893 | 144 | <_long>Skips the scale plugin animation.</_long> | ||
2894 | 145 | <default>false</default> | ||
2895 | 146 | </option> | ||
2896 | 142 | </group> | 147 | </group> |
2897 | 143 | <group> | 148 | <group> |
2898 | 144 | <_short>Bindings</_short> | 149 | <_short>Bindings</_short> |
2899 | 145 | 150 | ||
2900 | === modified file 'plugins/scale/src/scale.cpp' | |||
2901 | --- plugins/scale/src/scale.cpp 2016-05-17 02:53:00 +0000 | |||
2902 | +++ plugins/scale/src/scale.cpp 2016-07-14 15:55:30 +0000 | |||
2903 | @@ -932,9 +932,11 @@ | |||
2904 | 932 | if (state != ScaleScreen::Idle && state != ScaleScreen::Wait) | 932 | if (state != ScaleScreen::Idle && state != ScaleScreen::Wait) |
2905 | 933 | { | 933 | { |
2906 | 934 | int steps; | 934 | int steps; |
2910 | 935 | float amount, chunk; | 935 | float amount, chunk, speed; |
2911 | 936 | 936 | ||
2912 | 937 | amount = msSinceLastPaint * 0.05f * optionGetSpeed (); | 937 | speed = optionGetSkipAnimation() ? USHRT_MAX : optionGetSpeed(); |
2913 | 938 | |||
2914 | 939 | amount = msSinceLastPaint * 0.05f * speed; | ||
2915 | 938 | steps = amount / (0.5f * optionGetTimestep ()); | 940 | steps = amount / (0.5f * optionGetTimestep ()); |
2916 | 939 | 941 | ||
2917 | 940 | if (!steps) | 942 | if (!steps) |
Please fix indentation (it should be mixed spaces tabs [odd levels 4 spaces, even levels tabs).
As for default values for Zooming, I'd set instead Ctrl+Alt+ MouseWheel.
Although I think you can keep them disabled for upstream.