Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
2cd66f41
Commit
2cd66f41
authored
Nov 04, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
069a6daa
8f8710f5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
16 deletions
+32
-16
gframe/game.cpp
gframe/game.cpp
+29
-14
gframe/game.h
gframe/game.h
+1
-0
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/game.cpp
View file @
2cd66f41
...
@@ -39,8 +39,10 @@ bool Game::Initialize() {
...
@@ -39,8 +39,10 @@ bool Game::Initialize() {
params
.
DriverType
=
irr
::
video
::
EDT_OPENGL
;
params
.
DriverType
=
irr
::
video
::
EDT_OPENGL
;
params
.
WindowSize
=
irr
::
core
::
dimension2d
<
u32
>
(
gameConf
.
window_width
,
gameConf
.
window_height
);
params
.
WindowSize
=
irr
::
core
::
dimension2d
<
u32
>
(
gameConf
.
window_width
,
gameConf
.
window_height
);
device
=
irr
::
createDeviceEx
(
params
);
device
=
irr
::
createDeviceEx
(
params
);
if
(
!
device
)
if
(
!
device
)
{
ErrorLog
(
"Failed to create Irrlicht Engine device!"
);
return
false
;
return
false
;
}
// Apply skin
// Apply skin
if
(
gameConf
.
skin_index
&&
gameConf
.
use_d3d
)
{
if
(
gameConf
.
skin_index
&&
gameConf
.
use_d3d
)
{
wchar_t
skin_dir
[
16
];
wchar_t
skin_dir
[
16
];
...
@@ -81,15 +83,21 @@ bool Game::Initialize() {
...
@@ -81,15 +83,21 @@ bool Game::Initialize() {
driver
->
setTextureCreationFlag
(
irr
::
video
::
ETCF_CREATE_MIP_MAPS
,
false
);
driver
->
setTextureCreationFlag
(
irr
::
video
::
ETCF_CREATE_MIP_MAPS
,
false
);
driver
->
setTextureCreationFlag
(
irr
::
video
::
ETCF_OPTIMIZED_FOR_QUALITY
,
true
);
driver
->
setTextureCreationFlag
(
irr
::
video
::
ETCF_OPTIMIZED_FOR_QUALITY
,
true
);
imageManager
.
SetDevice
(
device
);
imageManager
.
SetDevice
(
device
);
if
(
!
imageManager
.
Initial
())
if
(
!
imageManager
.
Initial
())
{
ErrorLog
(
"Failed to load textures!"
);
return
false
;
return
false
;
}
LoadExpansionDB
();
LoadExpansionDB
();
if
(
dataManager
.
LoadDB
(
GetLocaleDir
(
"cards.cdb"
)))
{}
else
if
(
dataManager
.
LoadDB
(
GetLocaleDir
(
"cards.cdb"
)))
{}
else
if
(
!
dataManager
.
LoadDB
(
"cards.cdb"
))
if
(
!
dataManager
.
LoadDB
(
"cards.cdb"
))
{
ErrorLog
(
"Failed to load card database (cards.cdb)!"
);
return
false
;
return
false
;
}
if
(
dataManager
.
LoadStrings
(
GetLocaleDir
(
"strings.conf"
)))
{}
else
if
(
dataManager
.
LoadStrings
(
GetLocaleDir
(
"strings.conf"
)))
{}
else
if
(
!
dataManager
.
LoadStrings
(
"strings.conf"
))
if
(
!
dataManager
.
LoadStrings
(
"strings.conf"
))
{
ErrorLog
(
"Failed to load strings!"
);
return
false
;
return
false
;
}
LoadExpansionStrings
();
LoadExpansionStrings
();
env
=
device
->
getGUIEnvironment
();
env
=
device
->
getGUIEnvironment
();
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
...
@@ -97,8 +105,10 @@ bool Game::Initialize() {
...
@@ -97,8 +105,10 @@ bool Game::Initialize() {
lpcFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
48
);
lpcFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
48
);
guiFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
guiFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
textFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
textFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
if
(
!
numFont
||
!
textFont
)
if
(
!
numFont
||
!
textFont
)
{
ErrorLog
(
"Failed to load font(s)!"
);
return
false
;
return
false
;
}
smgr
=
device
->
getSceneManager
();
smgr
=
device
->
getSceneManager
();
device
->
setWindowCaption
(
L"KoishiPro"
);
device
->
setWindowCaption
(
L"KoishiPro"
);
device
->
setResizable
(
true
);
device
->
setResizable
(
true
);
...
@@ -1795,17 +1805,22 @@ void Game::AddDebugMsg(char* msg)
...
@@ -1795,17 +1805,22 @@ void Game::AddDebugMsg(char* msg)
AddChatMsg
(
wbuf
,
9
);
AddChatMsg
(
wbuf
,
9
);
}
}
if
(
enable_log
&
0x2
)
{
if
(
enable_log
&
0x2
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
char
msgbuf
[
1040
];
if
(
!
fp
)
sprintf
(
msgbuf
,
"[Script Error]: %s"
,
msg
);
return
;
ErrorLog
(
msgbuf
);
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
strftime
(
timebuf
,
40
,
"%Y-%m-%d %H:%M:%S"
,
localedtime
);
fprintf
(
fp
,
"[%s][Script Error]: %s
\n
"
,
timebuf
,
msg
);
fclose
(
fp
);
}
}
}
}
void
Game
::
ErrorLog
(
char
*
msg
)
{
FILE
*
fp
=
fopen
(
"error.log"
,
"at"
);
if
(
!
fp
)
return
;
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
strftime
(
timebuf
,
40
,
"%Y-%m-%d %H:%M:%S"
,
localedtime
);
fprintf
(
fp
,
"[%s]%s
\n
"
,
timebuf
,
msg
);
fclose
(
fp
);
}
bool
Game
::
MakeDirectory
(
const
std
::
string
folder
)
{
bool
Game
::
MakeDirectory
(
const
std
::
string
folder
)
{
std
::
string
folder_builder
;
std
::
string
folder_builder
;
std
::
string
sub
;
std
::
string
sub
;
...
...
gframe/game.h
View file @
2cd66f41
...
@@ -160,6 +160,7 @@ public:
...
@@ -160,6 +160,7 @@ 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
);
void
ErrorLog
(
char
*
msgbuf
);
bool
MakeDirectory
(
const
std
::
string
folder
);
bool
MakeDirectory
(
const
std
::
string
folder
);
void
initUtils
();
void
initUtils
();
void
ClearTextures
();
void
ClearTextures
();
...
...
ocgcore
@
17c2dfaf
Subproject commit
71bfee8472a8ae1e2eb3555432a78d6467588abf
Subproject commit
17c2dfaf1b157fb65e81ab05883106a3cc38e2ae
script
@
aaef0a01
Subproject commit
1a39548609ebe380fff36f34e8561bfd51a3b4c8
Subproject commit
aaef0a01369bd09bf0e4dd812483df1d0f856f3a
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