aboutsummaryrefslogtreecommitdiff
path: root/release/picobsd
diff options
context:
space:
mode:
authorAndrzej Bialecki <abial@FreeBSD.org>1998-10-09 12:42:56 +0000
committerAndrzej Bialecki <abial@FreeBSD.org>1998-10-09 12:42:56 +0000
commit5499ac46f6bb554fa0482f09658525e886c6bd85 (patch)
tree2af985255b3ab11a4907fa325f515d0b94f47056 /release/picobsd
parent86fc7f021cfc08189a68b3e6b6a632e22ca748fd (diff)
downloadsrc-5499ac46f6bb554fa0482f09658525e886c6bd85.tar.gz
src-5499ac46f6bb554fa0482f09658525e886c6bd85.zip
Put some #ifdef's around debugging code.
Notes
Notes: svn path=/head/; revision=40122
Diffstat (limited to 'release/picobsd')
-rw-r--r--release/picobsd/tinyware/view/Makefile4
-rw-r--r--release/picobsd/tinyware/view/view.c18
2 files changed, 19 insertions, 3 deletions
diff --git a/release/picobsd/tinyware/view/Makefile b/release/picobsd/tinyware/view/Makefile
index a960fe36217b..f676e7aa14da 100644
--- a/release/picobsd/tinyware/view/Makefile
+++ b/release/picobsd/tinyware/view/Makefile
@@ -1,9 +1,9 @@
-# $Id: Makefile,v 1.1 1998/08/19 06:13:34 abial Exp $
+# $Id: Makefile,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
PROG=view
SRCS=view.c
CFLAGS+=-I/usr/local/include
-LDADD+=-L/usr/local/lib -lpng -lvgl
+LDADD+=-L/usr/local/lib -lpng -lvgl -lz -lm
NOMAN=yes
.include <bsd.prog.mk>
diff --git a/release/picobsd/tinyware/view/view.c b/release/picobsd/tinyware/view/view.c
index 9285126616af..0c2ad2645914 100644
--- a/release/picobsd/tinyware/view/view.c
+++ b/release/picobsd/tinyware/view/view.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: view.c,v 1.1 1998/08/19 06:13:35 abial Exp $
+ * $Id: view.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
*/
/*
@@ -472,7 +472,9 @@ main(int argc, char *argv[])
progname=argv[0];
screen_gamma=1.5;
+#ifdef DEBUG
log=fopen("/png/view.log","w");
+#endif
while((c=getopt(argc,argv,"r:g:"))!=-1) {
switch(c) {
case 'r':
@@ -503,7 +505,9 @@ main(int argc, char *argv[])
usage();
exit(-1);
}
+#ifdef DEBUG
fprintf(log,"VGL initialised\n");
+#endif
VGLSavePalette();
VGLMouseInit(VGL_MOUSEHIDE);
if(argc>optind) {
@@ -516,7 +520,9 @@ main(int argc, char *argv[])
if(res) {
/* Hmm... Script? */
fsc=fopen(argv[optind],"r");
+#ifdef DEBUG
fprintf(log,"Trying script %s\n",argv[optind]);
+#endif
fgets(buf,99,fsc);
if(strcmp("VIEW SCRIPT\n",buf)!=NULL) {
VGLEnd();
@@ -537,7 +543,9 @@ main(int argc, char *argv[])
}
fclose(fsc);
cur_img=0;
+#ifdef DEBUG
fprintf(log,"Script with %d entries\n",nimg);
+#endif
png_load(pres[cur_img]);
}
/* Prepare the keyboard */
@@ -561,23 +569,31 @@ main(int argc, char *argv[])
display(&pic,pal_red,pal_green,pal_blue,&a);
while(!quit) {
if(act) {
+#ifdef DEBUG
fprintf(log,"kbd_action(%c)\n",act);
+#endif
kbd_action(x,y,act);
}
if(quit) break;
if(changed) {
+#ifdef DEBUG
fprintf(log,"changed, redisplaying\n");
+#endif
display(&pic,pal_red,pal_green,pal_blue,&a);
changed=0;
}
pause();
VGLMouseStatus(&x,&y,&buttons);
if(buttons & MOUSE_BUTTON3DOWN) {
+#ifdef DEBUG
fprintf(log,"pop_up called\n");
+#endif
pop_up("View",x,y);
}
}
VGLEnd();
+#ifdef DEBUG
fclose(log);
+#endif
exit(0);
}