From: tanya Date: Wed, 18 Aug 2010 05:58:39 +0000 (+0300) Subject: fixed fish returns X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=1e8bef7ac5059d131eda432ecf9fbe3afbb203d3;p=shermanaquarium fixed fish returns --- diff --git a/sherman-aquarium/debian/control b/sherman-aquarium/debian/control index 902dd70..8cf07d9 100644 --- a/sherman-aquarium/debian/control +++ b/sherman-aquarium/debian/control @@ -2,7 +2,7 @@ Source: shermans-aquarium Section: gnome Priority: optional Maintainer: Jose M. Moya -Build-Depends: debhelper (>= 4.1.0), cdbs, libsdl1.2-dev, libgai-dev (>= 0.5.3), autotools-dev +Build-Depends: debhelper (>= 4.1.0), cdbs, libsdl1.2-dev, autotools-dev Standards-Version: 3.7.3 Homepage: http://aquariumapplet.sourceforge.net/ diff --git a/sherman-aquarium/shermans/Makefile b/sherman-aquarium/shermans/Makefile index 6ec29dd..6ef424e 100644 --- a/sherman-aquarium/shermans/Makefile +++ b/sherman-aquarium/shermans/Makefile @@ -8,20 +8,20 @@ CC = cc PREFIX = /usr GNOMEDIR = /usr -INSTALL_PATH=$(DESTDIR)$(GNOMEDIR) +INSTALL_PATH=$(DESTDIR)/usr # Setting up the CFLAGS and LDFLAGS variables -CFLAGS += -Wall -Wno-strict-aliasing -O3 -DIMAGE_PATH=\"/usr/share/pixmaps/shermans\" -DGAI -pthread -DORBIT2=1 -I/usr/include/gtk-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/panel-2.0 -I/usr/include/gtkglext-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/libgnomeui-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/gail-1.0 -I/usr/lib/gtkglext-1.0/include -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -LDFLAGS_GAI = $(LDFLAGS) -pthread -Wl,--export-dynamic -L/usr/lib/lib -lgai -lpangoft2-1.0 -lpanel-applet-2 -lgtkglext-x11-1.0 -lgnomeui-2 -lbonoboui-2 -lgnomevfs-2 -lgconf-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lbonobo-2 -lbonobo-activation -lORBit-2 -lgthread-2.0 -lrt -lgdkglext-x11-1.0 -lGLU -lGL -lXmu -lXt -lSM -lICE -lgtk-x11-2.0 -lpangox-1.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -LDFLAGS_SDL = $(LDFLAGS) -L/usr/lib -lSDL -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 +CFLAGS += -Wall -Wno-strict-aliasing -O3 -DIMAGE_PATH=\"/usr/share/pixmaps/shermans\" -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DMAEMO_CHANGES -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +LDFLAGS_GAI = $(LDFLAGS) +LDFLAGS_SDL = $(LDFLAGS) -L/usr/lib -lSDL -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 OBJS = fish.o background.o bubble.o draw.o bottom.o soundeffects.o images.o OBJS_GAI = settings.o pref.o date.o clock.o matrix.o over.o thermometer.o leds.o aquarium.o tetris.o plasma.o status_linux26.o OBJS_SDL = screensaver.o grabscreen.o -.PHONY: all install clean shermans_applet shermans install-images install_applet install_screensaver +.PHONY: all install clean shermans install-images install_screensaver -all: shermans_applet shermans +all: shermans shermans_applet: $(OBJS_GAI) $(OBJS) $(CC) -o shermans_applet $(OBJS) $(OBJS_GAI) $(LDFLAGS_GAI) @@ -30,9 +30,9 @@ shermans_applet: $(OBJS_GAI) $(OBJS) shermans: $(OBJS) $(OBJS_SDL) $(CC) -o shermans $(OBJS) $(OBJS_SDL) $(LDFLAGS_SDL) -install: shermans_applet shermans install-images install_applet install_screensaver +install: shermans install-images install_screensaver -install_applet: install-gnome +install_applet: install -d $(INSTALL_PATH)/bin install -m 755 shermans_applet $(INSTALL_PATH)/bin install -d $(INSTALL_PATH)/share/pixmaps/ @@ -63,7 +63,7 @@ install-rox: ln -s $(INSTALL_PATH)/bin/shermans_applet "$(DESTDIR)/Sherman's aquarium/shermans_applet" install -m 644 AppInfo.xml "$(DESTDIR)/Sherman's aquarium" clean: - rm -rf *.o .xvpics *~ shermans_applet shermans + rm -rf *.o .xvpics *~ shermans # Dependencies: diff --git a/sherman-aquarium/shermans/fish.c b/sherman-aquarium/shermans/fish.c index c935ab6..a23ca9c 100644 --- a/sherman-aquarium/shermans/fish.c +++ b/sherman-aquarium/shermans/fish.c @@ -564,8 +564,7 @@ void fish_update(void) #ifdef DEBUG printf("\t\t - Done special hits.\n"); #endif - - + for(i = 0;i < fish_settings.num_fish; i++){ aquarium_clean_image((int) fishes[i].tx, fishes[i].y - ad->viewpoint_start_y, @@ -649,9 +648,7 @@ void fish_update(void) if(fishes[i].is_dead == TRUE){ - fprintf(stderr,"ddddddddddddddddd33333333\n"); if(fish_settings.rebirth){ - fprintf(stderr,"ddddddddddddddddd\n"); if(g_rand_int_range(ad->rnd, 0, 100) < 20){ // printf("Rebirth and salvation..\n"); /* Salvation and rebirth...*/ @@ -693,8 +690,8 @@ void fish_update(void) /* move fish in horizontal direction, left or right */ /* Large aquarium, the fishes are shown more seldom */ - - if (!fishes[i].rev) { + + if (!fishes[i].rev) { fishes[i].tx -= (fishes[i].speed[fishes[i].frame]) * (fishes[i].speed_mul * fish_settings.speed / 100); @@ -703,6 +700,7 @@ void fish_update(void) /* we moved out of bounds. change direction, * position, speed. */ + fishes[i].travel = g_rand_int_range(ad->rnd, 0, (ad->virtual_aquarium_x - ad->xmax) / 2) + fishes[i].width; fishes[i].tx = -fishes[i].width - fishes[i].travel; @@ -721,7 +719,6 @@ void fish_update(void) } } else { - fishes[i].tx += (fishes[i].speed[fishes[i].frame]) * (fishes[i].speed_mul * fish_settings.speed / 100); diff --git a/sherman-aquarium/shermans/screensaver.c b/sherman-aquarium/shermans/screensaver.c index 8f1f57f..5f5f9a3 100644 --- a/sherman-aquarium/shermans/screensaver.c +++ b/sherman-aquarium/shermans/screensaver.c @@ -517,7 +517,8 @@ void screensaver_init() screen_height = win_attr.height; screen_width = win_attr.width; fullscreen = 0; - ad.proximity = 1; /* No sound effects */ + //ad.proximity = 1; /* No sound effects */ + ad.proximity = 0; window = gdk_window_foreign_new((Window)window_id); gdk_window_show(window); gc = gdk_gc_new(window); @@ -917,12 +918,10 @@ int main(int argc, char **argv) screensaver_init(0); if(window_id==-1){ - fprintf(stderr, "screensaver_main_sdl\n"); - screensaver_main_sdl(); + screensaver_main_sdl(); } else{ - fprintf(stderr, "screensaver_main_GDK\n"); - screensaver_main_gdk(); + screensaver_main_gdk(); } return 0; }