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
if((len > 1) && (work[len-1] == CROSS_FILESPLIT )) {
#endif
#ifndef HW_RVL
work[len-1] = 0; // Remove trailing slashes except when in root
#endif
}
}
return work;

View File

@ -21,18 +21,29 @@
//#include "render.h"
#include "video.h"
#if RENDER_USE_ADVANCED_SCALERS>0
#define SCALER_MAXWIDTH 1280
#define SCALER_MAXHEIGHT 1024
#else
// reduced to save some memory
#define SCALER_MAXWIDTH 800
#define SCALER_MAXHEIGHT 600
#endif
#if RENDER_USE_ADVANCED_SCALERS>1
#define SCALER_COMPLEXWIDTH 800
#define SCALER_COMPLEXHEIGHT 600
#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
#define SCALER_MAXWIDTH 1280
#define SCALER_MAXHEIGHT 1024
#else
// reduced to save some memory
#define SCALER_MAXWIDTH 800
#define SCALER_MAXHEIGHT 600
#endif
#if RENDER_USE_ADVANCED_SCALERS>1
#define SCALER_COMPLEXWIDTH 800
#define SCALER_COMPLEXHEIGHT 600
#endif
#endif
#define SCALER_BLOCKSIZE 16

View File

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