Skip to content

Commit dd4bcb1

Browse files
committed
屏蔽字体功能
1 parent 31bedec commit dd4bcb1

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

smallpot.dll/smallpot.dll.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<TargetName>smallpot</TargetName>
104104
</PropertyGroup>
105105
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
106-
<TargetName>smallpotd</TargetName>
106+
<TargetName>smallpot</TargetName>
107107
</PropertyGroup>
108108
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
109109
<ClCompile>

src/Engine.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
#include <windows.h>
55
#pragma comment(lib, "user32.lib")
66
#endif
7-
#include "ft2build.h"
8-
9-
#include "freetype/freetype.h"
10-
#include "freetype/ftglyph.h"
117

128
#if defined(_WIN32) && defined(WITH_SMALLPOT)
139
#include "PotDll.h"
@@ -95,8 +91,9 @@ int Engine::init(void* handle /*= nullptr*/, int handle_type /*= 0*/, int maximi
9591
//logo_ = loadImage("logo.png");
9692
showLogo();
9793
renderPresent();
94+
#ifndef _WINDLL
9895
TTF_Init();
99-
96+
#endif
10097
#ifdef _MSC_VER
10198
RECT r;
10299
SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)&r, 0);
@@ -807,6 +804,7 @@ Texture* Engine::createRectTexture(int w, int h, int style) const
807804

808805
Texture* Engine::createTextTexture(const std::string& fontname, const std::string& text, int size, Color c) const
809806
{
807+
#ifndef _WINDLL
810808
auto font = TTF_OpenFont(fontname.c_str(), size);
811809
if (!font)
812810
{
@@ -817,10 +815,13 @@ Texture* Engine::createTextTexture(const std::string& fontname, const std::strin
817815
SDL_DestroySurface(text_s);
818816
TTF_CloseFont(font);
819817
return text_t;
818+
#endif
819+
return nullptr;
820820
}
821821

822822
Texture* Engine::createTextTexture(const std::string& fontname, wchar_t text, int size, Color c) const
823823
{
824+
#ifndef _WINDLL
824825
FT_Library library{ nullptr };
825826
FT_Face face{ nullptr };
826827
FT_GlyphSlot slot{ nullptr };
@@ -880,6 +881,8 @@ Texture* Engine::createTextTexture(const std::string& fontname, wchar_t text, in
880881
SDL_DestroySurface(text_s);
881882
//TTF_CloseFont(font);
882883
return text_t;
884+
#endif
885+
return nullptr;
883886
}
884887

885888
int Engine::showMessage(const std::string& content) const

src/PotPlayer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,16 @@ int PotPlayer::eventLoop()
600600

601601
int PotPlayer::init()
602602
{
603+
int maximum = 0;
603604
#ifndef _WINDLL
604605
Config::getInstance().init(run_path_);
605-
int maximum = Config::getInstance()["windows_maximized"];
606+
maximum = Config::getInstance()["windows_maximized"];
607+
#endif
606608
if (engine_->init(handle_, handle_type_, maximum))
607609
{
608610
return -1;
609611
}
612+
#ifndef _WINDLL
610613
#ifdef _WIN32
611614
sys_encode_ = Config::getInstance().get("sys_encode", "cp936");
612615
#else
@@ -655,6 +658,8 @@ int PotPlayer::beginWithFile(std::string filename)
655658
}
656659
//首次运行拖拽的文件也认为是同一个
657660
drop_filename_ = Config::getInstance().findSuitableFilename(filename);
661+
#else
662+
drop_filename_ = filename;
658663
#endif
659664
std::print("Begin with file: {}\n", filename);
660665
auto play_filename = drop_filename_;

0 commit comments

Comments
 (0)