do not strip trailing slash when returning to root (or ever!)

limit scalers to 640x480
fix dirname function
This commit is contained in:
dborth 2009-10-15 20:46:41 +00:00
parent 9af07c7d2d
commit f349ef029d
3 changed files with 42 additions and 24 deletions

View File

@ -185,7 +185,9 @@ char* DOS_Drive_Cache::GetExpandName(const char* path) {
#else #else
if((len > 1) && (work[len-1] == CROSS_FILESPLIT )) { if((len > 1) && (work[len-1] == CROSS_FILESPLIT )) {
#endif #endif
#ifndef HW_RVL
work[len-1] = 0; // Remove trailing slashes except when in root work[len-1] = 0; // Remove trailing slashes except when in root
#endif
} }
} }
return work; return work;

View File

@ -21,6 +21,16 @@
//#include "render.h" //#include "render.h"
#include "video.h" #include "video.h"
#ifdef HW_RVL
#define SCALER_MAXWIDTH 640
#define SCALER_MAXHEIGHT 480
#if RENDER_USE_ADVANCED_SCALERS>1
#define SCALER_COMPLEXWIDTH 640
#define SCALER_COMPLEXHEIGHT 480
#endif
#else
#if RENDER_USE_ADVANCED_SCALERS>0 #if RENDER_USE_ADVANCED_SCALERS>0
#define SCALER_MAXWIDTH 1280 #define SCALER_MAXWIDTH 1280
#define SCALER_MAXHEIGHT 1024 #define SCALER_MAXHEIGHT 1024
@ -34,6 +44,7 @@
#define SCALER_COMPLEXWIDTH 800 #define SCALER_COMPLEXWIDTH 800
#define SCALER_COMPLEXHEIGHT 600 #define SCALER_COMPLEXHEIGHT 600
#endif #endif
#endif
#define SCALER_BLOCKSIZE 16 #define SCALER_BLOCKSIZE 16

View File

@ -5,31 +5,36 @@
#include <libgen.h> #include <libgen.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "dos_inc.h" #include "dos_inc.h"
#define MAX_FILENAME_LENGTH 256
static char tmp[MAX_FILENAME_LENGTH]; static char tmp[MAXPATHLEN];
char * dirname(char * file) {
// CAKTODO char * dirname(char * file)
{
if(!file || file[0] == 0)
return ".";
char * sep = strrchr(file, '/'); char * sep = strrchr(file, '/');
if (sep == NULL) if (sep == NULL)
sep = strrchr(file, '\\'); sep = strrchr(file, '\\');
if (sep == NULL) if (sep == NULL)
return ""; return ".";
else {
int len = (int)(sep - file); int len = (int)(sep - file);
safe_strncpy(tmp, file, len+1); safe_strncpy(tmp, file, len+1);
return tmp; return tmp;
} }
} int access(const char *path, int amode)
int access(const char *path, int amode) { {
struct stat st; struct stat st;
bool folderExists = (stat(path, &st) == 0); bool folderExists = (stat(path, &st) == 0);
if (folderExists) return 0; if (folderExists) return 0;
else return ENOENT; else return ENOENT;
} }
int rmdir(const char *path) { int rmdir(const char *path)
{
return remove(path); return remove(path);
} }
int execlp(const char *file, const char *arg, ...) { int execlp(const char *file, const char *arg, ...)
{
return -1; return -1;
} }