aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2013-03-27 21:47:34 +0000
committerDimitri Sokolyuk <demon@dim13.org>2013-03-27 21:47:34 +0000
commitf4a2afab86a7c456804d37be4f3997018428ee91 (patch)
tree16ae0b1d9c2a9b2b60e230fbc6f3e0de241b1ec4
parent0b3d6aad997eb049c86cb78ec98e87bf0a03cab2 (diff)
minor
-rw-r--r--Makefile2
-rw-r--r--spectrogram.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 257005c..296f6e3 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ PCCF!= pkg-config --cflags ${LIBS}
PCLA!= pkg-config --libs ${LIBS}
CFLAGS+=${PCCF}
LDADD+= ${PCLA} -lsndio
-DEBUG+= -Wall
+DEBUG+= -Wall -ggdb
NOMAN=
.include <bsd.prog.mk>
diff --git a/spectrogram.c b/spectrogram.c
index 40bdf55..cf93a89 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -135,7 +135,7 @@ init_palette(float h, float dh, float s, float ds, float v, float dv, int n, int
return p;
}
-void
+static inline void
drawpixel(SDL_Surface *s, int x, int y, SDL_Color *c)
{
Uint32 *buf = (Uint32 *)s->pixels + y * (s->pitch >> 2) + x;
@@ -149,12 +149,13 @@ draw(double *left, double *right, int p, int step)
int x, y, l, r, lx, rx;
double lo, mi, hi, av;
- if (SDL_MUSTLOCK(screen) && SDL_LockSurface(screen))
- return -1;
+ if (SDL_MUSTLOCK(screen))
+ SDL_LockSurface(screen);
SDL_BlitSurface(screen, &wf_from, screen, &wf_to);
- lo = mi = hi = 0;
+ if (discolight)
+ lo = mi = hi = 0.0;
for (x = 0; x < wf_left.w; x++) {
l = left[x] - 0.5;
@@ -287,7 +288,7 @@ main(int argc, char **argv)
height = 3 * width / 4;
screen = SDL_SetVideoMode(width, height, 32,
- SDL_HWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF);
+ SDL_HWSURFACE | SDL_DOUBLEBUF);
if (!screen)
errx(1, "set video mode failed");