diff --git a/src/Misc.cpp b/src/Misc.cpp index 511c3fabb..bd102bd00 100644 --- a/src/Misc.cpp +++ b/src/Misc.cpp @@ -351,183 +351,6 @@ vector2d v2d_new(float x, float y) return result; } -int register_extension() -{ -#if defined(WIN) - int returnval; - LONG rresult; - HKEY newkey; - char *currentfilename = exe_name(); - char *iconname = NULL; - char *opencommand = NULL; - //char AppDataPath[MAX_PATH]; - char *AppDataPath = NULL; - iconname = (char*)malloc(strlen(currentfilename)+6); - sprintf(iconname, "%s,-102", currentfilename); - - //Create Roaming application data folder - /*if(!SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, AppDataPath))) - { - returnval = 0; - goto finalise; - }*/ - - //AppDataPath = _getcwd(NULL, 0); - - //Move Game executable into application data folder - //TODO: Implement - - opencommand = (char*)malloc(strlen(currentfilename)+53+strlen(AppDataPath)); - /*if((strlen(AppDataPath)+strlen(APPDATA_SUBDIR "\\Powder Toy"))\n" -" \n" -" \n" -" Powder Toy save\n" -" \n" -" \n" -" \n" -"\n"; - f = fopen("powdertoy-save.xml", "wb"); - if (!f) - return 0; - fwrite(mimedata, 1, strlen(mimedata), f); - fclose(f); - - const char *desktopfiledata_tmp = -"[Desktop Entry]\n" -"Type=Application\n" -"Name=Powder Toy\n" -"Comment=Physics sandbox game\n" -"MimeType=application/vnd.powdertoy.save;\n" -"NoDisplay=true\n"; - char *desktopfiledata = (char *)malloc(strlen(desktopfiledata_tmp)+strlen(currentfilename)+100); - strcpy(desktopfiledata, desktopfiledata_tmp); - strappend(desktopfiledata, "Exec="); - strappend(desktopfiledata, currentfilename); - strappend(desktopfiledata, " open %f\n"); - f = fopen("powdertoy-tpt.desktop", "wb"); - if (!f) - return 0; - fwrite(desktopfiledata, 1, strlen(desktopfiledata), f); - fclose(f); - system("xdg-mime install powdertoy-save.xml"); - system("xdg-desktop-menu install powdertoy-tpt.desktop"); - f = fopen("powdertoy-save-32.png", "wb"); - if (!f) - return 0; - fwrite(icon_doc_32_png, 1, sizeof(icon_doc_32_png), f); - fclose(f); - f = fopen("powdertoy-save-16.png", "wb"); - if (!f) - return 0; - fwrite(icon_doc_16_png, 1, sizeof(icon_doc_16_png), f); - fclose(f); - system("xdg-icon-resource install --noupdate --context mimetypes --size 32 powdertoy-save-32.png application-vnd.powdertoy.save"); - system("xdg-icon-resource install --noupdate --context mimetypes --size 16 powdertoy-save-16.png application-vnd.powdertoy.save"); - system("xdg-icon-resource forceupdate"); - system("xdg-mime default powdertoy-tpt.desktop application/vnd.powdertoy.save"); - unlink("powdertoy-save-32.png"); - unlink("powdertoy-save-16.png"); - unlink("powdertoy-save.xml"); - unlink("powdertoy-tpt.desktop"); - return 1; -#elif defined MACOSX - return 0; -#endif -} - void HSV_to_RGB(int h,int s,int v,int *r,int *g,int *b)//convert 0-255(0-360 for H) HSV values to 0-255 RGB { float hh, ss, vv, c, x; diff --git a/src/Misc.h b/src/Misc.h index 6bbbd3a05..418298f08 100644 --- a/src/Misc.h +++ b/src/Misc.h @@ -72,8 +72,6 @@ void *file_load(char *fn, int *size); extern char *clipboard_text; -int register_extension(); - int cpu_check(void); void HSV_to_RGB(int h,int s,int v,int *r,int *g,int *b);