diff options
-rw-r--r-- | doc/TODO | 15 | ||||
-rw-r--r-- | doc/manual.html | 10 | ||||
-rw-r--r-- | src/filesystem/filesystem.cc | 29 | ||||
-rw-r--r-- | src/game/Makefile.am | 3 | ||||
-rw-r--r-- | src/render/tga.cc | 2 | ||||
-rw-r--r-- | src/sys/sys.cc | 11 |
6 files changed, 46 insertions, 24 deletions
@@ -82,13 +82,13 @@ client: keyboard repeat (ok) fix tracking camera (ok) shift/ctrl/alt modifier key binds (ok) + fast fullscreen/windowed mode switch (ok) fix camera frustum clip (size issue, postponed) view_next, view_prev (ok) tracking camera absolute speed/position visual feedback on impulse drive - fast fullscreen/windowed mode switch render: render pipeline (ok) @@ -111,7 +111,7 @@ sound: engine sounds (ok) user interface sounds (ok) - enitity/event positional sounds + entity/event positional sounds impulse/jump drive sound events game: @@ -124,9 +124,8 @@ game: jumpgates (required docking) win32 port: - network not functional (ok) - texture loading is broken (ok) - screenshots are broken (ok) - sound is broken (ok) - - directory creation is broken + network (ok) + texture loading (ok) + screenshots (ok) + sound (ok) + directory creation (ok) diff --git a/doc/manual.html b/doc/manual.html index b788485..7508b4b 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -295,15 +295,11 @@ osiriond +set sv_name My Osirion Server written to client.cfg and server.cfg. If you run into problems, check those files or delete them. <h2> - Note for windows32 users + Note for windows users </h2> <p> - On windows32, the game uses the <i>home</i> subdirectory as your personal - directory. For example, the client.ini can be found as <i>home\base\client.ini</i>. -<p> - There is also a problem that prevents the game from creating directories. - If you need any subdirectories like <i>screenshots</i> in your personal folder, - you will have to create it manually. + On windows32, the game uses the <i>My Documents\My Games\Osirion</i> subdirectory as your personal + directory. For example, the client.ini can be found as <i>My Documents\My Games\Osirion\base\client.ini</i>. </body> </html> diff --git a/src/filesystem/filesystem.cc b/src/filesystem/filesystem.cc index 0fec129..3404296 100644 --- a/src/filesystem/filesystem.cc +++ b/src/filesystem/filesystem.cc @@ -8,6 +8,13 @@ #include <list> +#ifdef _WIN32 + +#include <windows.h> +#include <shlobj.h> + +#endif + #include "filesystem/filesystem.h" #include "filesystem/diskfile.h" #include "filesystem/file.h" @@ -54,8 +61,25 @@ void init(std::string const & basename, std::string const & modname) filesystem_homedir.assign(getenv("HOME")); filesystem_homedir.append("/.osirion/"); #else - // FIXME win32 - filesystem_homedir.assign("home/"); + char mydocuments[512]; + memset(mydocuments, 0, sizeof(mydocuments)); + + SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, mydocuments); + filesystem_homedir.assign(mydocuments); + + if (filesystem_homedir.size()) { + filesystem_homedir.append("\\My Games"); + if (!sys::isdirectory(filesystem_homedir)) + sys::mkdir(filesystem_homedir); + + filesystem_homedir.append("\\Osirion"); + if (!sys::isdirectory(filesystem_homedir)) + sys::mkdir(filesystem_homedir); + + filesystem_homedir.append("\\"); + } else { + filesystem_homedir.assign("home/"); + } #endif std::string current_datadir("data/"); @@ -77,7 +101,6 @@ void init(std::string const & basename, std::string const & modname) sys::mkdir(filesystem_homedir); sys::mkdir(filesystem_writedir); - // modname search path if (filesystem_modname.size()) { // HOME/modname diff --git a/src/game/Makefile.am b/src/game/Makefile.am index 0ff1ba5..ff591eb 100644 --- a/src/game/Makefile.am +++ b/src/game/Makefile.am @@ -7,5 +7,4 @@ libgame_la_SOURCES = game.cc jumppoint.cc navpoint.cc planet.cc racetrack.cc \ noinst_LTLIBRARIES = libgame.la noinst_HEADERS = game.h navpoint.h planet.h racetrack.h ship.h shipmodel.h \ - star.h -_SOURCES = jumppoint.h + star.h jumppoint.h diff --git a/src/render/tga.cc b/src/render/tga.cc index d9e5cb2..a7a2356 100644 --- a/src/render/tga.cc +++ b/src/render/tga.cc @@ -167,7 +167,7 @@ Image *TGA::load(const char *filename) while (index < tga_width * tga_height) { unsigned char rle = 0; - unsigned char pixel_data[channels]; + unsigned char pixel_data[3]; // read RLE packet byte tga_file->read(&rle, 1); diff --git a/src/sys/sys.cc b/src/sys/sys.cc index 3aec456..db2be4d 100644 --- a/src/sys/sys.cc +++ b/src/sys/sys.cc @@ -10,6 +10,7 @@ #include <windows.h> #include <sys/types.h> #include <sys/stat.h> +#include <direct.h> #else @@ -22,6 +23,7 @@ #endif +#include <stdio.h> #include <stdlib.h> #include <string> @@ -62,12 +64,15 @@ bool isdirectory(std::string const &path) void mkdir(std::string const &path) { #ifdef _WIN32 -/* std::string p(path); for (size_t i = 0; i < p.size(); i++) if (p[i] == '/') p[i] = '\\'; - mkdir(p.c_str()); -*/ + if (p.size() && (p[p.size()-1] == '\\')) + p.erase(p.size() -1, 1); + + if (_mkdir(p.c_str()) != 0) { + con_warn << "Could not create directory '" << p << "'" << std::endl; + } #else ::mkdir(path.c_str(), 0777); |