- Fixed building with libdumb on Linux.

SVN r997 (trunk)
This commit is contained in:
Randy Heit 2008-05-30 01:02:35 +00:00
parent db0b93d40f
commit ee1039f04e
6 changed files with 18 additions and 12 deletions

View file

@ -6,6 +6,9 @@ CC ?= gcc
NASM ?= nasm NASM ?= nasm
CCDV = @./ccdv CCDV = @./ccdv
# Can be libdumbd.a, if you really need to debug DUMB
DUMBLIB ?= libdumbd.a
ifndef X64 ifndef X64
ifeq (x86_64,$(shell uname -m)) ifeq (x86_64,$(shell uname -m))
X64=64 X64=64
@ -79,10 +82,10 @@ OBJS = $(addprefix $(OBJDIR)/,$(AOBJFILES)) $(COBJS)
all: $(ZDOOMBIN) toolsandpk3 zdoom.pk3 all: $(ZDOOMBIN) toolsandpk3 zdoom.pk3
$(ZDOOMBIN): ccdv updaterev src/xlat/xlat_parser.h src/xlat/xlat_parser.c $(OBJDIR) $(OBJS) snes_spc/libsnes_spc.a $(ZDOOMBIN): ccdv updaterev src/xlat/xlat_parser.h src/xlat/xlat_parser.c $(OBJDIR) $(OBJS) snes_spc/libsnes_spc.a dumb/lib/$(DUMBLIB)
$(CCDV) $(CXX) $(LDFLAGS) $(OBJDIR)/autostart.o \ $(CCDV) $(CXX) $(LDFLAGS) $(OBJDIR)/autostart.o \
$(filter-out %/autostart.o %/autozend.o,$(OBJS)) \ $(filter-out %/autostart.o %/autozend.o,$(OBJS)) \
snes_spc/libsnes_spc.a $(OBJDIR)/autozend.o -o $(ZDOOMBIN) snes_spc/libsnes_spc.a dumb/lib/$(DUMBLIB) $(OBJDIR)/autozend.o -o $(ZDOOMBIN)
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/%.o: %.cpp
$(CCDV) $(CXX) $(CXXFLAGS) -o $@ -c $< $(CCDV) $(CXX) $(CXXFLAGS) -o $@ -c $<
@ -116,6 +119,12 @@ zdoom.pk3: toolsandpk3
snes_spc/libsnes_spc.a: ccdv snes_spc/libsnes_spc.a: ccdv
$(MAKE) -C snes_spc/ $(MAKE) -C snes_spc/
dumb/lib/libdumb.a: ccdv
$(MAKE) -C dumb/
dumb/lib/libdumbd.a: ccdv
$(MAKE) CONFIG=Debug -C dumb/
tools/makewad/makewad: ccdv tools/makewad/makewad: ccdv
$(MAKE) -C tools/makewad/ $(MAKE) -C tools/makewad/

View file

@ -3555,7 +3555,7 @@ static void process_playing(DUMB_IT_SIGRENDERER *sigrenderer, IT_PLAYING *playin
playing->sample_vibrato_time += playing->sample->vibrato_speed; playing->sample_vibrato_time += playing->sample->vibrato_speed;
} }
#ifndef __GNUC__ #if !defined(_WIN32) || !defined(__GNUC__)
static double log2(double x) {return log(x)/log(2.0f);} static double log2(double x) {return log(x)/log(2.0f);}
#endif #endif

View file

@ -1271,7 +1271,7 @@ DUH *DUMBEXPORT dumb_read_psm_quick(DUMBFILE *f, int subsong)
if ( ver ) if ( ver )
{ {
tag[2][0] = "FORMATVERSION"; tag[2][0] = "FORMATVERSION";
itoa(ver, version, 10); sprintf(version, "%d", ver);
tag[2][1] = (const char *) &version; tag[2][1] = (const char *) &version;
++n_tags; ++n_tags;
} }

View file

@ -24,6 +24,10 @@
#include "dumb.h" #include "dumb.h"
#include "internal/it.h" #include "internal/it.h"
#ifndef _WIN32
#define strnicmp strncasecmp
#endif
static int it_stm_read_sample_header( IT_SAMPLE *sample, DUMBFILE *f ) static int it_stm_read_sample_header( IT_SAMPLE *sample, DUMBFILE *f )
{ {
dumbfile_getnc( sample->filename, 12, f ); dumbfile_getnc( sample->filename, 12, f );

View file

@ -903,7 +903,6 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
for (i = 0; i < sigdata->n_instruments; i++) { for (i = 0; i < sigdata->n_instruments; i++) {
XM_INSTRUMENT_EXTRA extra; XM_INSTRUMENT_EXTRA extra;
assert(_heapchk()==_HEAPOK);
if (it_xm_read_instrument(&sigdata->instrument[i], &extra, f) < 0) { if (it_xm_read_instrument(&sigdata->instrument[i], &extra, f) < 0) {
// XXX // XXX
if ( ! i ) if ( ! i )
@ -918,7 +917,6 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
break; break;
} }
} }
assert(_heapchk()==_HEAPOK);
if (extra.n_samples) { if (extra.n_samples) {
unsigned char roguebytes[XM_MAX_SAMPLES_PER_INSTRUMENT]; unsigned char roguebytes[XM_MAX_SAMPLES_PER_INSTRUMENT];
@ -936,11 +934,9 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
sigdata->sample[j].data = NULL; sigdata->sample[j].data = NULL;
/* read instrument's samples */ /* read instrument's samples */
assert(_heapchk()==_HEAPOK);
for (j = 0; j < extra.n_samples; j++) { for (j = 0; j < extra.n_samples; j++) {
IT_SAMPLE *sample = &sigdata->sample[total_samples+j]; IT_SAMPLE *sample = &sigdata->sample[total_samples+j];
int b = it_xm_read_sample_header(sample, f); int b = it_xm_read_sample_header(sample, f);
assert(_heapchk()==_HEAPOK);
if (b < 0) { if (b < 0) {
_dumb_it_unload_sigdata(sigdata); _dumb_it_unload_sigdata(sigdata);
return NULL; return NULL;
@ -955,15 +951,12 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
*/ */
sample->vibrato_waveform = xm_convert_vibrato[extra.vibrato_type]; sample->vibrato_waveform = xm_convert_vibrato[extra.vibrato_type];
sample->max_resampling_quality = -1; sample->max_resampling_quality = -1;
assert(_heapchk()==_HEAPOK);
} }
for (j = 0; j < extra.n_samples; j++) { for (j = 0; j < extra.n_samples; j++) {
assert(_heapchk()==_HEAPOK);
if (it_xm_read_sample_data(&sigdata->sample[total_samples+j], roguebytes[j], f) != 0) { if (it_xm_read_sample_data(&sigdata->sample[total_samples+j], roguebytes[j], f) != 0) {
_dumb_it_unload_sigdata(sigdata); _dumb_it_unload_sigdata(sigdata);
return NULL; return NULL;
} }
assert(_heapchk()==_HEAPOK);
} }
total_samples += extra.n_samples; total_samples += extra.n_samples;
} }

View file

@ -1070,7 +1070,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
DTA_DestHeight, cmd.special2, DTA_DestHeight, cmd.special2,
DTA_Bottom320x200, Scaled, DTA_Bottom320x200, Scaled,
DTA_Alpha, alpha, DTA_Alpha, alpha,
DTA_AlphaChannel, true, DTA_AlphaChannel, 0,// true,
DTA_FillColor, 0, DTA_FillColor, 0,
TAG_DONE); TAG_DONE);
break; break;