Skip to content

Commit

Permalink
Fixed build paths, added comparison warnings, other misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bfiete committed Oct 5, 2019
1 parent dae5c6c commit f4c2520
Show file tree
Hide file tree
Showing 19 changed files with 231 additions and 49 deletions.
4 changes: 2 additions & 2 deletions BeefLibs/MiniZ/src/Zip.bf
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ namespace IDE.Util

static void tdefl_start_dynamic_block(tdefl_compressor* d)
{
uint32 num_lit_codes, num_dist_codes, num_bit_lengths; uint32 i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count, rle_repeat_count, packed_code_sizes_index;
int32 num_lit_codes, num_dist_codes, num_bit_lengths; int32 i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count, rle_repeat_count, packed_code_sizes_index;
uint8[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1] code_sizes_to_pack = ?;
uint8[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1] packed_code_sizes = ?;
uint8 prev_code_size = 0xFF;
Expand Down Expand Up @@ -3068,7 +3068,7 @@ namespace IDE.Util
ZIP_ARRAY_ELEMENT!<uint32>(&pZip.m_pState.m_sorted_central_dir_offsets, i) = (uint32)i;
comp_size = (int32)ReadLE32!(p + ZIP_CDH_COMPRESSED_SIZE_OFS);
decomp_size = (int32)ReadLE32!(p + ZIP_CDH_DECOMPRESSED_SIZE_OFS);
if (((ReadLE32!(p + ZIP_CDH_METHOD_OFS) == 0) && (decomp_size != comp_size)) || ((decomp_size != 0) && (comp_size == 0)) || (decomp_size == 0xFFFFFFFF) || (comp_size == 0xFFFFFFFF))
if (((ReadLE32!(p + ZIP_CDH_METHOD_OFS) == 0) && (decomp_size != comp_size)) || ((decomp_size != 0) && (comp_size == 0)) || (decomp_size == -1) || (comp_size == -1))
return false;
disk_index = ReadLE16!(p + ZIP_CDH_DISK_START_OFS);
if ((disk_index != num_this_disk) && (disk_index != 1))
Expand Down
8 changes: 4 additions & 4 deletions BeefLibs/corlib/src/Reflection/Convert.bf
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ namespace System.Reflection
case .Int8: return (val >= -0x80) && (val <= 0x7F);
case .Int16: return (val >= -0x8000) && (val <= 0x7FFF);
case .Int32: return (val >= -0x80000000) && (val <= 0x7FFF'FFFF);
case .Int64: return (val >= -0x80000000'00000000) && (val <= 0x7FFFFFFF'FFFFFFFF);
case .Int64: return true;
case .UInt8, .Char8: return (val >= 0) && (val <= 0xFF);
case .UInt16, .Char16: return (val >= 0) && (val <= 0xFFFF);
case .UInt32, .Char32: return (val >= 0) && (val <= 0xFFFFFFFF);
case .UInt64: return (val >= 0) && (val <= 0x7FFFFFFF'FFFFFFFF);
case .UInt64: return (val >= 0);
#if BF_64_BIT
case .Int: return (val >= -0x80000000'00000000) && (val <= 0x7FFFFFFF'FFFFFFFF);
case .UInt: return (val >= 0) && (val <= 0x7FFFFFFF'FFFFFFFF);
case .Int: return true;
case .UInt: return (val >= 0);
#else
case .Int: return (val >= -0x80000000) && (val <= 0x7FFF'FFFF);
case .UInt: return (val >= 0) && (val <= 0xFFFFFFFF);
Expand Down
34 changes: 17 additions & 17 deletions BeefTools/BeefMem/BeefMem.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug Static|Win32">
Expand Down Expand Up @@ -231,32 +231,32 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>$(ProjectName)64_d</TargetName>
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
<TargetName>$(ProjectName)64_d</TargetName>
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>$(ProjectName)64</TargetName>
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
<TargetName>$(ProjectName)64</TargetName>
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
<OutDir>$(SolutionDir)\dist\</OutDir>
<OutDir>$(SolutionDir)\IDE\dist\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -301,8 +301,8 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<OutputFile>$(SolutionDir)\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\dist\$(TargetName).lib</ImportLibrary>
<OutputFile>$(SolutionDir)\IDE\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\IDE\dist\$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
Expand All @@ -320,8 +320,8 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<OutputFile>$(SolutionDir)\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\dist\$(TargetName).lib</ImportLibrary>
<OutputFile>$(SolutionDir)\IDE\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\IDE\dist\$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down Expand Up @@ -377,8 +377,8 @@
<GenerateDebugInformation>Debug</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(SolutionDir)\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\dist\$(TargetName).lib</ImportLibrary>
<OutputFile>$(SolutionDir)\IDE\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\IDE\dist\$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
Expand All @@ -397,8 +397,8 @@
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(SolutionDir)\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\dist\$(TargetName).lib</ImportLibrary>
<OutputFile>$(SolutionDir)\IDE\dist\$(TargetName).dll</OutputFile>
<ImportLibrary>$(SolutionDir)\IDE\dist\$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?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">
Expand Down Expand Up @@ -39,7 +39,7 @@
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions BeefySysLib/BeefySysLib_static.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<TargetName>$(ProjectName)_d</TargetName>
<LibraryPath>third_party\AK\lib\debug;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2007%29\Lib\x86;$(LibraryPath);$(WindowsSDK_LibraryPath_x86)</LibraryPath>
<IntDir>$(Platform)\$(Configuration)_static\</IntDir>
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
Expand All @@ -90,6 +91,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Platform)\$(Configuration)_static\</IntDir>
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
4 changes: 2 additions & 2 deletions BeefySysLib/gfx/FTFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ void FTFontManager::ClearCache()

FTFontManager::Page::~Page()
{
mTexture->Release();
//delete mTexture;
}

Expand Down Expand Up @@ -266,8 +267,7 @@ FTFontManager::Glyph* FTFont::AllocGlyph(int charCode, bool allowDefault)
else
img.mBits[i] = 0xFF0000FF;
}
page->mTexture = gBFApp->mRenderDevice->LoadTexture(&img, TextureFlag_NoPremult);
page->mTexture->mRefCount = 0;
page->mTexture = gBFApp->mRenderDevice->LoadTexture(&img, TextureFlag_NoPremult);
}

if (bitmap.width > 0)
Expand Down
2 changes: 1 addition & 1 deletion BeefySysLib/util/BeefPerf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1781,4 +1781,4 @@ BP_EXPORT const char* BP_CALLTYPE BpDynStr(const char* str)
return str;
}

#endif
#endif
8 changes: 5 additions & 3 deletions Debugger32/Debugger32.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand Down Expand Up @@ -106,19 +106,21 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<IncludePath>$(VSInstallDir)\DIA SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<IncludePath>$(VSInstallDir)\DIA SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IncludePath>$(VSInstallDir)\DIA SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IncludePath>$(VSInstallDir)\DIA SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down
4 changes: 3 additions & 1 deletion Debugger64/Debugger64.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<IncludePath>$(VSInstallDir)\DIA SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(IncludePath)</IncludePath>
</PropertyGroup>
Expand All @@ -116,9 +116,11 @@
<IncludePath>$(VSInstallDir)\DIA SDK\include;;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IncludePath>$(VSInstallDir)\DIA SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)\ide\dist\$(Platform)\$(Configuration)\</OutDir>
<IncludePath>$(VSInstallDir)\DIA SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down
18 changes: 10 additions & 8 deletions IDE/src/BuildContext.bf
Original file line number Diff line number Diff line change
Expand Up @@ -831,19 +831,23 @@ namespace IDE
return true;

Workspace.Options workspaceOptions = gApp.GetCurWorkspaceOptions();
BfCompiler bfCompiler = gApp.mBfBuildCompiler;
BfCompiler bfCompiler = gApp.mBfBuildCompiler;
var bfProject = gApp.mBfBuildSystem.mProjectMap[project];
bool bfHadOutputChanges;
bool bfHadOutputChanges = false;
List<String> bfFileNames = scope List<String>();
bfCompiler.GetOutputFileNames(bfProject, true, out bfHadOutputChanges, bfFileNames);
defer ClearAndDeleteItems(bfFileNames);//DeleteAndClearItems!(bfFileNames);
if (project.mCurBfOutputFileNames == null)
{
project.mCurBfOutputFileNames = new .();
bfCompiler.GetOutputFileNames(bfProject, true, out bfHadOutputChanges, project.mCurBfOutputFileNames);
}
for (var fileName in project.mCurBfOutputFileNames)
bfFileNames.Add(fileName);
if (bfHadOutputChanges)
project.mNeedsTargetRebuild = true;

List<ProjectSource> allFileNames = scope List<ProjectSource>();
List<String> clangAllObjNames = scope List<String>();
//List<String> clangObjNames = scope List<String>();


gApp.GetClangFiles(project.mRootFolder, allFileNames);

String workspaceBuildDir = scope String();
Expand All @@ -853,8 +857,6 @@ namespace IDE
if (!projectBuildDir.IsEmpty)
Directory.CreateDirectory(projectBuildDir).IgnoreError();

//List<String> buildFileNames = new List<String>();

String targetPath = scope String();

String outputDir = scope String();
Expand Down
2 changes: 2 additions & 0 deletions IDE/src/Project.bf
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,8 @@ namespace IDE
public bool mFailed;
public bool mNeedsCreate;

public List<String> mCurBfOutputFileNames ~ DeleteContainerAndItems!(_);

public String ProjectFileName
{
get
Expand Down
2 changes: 1 addition & 1 deletion IDE/src/ui/WelcomePanel.bf
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace IDE.ui
public override void Draw(Graphics g)
{
using (g.PushColor(0x40000000))
g.FillRect(mWidth/2 - GS!(500), YOfs - GS!(24), GS!(500)*2, 570);
g.FillRect(mWidth/2 - GS!(500), YOfs - GS!(24), GS!(500)*2, GS!(570));

g.SetFont(mLargeFont);
using (g.PushColor(0xFFE0E0FF))
Expand Down
Loading

0 comments on commit f4c2520

Please sign in to comment.