mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 23:43:10 +00:00
Dumb up filename case insensitivity
svn-id: r4504
This commit is contained in:
parent
e92bb8a778
commit
c579c16bf1
4
Makefile
4
Makefile
@ -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
|
||||
|
@ -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
|
||||
|
15
resource.cpp
15
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user