OSDN Git Service

Fix problems in NexusGL:
authorDaniel Sandler <dsandler@google.com>
Thu, 3 Dec 2009 16:28:35 +0000 (11:28 -0500)
committerDaniel Sandler <dsandler@google.com>
Thu, 3 Dec 2009 16:28:35 +0000 (11:28 -0500)
* pulse has bad dithering & off-color pixels
* glow isn't smooth enough
* off-by-one error in pulse positioning code
  (you can see it by tapping the wallpaper; the four pulses
  do not launch symmetrically---the north and west pulses
  have a 'head start' of 1 cell)

Change-Id: I789085a5ef73a1ea3ed36dbbcb61c405563b463c

res/drawable-hdpi/glow.png
res/drawable-hdpi/pulse.png
res/raw/nexus.rs

index 613c45b..d02c971 100644 (file)
Binary files a/res/drawable-hdpi/glow.png and b/res/drawable-hdpi/glow.png differ
index 4bdfc5f..ed5c5a0 100644 (file)
Binary files a/res/drawable-hdpi/pulse.png and b/res/drawable-hdpi/pulse.png differ
index 43dde76..ab11c28 100644 (file)
@@ -21,8 +21,8 @@
 #define MAX_EXTRAS           40
 #define PULSE_SIZE           14 // Size in pixels of a cell
 #define HALF_PULSE_SIZE      7
-#define GLOW_SIZE            32 // Size of the leading glow in pixels
-#define HALF_GLOW_SIZE       16 
+#define GLOW_SIZE            64 // Size of the leading glow in pixels
+#define HALF_GLOW_SIZE       32 
 #define SPEED                0.2f // (200 / 1000) Pixels per ms
 #define SPEED_VARIANCE       0.3f
 #define PULSE_NORMAL         0
@@ -160,6 +160,7 @@ void drawPulses(struct pulse_s * pulseSet, int setSize) {
                            0.0f);
                    }
                } else if (p->dx > 0) {
+                               x += PULSE_SIZE; // need to start on the other side of this cell
                    matrixRotate(matrix, 180.0f, 0.0f, 0.0f, 1.0f);
                    vpLoadTextureMatrix(matrix);
                    float xx = x - (TRAIL_SIZE * PULSE_SIZE);
@@ -194,6 +195,7 @@ void drawPulses(struct pulse_s * pulseSet, int setSize) {
                            0.0f);
                    }
                } else if (p->dy > 0) {
+                               y += PULSE_SIZE; // need to start on the other side of this cell
                    matrixRotate(matrix, 90.0f, 0.0f, 0.0f, 1.0f);
                    vpLoadTextureMatrix(matrix);
                    float yy = y - (TRAIL_SIZE * PULSE_SIZE);