mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Make osal as separate library.
I need filesystem functions in the plugin, thus I decided to move osal code from GLideNHQ to osal lib.
This commit is contained in:
parent
757ac8135a
commit
f212710ea7
|
@ -5,11 +5,14 @@ VisualStudioVersion = 12.0.31101.0
|
|||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLideN64", "GLideN64.vcxproj", "{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C} = {7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}
|
||||
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756} = {DA965BCF-2219-47AF-ACE7-EAF76D5D4756}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLideNHQ", "libGLideNHQ.vcxproj", "{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osal", "osal.vcxproj", "{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug_mupenplus|Win32 = Debug_mupenplus|Win32
|
||||
|
@ -49,6 +52,20 @@ Global
|
|||
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release|Win32.Build.0 = Release|Win32
|
||||
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
|
||||
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_mupenplus|Win32.ActiveCfg = Debug|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_mupenplus|Win32.Build.0 = Debug|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.MinSizeRel|Win32.ActiveCfg = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.MinSizeRel|Win32.Build.0 = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_dll|Win32.ActiveCfg = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_dll|Win32.Build.0 = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_mupenplus|Win32.ActiveCfg = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_mupenplus|Win32.Build.0 = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release|Win32.Build.0 = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
|
||||
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.RelWithDebInfo|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -111,10 +111,10 @@
|
|||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../src/osal;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetype253MT_D.lib;..\..\src\GLideNUI\debug\GLideNUI.lib;GLideNHQ\Debug\libGLideNHQ.lib;opengl32.lib;glu32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>freetype253MT_D.lib;..\..\src\GLideNUI\debug\GLideNUI.lib;osal\Debug\osal.lib;GLideNHQ\Debug\libGLideNHQ.lib;opengl32.lib;glu32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>c:\Games\N64\Plugin\GLideN64.dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)New glNintendo64().pdb</ProgramDatabaseFile>
|
||||
|
@ -136,12 +136,12 @@
|
|||
<PrecompiledHeaderFile>glN64.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../src/osal;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetype253MT_D.lib;GLideNHQ\Debug\libGLideNHQ.lib;opengl32.lib;glu32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>freetype253MT_D.lib;osal\Debug\osal.lib;GLideNHQ\Debug\libGLideNHQ.lib;opengl32.lib;glu32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>c:\Games\N64\M64Py\mupen64plus-video-GLideN64.dll </OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)New glNintendo64().pdb</ProgramDatabaseFile>
|
||||
|
@ -168,10 +168,10 @@
|
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../src/osal;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetype253MT.lib;..\..\src\GLideNUI\release\GLideNUI.lib;GLideNHQ\Release\libGLideNHQ.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>freetype253MT.lib;..\..\src\GLideNUI\release\GLideNUI.lib;osal\Release\osal.lib;GLideNHQ\Release\libGLideNHQ.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>c:\Games\N64\Plugin\GLideN64.dll</OutputFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
@ -197,12 +197,12 @@
|
|||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../src/inc;../../src/osal;../../../freetype/include</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetype253MT.lib;GLideNHQ\Release\libGLideNHQ.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>freetype253MT.lib;osal\Release\osal.lib;GLideNHQ\Release\libGLideNHQ.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>c:\Games\N64\M64Py\mupen64plus-video-GLideN64.dll</OutputFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\src\inc;..\..\src\GLideNHQ\osal;..\..\src\GLideNHQ\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\src\inc;..\..\src\osal;..\..\src\GLideNHQ\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AssemblerListingLocation>Debug/</AssemblerListingLocation>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
|
@ -133,7 +133,7 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\src\inc;..\..\src\GLideNHQ\osal;..\..\src\GLideNHQ\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\src\inc;..\..\src\osal;..\..\src\GLideNHQ\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AssemblerListingLocation>Release/</AssemblerListingLocation>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
|
@ -145,7 +145,7 @@
|
|||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;_WINDOWS;NDEBUG;WIN32;OS_WINDOWS;_CRT_SECURE_NO_WARNINGS;DEBUG;__MSC__;CMAKE_INTDIR="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;_WINDOWS;NDEBUG;OS_WINDOWS;_CRT_SECURE_NO_WARNINGS;__MSC__;CMAKE_INTDIR="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
|
@ -269,7 +269,6 @@
|
|||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\GLideNHQ\osal\osal_files_win32.c" />
|
||||
<ClCompile Include="..\..\src\GLideNHQ\TextureFilters.cpp" />
|
||||
<ClCompile Include="..\..\src\GLideNHQ\TextureFilters_2xsai.cpp" />
|
||||
<ClCompile Include="..\..\src\GLideNHQ\TextureFilters_hq2x.cpp" />
|
||||
|
|
|
@ -46,9 +46,6 @@
|
|||
<ClCompile Include="..\..\src\GLideNHQ\TextureFilters.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\GLideNHQ\osal\osal_files_win32.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
|
|
84
projects/msvc12/osal.vcxproj
Normal file
84
projects/msvc12/osal.vcxproj
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}</ProjectGuid>
|
||||
<RootNamespace>osal</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)osal\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)osal\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;UNICODE;OS_WINDOWS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;UNICODE;OS_WINDOWS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\osal\osal_files.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\osal\osal_files_win32.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
23
projects/msvc12/osal.vcxproj.filters
Normal file
23
projects/msvc12/osal.vcxproj.filters
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\osal\osal_files.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\osal\osal_files_win32.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -80,7 +80,9 @@ else(MUPENPLUSAPI)
|
|||
set(GLideN64_DLL_NAME GLideN64)
|
||||
endif(MUPENPLUSAPI)
|
||||
|
||||
add_subdirectory(GLideNHQ)
|
||||
add_subdirectory( osal )
|
||||
include_directories( osal )
|
||||
add_subdirectory( GLideNHQ )
|
||||
include_directories( GLideNHQ )
|
||||
|
||||
if(UNIX)
|
||||
|
@ -192,9 +194,9 @@ if( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||
)
|
||||
|
||||
if(SDL)
|
||||
target_link_libraries(${GLideN64_DLL_NAME} PRIVATE ${OPENGL_LIBRARIES} ${SDL_LIBRARIES} ${FREETYPE_LIBRARIES} GLideNHQd )
|
||||
target_link_libraries(${GLideN64_DLL_NAME} PRIVATE ${OPENGL_LIBRARIES} ${SDL_LIBRARIES} ${FREETYPE_LIBRARIES} osald GLideNHQd )
|
||||
else(SDL)
|
||||
target_link_libraries(${GLideN64_DLL_NAME} PRIVATE ${OPENGL_LIBRARIES} ${FREETYPE_LIBRARIES} GLideNHQd )
|
||||
target_link_libraries(${GLideN64_DLL_NAME} PRIVATE ${OPENGL_LIBRARIES} ${FREETYPE_LIBRARIES} osald GLideNHQd )
|
||||
endif(SDL)
|
||||
endif( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
|
@ -208,9 +210,9 @@ if( CMAKE_BUILD_TYPE STREQUAL "Release")
|
|||
)
|
||||
|
||||
if(SDL)
|
||||
target_link_libraries(${GLideN64_DLL_NAME} ${OPENGL_LIBRARIES} ${SDL_LIBRARIES} ${FREETYPE_LIBRARIES} GLideNHQ )
|
||||
target_link_libraries(${GLideN64_DLL_NAME} ${OPENGL_LIBRARIES} ${SDL_LIBRARIES} ${FREETYPE_LIBRARIES} osal GLideNHQ )
|
||||
else(SDL)
|
||||
target_link_libraries(${GLideN64_DLL_NAME} PRIVATE ${OPENGL_LIBRARIES} ${FREETYPE_LIBRARIES} GLideNHQ )
|
||||
target_link_libraries(${GLideN64_DLL_NAME} PRIVATE ${OPENGL_LIBRARIES} ${FREETYPE_LIBRARIES} osal GLideNHQ )
|
||||
endif(SDL)
|
||||
endif( CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
|
||||
|
|
|
@ -21,14 +21,13 @@ set(GLideNHQ_SOURCES
|
|||
)
|
||||
|
||||
if(PANDORA)
|
||||
include_directories( osal )
|
||||
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../osal )
|
||||
else(PANDORA)
|
||||
include_directories( inc osal )
|
||||
include_directories( inc ${CMAKE_CURRENT_SOURCE_DIR}/../osal )
|
||||
endif(PANDORA)
|
||||
LINK_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/lib )
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND GLideNHQ_SOURCES osal/osal_files_unix.c)
|
||||
add_definitions(
|
||||
-DNDEBUG
|
||||
-DOS_LINUX
|
||||
|
@ -36,7 +35,6 @@ if(UNIX)
|
|||
endif(UNIX)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND GLideNHQ_SOURCES osal/osal_files_win32.c)
|
||||
LINK_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/lib )
|
||||
add_definitions(
|
||||
-DWIN32
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "TxCache.h"
|
||||
#include "TxDbg.h"
|
||||
#include "osal_files.h"
|
||||
#include <osal_files.h>
|
||||
#include <zlib.h>
|
||||
#include <memory.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <thread>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "osal_files.h"
|
||||
#include <osal_files.h>
|
||||
#include "TxFilter.h"
|
||||
#include "TextureFilters.h"
|
||||
#include "TxDbg.h"
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
#include "TxHiResCache.h"
|
||||
#include "TxDbg.h"
|
||||
#include "osal_files.h"
|
||||
#include <osal_files.h>
|
||||
#include <zlib.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "TxTexCache.h"
|
||||
#include "TxDbg.h"
|
||||
#include "osal_files.h"
|
||||
#include <osal_files.h>
|
||||
#include <zlib.h>
|
||||
|
||||
TxTexCache::~TxTexCache()
|
||||
|
|
53
src/osal/CMakeLists.txt
Normal file
53
src/osal/CMakeLists.txt
Normal file
|
@ -0,0 +1,53 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
project( osal )
|
||||
|
||||
LINK_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/lib )
|
||||
|
||||
if(UNIX)
|
||||
set(OSAL_SOURCES osal_files_unix.c)
|
||||
add_definitions(
|
||||
-DNDEBUG
|
||||
-DOS_LINUX
|
||||
)
|
||||
endif(UNIX)
|
||||
|
||||
if(WIN32)
|
||||
set(OSAL_SOURCES osal_files_win32.c)
|
||||
add_definitions(
|
||||
-DOS_WINDOWS
|
||||
-D_CRT_SECURE_NO_WARNINGS
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
# Build type
|
||||
|
||||
if( NOT CMAKE_BUILD_TYPE)
|
||||
set( CMAKE_BUILD_TYPE Release)
|
||||
endif( NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
if( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set( CMAKE_BUILD_TYPE Debug)
|
||||
set( DEBUG_BUILD TRUE)
|
||||
add_definitions(
|
||||
-DDEBUG
|
||||
)
|
||||
endif( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
add_definitions( -D__MSC__)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET(GCC_CPP11_COMPILE_FLAGS "-std=c++0x")
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_CPP11_COMPILE_FLAGS} -static -fPIC " )
|
||||
SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -fPIC " )
|
||||
endif()
|
||||
|
||||
if( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_library( osald STATIC ${OSAL_SOURCES})
|
||||
endif( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
if( CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
add_library( osal STATIC ${OSAL_SOURCES})
|
||||
endif( CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
@ -33,23 +33,33 @@ extern "C" {
|
|||
#define OSAL_DIR_SEPARATOR_STR L"/"
|
||||
#define OSAL_DIR_SEPARATOR_CHAR L'/'
|
||||
|
||||
#if defined(WIN32)
|
||||
#define PATH_MAX _MAX_PATH
|
||||
#define strdup _strdup
|
||||
#if defined(OS_WINDOWS)
|
||||
#define EXPORT __declspec(dllexport)
|
||||
#define CALL __cdecl
|
||||
#define PATH_MAX _MAX_PATH
|
||||
#define strdup _strdup
|
||||
#else /* Not WIN32 */
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 260
|
||||
#endif
|
||||
#define EXPORT __attribute__((visibility("default")))
|
||||
#define CALL
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 260
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int osal_is_directory(const wchar_t* name);
|
||||
int osal_mkdirp(const wchar_t *dirpath);
|
||||
int osal_path_existsA(const char *path);
|
||||
int osal_path_existsW(const wchar_t *path);
|
||||
// Returns 1 if name contains path to a directory, 0 otherwise
|
||||
EXPORT int CALL osal_is_directory(const wchar_t* name);
|
||||
// Returns 1 if path points to file or directory, 0 otherwise
|
||||
EXPORT int CALL osal_path_existsA(const char *path);
|
||||
// Returns 1 if path points to file or directory, 0 otherwise
|
||||
EXPORT int CALL osal_path_existsW(const wchar_t *path);
|
||||
// Returns 0 if all directories on the path exist or successfully created
|
||||
// Returns 1 if path is bad
|
||||
// Returns 2 if we can't create some directory on the path
|
||||
EXPORT int CALL osal_mkdirp(const wchar_t *dirpath);
|
||||
|
||||
void * osal_search_dir_open(const wchar_t *_pathname);
|
||||
const wchar_t *osal_search_dir_read_next(void * dir_handle);
|
||||
void osal_search_dir_close(void * dir_handle);
|
||||
EXPORT void * CALL osal_search_dir_open(const wchar_t *_pathname);
|
||||
EXPORT const wchar_t * CALL osal_search_dir_read_next(void * dir_handle);
|
||||
EXPORT void CALL osal_search_dir_close(void * dir_handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
|
@ -35,13 +35,17 @@
|
|||
|
||||
/* global functions */
|
||||
|
||||
int osal_path_existsA(const char *path)
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
EXPORT int CALL osal_path_existsA(const char *path)
|
||||
{
|
||||
struct stat fileinfo;
|
||||
return stat(path, &fileinfo) == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
int osal_path_existsW(const wchar_t *_path)
|
||||
EXPORT int CALL osal_path_existsW(const wchar_t *_path)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
wcstombs(path, _path, PATH_MAX);
|
||||
|
@ -49,7 +53,7 @@ int osal_path_existsW(const wchar_t *_path)
|
|||
return stat(path, &fileinfo) == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
int osal_is_directory(const wchar_t * _name)
|
||||
EXPORT int CALL osal_is_directory(const wchar_t * _name)
|
||||
{
|
||||
char name[PATH_MAX + 1];
|
||||
wcstombs(name, _name, PATH_MAX);
|
||||
|
@ -63,7 +67,7 @@ int osal_is_directory(const wchar_t * _name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int osal_mkdirp(const wchar_t *_dirpath)
|
||||
EXPORT int CALL osal_mkdirp(const wchar_t *_dirpath)
|
||||
{
|
||||
char dirpath[PATH_MAX];
|
||||
wcstombs(dirpath, _dirpath, PATH_MAX);
|
||||
|
@ -109,7 +113,7 @@ int osal_mkdirp(const wchar_t *_dirpath)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void * osal_search_dir_open(const wchar_t *_pathname)
|
||||
EXPORT void * CALL osal_search_dir_open(const wchar_t *_pathname)
|
||||
{
|
||||
char pathname[PATH_MAX];
|
||||
wcstombs(pathname, _pathname, PATH_MAX);
|
||||
|
@ -118,7 +122,7 @@ void * osal_search_dir_open(const wchar_t *_pathname)
|
|||
return dir;
|
||||
}
|
||||
|
||||
const wchar_t *osal_search_dir_read_next(void * dir_handle)
|
||||
EXPORT const wchar_t * CALL osal_search_dir_read_next(void * dir_handle)
|
||||
{
|
||||
static wchar_t last_filename[PATH_MAX];
|
||||
DIR *dir = (DIR *) dir_handle;
|
||||
|
@ -131,8 +135,11 @@ const wchar_t *osal_search_dir_read_next(void * dir_handle)
|
|||
return last_filename;
|
||||
}
|
||||
|
||||
void osal_search_dir_close(void * dir_handle)
|
||||
EXPORT void CALL osal_search_dir_close(void * dir_handle)
|
||||
{
|
||||
closedir((DIR *) dir_handle);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -35,19 +35,23 @@
|
|||
|
||||
/* global functions */
|
||||
|
||||
int osal_path_existsA(const char *path)
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
EXPORT int CALL osal_path_existsA(const char *path)
|
||||
{
|
||||
struct _stat fileinfo;
|
||||
return _stat(path, &fileinfo) == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
int osal_path_existsW(const wchar_t *path)
|
||||
EXPORT int CALL osal_path_existsW(const wchar_t *path)
|
||||
{
|
||||
struct _stat fileinfo;
|
||||
return _wstat(path, &fileinfo) == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
int osal_is_directory(const wchar_t* _name)
|
||||
EXPORT int CALL osal_is_directory(const wchar_t* _name)
|
||||
{
|
||||
wchar_t DirName[MAX_PATH + 1];
|
||||
int namelen = 0;
|
||||
|
@ -61,7 +65,7 @@ int osal_is_directory(const wchar_t* _name)
|
|||
return (GetFileAttributes(DirName) & FILE_ATTRIBUTE_DIRECTORY);
|
||||
}
|
||||
|
||||
int osal_mkdirp(const wchar_t * dirpath)
|
||||
EXPORT int CALL osal_mkdirp(const wchar_t * dirpath)
|
||||
{
|
||||
struct _stat fileinfo;
|
||||
size_t dirpathlen = wcslen(dirpath);
|
||||
|
@ -102,7 +106,7 @@ typedef struct {
|
|||
WIN32_FIND_DATA find_data;
|
||||
} dir_search_info;
|
||||
|
||||
void * osal_search_dir_open(const wchar_t *pathname)
|
||||
EXPORT void * CALL osal_search_dir_open(const wchar_t *pathname)
|
||||
{
|
||||
wchar_t SearchString[MAX_PATH + 1];
|
||||
dir_search_info *pInfo = (dir_search_info *)malloc(sizeof(dir_search_info));
|
||||
|
@ -123,7 +127,7 @@ void * osal_search_dir_open(const wchar_t *pathname)
|
|||
return (void *) pInfo;
|
||||
}
|
||||
|
||||
const wchar_t *osal_search_dir_read_next(void * search_info)
|
||||
EXPORT const wchar_t * CALL osal_search_dir_read_next(void * search_info)
|
||||
{
|
||||
static wchar_t last_filename[_MAX_PATH];
|
||||
dir_search_info *pInfo = (dir_search_info *) search_info;
|
||||
|
@ -141,7 +145,7 @@ const wchar_t *osal_search_dir_read_next(void * search_info)
|
|||
return last_filename;
|
||||
}
|
||||
|
||||
void osal_search_dir_close(void * search_info)
|
||||
EXPORT void CALL osal_search_dir_close(void * search_info)
|
||||
{
|
||||
dir_search_info *pInfo = (dir_search_info *) search_info;
|
||||
|
||||
|
@ -152,3 +156,7 @@ void osal_search_dir_close(void * search_info)
|
|||
free(pInfo);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user