Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
REIKAI
ygopro
Commits
8bd789e3
Commit
8bd789e3
authored
May 06, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
merge mkdir
parents
8df9e3f0
621551e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
gframe/game.cpp
gframe/game.cpp
+58
-0
gframe/game.h
gframe/game.h
+4
-0
strings.conf
strings.conf
+3
-0
No files found.
gframe/game.cpp
View file @
8bd789e3
...
...
@@ -18,7 +18,12 @@
#ifndef _WIN32
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#else
#include <direct.h>
#include <io.h>
#endif
const
unsigned
short
PRO_VERSION
=
0x1343
;
...
...
@@ -33,6 +38,7 @@ unsigned short replay_mode;
HostInfo
game_info
;
void
Game
::
MainServerLoop
()
{
initUtils
();
deckManager
.
LoadLFList
();
LoadExpansionDB
();
dataManager
.
LoadDB
(
"cards.cdb"
);
...
...
@@ -53,6 +59,7 @@ void Game::MainServerLoop() {
#else //YGOPRO_SERVER_MODE
bool
Game
::
Initialize
()
{
srand
(
time
(
0
));
initUtils
();
LoadConfig
();
irr
::
SIrrlichtCreationParameters
params
=
irr
::
SIrrlichtCreationParameters
();
params
.
AntiAlias
=
gameConf
.
antialias
;
...
...
@@ -1381,6 +1388,57 @@ void Game::AddDebugMsg(char* msg)
}
#endif //YGOPRO_SERVER_MODE
}
bool
Game
::
MakeDirectory
(
const
std
::
string
folder
)
{
std
::
string
folder_builder
;
std
::
string
sub
;
sub
.
reserve
(
folder
.
size
());
for
(
auto
it
=
folder
.
begin
();
it
!=
folder
.
end
();
++
it
)
{
const
char
c
=
*
it
;
sub
.
push_back
(
c
);
if
(
c
==
'/'
||
it
==
folder
.
end
()
-
1
)
{
folder_builder
.
append
(
sub
);
if
(
access
(
folder_builder
.
c_str
(),
0
)
!=
0
)
#ifdef _WIN32
if
(
mkdir
(
folder_builder
.
c_str
())
!=
0
)
#else
if
(
mkdir
(
folder_builder
.
c_str
(),
0777
)
!=
0
)
#endif
return
false
;
sub
.
clear
();
}
}
return
true
;
}
void
Game
::
initUtils
()
{
//user files
MakeDirectory
(
"replay"
);
#ifdef YGOPRO_SERVER_MODE
//special scripts
MakeDirectory
(
"specials"
);
#else
//cards from extra pack
MakeDirectory
(
"expansions"
);
//files in ygopro-starter-pack
MakeDirectory
(
"deck"
);
MakeDirectory
(
"single"
);
//original files
MakeDirectory
(
"script"
);
MakeDirectory
(
"textures"
);
//sound
MakeDirectory
(
"sound"
);
MakeDirectory
(
"sound/BGM"
);
MakeDirectory
(
"sound/BGM/advantage"
);
MakeDirectory
(
"sound/BGM/deck"
);
MakeDirectory
(
"sound/BGM/disadvantage"
);
MakeDirectory
(
"sound/BGM/duel"
);
MakeDirectory
(
"sound/BGM/lose"
);
MakeDirectory
(
"sound/BGM/menu"
);
MakeDirectory
(
"sound/BGM/win"
);
//pics
MakeDirectory
(
"pics"
);
MakeDirectory
(
"pics/field"
);
#endif //YGOPRO_SERVER_MODE
}
#ifndef YGOPRO_SERVER_MODE
void
Game
::
ClearTextures
()
{
matManager
.
mCard
.
setTexture
(
0
,
0
);
...
...
gframe/game.h
View file @
8bd789e3
...
...
@@ -110,6 +110,8 @@ public:
void
MainServerLoop
();
void
LoadExpansionDB
();
void
AddDebugMsg
(
char
*
msgbuf
);
void
AddDebugMsg
(
char
*
msgbuf
);
bool
MakeDirectory
(
const
std
::
string
folder
);
#else
void
MainLoop
();
void
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
f32
left
,
f32
right
,
f32
bottom
,
f32
top
,
f32
znear
,
f32
zfar
);
...
...
@@ -144,6 +146,8 @@ public:
void
AddChatMsg
(
wchar_t
*
msg
,
int
player
);
void
ClearChatMsg
();
void
AddDebugMsg
(
char
*
msgbuf
);
bool
MakeDirectory
(
const
std
::
string
folder
);
void
initUtils
();
void
ClearTextures
();
void
CloseDuelWindow
();
...
...
strings.conf
View file @
8bd789e3
...
...
@@ -240,6 +240,9 @@
!
system
1161
效果处理
!
system
1162
效果重置
!
system
1163
灵摆召唤
!
system
1164
同调召唤
!
system
1165
超量召唤
!
system
1166
连接召唤
#menu
!
system
1200
联机模式
!
system
1201
单人模式
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment