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
de04eeee
Commit
de04eeee
authored
Mar 27, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'subdir'"
This reverts commit
a2455736
, reversing changes made to
83f05fd7
.
parent
f2700f47
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
40 additions
and
125 deletions
+40
-125
gframe/data_manager.cpp
gframe/data_manager.cpp
+5
-23
gframe/data_manager.h
gframe/data_manager.h
+1
-1
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+0
-13
gframe/game.cpp
gframe/game.cpp
+3
-23
gframe/game.h
gframe/game.h
+0
-2
gframe/image_manager.cpp
gframe/image_manager.cpp
+24
-54
gframe/image_manager.h
gframe/image_manager.h
+0
-2
gframe/replay_mode.h
gframe/replay_mode.h
+2
-2
gframe/single_duel.h
gframe/single_duel.h
+2
-2
gframe/single_mode.h
gframe/single_mode.h
+1
-1
gframe/tag_duel.h
gframe/tag_duel.h
+2
-2
No files found.
gframe/data_manager.cpp
View file @
de04eeee
...
@@ -67,13 +67,7 @@ bool DataManager::LoadDB(const char* file) {
...
@@ -67,13 +67,7 @@ bool DataManager::LoadDB(const char* file) {
return
true
;
return
true
;
}
}
bool
DataManager
::
LoadStrings
(
const
char
*
file
)
{
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"
);
FILE
*
fp
=
fopen
(
file
,
"r"
);
#endif // _WIN32
if
(
!
fp
)
if
(
!
fp
)
return
false
;
return
false
;
char
linebuf
[
256
];
char
linebuf
[
256
];
...
@@ -320,34 +314,22 @@ int DataManager::CardReader(int code, void* pData) {
...
@@ -320,34 +314,22 @@ int DataManager::CardReader(int code, void* pData) {
byte
*
DataManager
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
byte
*
DataManager
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
byte
*
buffer
;
byte
*
buffer
;
if
(
!
mainGame
->
gameConf
.
prefer_expansion_script
)
{
if
(
!
mainGame
->
gameConf
.
prefer_expansion_script
)
{
buffer
=
ScriptReaderEx
Directry
(
"."
,
script_name
,
slen
);
buffer
=
ScriptReaderEx
Single
(
"."
,
script_name
,
slen
);
if
(
buffer
)
if
(
buffer
)
return
buffer
;
return
buffer
;
}
}
buffer
=
ScriptReaderEx
Directry
(
"./specials"
,
script_name
,
slen
,
8
);
buffer
=
ScriptReaderEx
Single
(
"./specials"
,
script_name
,
slen
,
8
);
if
(
buffer
)
if
(
buffer
)
return
buffer
;
return
buffer
;
buffer
=
ScriptReaderEx
Directry
(
"./expansions"
,
script_name
,
slen
);
buffer
=
ScriptReaderEx
Single
(
"./expansions"
,
script_name
,
slen
);
if
(
buffer
)
if
(
buffer
)
return
buffer
;
return
buffer
;
buffer
=
ScriptReaderEx
Directry
(
"./beta"
,
script_name
,
slen
);
buffer
=
ScriptReaderEx
Single
(
"./beta"
,
script_name
,
slen
);
if
(
buffer
)
if
(
buffer
)
return
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
,
".."
)
&&
strcmp
(
name
,
"pics"
)
&&
strcmp
(
name
,
"script"
))
{
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
);
return
ScriptReader
(
script_name
,
slen
);
}
}
byte
*
DataManager
::
ScriptReaderEx
Directry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
)
{
byte
*
DataManager
::
ScriptReaderEx
Single
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
)
{
char
sname
[
256
];
char
sname
[
256
];
sprintf
(
sname
,
"%s%s"
,
path
,
script_name
+
pre_len
);
//default script name: ./script/c%d.lua
sprintf
(
sname
,
"%s%s"
,
path
,
script_name
+
pre_len
);
//default script name: ./script/c%d.lua
return
ScriptReader
(
sname
,
slen
);
return
ScriptReader
(
sname
,
slen
);
...
...
gframe/data_manager.h
View file @
de04eeee
...
@@ -53,7 +53,7 @@ public:
...
@@ -53,7 +53,7 @@ public:
static
const
wchar_t
*
unknown_string
;
static
const
wchar_t
*
unknown_string
;
static
int
CardReader
(
int
,
void
*
);
static
int
CardReader
(
int
,
void
*
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReaderEx
Directry
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
=
1
);
static
byte
*
ScriptReaderEx
Single
(
const
char
*
path
,
const
char
*
script_name
,
int
*
slen
,
int
pre_len
=
1
);
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
};
};
...
...
gframe/deck_manager.cpp
View file @
de04eeee
...
@@ -10,13 +10,7 @@ DeckManager deckManager;
...
@@ -10,13 +10,7 @@ DeckManager deckManager;
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
LFList
*
cur
=
NULL
;
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"
);
FILE
*
fp
=
fopen
(
path
,
"r"
);
#endif // _WIN32
char
linebuf
[
256
];
char
linebuf
[
256
];
wchar_t
strBuffer
[
256
];
wchar_t
strBuffer
[
256
];
if
(
fp
)
{
if
(
fp
)
{
...
@@ -57,13 +51,6 @@ void DeckManager::LoadLFListSingle(const char* path) {
...
@@ -57,13 +51,6 @@ void DeckManager::LoadLFListSingle(const char* path) {
}
}
void
DeckManager
::
LoadLFList
()
{
void
DeckManager
::
LoadLFList
()
{
LoadLFListSingle
(
"expansions/lflist.conf"
);
LoadLFListSingle
(
"expansions/lflist.conf"
);
FileSystem
::
TraversalDir
(
"./expansions"
,
[
this
](
const
char
*
name
,
bool
isdir
)
{
if
(
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
)
&&
strcmp
(
name
,
"pics"
)
&&
strcmp
(
name
,
"script"
))
{
char
fpath
[
1024
];
sprintf
(
fpath
,
"./expansions/%s/lflist.conf"
,
name
);
LoadLFListSingle
(
fpath
);
}
});
LoadLFListSingle
(
"lflist.conf"
);
LoadLFListSingle
(
"lflist.conf"
);
LFList
nolimit
;
LFList
nolimit
;
myswprintf
(
nolimit
.
listName
,
L"N/A"
);
myswprintf
(
nolimit
.
listName
,
L"N/A"
);
...
...
gframe/game.cpp
View file @
de04eeee
...
@@ -89,7 +89,7 @@ bool Game::Initialize() {
...
@@ -89,7 +89,7 @@ bool Game::Initialize() {
ErrorLog
(
"Failed to load strings!"
);
ErrorLog
(
"Failed to load strings!"
);
return
false
;
return
false
;
}
}
LoadExpansionStrings
(
);
dataManager
.
LoadStrings
(
"./expansions/strings.conf"
);
env
=
device
->
getGUIEnvironment
();
env
=
device
->
getGUIEnvironment
();
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
adFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
12
);
adFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
12
);
...
@@ -982,34 +982,14 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
...
@@ -982,34 +982,14 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
pControl
->
setText
(
dataManager
.
strBuffer
);
pControl
->
setText
(
dataManager
.
strBuffer
);
}
}
void
Game
::
LoadExpansionDB
()
{
void
Game
::
LoadExpansionDB
()
{
LoadExpansionDBDirectry
(
"./expansions"
);
FileSystem
::
TraversalDir
(
"./expansions"
,
[](
const
char
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
"./expansions"
,
[
this
](
const
char
*
name
,
bool
isdir
)
{
if
(
isdir
&&
strcmp
(
name
,
"."
)
&&
strcmp
(
name
,
".."
)
&&
strcmp
(
name
,
"pics"
)
&&
strcmp
(
name
,
"script"
))
{
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
))
{
if
(
!
isdir
&&
strrchr
(
name
,
'.'
)
&&
!
mystrncasecmp
(
strrchr
(
name
,
'.'
),
".cdb"
,
4
))
{
char
fpath
[
1024
];
char
fpath
[
1024
];
sprintf
(
fpath
,
"
%s/%s"
,
path
,
name
);
sprintf
(
fpath
,
"
./expansions/%s"
,
name
);
dataManager
.
LoadDB
(
fpath
);
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
,
".."
)
&&
strcmp
(
name
,
"pics"
)
&&
strcmp
(
name
,
"script"
))
{
char
fpath
[
1024
];
sprintf
(
fpath
,
"./expansions/%s/strings.conf"
,
name
);
dataManager
.
LoadStrings
(
fpath
);
}
});
}
void
Game
::
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
void
Game
::
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
cbDeck
->
clear
();
cbDeck
->
clear
();
FileSystem
::
TraversalDir
(
L"./deck"
,
[
cbDeck
](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
L"./deck"
,
[
cbDeck
](
const
wchar_t
*
name
,
bool
isdir
)
{
...
...
gframe/game.h
View file @
de04eeee
...
@@ -130,8 +130,6 @@ public:
...
@@ -130,8 +130,6 @@ public:
void
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
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
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
void
LoadExpansionDB
();
void
LoadExpansionDB
();
void
LoadExpansionDBDirectry
(
const
char
*
path
);
void
LoadExpansionStrings
();
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshReplay
();
void
RefreshReplay
();
void
RefreshSingleplay
();
void
RefreshSingleplay
();
...
...
gframe/image_manager.cpp
View file @
de04eeee
...
@@ -274,55 +274,25 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
...
@@ -274,55 +274,25 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
}
}
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
)
{
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
)
{
if
(
mainGame
->
gameConf
.
use_image_scale
)
{
irr
::
video
::
ITexture
*
texture
;
irr
::
video
::
ITexture
*
texture
;
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
nam
e
);
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
fil
e
);
if
(
srcimg
==
NULL
)
if
(
srcimg
==
NULL
)
return
NULL
;
return
NULL
;
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
))
{
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
))
{
texture
=
driver
->
addTexture
(
nam
e
,
srcimg
);
texture
=
driver
->
addTexture
(
fil
e
,
srcimg
);
}
else
{
}
else
{
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
));
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
));
imageScaleNNAA
(
srcimg
,
destimg
);
imageScaleNNAA
(
srcimg
,
destimg
);
texture
=
driver
->
addTexture
(
nam
e
,
destimg
);
texture
=
driver
->
addTexture
(
fil
e
,
destimg
);
destimg
->
drop
();
destimg
->
drop
();
}
}
srcimg
->
drop
();
srcimg
->
drop
();
return
texture
;
return
texture
;
}
else
{
}
else
{
return
driver
->
getTexture
(
nam
e
);
return
driver
->
getTexture
(
fil
e
);
}
}
}
}
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
,
".."
)
&&
strcmp
(
name
,
"pics"
)
&&
strcmp
(
name
,
"script"
))
{
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
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
if
(
code
==
0
)
if
(
code
==
0
)
return
fit
?
tUnknownFit
:
tUnknown
;
return
fit
?
tUnknownFit
:
tUnknown
;
...
@@ -338,11 +308,11 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
...
@@ -338,11 +308,11 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
auto
tit
=
tMap
[
fit
?
1
:
0
].
find
(
code
);
auto
tit
=
tMap
[
fit
?
1
:
0
].
find
(
code
);
if
(
tit
==
tMap
[
fit
?
1
:
0
].
end
())
{
if
(
tit
==
tMap
[
fit
?
1
:
0
].
end
())
{
char
file
[
256
];
char
file
[
256
];
sprintf
(
file
,
"pics/%d.png"
,
code
);
sprintf
(
file
,
"
expansions/
pics/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
irr
::
video
::
ITexture
*
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/%d.jpg"
,
code
);
sprintf
(
file
,
"
expansions/
pics/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
}
}
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.png"
),
code
);
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.png"
),
code
);
...
@@ -380,11 +350,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -380,11 +350,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
if
(
tit
==
tThumb
.
end
())
{
if
(
tit
==
tThumb
.
end
())
{
char
file
[
256
];
char
file
[
256
];
sprintf
(
file
,
"pics/thumbnail/%d.png"
,
code
);
sprintf
(
file
,
"
expansions/
pics/thumbnail/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
irr
::
video
::
ITexture
*
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/thumbnail/%d.jpg"
,
code
);
sprintf
(
file
,
"
expansions/
pics/thumbnail/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
}
}
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/thumbnail/%d.png"
),
code
);
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/thumbnail/%d.png"
),
code
);
...
@@ -403,11 +373,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -403,11 +373,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
}
if
(
img
==
NULL
&&
mainGame
->
gameConf
.
use_image_scale
)
{
if
(
img
==
NULL
&&
mainGame
->
gameConf
.
use_image_scale
)
{
sprintf
(
file
,
"pics/%d.png"
,
code
);
sprintf
(
file
,
"
expansions/
pics/%d.png"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/%d.jpg"
,
code
);
sprintf
(
file
,
"
expansions/
pics/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
width
,
height
);
img
=
GetTexture
FromFile
(
file
,
width
,
height
);
}
}
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.png"
),
code
);
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.png"
),
code
);
...
@@ -437,11 +407,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -437,11 +407,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
auto
tit
=
tFields
.
find
(
code
);
auto
tit
=
tFields
.
find
(
code
);
if
(
tit
==
tFields
.
end
())
{
if
(
tit
==
tFields
.
end
())
{
char
file
[
256
];
char
file
[
256
];
sprintf
(
file
,
"pics/field/%d.png"
,
code
);
sprintf
(
file
,
"
expansions/
pics/field/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
Expansions
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
irr
::
video
::
ITexture
*
img
=
GetTexture
FromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/field/%d.jpg"
,
code
);
sprintf
(
file
,
"
expansions/
pics/field/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
img
=
GetTexture
FromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
}
}
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/field/%d.png"
),
code
);
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/field/%d.png"
),
code
);
...
@@ -481,11 +451,11 @@ irr::video::ITexture* ImageManager::GetTextureField(int code) {
...
@@ -481,11 +451,11 @@ irr::video::ITexture* ImageManager::GetTextureField(int code) {
auto
tit
=
tFields
.
find
(
code
);
auto
tit
=
tFields
.
find
(
code
);
if
(
tit
==
tFields
.
end
())
{
if
(
tit
==
tFields
.
end
())
{
char
file
[
256
];
char
file
[
256
];
sprintf
(
file
,
"pics/field/%d.png"
,
code
);
sprintf
(
file
,
"
expansions/
pics/field/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTexture
Expansions
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
irr
::
video
::
ITexture
*
img
=
GetTexture
FromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/field/%d.jpg"
,
code
);
sprintf
(
file
,
"
expansions/
pics/field/%d.jpg"
,
code
);
img
=
GetTexture
Expansions
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
img
=
GetTexture
FromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
}
}
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/field/%d.png"
),
code
);
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/field/%d.png"
),
code
);
...
...
gframe/image_manager.h
View file @
de04eeee
...
@@ -22,8 +22,6 @@ public:
...
@@ -22,8 +22,6 @@ public:
void
RemoveTexture
(
int
code
);
void
RemoveTexture
(
int
code
);
void
ResizeTexture
();
void
ResizeTexture
();
irr
::
video
::
ITexture
*
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
);
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
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
...
...
gframe/replay_mode.h
View file @
de04eeee
...
@@ -25,7 +25,7 @@ private:
...
@@ -25,7 +25,7 @@ private:
public:
public:
static
Replay
cur_replay
;
static
Replay
cur_replay
;
public:
public:
static
bool
StartReplay
(
int
skipturn
);
static
bool
StartReplay
(
int
skipturn
);
static
void
StopReplay
(
bool
is_exiting
=
false
);
static
void
StopReplay
(
bool
is_exiting
=
false
);
...
@@ -38,7 +38,7 @@ public:
...
@@ -38,7 +38,7 @@ public:
static
void
Restart
(
bool
refresh
);
static
void
Restart
(
bool
refresh
);
static
void
Undo
();
static
void
Undo
();
static
bool
ReplayAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
bool
ReplayAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
void
ReplayRefresh
(
int
flag
=
0xf81fff
);
static
void
ReplayRefresh
(
int
flag
=
0xf81fff
);
static
void
ReplayRefreshHand
(
int
player
,
int
flag
=
0x781fff
);
static
void
ReplayRefreshHand
(
int
player
,
int
flag
=
0x781fff
);
static
void
ReplayRefreshGrave
(
int
player
,
int
flag
=
0x181fff
);
static
void
ReplayRefreshGrave
(
int
player
,
int
flag
=
0x181fff
);
...
...
gframe/single_duel.h
View file @
de04eeee
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
void
*
pdata
,
unsigned
int
len
);
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
void
*
pdata
,
unsigned
int
len
);
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
);
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
);
virtual
void
EndDuel
();
virtual
void
EndDuel
();
void
DuelEndProc
();
void
DuelEndProc
();
void
WaitforResponse
(
int
playerid
);
void
WaitforResponse
(
int
playerid
);
void
RefreshMzone
(
int
player
,
int
flag
=
0x881fff
,
int
use_cache
=
1
);
void
RefreshMzone
(
int
player
,
int
flag
=
0x881fff
,
int
use_cache
=
1
);
...
@@ -40,7 +40,7 @@ public:
...
@@ -40,7 +40,7 @@ public:
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
protected:
protected:
DuelPlayer
*
players
[
2
];
DuelPlayer
*
players
[
2
];
DuelPlayer
*
pplayer
[
2
];
DuelPlayer
*
pplayer
[
2
];
...
...
gframe/single_mode.h
View file @
de04eeee
...
@@ -17,7 +17,7 @@ public:
...
@@ -17,7 +17,7 @@ public:
static
void
SetResponse
(
unsigned
char
*
resp
,
unsigned
int
len
);
static
void
SetResponse
(
unsigned
char
*
resp
,
unsigned
int
len
);
static
int
SinglePlayThread
(
void
*
param
);
static
int
SinglePlayThread
(
void
*
param
);
static
bool
SinglePlayAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
bool
SinglePlayAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
void
SinglePlayRefresh
(
int
flag
=
0xf81fff
);
static
void
SinglePlayRefresh
(
int
flag
=
0xf81fff
);
static
void
SinglePlayRefreshHand
(
int
player
,
int
flag
=
0x781fff
);
static
void
SinglePlayRefreshHand
(
int
player
,
int
flag
=
0x781fff
);
static
void
SinglePlayRefreshGrave
(
int
player
,
int
flag
=
0x181fff
);
static
void
SinglePlayRefreshGrave
(
int
player
,
int
flag
=
0x181fff
);
...
...
gframe/tag_duel.h
View file @
de04eeee
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
void
*
pdata
,
unsigned
int
len
);
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
void
*
pdata
,
unsigned
int
len
);
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
);
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
);
virtual
void
EndDuel
();
virtual
void
EndDuel
();
void
DuelEndProc
();
void
DuelEndProc
();
void
WaitforResponse
(
int
playerid
);
void
WaitforResponse
(
int
playerid
);
void
RefreshMzone
(
int
player
,
int
flag
=
0x881fff
,
int
use_cache
=
1
);
void
RefreshMzone
(
int
player
,
int
flag
=
0x881fff
,
int
use_cache
=
1
);
...
@@ -40,7 +40,7 @@ public:
...
@@ -40,7 +40,7 @@ public:
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
TagTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
TagTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
protected:
protected:
DuelPlayer
*
players
[
4
];
DuelPlayer
*
players
[
4
];
DuelPlayer
*
pplayer
[
4
];
DuelPlayer
*
pplayer
[
4
];
...
...
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