Skip to content

Commit 7fee7ec

Browse files
committed
初次提交
0 parents  commit 7fee7ec

285 files changed

Lines changed: 84974 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
build/
21+
bld/
22+
[Bb]in/
23+
[Oo]bj/
24+
25+
# Visual Studio 2015 cache/options directory
26+
.vs/
27+
28+
# MSTest test Results
29+
[Tt]est[Rr]esult*/
30+
[Bb]uild[Ll]og.*
31+
32+
# NUNIT
33+
*.VisualState.xml
34+
TestResult.xml
35+
36+
# Build Results of an ATL Project
37+
[Dd]ebugPS/
38+
[Rr]eleasePS/
39+
dlldata.c
40+
41+
# DNX
42+
project.lock.json
43+
artifacts/
44+
45+
*_i.c
46+
*_p.c
47+
*_i.h
48+
*.ilk
49+
*.meta
50+
*.obj
51+
*.pch
52+
*.pdb
53+
*.pgc
54+
*.pgd
55+
*.rsp
56+
*.sbr
57+
*.tlb
58+
*.tli
59+
*.tlh
60+
*.tmp
61+
*.tmp_proj
62+
*.log
63+
*.vspscc
64+
*.vssscc
65+
.builds
66+
*.pidb
67+
*.svclog
68+
*.scc
69+
70+
# Chutzpah Test files
71+
_Chutzpah*
72+
73+
# Visual C++ cache files
74+
ipch/
75+
*.aps
76+
*.ncb
77+
*.opensdf
78+
*.sdf
79+
*.cachefile
80+
81+
# Visual Studio profiler
82+
*.psess
83+
*.vsp
84+
*.vspx
85+
86+
# TFS 2012 Local Workspace
87+
$tf/
88+
89+
# Guidance Automation Toolkit
90+
*.gpState
91+
92+
# ReSharper is a .NET coding add-in
93+
_ReSharper*/
94+
*.[Rr]e[Ss]harper
95+
*.DotSettings.user
96+
97+
# JustCode is a .NET coding add-in
98+
.JustCode
99+
100+
# TeamCity is a build add-in
101+
_TeamCity*
102+
103+
# DotCover is a Code Coverage Tool
104+
*.dotCover
105+
106+
# NCrunch
107+
_NCrunch_*
108+
.*crunch*.local.xml
109+
110+
# MightyMoose
111+
*.mm.*
112+
AutoTest.Net/
113+
114+
# Web workbench (sass)
115+
.sass-cache/
116+
117+
# Installshield output folder
118+
[Ee]xpress/
119+
120+
# DocProject is a documentation generator add-in
121+
DocProject/buildhelp/
122+
DocProject/Help/*.HxT
123+
DocProject/Help/*.HxC
124+
DocProject/Help/*.hhc
125+
DocProject/Help/*.hhk
126+
DocProject/Help/*.hhp
127+
DocProject/Help/Html2
128+
DocProject/Help/html
129+
130+
# Click-Once directory
131+
publish/
132+
133+
# Publish Web Output
134+
*.[Pp]ublish.xml
135+
*.azurePubxml
136+
# TODO: Comment the next line if you want to checkin your web deploy settings
137+
# but database connection strings (with potential passwords) will be unencrypted
138+
*.pubxml
139+
*.publishproj
140+
141+
# NuGet Packages
142+
*.nupkg
143+
# The packages folder can be ignored because of Package Restore
144+
**/packages/*
145+
# except build/, which is used as an MSBuild target.
146+
!**/packages/build/
147+
# Uncomment if necessary however generally it will be regenerated when needed
148+
#!**/packages/repositories.config
149+
150+
# Windows Azure Build Output
151+
csx/
152+
*.build.csdef
153+
154+
# Windows Store app package directory
155+
AppPackages/
156+
157+
# Visual Studio cache files
158+
# files ending in .cache can be ignored
159+
*.[Cc]ache
160+
# but keep track of directories ending in .cache
161+
!*.[Cc]ache/
162+
163+
# Others
164+
ClientBin/
165+
[Ss]tyle[Cc]op.*
166+
~$*
167+
*~
168+
*.dbmdl
169+
*.dbproj.schemaview
170+
*.pfx
171+
*.publishsettings
172+
node_modules/
173+
orleans.codegen.cs
174+
175+
# RIA/Silverlight projects
176+
Generated_Code/
177+
178+
# Backup & report files from converting an old project file
179+
# to a newer Visual Studio version. Backup files are not needed,
180+
# because we have git ;-)
181+
_UpgradeReport_Files/
182+
Backup*/
183+
UpgradeLog*.XML
184+
UpgradeLog*.htm
185+
186+
# SQL Server files
187+
*.mdf
188+
*.ldf
189+
190+
# Business Intelligence projects
191+
*.rdl.data
192+
*.bim.layout
193+
*.bim_*.settings
194+
195+
# Microsoft Fakes
196+
FakesAssemblies/
197+
198+
# Node.js Tools for Visual Studio
199+
.ntvs_analysis.dat
200+
201+
# Visual Studio 6 build log
202+
*.plg
203+
204+
# Visual Studio 6 workspace options file
205+
*.opt

DxAPI/DxAPI.cpp

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// DxAPI.cpp : 定义 DLL 应用程序的导出函数。
2+
//
3+
4+
#include "stdafx.h"
5+
#include <NativeLibrary.h>
6+
#include <d3d9.h>
7+
#include <d3dx9core.h>
8+
#include <tchar.h>
9+
10+
class DxAPI
11+
: public NativeLibrary
12+
{
13+
public:
14+
DxAPI() = default;
15+
~DxAPI() = default;
16+
17+
int Init() override
18+
{
19+
return 0;
20+
}
21+
22+
void Exit() override
23+
{
24+
font->Release();
25+
}
26+
27+
void GetSQVM(SQVM* /*vm*/) override
28+
{
29+
}
30+
31+
void GetDxInterface(IDirect3D9* pDx9, IDirect3DDevice9* pDxDevice) override
32+
{
33+
m_pDx9 = pDx9;
34+
m_pDxDevice = pDxDevice;
35+
36+
ZeroMemory(&lf, sizeof(D3DXFONT_DESCA));
37+
lf.Height = 24;
38+
lf.Width = 10;
39+
lf.Weight = 10;
40+
lf.Italic = false;
41+
lf.CharSet = DEFAULT_CHARSET;
42+
lstrcpy(lf.FaceName, _T("微软雅黑"));
43+
44+
D3DXCreateFontIndirect(m_pDxDevice, &lf, &font);
45+
}
46+
47+
bool HandlePresent() override
48+
{
49+
return true;
50+
}
51+
52+
void PrePresent() override
53+
{
54+
TCHAR strText[] = _T("Acaly and Natsu's Modloader Test");
55+
RECT myrect;
56+
myrect.top = 150;
57+
myrect.left = 0;
58+
myrect.right = 500 + myrect.left;
59+
myrect.bottom = 100 + myrect.top;
60+
m_pDxDevice->BeginScene();
61+
62+
font->DrawText(
63+
NULL,
64+
strText,
65+
sizeof strText - 1,
66+
&myrect,
67+
DT_TOP | DT_LEFT,
68+
D3DCOLOR_ARGB(255, 255, 255, 0));
69+
70+
m_pDxDevice->EndScene();
71+
}
72+
73+
static DxAPI& GetInstance()
74+
{
75+
static DxAPI Instance;
76+
return Instance;
77+
}
78+
79+
private:
80+
IDirect3D9* m_pDx9;
81+
IDirect3DDevice9* m_pDxDevice;
82+
83+
D3DXFONT_DESCA lf;
84+
ID3DXFont* font;
85+
};
86+
87+
int GetNativeLibraryInstance(NativeLibrary** ppLib)
88+
{
89+
if (ppLib == nullptr)
90+
{
91+
return -1;
92+
}
93+
94+
*ppLib = &DxAPI::GetInstance();
95+
96+
return 0;
97+
}

0 commit comments

Comments
 (0)