summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPal Dorogi <pal.dorogi@gmail.com>2010-10-16 23:47:41 +1000
committerPal Dorogi <pal.dorogi@gmail.com>2010-10-16 23:47:41 +1000
commit0b518b98ba6222ec91b1c6fac1ce2c995cfd3969 (patch)
treee9a49b8c891867cf3b96a9d4245924b943b2231d
parenteeda5bf2e1c5713ad370ca87f6e6857d22e3427d (diff)
downloadcompiz-plugins-livewallpapers-0b518b98ba6222ec91b1c6fac1ce2c995cfd3969.tar.gz
compiz-plugins-livewallpapers-0b518b98ba6222ec91b1c6fac1ce2c995cfd3969.tar.bz2
Implement Galaxy's offset, speed and some other tunings.HEADmaster
-rw-r--r--CREDITS42
-rw-r--r--ChangeLog12
-rw-r--r--TODO28
-rw-r--r--debian/changelog6
-rw-r--r--dummy0
-rw-r--r--metadata/galaxy.xml88
-rw-r--r--metadata/galaxy.xml.in32
-rw-r--r--po/LINGUAS2
-rw-r--r--po/en_GB.po18
-rw-r--r--po/ru_RU.po104
-rw-r--r--po/uk_UA.po104
-rw-r--r--src/galaxy/galaxy.c39
-rw-r--r--src/galaxy/particle.c25
-rw-r--r--src/galaxy/particle.h12
14 files changed, 407 insertions, 105 deletions
diff --git a/CREDITS b/CREDITS
new file mode 100644
index 0000000..25dc763
--- /dev/null
+++ b/CREDITS
@@ -0,0 +1,42 @@
+###############################################################################
+# Credits #
+###############################################################################
+
+This plugin wouldn't exist without bunch of information that I could get from
+the Internet. So, I am trying to collect the name and URI-s of all of those
+people and their sites which invaluable information, idea and solution helped
+me to made this plugin.
+
+It's impossible to give everybody the credit, but I will try.:)
+
+-------------------
+ = <Name>:
+ <URL1>
+ ...
+ <URLN>
+
+ = Romain Guy:
+ http://www.curious-creature.org/2010/01/07/nexus-one-live-wallpapers/
+
+ = Dr Goulu:
+ http://3dmon.wordpress.com/
+ http://www.ozone3d.net/demos_projects/spiral_galaxy.php
+ http://www.ozone3d.net/blogs/demoniak3d/?p=10
+ http://drgoulu.com/2008/02/08/galaxie-spirale-et-sequence-principale/
+
+ = blackpawn:
+ http://blackpawn.com/blog/?page_id=219
+ http://www.blackpawn.com/texts/lensflare/default.html
+
+ = Unknown:
+ http://en.wikipedia.org/wiki/Density_wave_theory
+
+ = Ingo Berg:
+ http://beltoforion.de/galaxy/galaxy_en.html
+
+ = Nehe:
+ http://nehe.gamedev.net/
+
+ = Compiz:
+ http://compiz.org
+
diff --git a/ChangeLog b/ChangeLog
index 8b13789..1491d1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1 +1,13 @@
+2010-10-16 Pal Dorogi <pal.dorogi@gmail.com>
+ * metadata/galaxy.xml.in: Add the Offset X and Y, Speed ratio (3x).
+
+ * particle.h: Add maxusr, offsetX, offsetY and speedRatio variables to
+ ParticleSystem structure.
+
+ * galaxy.c:
+ * galaxy.h:
+ * particle.c: Implement Galaxy's offset, speed and some other tunings.
+
+ * Add uk_UA and ru_RU translation files given and translated by
+ Romek Marszcziwski <marszcziwski@gmail.com>
diff --git a/TODO b/TODO
index e69de29..b2e6098 100644
--- a/TODO
+++ b/TODO
@@ -0,0 +1,28 @@
+= General:
+
+* Configurable speed option.
+
+* Configurable X and Y offset.
+
+* Automated configuration based on the screen ratio (What if dual-screen?)
+ If ratio > 2.0 then it should be multiple-screen.
+
+* Create 1080p and better background and light.
+
+* Implement more light textures.
+
+* Find better quadratic values.
+
+* Generate better flare texture.
+
+* Implement some other animated wallpapers.
+
+* More translations.
+
+* Update translation files.
+
+= Compiz 0.9
+
+* Redesign the framework
+
+* Port to Compiz 0.9 \ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 028b258..664247d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+compiz-plugins-livewallpapers (0.0.1-0ubuntu1~ppa5) maverick; urgency=low
+
+ * Implement Galaxy's offset, speed and some other tunings.
+
+ -- Pal Dorogi <pal.dorogi@gmail.com> Sat, 16 Oct 2010 22:45:28 +1000
+
compiz-plugins-livewallpapers (0.0.1-0ubuntu1~ppa4) maverick; urgency=low
* Updated control file.
diff --git a/dummy b/dummy
deleted file mode 100644
index e69de29..0000000
--- a/dummy
+++ /dev/null
diff --git a/metadata/galaxy.xml b/metadata/galaxy.xml
deleted file mode 100644
index 045823e..0000000
--- a/metadata/galaxy.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<compiz>
- <plugin useBcop="true" name="galaxy">
- <short>Galaxy Live Wallpaper</short>
- <long>Galaxy Live Wallpaper for Compiz</long>
- <category>Live Wallpapers</category>
- <deps>
- <relation type="after">
- <plugin>png</plugin>
- <plugin>svg</plugin>
- <plugin>jpeg</plugin>
- <plugin>imgjpeg</plugin>
- </relation>
- </deps>
- <display>
- <group>
- <short>Settings</short>
- <option type="int" name="particles_count">
- <short>Number Of Stars</short>
- <long>Number of stars (This has not been implemented yet)</long>
- <default>12500</default>
- <min>0</min>
- <max>25000</max>
- </option>
- <option type="float" name="particles_size">
- <short>Size Of Stars</short>
- <long>Size of stars</long>
- <default>13.5</default>
- <min>0.0</min>
- <max>64.0</max>
- <precision>0.5</precision>
- </option>
- <option type="int" name="update_delay">
- <short>Update Delay</short>
- <long>Delay in ms between screen updates. Example 1000ms/40ms = 25/sec</long>
- <default>40</default>
- <min>20</min>
- <max>200</max>
- </option>
- <option type="bool" name="draw_streaks">
- <short>Draw Star streaks</short>
- <long>Draw a Star with streaks</long>
- <default>true</default>
- </option>
- </group>
- <group>
- <short>Rotation</short>
- <option type="int" name="rotate_x">
- <short>Rotate X</short>
- <long>Rotate Galaxy through X coordinate</long>
- <default>-60</default>
- <min>-90</min>
- <max>90</max>
- </option>
- <option type="int" name="rotate_y">
- <short>Rotate Y</short>
- <long>Rotate Galaxy through Y coordinate</long>
- <default>15</default>
- <min>-90</min>
- <max>90</max>
- </option>
- <option type="int" name="rotate_z">
- <short>Rotate Z</short>
- <long>Rotate Galaxy through Z coordinate</long>
- <default>0</default>
- <min>0</min>
- <max>360</max>
- </option>
- <option type="float" name="zoom">
- <short>Zoom in/out</short>
- <long>Zoom in and out</long>
- <default>2.0</default>
- <min>0.0</min>
- <max>10</max>
- <precision>0.1</precision>
- </option>
- </group>
- <group>
- <short>Key Bindings</short>
- <option type="key" name="toggle_key">
- <short>Galaxy Live Wallpaper Toggle</short>
- <long>Galaxy Live Wallpaper toggle key</long>
- <default>&lt;Super&gt;F4</default>
- </option>
- </group>
- </display>
- </plugin>
-</compiz> \ No newline at end of file
diff --git a/metadata/galaxy.xml.in b/metadata/galaxy.xml.in
index 084e4c8..81ccef1 100644
--- a/metadata/galaxy.xml.in
+++ b/metadata/galaxy.xml.in
@@ -25,7 +25,7 @@
<option name="particles_size" type="float">
<_short>Size Of Stars</_short>
<_long>Size of stars</_long>
- <default>13.5</default>
+ <default>10</default>
<min>0.0</min>
<max>64.0</max>
<precision>0.5</precision>
@@ -42,9 +42,17 @@
<_long>Draw a Star with streaks</_long>
<default>true</default>
</option>
+ <option name="speed_ratio" type="float">
+ <_short>Speed ratio</_short>
+ <_long>Speed ratio of the Galaxy</_long>
+ <default>1.0</default>
+ <min>0.0</min>
+ <max>3.0</max>
+ <precision>0.1</precision>
+ </option>
</group>
<group>
- <_short>Rotation</_short>
+ <_short>Move, Rotate and Zoom</_short>
<option name="rotate_x" type="int">
<_short>Rotate X</_short>
<_long>Rotate Galaxy through X coordinate</_long>
@@ -69,11 +77,27 @@
<option name="zoom" type="float">
<_short>Zoom in/out</_short>
<_long>Zoom in and out</_long>
- <default>2.0</default>
+ <default>1.5</default>
<min>0.0</min>
- <max>10</max>
+ <max>5.0</max>
<precision>0.1</precision>
</option>
+ <option name="offset_x" type="float">
+ <_short>Offset X</_short>
+ <_long>X offset of the centre of Galaxy</_long>
+ <default>0.0</default>
+ <min>-2.0</min>
+ <max>2.0</max>
+ <precision>0.005</precision>
+ </option>
+ <option name="offset_y" type="float">
+ <_short>Offset Y</_short>
+ <_long>Y offset of the centre of Galaxy</_long>
+ <default>0.0</default>
+ <min>-2.0</min>
+ <max>2.0</max>
+ <precision>0.005</precision>
+ </option>
</group>
<group>
<_short>Key Bindings</_short>
diff --git a/po/LINGUAS b/po/LINGUAS
index 99a7255..516ed0d 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -1,2 +1,4 @@
# Set of available languages. Keep it alphabatical. One lingua per line.
en_GB
+ru_RU
+uk_UA \ No newline at end of file
diff --git a/po/en_GB.po b/po/en_GB.po
index 105bc02..b809757 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -84,3 +84,21 @@ msgstr "Galaxy Live Wallpaper Toggle"
msgid "Galaxy Live Wallpaper toggle key"
msgstr "Galaxy Live Wallpaper toggle key"
+
+msgid "Offset X"
+msgstr "Offset X"
+
+msgid "X offset of the centre of Galaxy"
+msgstr "X offset of the centre of Galaxy"
+
+msgid "Offset Y"
+msgstr "Offset Y"
+
+msgid "Y offset of the centre of Galaxy"
+msgstr "Y offset of the centre of Galaxy"
+
+msgid "Speed Ratio"
+msgstr "Speed Ratio"
+
+msgid "Speed ratio of the Galaxy"
+msgstr "Speed ratio of the Galaxy" \ No newline at end of file
diff --git a/po/ru_RU.po b/po/ru_RU.po
new file mode 100644
index 0000000..9454386
--- /dev/null
+++ b/po/ru_RU.po
@@ -0,0 +1,104 @@
+# compiz-plugins-livewallpapers plugins translations.
+# Copyright (C) 2010 Pal Dorogi
+# This file is distributed under the same license as the compiz-plugins-livewallpapers package.
+# Pal Dorogi <pal.dorogi@gmail.com>.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: compiz-plugins-livewallpapers 0.1\n"
+"Report-Msgid-Bugs-To:https://bugs.launchpad.net/~ilap\n"
+"POT-Creation-Date: 2010-10-07 18:10+1100\n"
+"PO-Revision-Date: 2010-10-07 19:33+1100\n"
+"Last-Translator: Romek Marszcziwski <marszcziwski@gmail.com>\n"
+"Language-Team: uk_UA <marszcziwski@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Pootle 1.1.0\n"
+
+msgid "Galaxy Live Wallpaper"
+msgstr "Живые обои Galaxy"
+
+msgid "Galaxy Live Wallpaper for Compiz"
+msgstr "Живые обои Galaxy для Compiz"
+
+msgid "Settings"
+msgstr "Настройки"
+
+msgid "Number Of Stars"
+msgstr "Количество звёзд"
+
+msgid "Number of stars (This has not been implemented yet)"
+msgstr "Количество звёзд (Это не было реализовано)"
+
+msgid "Size Of Stars"
+msgstr "Размер звёзд"
+
+msgid "Size of stars"
+msgstr "Размер звёзд"
+
+msgid "Update Delay"
+msgstr "Обновление задержки"
+
+msgid "Delay in ms between screen updates. Example 1000ms/40ms = 25/sec"
+msgstr "Задержка в мс между обновлением экрана. Пример 1000мс/40мс = 25/сек"
+
+msgid "Draw Star streaks"
+msgstr "Прорисовка звезды с полосами"
+
+msgid "Draw a Star with streaks"
+msgstr "Прорисовка звезды с полосами"
+
+msgid "Rotation"
+msgstr "Вращения"
+
+msgid "Rotate X"
+msgstr "Вращение по оси X"
+
+msgid "Rotate Galaxy through X coordinate"
+msgstr "Вращение галактики по оси X"
+
+msgid "Rotate Y"
+msgstr "Вращение по оси Y"
+
+msgid "Rotate Galaxy through Y coordinate"
+msgstr "Вращение галактики по оси Y"
+
+msgid "Rotate Z"
+msgstr "Вращение по оси Z"
+
+msgid "Rotate Galaxy through Z coordinate"
+msgstr "Вращение галактики по оси Z"
+
+msgid "Zoom in/out"
+msgstr "Увеличение +/-"
+
+msgid "Zoom in and out"
+msgstr "Увеличение +/-"
+
+msgid "Key Bindings"
+msgstr "Сочетания клавиш"
+
+msgid "Galaxy Live Wallpaper Toggle"
+msgstr "Включить Живые обои Galaxy"
+
+msgid "Galaxy Live Wallpaper toggle key"
+msgstr "Клавиша включения Живых обоев Galaxy"
+
+msgid "Offset X"
+msgstr "Offset X"
+
+msgid "X offset of the centre of Galaxy"
+msgstr "X offset of the centre of Galaxy"
+
+msgid "Offset Y"
+msgstr "Offset Y"
+
+msgid "Y offset of the centre of Galaxy"
+msgstr "Y offset of the centre of Galaxy"
+
+msgid "Speed Ratio"
+msgstr "Speed Ratio"
+
+msgid "Speed ratio of the Galaxy"
+msgstr "Speed ratio of the Galaxy"
diff --git a/po/uk_UA.po b/po/uk_UA.po
new file mode 100644
index 0000000..1c67bda
--- /dev/null
+++ b/po/uk_UA.po
@@ -0,0 +1,104 @@
+# compiz-plugins-livewallpapers plugins translations.
+# Copyright (C) 2010 Pal Dorogi
+# This file is distributed under the same license as the compiz-plugins-livewallpapers package.
+# Pal Dorogi <pal.dorogi@gmail.com>.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: compiz-plugins-livewallpapers 0.1\n"
+"Report-Msgid-Bugs-To:https://bugs.launchpad.net/~ilap\n"
+"POT-Creation-Date: 2010-10-07 18:10+1100\n"
+"PO-Revision-Date: 2010-10-07 19:33+1100\n"
+"Last-Translator: Romek Marszcziwski <marszcziwski@gmail.com>\n"
+"Language-Team: uk_UA <marszcziwski@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Pootle 1.1.0\n"
+
+msgid "Galaxy Live Wallpaper"
+msgstr "Живі шпалери Galaxy"
+
+msgid "Galaxy Live Wallpaper for Compiz"
+msgstr "Живі шпалери Galaxy для Compiz"
+
+msgid "Settings"
+msgstr "Налаштування"
+
+msgid "Number Of Stars"
+msgstr "Кількість зірок"
+
+msgid "Number of stars (This has not been implemented yet)"
+msgstr "Кількість зірок (Це не було реалізовано)"
+
+msgid "Size Of Stars"
+msgstr "Розмір зірок"
+
+msgid "Size of stars"
+msgstr "Розмір зірок"
+
+msgid "Update Delay"
+msgstr "Оновлення затримки"
+
+msgid "Delay in ms between screen updates. Example 1000ms/40ms = 25/sec"
+msgstr "Затримка у мс між оновленням екрана. Приклад 1000мс/40мс = 25/сек"
+
+msgid "Draw Star streaks"
+msgstr "Промальовування зірки зі смугами"
+
+msgid "Draw a Star with streaks"
+msgstr "Промальовування зірки зі смугами"
+
+msgid "Rotation"
+msgstr "Обертання"
+
+msgid "Rotate X"
+msgstr "Обертання по осі X"
+
+msgid "Rotate Galaxy through X coordinate"
+msgstr "Обертання галактики по осі X"
+
+msgid "Rotate Y"
+msgstr "Обертання по осі Y"
+
+msgid "Rotate Galaxy through Y coordinate"
+msgstr "Обертання галактики по осі Y"
+
+msgid "Rotate Z"
+msgstr "Обертання по осі Z"
+
+msgid "Rotate Galaxy through Z coordinate"
+msgstr "Обертання галактики по осі Z"
+
+msgid "Zoom in/out"
+msgstr "Збільшення +/-"
+
+msgid "Zoom in and out"
+msgstr "Збільшення +/-"
+
+msgid "Key Bindings"
+msgstr "Сполучення клавіш"
+
+msgid "Galaxy Live Wallpaper Toggle"
+msgstr "Увімкнути Живі шпалери Galaxy"
+
+msgid "Galaxy Live Wallpaper toggle key"
+msgstr "Клавіша увімкнення Живих шпалер Galaxy"
+
+msgid "Offset X"
+msgstr "Offset X"
+
+msgid "X offset of the centre of Galaxy"
+msgstr "X offset of the centre of Galaxy"
+
+msgid "Offset Y"
+msgstr "Offset Y"
+
+msgid "Y offset of the centre of Galaxy"
+msgstr "Y offset of the centre of Galaxy"
+
+msgid "Speed Ratio"
+msgstr "Speed Ratio"
+
+msgid "Speed ratio of the Galaxy"
+msgstr "Speed ratio of the Galaxy"
diff --git a/src/galaxy/galaxy.c b/src/galaxy/galaxy.c
index 2a9c354..a2f6e77 100644
--- a/src/galaxy/galaxy.c
+++ b/src/galaxy/galaxy.c
@@ -37,8 +37,18 @@ updateGalaxy (void *closure)
if (!gs->active)
return TRUE;
- if (gs->ps)
+ /* Probably wont slow it down too much */
+ if (gs->ps) {
+ if ((s->width != gs->ps->screenWidth) ||
+ (s->height != gs->ps->screenHeight)) {
+
+ gs->ps->screenWidth = s->width;
+ gs->ps->screenHeight = s->height;
+ gs->ps->maxusr = (GLfloat) s->width / (GLfloat )s->height;
+ }
+
updateParticles (gs->ps);
+ }
CompWindow *w;
@@ -61,6 +71,9 @@ initParticleSystem (CompScreen *s)
ParticleSystem *ps = gs->ps;
+ /* Screen ratio */
+ ps->maxusr = (GLfloat) s->width / (GLfloat) s->height;
+
ps->particlesCount = galaxyGetParticlesCount (s->display);
ps->particlesSize = galaxyGetParticlesSize (s->display);
@@ -73,6 +86,10 @@ initParticleSystem (CompScreen *s)
ps->rotateZ = galaxyGetRotateZ (s->display);
ps->zoom = galaxyGetZoom (s->display);
+ ps->offsetX = galaxyGetOffsetX (s->display);
+ ps->offsetY = galaxyGetOffsetY (s->display);
+
+ ps->speedRatio = galaxyGetSpeedRatio (s->display);
ps->lightTexture = 0;
ps->flareTexture = 0;
@@ -227,6 +244,23 @@ galaxyDisplayOptionChanged (CompDisplay *d,
gs->ps->zoom = galaxyGetZoom (d);
}
break;
+ case GalaxyDisplayOptionOffsetX:
+ {
+ if (gs->ps)
+ gs->ps->offsetX = galaxyGetOffsetX (d);
+ }
+ break;
+ case GalaxyDisplayOptionOffsetY:
+ {
+ if (gs->ps)
+ gs->ps->offsetY = galaxyGetOffsetY (d);
+ }
+ case GalaxyDisplayOptionSpeedRatio:
+ {
+ if (gs->ps)
+ gs->ps->speedRatio = galaxyGetSpeedRatio (d);
+ }
+ break;
}
}
@@ -284,6 +318,9 @@ galaxyInitDisplay (CompPlugin *p,
galaxySetRotateYNotify (d, galaxyDisplayOptionChanged);
galaxySetRotateZNotify (d, galaxyDisplayOptionChanged);
galaxySetZoomNotify (d, galaxyDisplayOptionChanged);
+ galaxySetOffsetXNotify (d, galaxyDisplayOptionChanged);
+ galaxySetOffsetYNotify (d, galaxyDisplayOptionChanged);
+ galaxySetSpeedRatioNotify (d, galaxyDisplayOptionChanged);
galaxySetToggleKeyInitiate (d, galaxyDisplayToggleChanged);
diff --git a/src/galaxy/particle.c b/src/galaxy/particle.c
index 6d87d87..4b932ef 100644
--- a/src/galaxy/particle.c
+++ b/src/galaxy/particle.c
@@ -81,7 +81,8 @@ clampf (float num, float min, float max)
if(num > max)
{
num = max;
- } else if (num < min)
+ }
+ else if (num < min)
{
num = min;
}
@@ -172,7 +173,7 @@ generateFlare (ParticleSystem *ps, GLboolean drawStreaks)
data[i + 0] = 255; /* Red */
data[i + 1] = 255; /* Ggreen */
data[i + 2] = 255; /* Blue */
- data[i + 3] = (GLubyte)(255.0f * fa); /* Alpha */
+ data[i + 3] = (GLubyte) (255.0f * fa); /* Alpha */
}
}
@@ -298,7 +299,8 @@ updateParticles (ParticleSystem *ps)
for (i = 0; i < ps->particlesCount; i++)
{
- particles[i].angle = particles[i].angle + particles[i].speed;
+ particles[i].angle = particles[i].angle +
+ particles[i].speed * ps->speedRatio;
x = particles[i].distance * cosf (particles[i].angle);
y = particles[i].distance * sinf (particles[i].angle) * -ELLIPSE_RATIO;
@@ -341,7 +343,7 @@ GLvoid
drawParticles (ParticleSystem *ps)
{
/* FIXME: Find a proper qudratic attenuation */
- static GLfloat quadratic[] = { 1.f, .0f, .050f };
+ static GLfloat quadratic[] = { 0.4f, .0f, .1f };
static GLfloat max_size = .0f;
glBindTexture (GL_TEXTURE_2D, ps->flareTexture);
@@ -357,7 +359,8 @@ drawParticles (ParticleSystem *ps)
#endif
glDepthMask(GL_FALSE);
- glPointSize (ps->particlesSize); /* It's faster than call the get func */
+ glPointSize (ps->particlesSize *
+ ps->maxusr); /* It's faster than call the get func */
glTexEnvf (GL_POINT_SPRITE_ARB, GL_COORD_REPLACE, GL_TRUE);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
@@ -395,20 +398,20 @@ drawGalaxy (ParticleSystem *ps)
* http://www.opengl.org/wiki/GluPerspective_code
*/
double ymax, xmax;
- ymax = ps->nearClip * tanf (ps->fovy * M_PI / 360.0);
+ ymax = ps->nearClip * tanf (ps->fovy * _PI / 360.0);
xmax = ymax * ((double) ps->screenWidth / (double) ps->screenHeight);
/* Set the correct Galaxy perspective. */
- glFrustum(-xmax, xmax, -ymax, ymax, ps->nearClip, ps->farClip);
+ glFrustum (-xmax, xmax, -ymax, ymax, ps->nearClip, ps->farClip);
glMatrixMode (GL_MODELVIEW);
glPushMatrix ();
- glLoadIdentity();
+ glLoadIdentity ();
/*
- * FIXME: Find a solution for proper background/wallpaper drawing
- drawBackground (ps);
+ * FIXME: Find a solution for proper background/wallpaper drawing
+ drawBackground (ps);
*/
- glTranslatef (0.0f, 0.0f, -ps->zoom);
+ glTranslatef (ps->offsetX, ps->offsetY, -ps->zoom * ps->maxusr);
glRotatef (ps->rotateX, 1.0f, 0.0f, 0.0f); /* Rotate on X axis */
glRotatef (ps->rotateY, 0.0f, 1.0f, 0.0f); /* Rotate on Y axis */
diff --git a/src/galaxy/particle.h b/src/galaxy/particle.h
index 6965622..ce683a8 100644
--- a/src/galaxy/particle.h
+++ b/src/galaxy/particle.h
@@ -27,7 +27,6 @@ COMPIZ_BEGIN_DECLS
#define _2PI (float) (2 * _PI)
#define ELLIPSE_RATIO .885f /* 0 (line) -> 1.0f (circle) */
-#define ELLIPSE_TWIST _2PI
/* Fovy angle a.k.a theta */
#define FOVY 45.0f
@@ -46,6 +45,12 @@ typedef struct _Particle {
} Particle;
typedef struct _ParticleSystem {
+ /**
+ * maxusr is promoted for a basis for calculating the other plugin's
+ * parameters such pointsize, quadration etc.
+ */
+ GLfloat maxusr; /* You should not know why it's named to this.;) */
+
GLint particlesCount;
GLint particlesSize;
@@ -58,6 +63,11 @@ typedef struct _ParticleSystem {
GLint rotateZ;
GLfloat zoom;
+ GLfloat offsetX;
+ GLfloat offsetY;
+
+ GLfloat speedRatio;
+
GLuint lightTexture;
GLuint flareTexture;