diff --git a/src/Misc.cpp b/src/Misc.cpp index 698354938..a0d6ffe73 100644 --- a/src/Misc.cpp +++ b/src/Misc.cpp @@ -5,70 +5,6 @@ #include #include -const static char hex[] = "0123456789ABCDEF"; -void strcaturl(char *dst, char *src) -{ - char *d; - unsigned char *s; - - for (d=dst; *d; d++) ; - - for (s=(unsigned char *)src; *s; s++) - { - if ((*s>='0' && *s<='9') || - (*s>='a' && *s<='z') || - (*s>='A' && *s<='Z')) - *(d++) = *s; - else - { - *(d++) = '%'; - *(d++) = hex[*s>>4]; - *(d++) = hex[*s&15]; - } - } - *d = 0; -} - -void strappend(char *dst, const char *src) -{ - char *d; - unsigned char *s; - - for (d=dst; *d; d++) ; - - for (s=(unsigned char *)src; *s; s++) - { - *(d++) = *s; - } - *d = 0; -} - -void *file_load(char *fn, int *size) -{ - FILE *f = fopen(fn, "rb"); - void *s; - - if (!f) - return NULL; - fseek(f, 0, SEEK_END); - *size = ftell(f); - fseek(f, 0, SEEK_SET); - s = malloc(*size); - if (!s) - { - fclose(f); - return NULL; - } - int readsize = fread(s, *size, 1, f); - fclose(f); - if (readsize != 1) - { - free(s); - return NULL; - } - return s; -} - matrix2d m2d_multiply_m2d(matrix2d m1, matrix2d m2) { matrix2d result = { @@ -77,6 +13,7 @@ matrix2d m2d_multiply_m2d(matrix2d m1, matrix2d m2) }; return result; } + vector2d m2d_multiply_v2d(matrix2d m, vector2d v) { vector2d result = { @@ -85,6 +22,7 @@ vector2d m2d_multiply_v2d(matrix2d m, vector2d v) }; return result; } + matrix2d m2d_multiply_float(matrix2d m, float s) { matrix2d result = { @@ -111,6 +49,7 @@ vector2d v2d_add(vector2d v1, vector2d v2) }; return result; } + vector2d v2d_sub(vector2d v1, vector2d v2) { vector2d result = { @@ -125,6 +64,7 @@ matrix2d m2d_new(float me0, float me1, float me2, float me3) matrix2d result = {me0,me1,me2,me3}; return result; } + vector2d v2d_new(float x, float y) { vector2d result = {x, y}; diff --git a/src/Misc.h b/src/Misc.h index 982ed6362..f4798808b 100644 --- a/src/Misc.h +++ b/src/Misc.h @@ -53,22 +53,8 @@ inline float restrict_flt(float f, float min, float max) return f; } -void save_presets(int do_update); - -void load_presets(void); - -void strcaturl(char *dst, const char *src); - -void strappend(char *dst, const char *src); - -void *file_load(char *fn, int *size); - -extern char *clipboard_text; - void HSV_to_RGB(int h,int s,int v,int *r,int *g,int *b); - void RGB_to_HSV(int r,int g,int b,int *h,int *s,int *v); - void membwand(void * dest, void * src, size_t destsize, size_t srcsize); // a b diff --git a/src/gui/filebrowser/FileBrowserActivity.cpp b/src/gui/filebrowser/FileBrowserActivity.cpp index 19a54b23d..ec1df18fb 100644 --- a/src/gui/filebrowser/FileBrowserActivity.cpp +++ b/src/gui/filebrowser/FileBrowserActivity.cpp @@ -140,7 +140,7 @@ void FileBrowserActivity::DeleteSave(SaveFile * file) String deleteMessage = "Are you sure you want to delete " + file->GetDisplayName() + ".cps?"; if (ConfirmPrompt::Blocking("Delete Save", deleteMessage)) { - remove(file->GetName().c_str()); + Platform::RemoveFile(file->GetName()); loadDirectory(directory, ""); } } diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index f556178f1..1a7038600 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -1004,7 +1004,7 @@ int GameView::Record(bool record) time_t startTime = time(NULL); recordingFolder = startTime; Platform::MakeDirectory("recordings"); - Platform::MakeDirectory(ByteString::Build("recordings", PATH_SEP_CHAR, recordingFolder).c_str()); + Platform::MakeDirectory(ByteString::Build("recordings", PATH_SEP_CHAR, recordingFolder)); recording = true; recordingIndex = 0; }