Dumb up filename case insensitivity

svn-id: r4504
This commit is contained in:
James Brown 2002-07-09 14:31:00 +00:00
parent e92bb8a778
commit c579c16bf1
3 changed files with 26 additions and 16 deletions

View File

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

View File

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

View File

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