small fixes

This commit is contained in:
dborca
2004-09-24 06:56:30 +00:00
parent e1a07c1ff2
commit 5484926668
3 changed files with 16 additions and 12 deletions

View File

@@ -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 $<

View File

@@ -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;

View File

@@ -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);
}
}