diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | Makefile.common | 23 | ||||
-rw-r--r-- | resource.cpp | 15 |
3 files changed, 26 insertions, 16 deletions
@@ -8,8 +8,8 @@ INCLUDES:= -I./ -I./sound LIBS = -lncurses # Uncomment this to activate the MAD lib for compressed sound files -DEFINES += -DCOMPRESSED_SOUND_FILE -LIBS += -lmad +#DEFINES += -DCOMPRESSED_SOUND_FILE +#LIBS += -lmad # Uncomment this to activate the ALSA lib for midi # DEFINES += -DUSE_ALSA diff --git a/Makefile.common b/Makefile.common index 63ddd8c5a9..b96410b996 100644 --- a/Makefile.common +++ b/Makefile.common @@ -32,20 +32,19 @@ clean: .PHONY: all clean dist # Default (dumb) compile & dependcy rules -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o -$(OBJS): $(INCS) +#.cpp.o: +# $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o +#$(OBJS): $(INCS) # If you use GCC, disable the above and enable this for intelligent # dependency tracking. -#DEPDIR := .deps -#.cpp.o: -# mkdir -p $(DEPDIR) -# $(CC) -Wp,-MMD,"$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o -# echo -n "$(*D)/" > $(DEPDIR)/$(*F).d -# cat "$(DEPDIR)/$(*F).d2" >> "$(DEPDIR)/$(*F).d" -# rm -f "$(DEPDIR)/$(*F).d2" -# -#-include $(DEPDIR)/*.d +DEPDIR := .deps +.cpp.o: + mkdir -p $(DEPDIR) + $(CC) -Wp,-MMD,"$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o + echo -n "$(*D)/" > $(DEPDIR)/$(*F).d + cat "$(DEPDIR)/$(*F).d2" >> "$(DEPDIR)/$(*F).d" + rm -f "$(DEPDIR)/$(*F).d2" +-include $(DEPDIR)/*.d diff --git a/resource.cpp b/resource.cpp index c98f1bdcd0..92d1dd0afe 100644 --- a/resource.cpp +++ b/resource.cpp @@ -22,6 +22,7 @@ #include "stdafx.h" #include "scumm.h" +#include <stdio.h> /* Open a room */ void Scumm::openRoom(int room) @@ -174,7 +175,7 @@ bool Scumm::openResourceFile(const char *filename) debug(9, "openResourceFile(%s)", filename); strcpy(buf, filename); - + printf("asked to open %s\n", filename); if (_fileHandle != NULL) { fileClose(_fileHandle); _fileHandle = NULL; @@ -182,13 +183,23 @@ bool Scumm::openResourceFile(const char *filename) _fileHandle = fileOpen(buf, 1); if (!_fileHandle) { - char *e = buf; + char *e=strrchr(buf, '/'); + if (!e) e=buf; do *e = tolower(*e); while (*e++); _fileHandle = fileOpen(buf, 1); } + if (!_fileHandle) { + char *e=strrchr(buf, '/'); + if (!e) e=buf; + do + *e = toupper(*e); + while (*e++); + _fileHandle = fileOpen(buf, 1); + } + return _fileHandle != NULL; } |