aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMarcus Comstedt2003-11-03 22:20:51 +0000
committerMarcus Comstedt2003-11-03 22:20:51 +0000
commite55370e08db26a871d47405208e8f8e5852afcbc (patch)
treefd4cc2c3fa55484b8c2b1ecf204075eddcc5d1fc /backends
parentd85757987e893f53a34e08e6ef912dc86ffe619f (diff)
downloadscummvm-rg350-e55370e08db26a871d47405208e8f8e5852afcbc.tar.gz
scummvm-rg350-e55370e08db26a871d47405208e8f8e5852afcbc.tar.bz2
scummvm-rg350-e55370e08db26a871d47405208e8f8e5852afcbc.zip
Use posix-fs on Dreamcast.
svn-id: r11112
Diffstat (limited to 'backends')
-rw-r--r--backends/dc/Makefile2
-rw-r--r--backends/dc/dc-fs.cpp27
-rw-r--r--backends/fs/posix/posix-fs.cpp12
3 files changed, 11 insertions, 30 deletions
diff --git a/backends/dc/Makefile b/backends/dc/Makefile
index 0e39ae51a8..a547f20490 100644
--- a/backends/dc/Makefile
+++ b/backends/dc/Makefile
@@ -21,7 +21,7 @@ AR = sh-elf-ar cru
RANLIB = sh-elf-ranlib
OBJS := dcmain.o time.o display.o audio.o input.o selector.o icon.o \
- label.o vmsave.o dc-fs.o
+ label.o vmsave.o backends/fs/posix/posix-fs.o
include ../../Makefile.common
diff --git a/backends/dc/dc-fs.cpp b/backends/dc/dc-fs.cpp
deleted file mode 100644
index f86ffb0522..0000000000
--- a/backends/dc/dc-fs.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2002 The ScummVM project
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Header$
- */
-
-#include <common/stdafx.h>
-#include <backends/fs/fs.h>
-#include "base/engine.h"
-
-FilesystemNode *FilesystemNode::getRoot() {
- error ("No filesystem implemented for DC!");
-}
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 43574ac818..4475e82abd 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -18,7 +18,9 @@
* $Header$
*/
-#if defined(UNIX) || defined (__GP32__) //ph0x
+#if defined(UNIX) || defined(__DC__) || defined (__GP32__) //ph0x
+
+#include "stdafx.h"
#include "../fs.h"
@@ -27,7 +29,9 @@
#endif
#include <sys/param.h>
#include <sys/stat.h>
+#ifndef __DC__
#include <dirent.h>
+#endif
#include <stdio.h>
#include <unistd.h>
@@ -80,7 +84,7 @@ FilesystemNode *FilesystemNode::getRoot() {
}
POSIXFilesystemNode::POSIXFilesystemNode() {
-#if 1
+#ifndef __DC__
char buf[MAXPATHLEN];
getcwd(buf, MAXPATHLEN);
@@ -134,9 +138,13 @@ FSList *POSIXFilesystemNode::listDir(ListMode mode) const {
entry._path = _path;
entry._path += dp->d_name;
+#ifdef __DC__
+ entry._isDirectory = dp->d_size < 0;
+#else
if (stat(entry._path.c_str(), &st))
continue;
entry._isDirectory = S_ISDIR(st.st_mode);
+#endif
// Honor the chosen mode
if ((mode == kListFilesOnly && entry._isDirectory) ||