From badd0f9bfc6dad829073e606c1953572ece1b06b Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Sat, 15 Apr 2006 16:22:32 +0000 Subject: [PATCH] fixed crashing bug in move_dust() (bounds checking wasn't right) --- Makefile | 6 +++--- dust.c | 4 ++-- main.c | 2 +- povimg.sh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 90e50a6..dacecb6 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ DATA_PREFIX := /usr/share/vor PROGRAM_PREFIX := /usr/games/bin -CFLAGS := -Wall -O3 +CFLAGS := -ggdb LDFLAGS := paths := -DDATA_PREFIX=\"$(DATA_PREFIX)\" @@ -58,8 +58,8 @@ data: $(graphics) program: vor %.o: %.c - @echo compiling $@ from $< - @$(CC) $(cflags) -c -o $@ $< + #@echo compiling $@ from $< + $(CC) $(cflags) -c -o $@ $< $(my_objects): config.h diff --git a/dust.c b/dust.c index 3a9f246..b336696 100644 --- a/dust.c +++ b/dust.c @@ -35,9 +35,9 @@ move_dust(void) for(i=0; i= XSIZE) motes[i].x -= XSIZE; + if(motes[i].x >= XSIZE) motes[i].x -= XSIZE; else if(motes[i].x < 0) motes[i].x += XSIZE; - if(motes[i].y > YSIZE) motes[i].y -= YSIZE; + if(motes[i].y >= YSIZE) motes[i].y -= YSIZE; else if(motes[i].y < 0) motes[i].y += YSIZE; } } diff --git a/main.c b/main.c index ea1f536..8a4f085 100644 --- a/main.c +++ b/main.c @@ -144,7 +144,7 @@ new_bang_dots(int xbang, int ybang, int dx, int dy, SDL_Surface *s) int row_inc; double theta, r; - n = 24.0 * t_frame; + n = 12.0 * t_frame; pixel = s->pixels; row_inc = s->pitch/sizeof(uint16_t) - s->w; colorkey = s->format->colorkey; diff --git a/povimg.sh b/povimg.sh index d2263fa..fcc21ac 100755 --- a/povimg.sh +++ b/povimg.sh @@ -1,3 +1,3 @@ #!/bin/sh -povray -D +A -O- +FP $* 2>/dev/null | pnmcrop | pnmtopng -transparent =black 2>/dev/null +povray -D +A -O- +FP $* 2>/dev/null | pnmcrop | pnmtopng -transparent black 2>/dev/null -- 1.7.10.4