From e55370e08db26a871d47405208e8f8e5852afcbc Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Mon, 3 Nov 2003 22:20:51 +0000 Subject: Use posix-fs on Dreamcast. svn-id: r11112 --- backends/dc/Makefile | 2 +- backends/dc/dc-fs.cpp | 27 --------------------------- backends/fs/posix/posix-fs.cpp | 12 ++++++++++-- 3 files changed, 11 insertions(+), 30 deletions(-) delete mode 100644 backends/dc/dc-fs.cpp 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 -#include -#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 #include +#ifndef __DC__ #include +#endif #include #include @@ -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) || -- cgit v1.2.3