Nicolas Cannasse 9 سال پیش
والد
کامیت
1ef46bfd2b
5فایلهای تغییر یافته به همراه32 افزوده شده و 16 حذف شده
  1. 15 1
      hl.sln
  2. 8 6
      hl.vcxproj
  3. 4 4
      libs/sdl/gl.c
  4. 4 4
      libs/sdl/sdl.vcxproj
  5. 1 1
      src/std/error.c

+ 15 - 1
hl.sln

@@ -1,10 +1,11 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
+VisualStudioVersion = 14.0.25123.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hl", "hl.vcxproj", "{80755B1F-41F6-4C73-B3F3-8325AEAE1016}"
 	ProjectSection(ProjectDependencies) = postProject
+		{7DDA1414-6675-45C7-8254-42057901F865} = {7DDA1414-6675-45C7-8254-42057901F865}
 		{12049F27-EA26-4A33-ADF8-E542C4167C00} = {12049F27-EA26-4A33-ADF8-E542C4167C00}
 		{C6213FBF-BC2B-4235-A827-84A60E848C52} = {C6213FBF-BC2B-4235-A827-84A60E848C52}
 	EndProjectSection
@@ -16,6 +17,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdl", "libs\sdl\sdl.vcxproj
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hldll", "hldll.vcxproj", "{C6213FBF-BC2B-4235-A827-84A60E848C52}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "libs\fmt\fmt.vcxproj", "{7DDA1414-6675-45C7-8254-42057901F865}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C6213FBF-BC2B-4235-A827-84A60E848C52} = {C6213FBF-BC2B-4235-A827-84A60E848C52}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -48,6 +54,14 @@ Global
 		{C6213FBF-BC2B-4235-A827-84A60E848C52}.Release|Win32.Build.0 = Release|Win32
 		{C6213FBF-BC2B-4235-A827-84A60E848C52}.Release|x64.ActiveCfg = Release|x64
 		{C6213FBF-BC2B-4235-A827-84A60E848C52}.Release|x64.Build.0 = Release|x64
+		{7DDA1414-6675-45C7-8254-42057901F865}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7DDA1414-6675-45C7-8254-42057901F865}.Debug|Win32.Build.0 = Debug|Win32
+		{7DDA1414-6675-45C7-8254-42057901F865}.Debug|x64.ActiveCfg = Debug|x64
+		{7DDA1414-6675-45C7-8254-42057901F865}.Debug|x64.Build.0 = Debug|x64
+		{7DDA1414-6675-45C7-8254-42057901F865}.Release|Win32.ActiveCfg = Release|Win32
+		{7DDA1414-6675-45C7-8254-42057901F865}.Release|Win32.Build.0 = Release|Win32
+		{7DDA1414-6675-45C7-8254-42057901F865}.Release|x64.ActiveCfg = Release|x64
+		{7DDA1414-6675-45C7-8254-42057901F865}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 8 - 6
hl.vcxproj

@@ -77,12 +77,12 @@
     <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;$(Configuration)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
+    <LinkIncremental>true</LinkIncremental>
     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);src</IncludePath>
     <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;$(Configuration)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
+    <LinkIncremental>true</LinkIncremental>
     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);src</IncludePath>
     <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;$(Configuration)</LibraryPath>
   </PropertyGroup>
@@ -97,7 +97,7 @@
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>std.lib;sdl.lib</AdditionalDependencies>
+      <AdditionalDependencies>std.lib;sdl.lib;fmt.lib</AdditionalDependencies>
       <StackReserveSize>0x200000</StackReserveSize>
     </Link>
   </ItemDefinitionGroup>
@@ -112,7 +112,7 @@
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>std.lib;sdl.lib</AdditionalDependencies>
+      <AdditionalDependencies>std.lib;sdl.lib;fmt.lib</AdditionalDependencies>
       <StackReserveSize>0x200000</StackReserveSize>
     </Link>
   </ItemDefinitionGroup>
@@ -126,13 +126,14 @@
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>std.lib;sdl.lib</AdditionalDependencies>
+      <AdditionalDependencies>std.lib;sdl.lib;fmt.lib</AdditionalDependencies>
       <StackReserveSize>0x200000</StackReserveSize>
     </Link>
   </ItemDefinitionGroup>
@@ -145,13 +146,14 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>std.lib;sdl.lib</AdditionalDependencies>
+      <AdditionalDependencies>std.lib;sdl.lib;fmt.lib</AdditionalDependencies>
       <StackReserveSize>0x200000</StackReserveSize>
     </Link>
   </ItemDefinitionGroup>

+ 4 - 4
libs/sdl/gl.c

@@ -168,7 +168,7 @@ HL_PRIM vbyte *HL_NAME(gl_get_program_info_bytes)( vdynamic *p ) {
 	char log[4096];
 	*log = 0;
 	glGetProgramInfoLog(p->v.i, 4096, NULL, log);
-	return hl_copy_bytes(log,strlen(log) + 1);
+	return hl_copy_bytes(log,(int)strlen(log) + 1);
 }
 
 HL_PRIM vdynamic *HL_NAME(gl_get_uniform_location)( vdynamic *p, vstring *name ) {
@@ -206,7 +206,7 @@ HL_PRIM vbyte *HL_NAME(gl_get_shader_info_bytes)( vdynamic *s ) {
 	char log[4096];
 	*log = 0;
 	glGetShaderInfoLog(s->v.i, 4096, NULL, log);
-	return hl_copy_bytes(log, strlen(log)+1);
+	return hl_copy_bytes(log, (int)strlen(log)+1);
 }
 
 HL_PRIM vdynamic *HL_NAME(gl_get_shader_parameter)( vdynamic *s, int param ) {
@@ -341,7 +341,7 @@ HL_PRIM void HL_NAME(gl_disable_vertex_attrib_array)( int attrib ) {
 }
 
 HL_PRIM void HL_NAME(gl_vertex_attrib_pointer)( int index, int size, int type, bool normalized, int stride, int position ) {
-	glVertexAttribPointer(index, size, type, normalized, stride, (void*)position);
+	glVertexAttribPointer(index, size, type, normalized, stride, (void*)(int_val)position);
 }
 
 HL_PRIM void HL_NAME(gl_delete_buffer)( vdynamic *b ) {
@@ -362,5 +362,5 @@ HL_PRIM void HL_NAME(gl_uniform4fv)( vdynamic *u, vbyte *buffer, int bufPos, int
 // draw
 
 HL_PRIM void HL_NAME(gl_draw_elements)( int mode, int count, int type, int start ) {
-	glDrawElements(mode, count, type, (void*)start);
+	glDrawElements(mode, count, type, (void*)(int_val)start);
 }

+ 4 - 4
libs/sdl/sdl.vcxproj

@@ -73,25 +73,25 @@
     <LinkIncremental>true</LinkIncremental>
     <TargetExt>.hdll</TargetExt>
     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../include/sdl/include;../../src;../../include/gl</IncludePath>
-    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;../../include/sdl/lib/x86;../../$(Configuration)</LibraryPath>
+    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;../../$(Configuration);../../include/sdl/lib/x86</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
     <TargetExt>.hdll</TargetExt>
     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../include/sdl/include;../../src;../../include/gl</IncludePath>
-    <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;;../../include/sdl/lib/x64</LibraryPath>
+    <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;../../x64/$(Configuration);../../include/sdl/lib/x64</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
     <TargetExt>.hdll</TargetExt>
     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../include/sdl/include;../../src;../../include/gl</IncludePath>
-    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;../../include/sdl/lib/x86;../../$(Configuration)</LibraryPath>
+    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;../../$(Configuration);../../include/sdl/lib/x86</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
     <TargetExt>.hdll</TargetExt>
     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../include/sdl/include;../../src;../../include/gl</IncludePath>
-    <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;;../../include/sdl/lib/x64</LibraryPath>
+    <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;../../x64/$(Configuration);../../include/sdl/lib/x64</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>

+ 1 - 1
src/std/error.c

@@ -101,7 +101,7 @@ HL_PRIM varray *hl_exception_stack() {
 		void *addr = stack_trace[i];
 		uchar *str = hl_resolve_symbol(addr);
 		if( str == NULL ) {
-			int size = usprintf(tmp,32,USTR("@0x%X"),(int)addr);
+			int size = usprintf(tmp,32,USTR("@0x%X"),(int)(int_val)addr);
 			str = (uchar*)hl_copy_bytes((vbyte*)tmp,sizeof(uchar)*(size+1));
 		}
 		hl_aptr(a,vbyte*)[i] = (vbyte*)str;