diff --git a/source/graphics/MapReader.h b/source/graphics/MapReader.h index f7601acf44..8b76d4a28b 100755 --- a/source/graphics/MapReader.h +++ b/source/graphics/MapReader.h @@ -2,7 +2,7 @@ #define _MAPREADER_H #include "MapIO.h" -#include "res/handle.h" +#include "lib/res/handle.h" #include "CStr.h" #include "LightEnv.h" #include "FileUnpacker.h" diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index a8e5c6d777..cab3702efa 100755 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -1,7 +1,7 @@ #include "precompiled.h" #include "lib/types.h" -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" #include "MapWriter.h" #include "MapReader.h" diff --git a/source/graphics/Material.cpp b/source/graphics/Material.cpp index 984363b5a5..6eb710031e 100755 --- a/source/graphics/Material.cpp +++ b/source/graphics/Material.cpp @@ -1,7 +1,7 @@ #include "precompiled.h" #include "ogl.h" -#include "res/res.h" +#include "lib/res/res.h" #include "Material.h" #include "Player.h" #include "Game.h" diff --git a/source/graphics/MiniPatch.h b/source/graphics/MiniPatch.h index c923569569..c89cd47559 100755 --- a/source/graphics/MiniPatch.h +++ b/source/graphics/MiniPatch.h @@ -9,7 +9,7 @@ #ifndef _MINIPATCH_H #define _MINIPATCH_H -#include "res/handle.h" +#include "lib/res/handle.h" class CPatch; diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp index 68385b2368..cd86f3e5ca 100755 --- a/source/graphics/Model.cpp +++ b/source/graphics/Model.cpp @@ -16,7 +16,7 @@ #include "SkeletonAnimDef.h" #include "SkeletonAnimManager.h" #include "MeshManager.h" -#include "lib/res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" #include "lib/res/h_mgr.h" #include "Profile.h" diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp index 0388fab43c..0b577d5ad8 100755 --- a/source/graphics/ObjectEntry.cpp +++ b/source/graphics/ObjectEntry.cpp @@ -15,7 +15,7 @@ #include "ps/Xeromyces.h" #include "ps/XMLWriter.h" -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" #include diff --git a/source/graphics/SkeletonAnimManager.cpp b/source/graphics/SkeletonAnimManager.cpp index d7c6ca636d..6b2d8adba7 100755 --- a/source/graphics/SkeletonAnimManager.cpp +++ b/source/graphics/SkeletonAnimManager.cpp @@ -8,7 +8,7 @@ #include "precompiled.h" -#include "res/res.h" +#include "lib/res/res.h" #include "Model.h" #include "CLogger.h" #include "SkeletonAnimManager.h" diff --git a/source/graphics/Sprite.cpp b/source/graphics/Sprite.cpp index b3900cd985..8a3d88d24f 100755 --- a/source/graphics/Sprite.cpp +++ b/source/graphics/Sprite.cpp @@ -29,7 +29,7 @@ #include "Sprite.h" #include "Renderer.h" #include "ogl.h" -#include "res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" CSprite::CSprite() : m_texture(NULL) diff --git a/source/graphics/Terrain.cpp b/source/graphics/Terrain.cpp index e1628b61fb..ca2442e5dd 100755 --- a/source/graphics/Terrain.cpp +++ b/source/graphics/Terrain.cpp @@ -8,8 +8,8 @@ #include "precompiled.h" -#include "res/ogl_tex.h" -#include "res/mem.h" +#include "lib/res/graphics/ogl_tex.h" +#include "lib/res/mem.h" #include #include "Terrain.h" diff --git a/source/graphics/Texture.h b/source/graphics/Texture.h index aebc380b85..baea42b08b 100755 --- a/source/graphics/Texture.h +++ b/source/graphics/Texture.h @@ -12,7 +12,7 @@ #ifndef _TEXTURE_H #define _TEXTURE_H -#include "res/handle.h" +#include "lib/res/handle.h" #include "CStr.h" class CTexture diff --git a/source/graphics/TextureEntry.cpp b/source/graphics/TextureEntry.cpp index 5817e8ac0d..c63f02a28f 100755 --- a/source/graphics/TextureEntry.cpp +++ b/source/graphics/TextureEntry.cpp @@ -3,7 +3,7 @@ #include #include "ogl.h" -#include "res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" #include "CLogger.h" diff --git a/source/graphics/TextureEntry.h b/source/graphics/TextureEntry.h index 0f3ccbd015..9ae7a740c5 100755 --- a/source/graphics/TextureEntry.h +++ b/source/graphics/TextureEntry.h @@ -3,7 +3,7 @@ #include -#include "res/handle.h" +#include "lib/res/handle.h" #include "CStr.h" #include "TextureManager.h" diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp index 9b686fb1b6..9d187e778f 100755 --- a/source/graphics/TextureManager.cpp +++ b/source/graphics/TextureManager.cpp @@ -8,7 +8,7 @@ #include "TerrainProperties.h" #include "lib/res/res.h" -#include "lib/res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" #include "lib/ogl.h" #include "lib/timer.h" diff --git a/source/graphics/TextureManager.h b/source/graphics/TextureManager.h index 782de289e9..67550a9c42 100755 --- a/source/graphics/TextureManager.h +++ b/source/graphics/TextureManager.h @@ -4,7 +4,7 @@ #include #include -#include "res/handle.h" +#include "lib/res/handle.h" #include "CStr.h" #include "Singleton.h" diff --git a/source/graphics/UnitManager.cpp b/source/graphics/UnitManager.cpp index 053d0d5f15..d0e343385f 100755 --- a/source/graphics/UnitManager.cpp +++ b/source/graphics/UnitManager.cpp @@ -8,7 +8,7 @@ #include "precompiled.h" -#include "res/res.h" +#include "lib/res/res.h" #include "Model.h" #include "UnitManager.h" #include "Unit.h" diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 053b6c099a..1ee6b1f95b 100755 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -10,7 +10,7 @@ gee@pyro.nu #include -#include "lib/res/unifont.h" +#include "lib/res/graphics/unifont.h" #include "GUI.h" diff --git a/source/gui/CGUISprite.h b/source/gui/CGUISprite.h index e908e5930a..a36525a57a 100755 --- a/source/gui/CGUISprite.h +++ b/source/gui/CGUISprite.h @@ -28,7 +28,7 @@ gee@pyro.nu #include "GUIutil.h" #include "Overlay.h" -#include "lib/res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" //-------------------------------------------------------- // Macros diff --git a/source/gui/CInput.cpp b/source/gui/CInput.cpp index 65c5165d69..818cb5091d 100755 --- a/source/gui/CInput.cpp +++ b/source/gui/CInput.cpp @@ -13,7 +13,7 @@ gee@pyro.nu // TODO Gee: new #include "OverlayText.h" -#include "lib/res/unifont.h" +#include "lib/res/graphics/unifont.h" #include "ps/Hotkey.h" diff --git a/source/lib/lib.cpp b/source/lib/lib.cpp index a9d875ed25..ca895707bf 100755 --- a/source/lib/lib.cpp +++ b/source/lib/lib.cpp @@ -292,6 +292,14 @@ u32 u64_lo(u64 x) return (u32)(x & 0xffffffff); } +u64 u64_from_u32(u32 hi, u32 lo) +{ + u64 x = (u64)hi; + x <<= 32; + x |= lo; + return x; +} + // input in [0, 1); convert to u8 range diff --git a/source/lib/lib.h b/source/lib/lib.h index 6ba3d7bf8c..210b6e0530 100755 --- a/source/lib/lib.h +++ b/source/lib/lib.h @@ -350,6 +350,8 @@ extern uintptr_t round_up(uintptr_t val, uintptr_t multiple); extern u32 u64_hi(u64 x); extern u32 u64_lo(u64 x); +extern u64 u64_from_u32(u32 hi, u32 lo); + extern u16 fp_to_u16(double in); diff --git a/source/lib/nommgr.h b/source/lib/nommgr.h index fd947652cc..0e58c884cd 100644 --- a/source/lib/nommgr.h +++ b/source/lib/nommgr.h @@ -1,16 +1,18 @@ // remove all of mmgr.h's memory allocation "hooks" - // but only if we actually defined them! #if CONFIG_USE_MMGR || HAVE_VC_DEBUG_ALLOC - -#undef new -#undef delete -#undef malloc -#undef calloc -#undef realloc -#undef free - -#undef strdup -#undef wcsdup -#undef getcwd - +# undef new +# undef delete +# undef malloc +# undef calloc +# undef realloc +# undef free +# undef strdup +# undef wcsdup +# undef getcwd +#endif + +// sanity check +#ifdef new +#error "nommgr.h - something is wrong, new is still defined" #endif diff --git a/source/lib/res/file.cpp b/source/lib/res/file/file.cpp similarity index 99% rename from source/lib/res/file.cpp rename to source/lib/res/file/file.cpp index ca65bef7ac..c08f3b7677 100755 --- a/source/lib/res/file.cpp +++ b/source/lib/res/file/file.cpp @@ -20,7 +20,7 @@ #include "precompiled.h" #include "lib.h" -#include "res.h" +#include "../res.h" #include "file.h" #include "detect.h" #include "adts.h" diff --git a/source/lib/res/file.h b/source/lib/res/file/file.h similarity index 100% rename from source/lib/res/file.h rename to source/lib/res/file/file.h diff --git a/source/lib/res/vfs.cpp b/source/lib/res/file/vfs.cpp similarity index 99% rename from source/lib/res/vfs.cpp rename to source/lib/res/file/vfs.cpp index a1cbade59d..1168e1b373 100755 --- a/source/lib/res/vfs.cpp +++ b/source/lib/res/file/vfs.cpp @@ -33,7 +33,7 @@ #include #include "lib.h" -#include "res.h" +#include "../res.h" #include "zip.h" #include "file.h" #include "adts.h" diff --git a/source/lib/res/vfs.h b/source/lib/res/file/vfs.h similarity index 97% rename from source/lib/res/vfs.h rename to source/lib/res/file/vfs.h index fc4c43521b..67633cfdf0 100755 --- a/source/lib/res/vfs.h +++ b/source/lib/res/file/vfs.h @@ -1,5 +1,6 @@ // virtual file system - transparent access to files in archives; // allows multiple mount points +// this is the public interface. // // Copyright (c) 2004 Jan Wassenberg // @@ -21,7 +22,6 @@ [KEEP IN SYNC WITH WIKI!] - Introduction ------------ @@ -47,9 +47,8 @@ Games typically encompass thousands of files. Such heavy loads expose The solution is to put all files in archives: internal fragmentation is eliminated since they are packed end-to-end; open is much faster; -seeks are avoided by arranging in order of access. - -For more information, see 'Archive Details' below. +seeks are avoided by arranging in order of access. For more information, +see 'Archive Details' below. Note that a good file system (Reiser3 comes close) could also deliver the above. However, this code is available now on all platforms; there is @@ -67,11 +66,12 @@ Since decreases in edit cycle time improve productivity, we want changes to files to be picked up immediately. To that end, we support hotloading - as soon as the OS reports changes, all Handle objects that ensued from that file are reloaded. + The VFS's part in this is registering "watches" that report changes to any mounted real directory. Since the file notification backend (currently SGI FAM and a Win32 port) cannot watch an entire directory tree, -we need to do so for every single directory. The VFS traverses and -stores data for them anyway, we do so here. +we need to do so for every single directory. The VFS traverses each and +stores information anyway, so we do that here. Modding @@ -186,9 +186,9 @@ Decompression is free because it is done in parallel with IOs. #ifndef __VFS_H__ #define __VFS_H__ -#include "handle.h" // Handle def -#include "posix.h" // struct stat -#include "file.h" // file open flags +#include "../handle.h" // Handle def +#include "lib/posix.h" // struct stat +#include "file.h" // file open flags // make the VFS tree ready for use. must be called before all other // functions below unless explicitly mentioned to be allowed. diff --git a/source/lib/res/vfs_mount.cpp b/source/lib/res/file/vfs_mount.cpp similarity index 96% rename from source/lib/res/vfs_mount.cpp rename to source/lib/res/file/vfs_mount.cpp index fc75cd1603..00da34a03c 100644 --- a/source/lib/res/vfs_mount.cpp +++ b/source/lib/res/file/vfs_mount.cpp @@ -4,7 +4,7 @@ #include "vfs_path.h" #include "vfs_tree.h" #include "zip.h" -#include "res.h" +#include "../res.h" struct Stats { diff --git a/source/lib/res/vfs_mount.h b/source/lib/res/file/vfs_mount.h similarity index 93% rename from source/lib/res/vfs_mount.h rename to source/lib/res/file/vfs_mount.h index a69598a0b7..05eaa13f20 100644 --- a/source/lib/res/vfs_mount.h +++ b/source/lib/res/file/vfs_mount.h @@ -1,8 +1,6 @@ #ifndef VFS_MOUNT_H__ #define VFS_MOUNT_H__ -#include "handle.h" - extern void mount_init(); extern void mount_shutdown(); diff --git a/source/lib/res/vfs_path.cpp b/source/lib/res/file/vfs_path.cpp similarity index 100% rename from source/lib/res/vfs_path.cpp rename to source/lib/res/file/vfs_path.cpp diff --git a/source/lib/res/vfs_path.h b/source/lib/res/file/vfs_path.h similarity index 100% rename from source/lib/res/vfs_path.h rename to source/lib/res/file/vfs_path.h diff --git a/source/lib/res/vfs_tree.cpp b/source/lib/res/file/vfs_tree.cpp similarity index 95% rename from source/lib/res/vfs_tree.cpp rename to source/lib/res/file/vfs_tree.cpp index 8e70e6e39b..787e794ccf 100644 --- a/source/lib/res/vfs_tree.cpp +++ b/source/lib/res/file/vfs_tree.cpp @@ -8,10 +8,10 @@ #include #include "lib.h" -#include "res.h" +#include "../res.h" #include "vfs_path.h" #include "vfs_tree.h" -#include "hotload.h" // see NO_DIR_WATCH +#include "../hotload.h" // see NO_DIR_WATCH // we add/cancel directory watches from the VFS mount code for convenience - diff --git a/source/lib/res/vfs_tree.h b/source/lib/res/file/vfs_tree.h similarity index 100% rename from source/lib/res/vfs_tree.h rename to source/lib/res/file/vfs_tree.h diff --git a/source/lib/res/zip.cpp b/source/lib/res/file/zip.cpp similarity index 99% rename from source/lib/res/zip.cpp rename to source/lib/res/file/zip.cpp index f0f20e22df..d36dd8fd67 100755 --- a/source/lib/res/zip.cpp +++ b/source/lib/res/file/zip.cpp @@ -36,7 +36,7 @@ #include "lib.h" #include "zip.h" -#include "res.h" +#include "../res.h" #include "byte_order.h" #include "timer.h" diff --git a/source/lib/res/zip.h b/source/lib/res/file/zip.h similarity index 99% rename from source/lib/res/zip.h rename to source/lib/res/file/zip.h index f49f9c6c4a..4928c210e2 100755 --- a/source/lib/res/zip.h +++ b/source/lib/res/file/zip.h @@ -19,7 +19,7 @@ #ifndef ZIP_H__ #define ZIP_H__ -#include "handle.h" +#include "../handle.h" #include "file.h" // FileCB for zip_enum diff --git a/source/lib/res/cursor.cpp b/source/lib/res/graphics/cursor.cpp similarity index 99% rename from source/lib/res/cursor.cpp rename to source/lib/res/graphics/cursor.cpp index 12abd8a621..b84d843b5d 100755 --- a/source/lib/res/cursor.cpp +++ b/source/lib/res/graphics/cursor.cpp @@ -10,7 +10,7 @@ #include "lib/ogl.h" #include "sysdep/sysdep.h" // sys_cursor_* -#include "res.h" +#include "../res.h" #include "ogl_tex.h" #include "cursor.h" diff --git a/source/lib/res/cursor.h b/source/lib/res/graphics/cursor.h similarity index 100% rename from source/lib/res/cursor.h rename to source/lib/res/graphics/cursor.h diff --git a/source/lib/res/jmemdatasrc.cpp b/source/lib/res/graphics/jmemdatasrc.cpp similarity index 99% rename from source/lib/res/jmemdatasrc.cpp rename to source/lib/res/graphics/jmemdatasrc.cpp index f1973f67f9..e4977cc7c9 100644 --- a/source/lib/res/jmemdatasrc.cpp +++ b/source/lib/res/graphics/jmemdatasrc.cpp @@ -13,7 +13,7 @@ #include "precompiled.h" #include "lib.h" -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" // must come before jpeg-6b headers. diff --git a/source/lib/res/ogl_tex.cpp b/source/lib/res/graphics/ogl_tex.cpp similarity index 99% rename from source/lib/res/ogl_tex.cpp rename to source/lib/res/graphics/ogl_tex.cpp index 997fd526e1..1c8c6f9aad 100755 --- a/source/lib/res/ogl_tex.cpp +++ b/source/lib/res/graphics/ogl_tex.cpp @@ -1,6 +1,6 @@ #include "precompiled.h" -#include "res.h" +#include "../res.h" #include "ogl.h" #include "tex.h" #include "ogl_tex.h" diff --git a/source/lib/res/ogl_tex.h b/source/lib/res/graphics/ogl_tex.h similarity index 97% rename from source/lib/res/ogl_tex.h rename to source/lib/res/graphics/ogl_tex.h index dc3b078183..0dc1707e3c 100755 --- a/source/lib/res/ogl_tex.h +++ b/source/lib/res/graphics/ogl_tex.h @@ -1,7 +1,7 @@ #ifndef OGL_TEX_H__ #define OGL_TEX_H__ -#include "handle.h" +#include "../handle.h" // load and return a handle to the texture given in . // supports RAW, BMP, JP2, PNG, TGA, DDS diff --git a/source/lib/res/tex.cpp b/source/lib/res/graphics/tex.cpp similarity index 99% rename from source/lib/res/tex.cpp rename to source/lib/res/graphics/tex.cpp index 4fd9c2ddb7..a0d8d55529 100755 --- a/source/lib/res/tex.cpp +++ b/source/lib/res/graphics/tex.cpp @@ -25,7 +25,7 @@ #include #include "lib.h" -#include "res.h" +#include "../res.h" #include "tex.h" #include "byte_order.h" diff --git a/source/lib/res/tex.h b/source/lib/res/graphics/tex.h similarity index 98% rename from source/lib/res/tex.h rename to source/lib/res/graphics/tex.h index 2238e9ebcb..487cde8f40 100755 --- a/source/lib/res/tex.h +++ b/source/lib/res/graphics/tex.h @@ -19,7 +19,7 @@ #ifndef __TEX_H__ #define __TEX_H__ -#include "handle.h" +#include "../handle.h" diff --git a/source/lib/res/unifont.cpp b/source/lib/res/graphics/unifont.cpp similarity index 99% rename from source/lib/res/unifont.cpp rename to source/lib/res/graphics/unifont.cpp index 841b2cfb7c..7556bd4007 100755 --- a/source/lib/res/unifont.cpp +++ b/source/lib/res/graphics/unifont.cpp @@ -10,7 +10,7 @@ Unicode OpenGL texture font #include "precompiled.h" #include "lib.h" -#include "res.h" +#include "../res.h" #include "ogl.h" #include "ogl_tex.h" diff --git a/source/lib/res/unifont.h b/source/lib/res/graphics/unifont.h similarity index 98% rename from source/lib/res/unifont.h rename to source/lib/res/graphics/unifont.h index fd61f0769e..1d5e2b396d 100755 --- a/source/lib/res/unifont.h +++ b/source/lib/res/graphics/unifont.h @@ -5,7 +5,7 @@ #include // va_list -#include "handle.h" +#include "../handle.h" // Load and return a handle to the font defined // in fn+".fnt" with texture fn+".tga" diff --git a/source/lib/res/h_mgr.cpp b/source/lib/res/h_mgr.cpp index 0dbbf05716..858fb79eff 100755 --- a/source/lib/res/h_mgr.cpp +++ b/source/lib/res/h_mgr.cpp @@ -19,7 +19,7 @@ #include "precompiled.h" #include "lib.h" -#include "res.h" +#include "h_mgr.h" #include // CHAR_BIT diff --git a/source/lib/res/mem.cpp b/source/lib/res/mem.cpp index 3be28f3729..464f4262ae 100755 --- a/source/lib/res/mem.cpp +++ b/source/lib/res/mem.cpp @@ -3,7 +3,8 @@ #include "precompiled.h" #include "lib.h" -#include "res.h" +#include "h_mgr.h" +#include "mem.h" #include diff --git a/source/lib/res/res.cpp b/source/lib/res/res.cpp index 8edcb6ddaa..89128befa1 100755 --- a/source/lib/res/res.cpp +++ b/source/lib/res/res.cpp @@ -1,7 +1,7 @@ #include "precompiled.h" #include "res.h" -#include "file.h" // file_make_native_path, file_invalidate_cache +#include "file/file.h" // file_make_native_path, file_invalidate_cache #include "timer.h" #include "hotload.h" // we implement that interface diff --git a/source/lib/res/res.h b/source/lib/res/res.h index a6d85c1e46..f0c9556d37 100755 --- a/source/lib/res/res.h +++ b/source/lib/res/res.h @@ -1,5 +1,5 @@ // common headers needed by lib/res code #include "h_mgr.h" -#include "vfs.h" +#include "file/vfs.h" #include "mem.h" diff --git a/source/lib/res/ogghack.cpp b/source/lib/res/sound/ogghack.cpp similarity index 100% rename from source/lib/res/ogghack.cpp rename to source/lib/res/sound/ogghack.cpp diff --git a/source/lib/res/ogghack.h b/source/lib/res/sound/ogghack.h similarity index 100% rename from source/lib/res/ogghack.h rename to source/lib/res/sound/ogghack.h diff --git a/source/lib/res/snd.cpp b/source/lib/res/sound/snd.cpp similarity index 99% rename from source/lib/res/snd.cpp rename to source/lib/res/sound/snd.cpp index 13aeb71efa..4c012bc3df 100755 --- a/source/lib/res/snd.cpp +++ b/source/lib/res/sound/snd.cpp @@ -18,9 +18,6 @@ #include "precompiled.h" -#include "res/res.h" -#include "res/snd.h" - #include // to extract snd_open's definition file contents #include #include @@ -45,6 +42,10 @@ # include "sysdep/win/win_internal.h" #endif +#include "../res.h" +#include "snd.h" + + #define OGG_HACK #include "ogghack.h" diff --git a/source/lib/res/snd.h b/source/lib/res/sound/snd.h similarity index 99% rename from source/lib/res/snd.h rename to source/lib/res/sound/snd.h index 31e7f5dceb..0588f7bf00 100755 --- a/source/lib/res/snd.h +++ b/source/lib/res/sound/snd.h @@ -19,7 +19,7 @@ #ifndef SND_H__ #define SND_H__ -#include "handle.h" +#include "../handle.h" /* diff --git a/source/lib/sysdep/sysdep.h b/source/lib/sysdep/sysdep.h index da5763abcb..695637a81f 100755 --- a/source/lib/sysdep/sysdep.h +++ b/source/lib/sysdep/sysdep.h @@ -81,15 +81,17 @@ enum ErrorReaction ER_EXIT }; -extern ErrorReaction display_error_impl(const wchar_t* text, int flags); - -extern ErrorReaction display_error(const wchar_t* text, int flags, +extern ErrorReaction display_error(const wchar_t* description, int flags, uint skip, void* context, const char* file, int line); // convenience version, in case the advanced parameters aren't needed. // done this way instead of with default values so that it also works in C. #define DISPLAY_ERROR(text) display_error(text, 0, 0, 0, __FILE__, __LINE__) +// internal use only (used by display_error) +extern ErrorReaction display_error_impl(const wchar_t* text, int flags); + + extern void display_msg(const char* caption, const char* msg); extern void wdisplay_msg(const wchar_t* caption, const wchar_t* msg); diff --git a/source/lib/sysdep/win/wdetect.cpp b/source/lib/sysdep/win/wdetect.cpp index 1aa92dc246..9f038b989a 100755 --- a/source/lib/sysdep/win/wdetect.cpp +++ b/source/lib/sysdep/win/wdetect.cpp @@ -20,7 +20,7 @@ #include "detect.h" #include "lib.h" -#include "lib/res/file.h" // file_enum +#include "lib/res/file/file.h" // file_enum #include "win_internal.h" diff --git a/source/lib/sysdep/win/wdir_watch.cpp b/source/lib/sysdep/win/wdir_watch.cpp index c4c4f4a612..848a69db94 100755 --- a/source/lib/sysdep/win/wdir_watch.cpp +++ b/source/lib/sysdep/win/wdir_watch.cpp @@ -19,7 +19,7 @@ #include "lib.h" #include "win_internal.h" -#include "lib/res/file.h" // file_is_subpath +#include "lib/res/file/file.h" // file_is_subpath diff --git a/source/lib/sysdep/win/wposix.cpp b/source/lib/sysdep/win/wposix.cpp index 853953c0d1..d784ee7c36 100755 --- a/source/lib/sysdep/win/wposix.cpp +++ b/source/lib/sysdep/win/wposix.cpp @@ -1,6 +1,6 @@ // misc. POSIX routines for Win32 // -// Copyright (c) 2004 Jan Wassenberg +// Copyright (c) 2004-2005 Jan Wassenberg // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -16,23 +16,20 @@ // Jan.Wassenberg@stud.uni-karlsruhe.de // http://www.stud.uni-karlsruhe.de/~urkt/ -// collection of hacks :P - #include "precompiled.h" +#include +#include + #include "lib.h" #include "posix.h" #include "win_internal.h" #include "sysdep/cpu.h" -#include -#include - - // cast intptr_t to HANDLE; centralized for easier changing, e.g. avoiding // warnings. i = -1 converts to INVALID_HANDLE_VALUE (same value). -static HANDLE cast_to_HANDLE(intptr_t i) +static HANDLE HANDLE_from_intptr(intptr_t i) { return (HANDLE)((char*)0 + i); } @@ -75,10 +72,6 @@ int open(const char* fn, int oflag, ...) int fd = _open(fn, oflag, mode); WIN_RESTORE_LAST_ERROR; -#if CONFIG_PARANOIA -debug_printf("open %s = %d\n", fn, fd); -#endif - // cases when we don't want to open a second AIO-capable handle: // .. stdin/stdout/stderr if(fd <= 2) @@ -93,7 +86,7 @@ debug_printf("open %s = %d\n", fn, fd); // none of the above apply; now re-open the file. // note: this is possible because _open defaults to DENY_NONE sharing. - aio_reopen(fd, fn, oflag); + WARN_ERR(aio_reopen(fd, fn, oflag)); no_aio: @@ -110,17 +103,13 @@ no_aio: int close(int fd) { -#if CONFIG_PARANOIA -debug_printf("close %d\n", fd); -#endif - debug_assert(3 <= fd && fd < 256); // note: there's no good way to notify us that wasn't opened for // AIO, so we could skip aio_close. storing a bit in the fd is evil and // a fd -> info map is redundant (waio already has one). // therefore, we require aio_close to fail gracefully. - aio_close(fd); + WARN_ERR(aio_close(fd)); return _close(fd); } @@ -144,7 +133,7 @@ int write(int fd, void* buf, size_t nbytes) int ioctl(int fd, int op, int* data) { - const HANDLE h = cast_to_HANDLE(_get_osfhandle(fd)); + const HANDLE h = HANDLE_from_intptr(_get_osfhandle(fd)); switch(op) { @@ -351,13 +340,13 @@ struct WDIR // low-level routine). static WDIR global_wdir; -static uintptr_t global_wdir_in_use; +static uintptr_t global_wdir_is_in_use; // zero-initializes the WDIR (code below relies on this) static inline WDIR* wdir_alloc() { // successfully reserved the global instance - if(CAS(&global_wdir_in_use, 0, 1)) + if(CAS(&global_wdir_is_in_use, 0, 1)) { memset(&global_wdir, 0, sizeof(global_wdir)); return &global_wdir; @@ -368,7 +357,7 @@ static inline WDIR* wdir_alloc() static inline void wdir_free(WDIR* d) { if(d == &global_wdir) - global_wdir_in_use = 0; + global_wdir_is_in_use = 0; else free(d); } @@ -452,7 +441,7 @@ int readdir_stat_np(DIR* d_, struct stat* s) WDIR* d = (WDIR*)d_; memset(s, 0, sizeof(struct stat)); - s->st_size = (off_t)((((u64)d->fd.nFileSizeHigh) << 32) | d->fd.nFileSizeLow); + s->st_size = (off_t)u64_from_u32(d->fd.nFileSizeHigh, d->fd.nFileSizeLow); s->st_mode = (d->fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)? S_IFDIR : S_IFREG; s->st_mtime = filetime_to_time_t(&d->fd.ftLastWriteTime); return 0; @@ -572,48 +561,58 @@ int mprotect(void* addr, size_t len, int prot) } +// called when flags & MAP_ANONYMOUS +static int map_mem(void* start, size_t len, int prot, int flags, int fd, void** pp) +{ + // sanity checks. we don't care about these but enforce them to + // ensure callers are compatible with mmap. + // .. MAP_ANONYMOUS is documented to require this. + debug_assert(fd == -1); + // .. if MAP_SHARED, writes are to change "the underlying [mapped] + // object", but there is none here (we're backed by the page file). + debug_assert(flags & MAP_PRIVATE); + + // see explanation at MAP_NORESERVE definition. + DWORD flAllocationType = (flags & MAP_NORESERVE)? MEM_RESERVE : MEM_COMMIT; + DWORD flProtect = win32_prot(prot); + void* p = VirtualAlloc(start, len, flAllocationType, flProtect); + if(!p) + return ERR_NO_MEM; + *pp = p; + return 0; +} + + // given mmap prot and flags, output protection/access values for use with // CreateFileMapping / MapViewOfFile. they only support read-only, // read/write and copy-on-write, so we dumb it down to that and later // set the correct (and more restrictive) permission via mprotect. -static int mmap_access(int prot, int flags, DWORD& flProtect, DWORD& dwAccess, SECURITY_ATTRIBUTES*& psec) +static int map_file_access(int prot, int flags, DWORD& flProtect, DWORD& dwAccess) { - SECURITY_ATTRIBUTES* saved_psec = psec; - - // assume read-only with default security; other cases handled below. + // assume read-only; other cases handled below. flProtect = PAGE_READONLY; dwAccess = FILE_MAP_READ; - psec = 0; - // we go to a bit of trouble and return a NULL pointer in the - // default case; this is more efficient. if(prot & PROT_WRITE) { - flProtect = PAGE_READWRITE; - dwAccess = FILE_MAP_WRITE; // read and write - // determine write behavior: (whether they change the underlying file) switch(flags & (MAP_SHARED|MAP_PRIVATE)) { - // .. POSIX says asking for both isn't allowed. - case MAP_SHARED|MAP_PRIVATE: - return ERR_INVALID_PARAM; - // .. changes are written to file and shared between processes. + // .. changes are written to file. case MAP_SHARED: - psec = saved_psec; - psec->nLength = sizeof(SECURITY_ATTRIBUTES); - psec->lpSecurityDescriptor = 0; - psec->bInheritHandle = TRUE; + flProtect = PAGE_READWRITE; + dwAccess = FILE_MAP_WRITE; // read and write break; - // .. copy-on-write mapping; writes do not affect the file or - // other processes. + // .. copy-on-write mapping; writes do not affect the file. case MAP_PRIVATE: flProtect = PAGE_WRITECOPY; dwAccess = FILE_MAP_COPY; break; - // .. changes are written to file but the handle isn't shareable. + // .. either none or both of the flags are set. the latter is + // definitely illegal according to POSIX and some man pages + // say exactly one must be set, so abort. default: - break; + return ERR_INVALID_PARAM; } } @@ -621,80 +620,88 @@ static int mmap_access(int prot, int flags, DWORD& flProtect, DWORD& dwAccess, S } -void* mmap(void* user_start, size_t len, int prot, int flags, int fd, off_t ofs) +static int map_file(void* start, size_t len, int prot, int flags, + int fd, off_t ofs, void** pp) { - { + debug_assert(fd != -1); // handled by mmap_mem + WIN_SAVE_LAST_ERROR; - int err; - // assume fd = -1 (requesting mapping backed by page file), - // so that we notice invalid file handles below. - HANDLE hFile = INVALID_HANDLE_VALUE; - if(fd != -1) - { - hFile = cast_to_HANDLE(_get_osfhandle(fd)); - if(hFile == INVALID_HANDLE_VALUE) - { - debug_warn("mmap: invalid file handle"); - goto fail; - } - } + HANDLE hFile = HANDLE_from_intptr(_get_osfhandle(fd)); + if(hFile == INVALID_HANDLE_VALUE) + return ERR_INVALID_PARAM; - // if MAP_FIXED, user_start is the start address; otherwise, - // MapViewOfFileEx will choose an address. - void* start = 0; - if(flags & MAP_FIXED) - { - start = user_start; - if(start == 0) // debug_assert below would fire - goto fail; - } + // MapViewOfFileEx will fail if the "suggested" base address is + // nonzero but cannot be honored, so wipe out unless MAP_FIXED. + if(!(flags & MAP_FIXED)) + start = 0; // choose protection and access rights for CreateFileMapping / // MapViewOfFile. these are weaker than what PROT_* allows and // are augmented below by subsequently mprotect-ing. DWORD flProtect; DWORD dwAccess; - SECURITY_ATTRIBUTES sec_; SECURITY_ATTRIBUTES* psec = &sec_; - err = mmap_access(prot, flags, flProtect, dwAccess, psec); - if(err < 0) - goto fail; + RETURN_ERR(map_file_access(prot, flags, flProtect, dwAccess)); // enough foreplay; now actually map. - // .. split size/offset into 32 bit values for the API. - // careful! C++ doesn't allow shifting 32-bit types by 32 bits. - const DWORD len_hi = u64_hi(len), len_lo = u64_lo(len); - const DWORD ofs_hi = u64_hi(ofs), ofs_lo = u64_lo(ofs); - const HANDLE hMap = CreateFileMapping(hFile, psec, flProtect, len_hi, len_lo, (LPCSTR)0); + const HANDLE hMap = CreateFileMapping(hFile, 0, flProtect, 0, 0, (LPCSTR)0); // .. create failed; bail now to avoid overwriting the last error value. if(!hMap) - goto fail; - void* addr = MapViewOfFileEx(hMap, dwAccess, ofs_hi, ofs_lo, (SIZE_T)len, start); + return ERR_NO_MEM; + const DWORD ofs_hi = u64_hi(ofs), ofs_lo = u64_lo(ofs); + void* p = MapViewOfFileEx(hMap, dwAccess, ofs_hi, ofs_lo, (SIZE_T)len, start); // .. make sure we got the requested address if MAP_FIXED was passed. - debug_assert(!(flags & MAP_FIXED) || (addr == start)); + debug_assert(!(flags & MAP_FIXED) || (p == start)); // .. free the mapping object now, so that we don't have to hold on to its // handle until munmap(). it's not actually released yet due to the // reference held by MapViewOfFileEx (if it succeeded). CloseHandle(hMap); // .. map failed; bail now to avoid "restoring" the last error value. - if(!addr) - goto fail; + if(!p) + return ERR_NO_MEM; // slap on correct (more restrictive) permissions. - WARN_ERR(mprotect(addr, len, prot)); + WARN_ERR(mprotect(p, len, prot)); WIN_RESTORE_LAST_ERROR; - return addr; + *pp = p; + return 0; +} + + +void* mmap(void* start, size_t len, int prot, int flags, int fd, off_t ofs) +{ + void* p; + int err; + if(flags & MAP_ANONYMOUS) + err = map_mem(start, len, prot, flags, fd, &p); + else + err = map_file(start, len, prot, flags, fd, ofs, &p); + if(err < 0) + { + WARN_ERR(err); + return MAP_FAILED; } -fail: - return (void*)MAP_FAILED; + return p; } int munmap(void* start, size_t UNUSED(len)) { + // UnmapViewOfFile checks if start was returned by MapViewOfFile*; + // if not, it will fail. BOOL ok = UnmapViewOfFile(start); - return ok? 0 : -1; + if(!ok) + // VirtualFree requires dwSize to be 0 (entire region is released). + ok = VirtualFree(start, 0, MEM_RELEASE); + + // both failed + if(!ok) + { + debug_warn("munmap failed"); + return -1; + } + return 0; } diff --git a/source/lib/sysdep/win/wposix.h b/source/lib/sysdep/win/wposix.h index 44bbad276f..47c9019bbb 100755 --- a/source/lib/sysdep/win/wposix.h +++ b/source/lib/sysdep/win/wposix.h @@ -203,9 +203,20 @@ extern int readdir_stat_np(DIR*, struct stat*); #define PROT_EXEC 0x04 // mmap flags -#define MAP_SHARED 0x01 // share changes across processes -#define MAP_PRIVATE 0x02 // private copy-on-write mapping +#define MAP_SHARED 0x01 // writes change the underlying file +#define MAP_PRIVATE 0x02 // writes do not affect the file (copy-on-write) #define MAP_FIXED 0x04 +// .. non-portable +#define MAP_ANONYMOUS 0x10 +#define MAP_NORESERVE 0x20 + +// note: we need a means of only "reserving" virtual address ranges +// for the fixed-address expandable array mechanism. the non-portable +// MAP_NORESERVE flag says that no space in the page file need be reserved. +// the caller can still try to access the entire mapping, but might get +// SIGBUS if there isn't enough room to commit a page. Linux currently +// doesn't commit mmap-ed regions anyway, but we specify this flag to +// make sure of that in the future. #define MAP_FAILED 0 diff --git a/source/main.cpp b/source/main.cpp index c0ca9e7b43..8601fa61af 100755 --- a/source/main.cpp +++ b/source/main.cpp @@ -18,10 +18,10 @@ #include "lib/timer.h" #include "lib/input.h" #include "lib/res/res.h" -#include "lib/res/tex.h" -#include "lib/res/snd.h" -#include "lib/res/hotload.h" -#include "lib/res/cursor.h" +#include "lib/res/hotload.h" // xxx +#include "lib/res/sound/snd.h" +#include "lib/res/graphics/tex.h" +#include "lib/res/graphics/cursor.h" #include "ps/Profile.h" #include "ps/ProfileViewer.h" diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index f8081ed227..385be22e70 100755 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -13,7 +13,7 @@ #include "Network/Client.h" #include "Network/Server.h" -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" #include "Interact.h" diff --git a/source/ps/CConsole.h b/source/ps/CConsole.h index 5fed084fca..7ee8e33278 100755 --- a/source/ps/CConsole.h +++ b/source/ps/CConsole.h @@ -15,7 +15,7 @@ #include #include -#include "res/unifont.h" +#include "lib/res/graphics/unifont.h" #include "ogl.h" #include "lib.h" #include "sdl.h" diff --git a/source/ps/CStr.h b/source/ps/CStr.h index 1c97dfc864..b69008f87b 100755 --- a/source/ps/CStr.h +++ b/source/ps/CStr.h @@ -64,8 +64,6 @@ enum PS_TRIM_MODE { PS_TRIM_LEFT, PS_TRIM_RIGHT, PS_TRIM_BOTH }; #include #include "ps/utf16string.h" -#include "Network/Serialization.h" - class CStr8; class CStrW; diff --git a/source/ps/CVFSFile.cpp b/source/ps/CVFSFile.cpp index 4d7a11fc30..f5e54e6541 100755 --- a/source/ps/CVFSFile.cpp +++ b/source/ps/CVFSFile.cpp @@ -3,7 +3,7 @@ #include "CVFSFile.h" #include "lib/res/mem.h" -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" #include "ps/CLogger.h" #define LOG_CATEGORY "file" diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp index 2ddefd9616..fbf4bf0c4c 100755 --- a/source/ps/ConfigDB.cpp +++ b/source/ps/ConfigDB.cpp @@ -4,11 +4,9 @@ #include "Parser.h" #include "ConfigDB.h" #include "CLogger.h" -#include "res/vfs.h" -#include "res/file.h" -#include "res/mem.h" +#include "lib/res/file/vfs.h" +#include "lib/res/mem.h" #include "scripting/ScriptingHost.h" -#include "lib/types.h" #define LOG_CATEGORY "config" diff --git a/source/ps/FilePacker.cpp b/source/ps/FilePacker.cpp index 79854b86a8..463107d412 100755 --- a/source/ps/FilePacker.cpp +++ b/source/ps/FilePacker.cpp @@ -14,7 +14,7 @@ # include #endif #include -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" //////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/ps/FileUnpacker.cpp b/source/ps/FileUnpacker.cpp index a6ead26d80..86867a9d22 100755 --- a/source/ps/FileUnpacker.cpp +++ b/source/ps/FileUnpacker.cpp @@ -9,7 +9,7 @@ #include "precompiled.h" #include "FileUnpacker.h" -#include "res/res.h" +#include "lib/res/res.h" //////////////////////////////////////////////////////////////////////////////////////// // CFileUnpacker constructor diff --git a/source/ps/Font.cpp b/source/ps/Font.cpp index 663192974c..0f83b7a714 100755 --- a/source/ps/Font.cpp +++ b/source/ps/Font.cpp @@ -3,7 +3,7 @@ #include "Font.h" #include "ps/ConfigDB.h" -#include "lib/res/unifont.h" +#include "lib/res/graphics/unifont.h" #include "ps/CLogger.h" #define LOG_CATEGORY "graphics" diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp index 90a6d9a6f1..128d7ed25d 100644 --- a/source/ps/ProfileViewer.cpp +++ b/source/ps/ProfileViewer.cpp @@ -2,7 +2,7 @@ #include "ProfileViewer.h" #include "Profile.h" #include "Renderer.h" -#include "res/unifont.h" +#include "lib/res/graphics/unifont.h" #include "Hotkey.h" bool profileVisible = false; diff --git a/source/ps/VFSUtil.cpp b/source/ps/VFSUtil.cpp index 76bad2f648..4bf9e04f9a 100755 --- a/source/ps/VFSUtil.cpp +++ b/source/ps/VFSUtil.cpp @@ -1,8 +1,7 @@ #include "precompiled.h" #include "VFSUtil.h" -#include "lib/res/vfs.h" -#include "lib/res/vfs_path.h" +#include "lib/res/file/vfs.h" #include "CLogger.h" #define LOG_CATEGORY "vfs" diff --git a/source/ps/VFSUtil.h b/source/ps/VFSUtil.h index 9f3516c6af..4e08ef79ee 100755 --- a/source/ps/VFSUtil.h +++ b/source/ps/VFSUtil.h @@ -1,5 +1,5 @@ #include "ps/CStr.h" -#include "res/vfs.h" +#include "lib/res/file/vfs.h" namespace VFSUtil { diff --git a/source/ps/XML.h b/source/ps/XML.h index ea4c3bd9c4..ff24677d1d 100755 --- a/source/ps/XML.h +++ b/source/ps/XML.h @@ -1,5 +1,5 @@ /* - XMLUtils.h - Xerces wrappers & convenience functions + XML.h - Xerces wrappers & convenience functions AUTHOR : Simon Brenner , EXAMPLE : diff --git a/source/ps/XMLUtils.cpp b/source/ps/XMLUtils.cpp index d1a8c9d81b..7fc3b8c99b 100755 --- a/source/ps/XMLUtils.cpp +++ b/source/ps/XMLUtils.cpp @@ -1,15 +1,12 @@ #include "precompiled.h" -#include "nommgr.h" #include "XML.h" -#include "nommgr.h" // undefine 'new' a lot, because Xerces doesn't like it - #include "CStr.h" #include "CLogger.h" #include "posix.h" // ptrdiff_t -#include "res/vfs.h" -#include "res/mem.h" +#include "lib/res/file/vfs.h" +#include "lib/res/mem.h" #define LOG_CATEGORY "xml" @@ -89,8 +86,10 @@ BinInputStream *CVFSInputSource::makeStream() const { if (m_pBuffer > 0) { +#include "nommgr.h" return new BinMemInputStream((XMLByte *)m_pBuffer, (unsigned int)m_BufferSize, BinMemInputStream::BufOpt_Reference); +#include "mmgr.h" } else return NULL; @@ -111,7 +110,9 @@ const char *prevpathcomp(const char *end, const char *beginning) InputSource *CVFSEntityResolver::resolveEntity(const XMLCh *const UNUSED(publicId), const XMLCh *const systemId) { +#include "nommgr.h" CVFSInputSource *ret=new CVFSInputSource(); +#include "mmgr.h" char *path=XMLString::transcode(systemId); char *orgpath=path; @@ -156,8 +157,9 @@ InputSource *CVFSEntityResolver::resolveEntity(const XMLCh *const UNUSED(publicI path=abspath; } + // janwas: removed for less spew // LOG(NORMAL, LOG_CATEGORY, "EntityResolver: path \"%s\" translated to \"%s\"", orgpath, path); -// janwas: less spew + char *pos=path; if ((pos=strchr(pos, '\\')) != NULL) diff --git a/source/ps/XMLWriter.cpp b/source/ps/XMLWriter.cpp index 51dc7e15c7..ea456c3152 100644 --- a/source/ps/XMLWriter.cpp +++ b/source/ps/XMLWriter.cpp @@ -3,7 +3,7 @@ #include "XMLWriter.h" #include "ps/CLogger.h" -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" // TODO (maybe): Write to the VFS handle frequently, instead of buffering // the entire file, so that large files get written faster. diff --git a/source/ps/Xeromyces.cpp b/source/ps/Xeromyces.cpp index 116704b95e..e3b879075a 100755 --- a/source/ps/Xeromyces.cpp +++ b/source/ps/Xeromyces.cpp @@ -10,7 +10,7 @@ #include "ps/Xeromyces.h" #include "ps/CLogger.h" -#include "lib/res/vfs.h" +#include "lib/res/file/vfs.h" #define ZLIB_DLL #include "zlib.h" // for crc32 diff --git a/source/renderer/ModelRData.cpp b/source/renderer/ModelRData.cpp index ee75c17a63..5912084d41 100755 --- a/source/renderer/ModelRData.cpp +++ b/source/renderer/ModelRData.cpp @@ -2,7 +2,7 @@ #include -#include "res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" #include "Renderer.h" #include "TransparencyRenderer.h" #include "PlayerRenderer.h" diff --git a/source/renderer/PatchRData.cpp b/source/renderer/PatchRData.cpp index d8fe6b8c64..e548b0c9e1 100755 --- a/source/renderer/PatchRData.cpp +++ b/source/renderer/PatchRData.cpp @@ -4,7 +4,7 @@ #include #include #include "Pyrogenesis.h" -#include "res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" #include "Renderer.h" #include "PatchRData.h" #include "AlphaMapCalculator.h" diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 4ddd42d64b..15e988392c 100755 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -34,9 +34,9 @@ #include "ModelDef.h" #include "ogl.h" -#include "res/mem.h" -#include "res/tex.h" -#include "res/ogl_tex.h" +#include "lib/res/mem.h" +#include "lib/res/graphics/tex.h" +#include "lib/res/graphics/ogl_tex.h" #include "timer.h" #define LOG_CATEGORY "graphics" diff --git a/source/renderer/VertexBuffer.h b/source/renderer/VertexBuffer.h index ee76a7ab76..3913b5e0b5 100755 --- a/source/renderer/VertexBuffer.h +++ b/source/renderer/VertexBuffer.h @@ -10,7 +10,7 @@ #define _VERTEXBUFFER_H #include "lib.h" -#include "res/ogl_tex.h" +#include "lib/res/graphics/ogl_tex.h" #include #include diff --git a/source/scripting/ScriptingHost.cpp b/source/scripting/ScriptingHost.cpp index bede7442ba..72b20f5110 100755 --- a/source/scripting/ScriptingHost.cpp +++ b/source/scripting/ScriptingHost.cpp @@ -8,7 +8,7 @@ #include "Profile.h" #include "ps/CLogger.h" -#include "res/res.h" +#include "lib/res/res.h" #ifdef NDEBUG diff --git a/source/sound/JSI_Sound.cpp b/source/sound/JSI_Sound.cpp index f10be8b3d7..9926373a4c 100755 --- a/source/sound/JSI_Sound.cpp +++ b/source/sound/JSI_Sound.cpp @@ -2,7 +2,7 @@ #include "JSI_Sound.h" #include "Vector3D.h" -#include "lib/res/snd.h" +#include "lib/res/sound/snd.h" #include "lib/res/h_mgr.h" // h_filename