From 548492666820c4565429093e2e6ca3bb74036025 Mon Sep 17 00:00:00 2001 From: dborca <> Date: Fri, 24 Sep 2004 06:56:30 +0000 Subject: [PATCH] small fixes --- glide3x/sst1/glide3/tests/makefile.linux | 6 ++++-- glide3x/sst1/glide3/tests/test29.c | 3 ++- glide3x/sst1/glide3/tests/test30.c | 19 ++++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/glide3x/sst1/glide3/tests/makefile.linux b/glide3x/sst1/glide3/tests/makefile.linux index 258408e..25e3375 100644 --- a/glide3x/sst1/glide3/tests/makefile.linux +++ b/glide3x/sst1/glide3/tests/makefile.linux @@ -32,6 +32,8 @@ HWDEF = -DSST1 else ifeq ($(FX_GLIDE_HW),sst96) HWDEF = -DSST96 +XPATH = -L/usr/X11R6/lib +XLIBS = -lXxf86dga -lXxf86rush -lXxf86vm endif endif @@ -45,10 +47,10 @@ CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -I$( CFLAGS += -I$(TOP)/swlibs/fxmisc CFLAGS += $(HWDEF) -LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib +LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib $(XPATH) LDLIBS = -lglide3 -LDLIBS += -lm +LDLIBS += $(XLIBS) -lm .c.o: $(CC) -o $@ $(CFLAGS) -c $< diff --git a/glide3x/sst1/glide3/tests/test29.c b/glide3x/sst1/glide3/tests/test29.c index a41e63d..8ea6aa1 100644 --- a/glide3x/sst1/glide3/tests/test29.c +++ b/glide3x/sst1/glide3/tests/test29.c @@ -238,7 +238,8 @@ void main(int argc, char **argv) { /* Download this in a sequential way to test the palette download */ i = 0; while(i < 256) { - const int end = MIN((i + (rand() % 10)), 255); + const int max = i + (rand() % 10); + const int end = MIN(max, 255); grTexDownloadTablePartial(curPalType, &texPal, i, end); i = end + 1; diff --git a/glide3x/sst1/glide3/tests/test30.c b/glide3x/sst1/glide3/tests/test30.c index 0dadb61..9e837a2 100644 --- a/glide3x/sst1/glide3/tests/test30.c +++ b/glide3x/sst1/glide3/tests/test30.c @@ -117,6 +117,7 @@ main(int argc, char **argv) { char filename[256]; FxVideoTimingInfo* vidTiming = NULL; FxVideoTimingInfo curVidTiming = gDefaultTimingVal; + GrContext_t ctx; /* Initialize Glide */ grGlideInit(); @@ -166,16 +167,16 @@ main(int argc, char **argv) { printf("%s\n", version); grSstSelect(0); - assert(grSstWinOpen(tlGethWnd(), + assert((ctx = grSstWinOpen(tlGethWnd(), GR_RESOLUTION_640x480, GR_REFRESH_60Hz, GR_COLORFORMAT_ABGR, GR_ORIGIN_UPPER_LEFT, - 2, 1)); + 2, 1))); tlConSet(0.0f, 0.0f, 1.0f, 1.0f, 60, 30, 0xffffff); - grSstWinClose(0); + grSstWinClose(ctx); { GrScreenRefresh_t curRefresh = GR_REFRESH_60Hz; @@ -184,10 +185,10 @@ main(int argc, char **argv) { while((frames != 0) && tlOkToRender()) { /* Try to open at the current user selection */ - if (!grSstWinOpen(tlGethWnd(), + if (!(ctx = grSstWinOpen(tlGethWnd(), curRes, curRefresh, GR_COLORFORMAT_ABGR, GR_ORIGIN_UPPER_LEFT, - numColorBuf, numAuxBuf)) { + numColorBuf, numAuxBuf))) { /* If we cannot use the user selection the set to one that * should work so that we have reasonable error output. @@ -196,9 +197,9 @@ main(int argc, char **argv) { * any failures due to bad data. */ grSstVidMode(0, NULL); - if (!grSstWinOpen(tlGethWnd(), GR_RESOLUTION_640x480, GR_REFRESH_60Hz, + if (!(ctx = grSstWinOpen(tlGethWnd(), GR_RESOLUTION_640x480, GR_REFRESH_60Hz, GR_COLORFORMAT_ABGR, GR_ORIGIN_UPPER_LEFT, - 2, 0)) { + 2, 0))) { fprintf(stderr, "Could not set error resolution.\n"); exit(-1); } @@ -218,7 +219,7 @@ main(int argc, char **argv) { /* Do Nothing */; /* Cleanup the error reporting and try again. */ - grSstWinClose(0); + grSstWinClose(ctx); continue; } @@ -391,7 +392,7 @@ main(int argc, char **argv) { } /* Start new refresh settings */ - grSstWinClose(0); + grSstWinClose(ctx); } }