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
d405565c
Commit
d405565c
authored
May 06, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add making dirs
parent
bdbbdb0c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
2 deletions
+54
-2
gframe/game.cpp
gframe/game.cpp
+50
-0
gframe/game.h
gframe/game.h
+2
-0
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/game.cpp
View file @
d405565c
...
@@ -12,7 +12,12 @@
...
@@ -12,7 +12,12 @@
#ifndef _WIN32
#ifndef _WIN32
#include <sys/types.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <dirent.h>
#include <unistd.h>
#else
#include <direct.h>
#include <io.h>
#endif
#endif
const
unsigned
short
PRO_VERSION
=
0x1343
;
const
unsigned
short
PRO_VERSION
=
0x1343
;
...
@@ -23,6 +28,7 @@ Game* mainGame;
...
@@ -23,6 +28,7 @@ Game* mainGame;
bool
Game
::
Initialize
()
{
bool
Game
::
Initialize
()
{
srand
(
time
(
0
));
srand
(
time
(
0
));
initUtils
();
LoadConfig
();
LoadConfig
();
irr
::
SIrrlichtCreationParameters
params
=
irr
::
SIrrlichtCreationParameters
();
irr
::
SIrrlichtCreationParameters
params
=
irr
::
SIrrlichtCreationParameters
();
params
.
AntiAlias
=
gameConf
.
antialias
;
params
.
AntiAlias
=
gameConf
.
antialias
;
...
@@ -1344,6 +1350,50 @@ void Game::AddDebugMsg(char* msg)
...
@@ -1344,6 +1350,50 @@ void Game::AddDebugMsg(char* msg)
fclose
(
fp
);
fclose
(
fp
);
}
}
}
}
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"
);
//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"
);
}
void
Game
::
ClearTextures
()
{
void
Game
::
ClearTextures
()
{
matManager
.
mCard
.
setTexture
(
0
,
0
);
matManager
.
mCard
.
setTexture
(
0
,
0
);
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
...
...
gframe/game.h
View file @
d405565c
...
@@ -133,6 +133,8 @@ public:
...
@@ -133,6 +133,8 @@ public:
void
AddChatMsg
(
wchar_t
*
msg
,
int
player
);
void
AddChatMsg
(
wchar_t
*
msg
,
int
player
);
void
ClearChatMsg
();
void
ClearChatMsg
();
void
AddDebugMsg
(
char
*
msgbuf
);
void
AddDebugMsg
(
char
*
msgbuf
);
bool
MakeDirectory
(
const
std
::
string
folder
);
void
initUtils
();
void
ClearTextures
();
void
ClearTextures
();
void
CloseDuelWindow
();
void
CloseDuelWindow
();
...
...
ocgcore
@
92ad9db2
Subproject commit
24dff6a9a81f3f3dae45b2e2600203a08b19a0cf
Subproject commit
92ad9db2a69bbaf4a07ef0173fe3ee03615b1f24
script
@
f1967358
Subproject commit
5f197f2d2cd3a619b48ce30d20b57a7fe5bb0d65
Subproject commit
f196735871f426872da35d2699c96466cbf48759
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