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
29dd97a1
Commit
29dd97a1
authored
Nov 13, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into another
parents
499f213f
a2455736
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
234 additions
and
105 deletions
+234
-105
.gitignore
.gitignore
+1
-1
.travis.yml
.travis.yml
+1
-1
gframe/data_manager.cpp
gframe/data_manager.cpp
+6
-0
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+13
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+5
-5
gframe/event_handler.cpp
gframe/event_handler.cpp
+7
-3
gframe/game.cpp
gframe/game.cpp
+23
-3
gframe/game.h
gframe/game.h
+2
-0
gframe/image_manager.cpp
gframe/image_manager.cpp
+50
-20
gframe/image_manager.h
gframe/image_manager.h
+2
-0
gframe/premake4.lua
gframe/premake4.lua
+4
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+26
-15
gframe/replay_mode.h
gframe/replay_mode.h
+3
-2
gframe/single_duel.cpp
gframe/single_duel.cpp
+26
-15
gframe/single_duel.h
gframe/single_duel.h
+3
-3
gframe/single_mode.cpp
gframe/single_mode.cpp
+26
-16
gframe/single_mode.h
gframe/single_mode.h
+2
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+27
-15
gframe/tag_duel.h
gframe/tag_duel.h
+3
-3
premake5.lua
premake5.lua
+3
-0
script
script
+1
-1
No files found.
.gitignore
View file @
29dd97a1
...
...
@@ -13,7 +13,7 @@
/freetype
/sqlite3
/irrklang
/irrlicht
/irrlicht
*
# gframe additionals
/gframe/ygopro.ico
...
...
.travis.yml
View file @
29dd97a1
...
...
@@ -13,7 +13,6 @@ addons:
-
libfreetype6-dev
-
libevent-dev
-
libsqlite3-dev
-
libirrlicht-dev
-
libgl1-mesa-dev
-
libglu-dev
-
p7zip-full
...
...
@@ -30,6 +29,7 @@ before_install:
curl --location --retry 5 https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-macosx.tar.gz | tar zfx -;
fi
-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
git clone https://github.com/DailyShana/irrlicht irrlicht_linux;
curl --location --retry 5 https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz | tar zfx -;
fi
...
...
gframe/data_manager.cpp
View file @
29dd97a1
...
...
@@ -65,7 +65,13 @@ bool DataManager::LoadDB(const char* file) {
return
true
;
}
bool
DataManager
::
LoadStrings
(
const
char
*
file
)
{
#ifdef _WIN32
wchar_t
fname
[
1024
];
BufferIO
::
DecodeUTF8
(
file
,
fname
);
FILE
*
fp
=
_wfopen
(
fname
,
L"r"
);
#else
FILE
*
fp
=
fopen
(
file
,
"r"
);
#endif // _WIN32
if
(
!
fp
)
return
false
;
char
linebuf
[
256
];
...
...
gframe/deck_manager.cpp
View file @
29dd97a1
...
...
@@ -10,7 +10,13 @@ DeckManager deckManager;
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
LFList
*
cur
=
NULL
;
#ifdef _WIN32
wchar_t
fname
[
1024
];
BufferIO
::
DecodeUTF8
(
path
,
fname
);
FILE
*
fp
=
_wfopen
(
fname
,
L"r"
);
#else
FILE
*
fp
=
fopen
(
path
,
"r"
);
#endif // _WIN32
char
linebuf
[
256
];
wchar_t
strBuffer
[
256
];
if
(
fp
)
{
...
...
@@ -51,6 +57,13 @@ void DeckManager::LoadLFListSingle(const char* path) {
}
void
DeckManager
::
LoadLFList
()
{
LoadLFListSingle
(
"expansions/lflist.conf"
);
FileSystem
::
TraversalDir
(
"./expansions"
,
[
this
](
const
char
*
name
,
bool
isdir
)
{
if
(
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
fpath
[
1024
];
sprintf
(
fpath
,
"./expansions/%s/lflist.conf"
,
name
);
LoadLFListSingle
(
fpath
);
}
});
LoadLFListSingle
(
"lflist.conf"
);
LFList
nolimit
;
myswprintf
(
nolimit
.
listName
,
L"N/A"
);
...
...
gframe/duelclient.cpp
View file @
29dd97a1
...
...
@@ -1013,7 +1013,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
text
Font
,
textBuffer
);
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
gui
Font
,
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
40
);
...
...
@@ -1031,7 +1031,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
text
Font
,
textBuffer
);
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
gui
Font
,
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
40
);
...
...
@@ -1042,7 +1042,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
text
Font
,
textBuffer
);
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
gui
Font
,
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
40
);
...
...
@@ -1053,7 +1053,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
data
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
text
Font
,
textBuffer
);
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
gui
Font
,
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
40
);
...
...
@@ -1064,7 +1064,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
text
Font
,
textBuffer
);
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
gui
Font
,
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
40
);
...
...
gframe/event_handler.cpp
View file @
29dd97a1
...
...
@@ -1633,7 +1633,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str
.
append
(
formatBuffer
);
}
should_show_tip
=
true
;
irr
::
core
::
dimension2d
<
unsigned
int
>
dtip
=
mainGame
->
text
Font
->
getDimension
(
str
.
c_str
())
+
irr
::
core
::
dimension2d
<
unsigned
int
>
(
10
,
10
);
irr
::
core
::
dimension2d
<
unsigned
int
>
dtip
=
mainGame
->
gui
Font
->
getDimension
(
str
.
c_str
())
+
irr
::
core
::
dimension2d
<
unsigned
int
>
(
10
,
10
);
mainGame
->
stTip
->
setRelativePosition
(
recti
(
mousepos
.
X
-
10
-
dtip
.
Width
,
mousepos
.
Y
+
10
,
mousepos
.
X
-
10
,
mousepos
.
Y
+
10
+
dtip
.
Height
));
mainGame
->
stTip
->
setText
(
str
.
c_str
());
}
...
...
@@ -1989,15 +1989,19 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_R
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
{
mainGame
->
textFont
->
setTransparency
(
true
);
mainGame
->
guiFont
->
setTransparency
(
true
);
}
return
true
;
break
;
}
case
irr
:
:
KEY_F9
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
{
mainGame
->
textFont
->
setTransparency
(
true
);
mainGame
->
guiFont
->
setTransparency
(
true
);
}
return
true
;
break
;
}
...
...
gframe/game.cpp
View file @
29dd97a1
...
...
@@ -88,7 +88,7 @@ bool Game::Initialize() {
ErrorLog
(
"Failed to load strings!"
);
return
false
;
}
dataManager
.
LoadStrings
(
"./expansions/strings.conf"
);
LoadExpansionStrings
(
);
env
=
device
->
getGUIEnvironment
();
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
adFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
12
);
...
...
@@ -972,14 +972,34 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
pControl
->
setText
(
dataManager
.
strBuffer
);
}
void
Game
::
LoadExpansionDB
()
{
FileSystem
::
TraversalDir
(
"./expansions"
,
[](
const
char
*
name
,
bool
isdir
)
{
LoadExpansionDBDirectry
(
"./expansions"
);
FileSystem
::
TraversalDir
(
"./expansions"
,
[
this
](
const
char
*
name
,
bool
isdir
)
{
if
(
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
subdir
[
1024
];
sprintf
(
subdir
,
"./expansions/%s"
,
name
);
LoadExpansionDBDirectry
(
subdir
);
}
});
}
void
Game
::
LoadExpansionDBDirectry
(
const
char
*
path
)
{
FileSystem
::
TraversalDir
(
path
,
[
path
](
const
char
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
strrchr
(
name
,
'.'
)
&&
!
mystrncasecmp
(
strrchr
(
name
,
'.'
),
".cdb"
,
4
))
{
char
fpath
[
1024
];
sprintf
(
fpath
,
"
./expansions/%s"
,
name
);
sprintf
(
fpath
,
"
%s/%s"
,
path
,
name
);
dataManager
.
LoadDB
(
fpath
);
}
});
}
void
Game
::
LoadExpansionStrings
()
{
dataManager
.
LoadStrings
(
"./expansions/strings.conf"
);
FileSystem
::
TraversalDir
(
"./expansions"
,
[](
const
char
*
name
,
bool
isdir
)
{
if
(
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
fpath
[
1024
];
sprintf
(
fpath
,
"./expansions/%s/strings.conf"
,
name
);
dataManager
.
LoadStrings
(
fpath
);
}
});
}
void
Game
::
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
cbDeck
->
clear
();
FileSystem
::
TraversalDir
(
L"./deck"
,
[
cbDeck
](
const
wchar_t
*
name
,
bool
isdir
)
{
...
...
gframe/game.h
View file @
29dd97a1
...
...
@@ -129,6 +129,8 @@ public:
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
LoadExpansionDB
();
void
LoadExpansionDBDirectry
(
const
char
*
path
);
void
LoadExpansionStrings
();
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshReplay
();
void
RefreshSingleplay
();
...
...
gframe/image_manager.cpp
View file @
29dd97a1
...
...
@@ -271,23 +271,30 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
)
{
#ifdef _WIN32
wchar_t
name
[
1024
];
BufferIO
::
DecodeUTF8
(
file
,
name
);
#else
char
*
name
=
file
;
#endif // _WIN32
if
(
mainGame
->
gameConf
.
use_image_scale
)
{
irr
::
video
::
ITexture
*
texture
;
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
fil
e
);
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
nam
e
);
if
(
srcimg
==
NULL
)
return
NULL
;
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
))
{
texture
=
driver
->
addTexture
(
fil
e
,
srcimg
);
texture
=
driver
->
addTexture
(
nam
e
,
srcimg
);
}
else
{
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
));
imageScaleNNAA
(
srcimg
,
destimg
);
texture
=
driver
->
addTexture
(
fil
e
,
destimg
);
texture
=
driver
->
addTexture
(
nam
e
,
destimg
);
destimg
->
drop
();
}
srcimg
->
drop
();
return
texture
;
}
else
{
return
driver
->
getTexture
(
fil
e
);
return
driver
->
getTexture
(
nam
e
);
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureUnknown
(
s32
width
,
s32
height
,
int
index
)
{
...
...
@@ -295,6 +302,29 @@ irr::video::ITexture* ImageManager::GetTextureUnknown(s32 width, s32 height, int
tUnknown
[
index
]
=
GetTextureFromFile
(
"textures/unknown.jpg"
,
width
,
height
);
return
tUnknown
[
index
];
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureExpansions
(
char
*
file
,
s32
width
,
s32
height
)
{
irr
::
video
::
ITexture
*
img
=
GetTextureExpansionsDirectry
(
"./expansions"
,
file
,
width
,
height
);
if
(
img
!=
NULL
)
return
img
;
bool
find
=
false
;
FileSystem
::
TraversalDir
(
"./expansions"
,
[
this
,
file
,
width
,
height
,
&
img
,
&
find
](
const
char
*
name
,
bool
isdir
)
{
if
(
!
find
&&
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
subdir
[
1024
];
sprintf
(
subdir
,
"./expansions/%s"
,
name
);
img
=
GetTextureExpansionsDirectry
(
subdir
,
file
,
width
,
height
);
if
(
img
)
find
=
true
;
}
});
if
(
find
)
return
img
;
return
img
;
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureExpansionsDirectry
(
const
char
*
path
,
char
*
file
,
s32
width
,
s32
height
)
{
char
fpath
[
1000
];
sprintf
(
fpath
,
"%s/%s"
,
path
,
file
);
return
GetTextureFromFile
(
fpath
,
width
,
height
);
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
int
width
=
CARD_IMG_WIDTH
;
int
height
=
CARD_IMG_HEIGHT
;
...
...
@@ -310,11 +340,11 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
auto
tit
=
tMap
[
fit
?
1
:
0
].
find
(
code
);
if
(
tit
==
tMap
[
fit
?
1
:
0
].
end
())
{
char
file
[
256
];
sprintf
(
file
,
"
expansions/
pics/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
sprintf
(
file
,
"pics/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
sprintf
(
file
,
"
expansions/
pics/%d.jpg"
,
code
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
sprintf
(
file
,
"pics/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.png"
),
code
);
...
...
@@ -352,11 +382,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
return
GetTextureUnknown
(
width
,
height
,
2
);
if
(
tit
==
tThumb
.
end
())
{
char
file
[
256
];
sprintf
(
file
,
"
expansions/
pics/thumbnail/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
sprintf
(
file
,
"pics/thumbnail/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
sprintf
(
file
,
"
expansions/
pics/thumbnail/%d.jpg"
,
code
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
sprintf
(
file
,
"pics/thumbnail/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/thumbnail/%d.png"
),
code
);
...
...
@@ -375,11 +405,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
if
(
img
==
NULL
&&
mainGame
->
gameConf
.
use_image_scale
)
{
sprintf
(
file
,
"
expansions/
pics/%d.png"
,
code
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
sprintf
(
file
,
"pics/%d.png"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
sprintf
(
file
,
"
expansions/
pics/%d.jpg"
,
code
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
sprintf
(
file
,
"pics/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.png"
),
code
);
...
...
@@ -412,11 +442,11 @@ irr::video::ITexture* ImageManager::GetTextureField(int code) {
auto
tit
=
tFields
.
find
(
code
);
if
(
tit
==
tFields
.
end
())
{
char
file
[
256
];
sprintf
(
file
,
"
expansions/
pics/field/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
FromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
sprintf
(
file
,
"pics/field/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
Expansions
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
if
(
img
==
NULL
)
{
sprintf
(
file
,
"
expansions/
pics/field/%d.jpg"
,
code
);
img
=
GetTexture
FromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
sprintf
(
file
,
"pics/field/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/field/%d.png"
,
code
);
...
...
gframe/image_manager.h
View file @
29dd97a1
...
...
@@ -23,6 +23,8 @@ public:
void
ResizeTexture
();
irr
::
video
::
ITexture
*
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTextureUnknown
(
s32
width
,
s32
height
,
int
index
);
irr
::
video
::
ITexture
*
GetTextureExpansions
(
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTextureExpansionsDirectry
(
const
char
*
path
,
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
...
...
gframe/premake4.lua
View file @
29dd97a1
...
...
@@ -33,16 +33,19 @@ project "ygopro"
configuration
"not vs*"
buildoptions
{
"-std=c++14"
,
"-fno-rtti"
}
configuration
"not windows"
includedirs
{
"/usr/include/
irrlicht"
,
"/usr/include/
freetype2"
}
includedirs
{
"/usr/include/freetype2"
}
excludes
{
"COSOperator.*"
}
links
{
"event_pthreads"
,
"GL"
,
"dl"
,
"pthread"
}
configuration
"linux"
includedirs
{
"../irrlicht_linux/include"
}
links
{
"X11"
,
"Xxf86vm"
}
if
USE_IRRKLANG
then
links
{
"IrrKlang"
}
linkoptions
{
"-Wl,-rpath=./"
}
libdirs
{
"../irrklang/bin/linux-gcc-64"
}
end
configuration
"macosx"
includedirs
{
"/usr/include/irrlicht"
}
if
USE_IRRKLANG
then
links
{
"irrklang"
}
libdirs
{
"../irrklang/bin/macosx-gcc"
}
...
...
gframe/replay_mode.cpp
View file @
29dd97a1
...
...
@@ -940,24 +940,35 @@ void ReplayMode::ReplayReload() {
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
}
byte
*
ReplayMode
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./specials"
;
strcat
(
sname
,
script_name
+
8
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./beta"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
byte
*
buffer
=
ScriptReaderExDirectry
(
"./specials"
,
script_name
,
slen
,
8
);
if
(
buffer
)
return
buffer
;
else
buffer
=
ScriptReaderExDirectry
(
"./expansions"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
buffer
=
ScriptReaderExDirectry
(
"./beta"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
bool
find
=
false
;
FileSystem
::
TraversalDir
(
"./expansions"
,
[
script_name
,
slen
,
&
buffer
,
&
find
](
const
char
*
name
,
bool
isdir
)
{
if
(
!
find
&&
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
subdir
[
1024
];
sprintf
(
subdir
,
"./expansions/%s"
,
name
);
buffer
=
ScriptReaderExDirectry
(
subdir
,
script_name
,
slen
);
if
(
buffer
)
find
=
true
;
}
});
if
(
find
)
return
buffer
;
return
default_script_reader
(
script_name
,
slen
);
}
byte
*
ReplayMode
::
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
)
{
char
sname
[
256
];
strcpy
(
sname
,
path
);
strcat
(
sname
,
script_name
+
pre_len
);
//default script name: ./script/c%d.lua
return
default_script_reader
(
sname
,
slen
);
}
int
ReplayMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
return
0
;
...
...
gframe/replay_mode.h
View file @
29dd97a1
...
...
@@ -48,6 +48,7 @@ public:
static
void
ReplayReload
();
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
=
1
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
};
...
...
gframe/single_duel.cpp
View file @
29dd97a1
...
...
@@ -1553,24 +1553,35 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
}
}
byte
*
SingleDuel
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./specials"
;
strcat
(
sname
,
script_name
+
8
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./beta"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
byte
*
buffer
=
ScriptReaderExDirectry
(
"./specials"
,
script_name
,
slen
,
8
);
if
(
buffer
)
return
buffer
;
else
buffer
=
ScriptReaderExDirectry
(
"./expansions"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
buffer
=
ScriptReaderExDirectry
(
"./beta"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
bool
find
=
false
;
FileSystem
::
TraversalDir
(
"./expansions"
,
[
script_name
,
slen
,
&
buffer
,
&
find
](
const
char
*
name
,
bool
isdir
)
{
if
(
!
find
&&
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
subdir
[
1024
];
sprintf
(
subdir
,
"./expansions/%s"
,
name
);
buffer
=
ScriptReaderExDirectry
(
subdir
,
script_name
,
slen
);
if
(
buffer
)
find
=
true
;
}
});
if
(
find
)
return
buffer
;
return
default_script_reader
(
script_name
,
slen
);
}
byte
*
SingleDuel
::
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
)
{
char
sname
[
256
];
strcpy
(
sname
,
path
);
strcat
(
sname
,
script_name
+
pre_len
);
//default script name: ./script/c%d.lua
return
default_script_reader
(
sname
,
slen
);
}
int
SingleDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
return
0
;
...
...
gframe/single_duel.h
View file @
29dd97a1
...
...
@@ -39,6 +39,7 @@ public:
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
=
1
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
...
...
@@ -65,4 +66,3 @@ protected:
}
#endif //SINGLE_DUEL_H
gframe/single_mode.cpp
View file @
29dd97a1
...
...
@@ -777,7 +777,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
memcpy
(
msgbuf
,
begin
,
len
+
1
);
BufferIO
::
DecodeUTF8
(
msgbuf
,
msg
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stMessage
,
310
,
mainGame
->
text
Font
,
msg
);
mainGame
->
SetStaticText
(
mainGame
->
stMessage
,
310
,
mainGame
->
gui
Font
,
msg
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
actionSignal
.
Reset
();
...
...
@@ -861,24 +861,34 @@ void SingleMode::SinglePlayReload() {
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
}
byte
*
SingleMode
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./specials"
;
strcat
(
sname
,
script_name
+
8
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
ScriptReader
(
sname
,
slen
);
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
ScriptReader
(
sname
,
slen
);
}
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./beta"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
ScriptReader
(
sname
,
slen
);
}
byte
*
buffer
=
ScriptReaderExDirectry
(
"./specials"
,
script_name
,
slen
,
8
);
if
(
buffer
)
return
buffer
;
buffer
=
ScriptReaderExDirectry
(
"./expansions"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
buffer
=
ScriptReaderExDirectry
(
"./beta"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
else
bool
find
=
false
;
FileSystem
::
TraversalDir
(
"./expansions"
,
[
script_name
,
slen
,
&
buffer
,
&
find
](
const
char
*
name
,
bool
isdir
)
{
if
(
!
find
&&
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
subdir
[
1024
];
sprintf
(
subdir
,
"./expansions/%s"
,
name
);
buffer
=
ScriptReaderExDirectry
(
subdir
,
script_name
,
slen
);
if
(
buffer
)
find
=
true
;
}
});
if
(
find
)
return
buffer
;
return
ScriptReader
(
script_name
,
slen
);
}
byte
*
SingleMode
::
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
)
{
char
sname
[
256
];
sprintf
(
sname
,
"%s%s"
,
path
,
script_name
+
pre_len
);
//default script name: ./script/c%d.lua
return
ScriptReader
(
sname
,
slen
);
}
byte
*
SingleMode
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
FILE
*
fp
;
#ifdef _WIN32
...
...
gframe/single_mode.h
View file @
29dd97a1
...
...
@@ -27,6 +27,7 @@ public:
static
void
SinglePlayReload
();
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
=
1
);
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
...
...
gframe/tag_duel.cpp
View file @
29dd97a1
...
...
@@ -1692,25 +1692,37 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
}
}
}
byte
*
TagDuel
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./specials"
;
strcat
(
sname
,
script_name
+
8
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
if
(
!
buffer
)
{
char
sname
[
256
]
=
"./beta"
;
strcat
(
sname
,
script_name
+
1
);
buffer
=
default_script_reader
(
sname
,
slen
);
}
byte
*
buffer
=
ScriptReaderExDirectry
(
"./specials"
,
script_name
,
slen
,
8
);
if
(
buffer
)
return
buffer
;
else
buffer
=
ScriptReaderExDirectry
(
"./expansions"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
buffer
=
ScriptReaderExDirectry
(
"./beta"
,
script_name
,
slen
);
if
(
buffer
)
return
buffer
;
bool
find
=
false
;
FileSystem
::
TraversalDir
(
"./expansions"
,
[
script_name
,
slen
,
&
buffer
,
&
find
](
const
char
*
name
,
bool
isdir
)
{
if
(
!
find
&&
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
))
{
char
subdir
[
1024
];
sprintf
(
subdir
,
"./expansions/%s"
,
name
);
buffer
=
ScriptReaderExDirectry
(
subdir
,
script_name
,
slen
);
if
(
buffer
)
find
=
true
;
}
});
if
(
find
)
return
buffer
;
return
default_script_reader
(
script_name
,
slen
);
}
byte
*
TagDuel
::
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
)
{
char
sname
[
256
];
strcpy
(
sname
,
path
);
strcat
(
sname
,
script_name
+
pre_len
);
//default script name: ./script/c%d.lua
return
default_script_reader
(
sname
,
slen
);
}
int
TagDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
return
0
;
...
...
gframe/tag_duel.h
View file @
29dd97a1
...
...
@@ -39,6 +39,7 @@ public:
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReaderExDirectry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
=
1
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
TagTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
...
...
@@ -62,4 +63,3 @@ protected:
}
#endif //TAG_DUEL_H
premake5.lua
View file @
29dd97a1
...
...
@@ -77,6 +77,9 @@ solution "ygo"
include
"irrlicht"
include
"sqlite3"
end
if
os
.
ishost
(
"linux"
)
then
include
"irrlicht_linux"
end
if
USE_IRRKLANG
then
include
"ikpmp3"
end
script
@
40ef6337
Subproject commit
74c6c3d87e622eaf8f80344d4b1578c69333cd16
Subproject commit
40ef633762b4f320427433a6963ebcfe241158f3
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