Skip to content

Commit

Permalink
libcurl static crt
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jul 10, 2019
1 parent b3e0eb4 commit 04e36fc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CGSSAssetDownloader.sln → CGSSAssetsDownloader.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CGSSAssetDownloader", "CGSSAssetDownloader.vcxproj", "{9D8C967A-CF50-4A53-9F90-5059F67F9BE9}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CGSSAssetsDownloader", "CGSSAssetsDownloader.vcxproj", "{9D8C967A-CF50-4A53-9F90-5059F67F9BE9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
18 changes: 10 additions & 8 deletions CGSSAssetDownloader.vcxproj → CGSSAssetsDownloader.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,34 @@
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{9D8C967A-CF50-4A53-9F90-5059F67F9BE9}</ProjectGuid>
<RootNamespace>CGSSAssetDownloader</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<RootNamespace>CGSSAssetsDownloader</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>CGSSAssetsDownloader</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -119,8 +120,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(ProjectDir)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcurl_a.lib;libmp3lame-static.lib;libmpghip-static.lib;ws2_32.lib;winmm.lib;wldap32.lib;crypt32.lib;Normaliz.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies>libcurl_a.lib;libmp3lame-static.lib;libmpghip-static.lib;ws2_32.lib;winmm.lib;wldap32.lib;crypt32.lib;Normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down
File renamed without changes.
Binary file modified lib/libcurl_a.lib
Binary file not shown.
15 changes: 9 additions & 6 deletions src/CGSSAssetsDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ static bool wav2mp3(std::string wavPath, std::string mp3Path) {

const int CHANNEL = 2;

short int wav_buffer[WAV_SIZE * CHANNEL];
unsigned char mp3_buffer[MP3_SIZE];
short int *wav_buffer = new short int[WAV_SIZE * CHANNEL];
unsigned char *mp3_buffer = new unsigned char[MP3_SIZE];

lame_t lame = lame_init();
lame_set_in_samplerate(lame, 44100);
Expand All @@ -65,6 +65,8 @@ static bool wav2mp3(std::string wavPath, std::string mp3Path) {
fwrite(mp3_buffer, sizeof(unsigned char), static_cast<size_t>(write), mp3);
} while (read != 0);

delete[] wav_buffer;
delete[] mp3_buffer;
// lame_mp3_tags_fid(lame, mp3);
lame_close(lame);
fclose(mp3);
Expand Down Expand Up @@ -212,15 +214,15 @@ void Downloader::download_single(string file) {
}

void show_introduction() {
printf("CGSSAssetsDownloader VERSION 2.0.0-pre2\n\n");
printf("CGSSAssetsDownloader VERSION 2.0.0\n\n");

printf("Usage: \n");
printf("CGSSAssetsDownloader [-v resource_version] [-a] [-u] [-mp3]\n");
printf("CGSSAssetsDownloader [-v resource_version] [-o option or filename] [-u] [-mp3]\n");
printf("CGSSAssetsDownloader file1 file2 file3 ...\n\n");

printf("Example: \n");
printf("CGSSAssetsDownloader -o -bgm -u\n");
printf("CGSSAssetsDownloader -o bgm -u\n");
printf("CGSSAssetsDownloader -v 10028005 -o gachaselect_30145.unity3d\n");
printf("CGSSAssetsDownloader -v 10031250 -a -u -mp3\n");
printf("CGSSAssetsDownloader path\\to\\NoSuffixFile path\\to\\ACBFile.acb path\\to\\HCAFile.hca ...\n\n");
Expand Down Expand Up @@ -318,10 +320,11 @@ void hcadec (string hcafile) {
}

printf("Decoding %s...\n", hcafile.c_str());
clHCA hca(ciphKey1, ciphKey2);
if (!hca.DecodeToWavefile(hcafile.c_str(), filenameOut, volume, mode, loop)) {
clHCA* hca = new clHCA(ciphKey1, ciphKey2);
if (!hca->DecodeToWavefile(hcafile.c_str(), filenameOut, volume, mode, loop)) {
printf("Error: Decoding failed.\n");
}
delete hca;
}

int exist(void *data, int argc, char **argv, char **azColName) {
Expand Down

0 comments on commit 04e36fc

Please sign in to comment.