# HG changeset patch # User Matti Hamalainen # Date 1363383352 -7200 # Node ID f896fe6a98da0f4baa7e1f999569d936c38c0229 # Parent 7c314ac342f4c45e66f1c13fae040174d10c246a Cleanups. diff -r 7c314ac342f4 -r f896fe6a98da 3x666.c --- a/3x666.c Fri Mar 15 23:21:08 2013 +0200 +++ b/3x666.c Fri Mar 15 23:35:52 2013 +0200 @@ -584,11 +584,15 @@ // capable of producing stereo anyway (for now, at least.) int i, need = len / sizeof(Sint16); +#if 0 // The audio rendering handling is a bit silly due to the way // the original code works (assumes that it can always render // a certain amount/duration of data, instead of being given // the buffer duration/size to render. So we cope with that here. - while (engine.mixFill < need && engine.mixFill < engine.mixBufSize / 2) + if (need >= engine.mixBufSize) + need = engine.mixBufSize; + + while (engine.mixFill < need && engine.mixFill < engine.mixBufSize) { int got = engineRenderAudio(engine.mixBuf + engine.mixFill); engine.mixFill += got; @@ -604,6 +608,7 @@ { memmove(engine.mixBuf, engine.mixBuf + need, engine.mixFill * sizeof(Sint32)); } +#endif } diff -r 7c314ac342f4 -r f896fe6a98da Makefile --- a/Makefile Fri Mar 15 23:21:08 2013 +0200 +++ b/Makefile Fri Mar 15 23:35:52 2013 +0200 @@ -1,21 +1,16 @@ -# mAKEFiLE fOR 3x666 bY oCSA +# +# Configuration settings for Linux and generic UNIX +# See other Makefile.* files for more options. +# + +# C-compiler, flags and linker flags +CC=gcc SDL_CFLAGS=`sdl-config --cflags` SDL_LDFLAGS=`sdl-config --libs` -CC = gcc -CFLAGS = -O3 -march=core2 - - -CFLAGS += -g -W -Wall $(SDL_CFLAGS) -LDFLAGS = $(SDL_LDFLAGS) -lm - +# Miscellaneous +BINPATH= +OBJPATH=obj/unix/ +EXEEXT= -3x666: 3x666.o - $(CC) -o $@ $+ $(LDFLAGS) - -3x666.o: 3x666.c config.h 3xfont.h - $(CC) $(CFLAGS) -c -o $@ $< - -clean: - $(RM) 3x666.o 3x666 - +include Makefile.gen diff -r 7c314ac342f4 -r f896fe6a98da Makefile.gwin --- a/Makefile.gwin Fri Mar 15 23:21:08 2013 +0200 +++ b/Makefile.gwin Fri Mar 15 23:35:52 2013 +0200 @@ -5,23 +5,13 @@ # C-compiler, flags and linker flags CC=$(MINGW_PREFIX)gcc -AR=$(MINGW_PREFIX)ar -RANLIB=$(MINGW_PREFIX)ranlib RM=rm SDL_CFLAGS=`$(MINGW_PATH)/bin/sdl-config --cflags` -SDL_LDFLAGS:=`$(MINGW_PATH)/bin/sdl-config --libs` +SDL_LDFLAGS=`$(MINGW_PATH)/bin/sdl-config --libs` -lSDL -CFLAGS = -O3 -march=pentium-m -g -W -Wall $(SDL_CFLAGS) -LDFLAGS = -lm -lmingw32 $(SDL_LDFLAGS) -lSDL +CFLAGS = -march=pentium-m +LDFLAGS = -lmingw32 -3x666$(EXEEXT): 3x666.o - $(CC) -o $@ $+ $(LDFLAGS) - -3x666.o: 3x666.c config.h 3xfont.h - $(CC) $(CFLAGS) -c -o $@ $< - -clean: - $(RM) 3x666.o 3x666$(EXEEXT) - +include Makefile.gen diff -r 7c314ac342f4 -r f896fe6a98da Makefile.w32 --- a/Makefile.w32 Fri Mar 15 23:21:08 2013 +0200 +++ b/Makefile.w32 Fri Mar 15 23:35:52 2013 +0200 @@ -4,6 +4,7 @@ MINGW_PREFIX=i686-w64-mingw32- MINGW_PATH=/usr/i686-w64-mingw32 +OBJPATH ?= obj/win32/ EXEEXT ?= .exe include Makefile.gwin