Dumb up filename case insensitivity
svn-id: r4504
This commit is contained in:
parent
e92bb8a778
commit
c579c16bf1
3 changed files with 26 additions and 16 deletions
4
Makefile
4
Makefile
|
@ -8,8 +8,8 @@ INCLUDES:= -I./ -I./sound
|
||||||
LIBS = -lncurses
|
LIBS = -lncurses
|
||||||
|
|
||||||
# Uncomment this to activate the MAD lib for compressed sound files
|
# Uncomment this to activate the MAD lib for compressed sound files
|
||||||
DEFINES += -DCOMPRESSED_SOUND_FILE
|
#DEFINES += -DCOMPRESSED_SOUND_FILE
|
||||||
LIBS += -lmad
|
#LIBS += -lmad
|
||||||
|
|
||||||
# Uncomment this to activate the ALSA lib for midi
|
# Uncomment this to activate the ALSA lib for midi
|
||||||
# DEFINES += -DUSE_ALSA
|
# DEFINES += -DUSE_ALSA
|
||||||
|
|
|
@ -32,20 +32,19 @@ clean:
|
||||||
.PHONY: all clean dist
|
.PHONY: all clean dist
|
||||||
|
|
||||||
# Default (dumb) compile & dependcy rules
|
# Default (dumb) compile & dependcy rules
|
||||||
.cpp.o:
|
#.cpp.o:
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
# $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
||||||
$(OBJS): $(INCS)
|
#$(OBJS): $(INCS)
|
||||||
|
|
||||||
|
|
||||||
# If you use GCC, disable the above and enable this for intelligent
|
# If you use GCC, disable the above and enable this for intelligent
|
||||||
# dependency tracking.
|
# dependency tracking.
|
||||||
#DEPDIR := .deps
|
DEPDIR := .deps
|
||||||
#.cpp.o:
|
.cpp.o:
|
||||||
# mkdir -p $(DEPDIR)
|
mkdir -p $(DEPDIR)
|
||||||
# $(CC) -Wp,-MMD,"$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
$(CC) -Wp,-MMD,"$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
||||||
# echo -n "$(*D)/" > $(DEPDIR)/$(*F).d
|
echo -n "$(*D)/" > $(DEPDIR)/$(*F).d
|
||||||
# cat "$(DEPDIR)/$(*F).d2" >> "$(DEPDIR)/$(*F).d"
|
cat "$(DEPDIR)/$(*F).d2" >> "$(DEPDIR)/$(*F).d"
|
||||||
# rm -f "$(DEPDIR)/$(*F).d2"
|
rm -f "$(DEPDIR)/$(*F).d2"
|
||||||
#
|
|
||||||
#-include $(DEPDIR)/*.d
|
|
||||||
|
|
||||||
|
-include $(DEPDIR)/*.d
|
||||||
|
|
15
resource.cpp
15
resource.cpp
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "scumm.h"
|
#include "scumm.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
/* Open a room */
|
/* Open a room */
|
||||||
void Scumm::openRoom(int room)
|
void Scumm::openRoom(int room)
|
||||||
|
@ -174,7 +175,7 @@ bool Scumm::openResourceFile(const char *filename)
|
||||||
|
|
||||||
debug(9, "openResourceFile(%s)", filename);
|
debug(9, "openResourceFile(%s)", filename);
|
||||||
strcpy(buf, filename);
|
strcpy(buf, filename);
|
||||||
|
printf("asked to open %s\n", filename);
|
||||||
if (_fileHandle != NULL) {
|
if (_fileHandle != NULL) {
|
||||||
fileClose(_fileHandle);
|
fileClose(_fileHandle);
|
||||||
_fileHandle = NULL;
|
_fileHandle = NULL;
|
||||||
|
@ -182,13 +183,23 @@ bool Scumm::openResourceFile(const char *filename)
|
||||||
|
|
||||||
_fileHandle = fileOpen(buf, 1);
|
_fileHandle = fileOpen(buf, 1);
|
||||||
if (!_fileHandle) {
|
if (!_fileHandle) {
|
||||||
char *e = buf;
|
char *e=strrchr(buf, '/');
|
||||||
|
if (!e) e=buf;
|
||||||
do
|
do
|
||||||
*e = tolower(*e);
|
*e = tolower(*e);
|
||||||
while (*e++);
|
while (*e++);
|
||||||
_fileHandle = fileOpen(buf, 1);
|
_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;
|
return _fileHandle != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue