Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rd-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
苍蓝
rd-ygopro
Commits
dc295d0d
Commit
dc295d0d
authored
Jan 06, 2016
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary inclusion
parent
506c0076
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
36 deletions
+38
-36
gframe/game.cpp
gframe/game.cpp
+37
-36
gframe/game.h
gframe/game.h
+1
-0
No files found.
gframe/game.cpp
View file @
dc295d0d
...
...
@@ -9,9 +9,7 @@
#include "netserver.h"
#include "single_mode.h"
#ifdef _WIN32
#include <io.h>
#else
#ifndef _WIN32
#include <sys/types.h>
#include <dirent.h>
#endif
...
...
@@ -58,39 +56,7 @@ bool Game::Initialize() {
return
false
;
if
(
!
dataManager
.
LoadStrings
(
"strings.conf"
))
return
false
;
#ifdef _WIN32
char
fpath
[
1000
];
WIN32_FIND_DATAW
fdataw
;
HANDLE
fh
=
FindFirstFileW
(
L"./expansions/*.cdb"
,
&
fdataw
);
if
(
fh
!=
INVALID_HANDLE_VALUE
)
{
do
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
sprintf
(
fpath
,
"./expansions/%ls"
,
fdataw
.
cFileName
);
dataManager
.
LoadDB
(
fpath
);
}
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
}
#else
DIR
*
dir
;
struct
dirent
*
dirp
;
const
char
*
foldername
=
"./expansions/"
;
if
((
dir
=
opendir
(
foldername
))
!=
NULL
)
{
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
size_t
len
=
strlen
(
dirp
->
d_name
);
if
(
len
<
5
||
strcasecmp
(
dirp
->
d_name
+
len
-
4
,
".cdb"
)
!=
0
)
continue
;
char
*
filepath
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
len
+
strlen
(
foldername
)));
strncpy
(
filepath
,
foldername
,
strlen
(
foldername
)
+
1
);
strncat
(
filepath
,
dirp
->
d_name
,
len
);
std
::
cout
<<
"Found file "
<<
filepath
<<
std
::
endl
;
if
(
!
dataManager
.
LoadDB
(
filepath
))
std
::
cout
<<
"Error loading file"
<<
std
::
endl
;
free
(
filepath
);
}
closedir
(
dir
);
}
#endif
RefreshExpansionDB
();
env
=
device
->
getGUIEnvironment
();
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
adFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
12
);
...
...
@@ -689,6 +655,41 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
dataManager
.
strBuffer
[
pbuffer
]
=
0
;
pControl
->
setText
(
dataManager
.
strBuffer
);
}
void
Game
::
RefreshExpansionDB
()
{
#ifdef _WIN32
char
fpath
[
1000
];
WIN32_FIND_DATAW
fdataw
;
HANDLE
fh
=
FindFirstFileW
(
L"./expansions/*.cdb"
,
&
fdataw
);
if
(
fh
!=
INVALID_HANDLE_VALUE
)
{
do
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
sprintf
(
fpath
,
"./expansions/%ls"
,
fdataw
.
cFileName
);
dataManager
.
LoadDB
(
fpath
);
}
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
}
#else
DIR
*
dir
;
struct
dirent
*
dirp
;
const
char
*
foldername
=
"./expansions/"
;
if
((
dir
=
opendir
(
foldername
))
!=
NULL
)
{
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
size_t
len
=
strlen
(
dirp
->
d_name
);
if
(
len
<
5
||
strcasecmp
(
dirp
->
d_name
+
len
-
4
,
".cdb"
)
!=
0
)
continue
;
char
*
filepath
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
len
+
strlen
(
foldername
)));
strncpy
(
filepath
,
foldername
,
strlen
(
foldername
)
+
1
);
strncat
(
filepath
,
dirp
->
d_name
,
len
);
std
::
cout
<<
"Found file "
<<
filepath
<<
std
::
endl
;
if
(
!
dataManager
.
LoadDB
(
filepath
))
std
::
cout
<<
"Error loading file"
<<
std
::
endl
;
free
(
filepath
);
}
closedir
(
dir
);
}
#endif
}
void
Game
::
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
cbDeck
->
clear
();
#ifdef _WIN32
...
...
gframe/game.h
View file @
dc295d0d
...
...
@@ -79,6 +79,7 @@ public:
void
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
f32
left
,
f32
right
,
f32
bottom
,
f32
top
,
f32
znear
,
f32
zfar
);
void
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
void
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
void
RefreshExpansionDB
();
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshReplay
();
void
RefreshSingleplay
();
...
...
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