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
wyykak
ygopro
Commits
c3bc1e44
Commit
c3bc1e44
authored
May 26, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into another
parents
0eb1769e
0e0ddc96
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
358 additions
and
349 deletions
+358
-349
cards.cdb
cards.cdb
+0
-0
gframe/client_field.cpp
gframe/client_field.cpp
+3
-0
gframe/client_field.h
gframe/client_field.h
+3
-0
gframe/drawing.cpp
gframe/drawing.cpp
+9
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+12
-31
gframe/event_handler.cpp
gframe/event_handler.cpp
+47
-9
gframe/game.cpp
gframe/game.cpp
+169
-276
gframe/game.h
gframe/game.h
+8
-2
gframe/image_manager.cpp
gframe/image_manager.cpp
+92
-22
gframe/image_manager.h
gframe/image_manager.h
+7
-0
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-2
ocgcore
ocgcore
+1
-1
premake/gframe/ygopro.rc
premake/gframe/ygopro.rc
+2
-2
script
script
+1
-1
strings.conf
strings.conf
+2
-1
system.conf
system.conf
+1
-0
No files found.
cards.cdb
View file @
c3bc1e44
No preview for this file type
gframe/client_field.cpp
View file @
c3bc1e44
...
...
@@ -12,6 +12,9 @@ namespace ygo {
ClientField
::
ClientField
()
{
panel
=
0
;
is_dragging_cardtext
=
false
;
dragging_cardtext_start_pos
=
0
;
dragging_cardtext_start_y
=
0
;
hovered_card
=
0
;
clicked_card
=
0
;
highlighting_card
=
0
;
...
...
gframe/client_field.h
View file @
c3bc1e44
...
...
@@ -117,6 +117,9 @@ public:
void
RefreshCardCountDisplay
();
irr
::
gui
::
IGUIElement
*
panel
;
bool
is_dragging_cardtext
;
int
dragging_cardtext_start_pos
;
int
dragging_cardtext_start_y
;
std
::
vector
<
int
>
ancard
;
int
hovered_controler
;
int
hovered_location
;
...
...
gframe/drawing.cpp
View file @
c3bc1e44
...
...
@@ -496,7 +496,7 @@ void Game::DrawMisc() {
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vActivate
,
4
,
matManager
.
iRectangle
,
2
);
}
if
(
dField
.
chains
.
size
()
>
1
)
{
if
(
dField
.
chains
.
size
()
>
1
||
mainGame
->
gameConf
.
draw_single_chain
)
{
for
(
size_t
i
=
0
;
i
<
dField
.
chains
.
size
();
++
i
)
{
if
(
dField
.
chains
[
i
].
solved
)
break
;
...
...
@@ -1072,6 +1072,8 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
fadingList
.
push_back
(
fu
);
}
void
Game
::
HideElement
(
irr
::
gui
::
IGUIElement
*
win
,
bool
set_action
)
{
if
(
!
win
->
isVisible
()
&&
!
set_action
)
return
;
FadingUnit
fu
;
fu
.
fadingSize
=
win
->
getRelativePosition
();
for
(
auto
fit
=
fadingList
.
begin
();
fit
!=
fadingList
.
end
();
++
fit
)
...
...
@@ -1287,8 +1289,13 @@ void Game::DrawDeckBd() {
DrawShadowText
(
numFont
,
deckBuilder
.
result_string
,
Resize
(
875
,
137
,
935
,
157
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
driver
->
draw2DRectangle
(
Resize
(
805
,
160
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
159
,
1020
,
630
));
for
(
size_t
i
=
0
;
i
<
7
&&
i
+
scrFilter
->
getPos
()
<
deckBuilder
.
results
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
9
&&
i
+
scrFilter
->
getPos
()
<
deckBuilder
.
results
.
size
();
++
i
)
{
code_pointer
ptr
=
deckBuilder
.
results
[
i
+
scrFilter
->
getPos
()];
if
(
i
>=
7
)
{
imageManager
.
GetTextureThumb
(
ptr
->
second
.
code
);
break
;
}
if
(
deckBuilder
.
hovered_pos
==
4
&&
deckBuilder
.
hovered_seq
==
(
int
)
i
)
driver
->
draw2DRectangle
(
0x80000000
,
Resize
(
806
,
164
+
i
*
66
,
1019
,
230
+
i
*
66
));
DrawThumb
(
ptr
,
position2di
(
810
,
165
+
i
*
66
),
deckBuilder
.
filterList
);
...
...
gframe/duelclient.cpp
View file @
c3bc1e44
...
...
@@ -267,6 +267,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
#endif
switch
(
pktType
)
{
case
STOC_GAME_MSG
:
{
if
(
!
mainGame
->
dInfo
.
isStarted
)
break
;
ClientAnalyze
(
pdata
,
len
-
1
);
break
;
}
...
...
@@ -466,24 +468,17 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
dField
.
Clear
();
mainGame
->
is_building
=
true
;
mainGame
->
is_siding
=
true
;
mainGame
->
CloseGameWindow
();
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
mainGame
->
stTip
->
setVisible
(
false
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSideOK
->
setVisible
(
true
);
mainGame
->
btnSideShuffle
->
setVisible
(
true
);
mainGame
->
btnSideSort
->
setVisible
(
true
);
mainGame
->
btnSideReload
->
setVisible
(
true
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSpectatorSwap
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
mainGame
->
deckBuilder
.
results
.
clear
();
...
...
@@ -587,12 +582,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
RefreshCategoryDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
);
mainGame
->
cbCategorySelect
->
setEnabled
(
true
);
mainGame
->
cbDeckSelect
->
setEnabled
(
true
);
if
(
mainGame
->
wCreateHost
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
else
if
(
mainGame
->
wLanWindow
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
else
if
(
mainGame
->
wSinglePlay
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
//if(!mainGame->chkIgnore1->isChecked())
mainGame
->
wChat
->
setVisible
(
true
);
...
...
@@ -756,14 +748,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
gMutex
.
lock
();
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSpectatorSwap
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
mainGame
->
wSurrender
->
setVisible
(
false
);
mainGame
->
CloseGameButtons
(
);
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
...
...
@@ -805,14 +792,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
case
STOC_REPLAY
:
{
mainGame
->
gMutex
.
lock
();
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
wSurrender
->
setVisible
(
false
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
CloseGameButtons
();
char
*
prep
=
pdata
;
Replay
new_replay
;
memcpy
(
&
new_replay
.
pheader
,
prep
,
sizeof
(
ReplayHeader
));
...
...
@@ -2651,8 +2633,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dInfo
.
is_swapped
=
!
mainGame
->
dInfo
.
is_swapped
;
return
true
;
}
if
(
mainGame
->
wSurrender
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
player_type
<
7
)
{
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1351
));
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
...
...
@@ -3184,7 +3165,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
WaitFrameSignal
(
11
);
}
}
if
(
mainGame
->
dField
.
chains
.
size
()
>
1
)
{
if
(
mainGame
->
dField
.
chains
.
size
()
>
1
||
mainGame
->
gameConf
.
draw_single_chain
)
{
if
(
mainGame
->
dField
.
last_chain
)
mainGame
->
WaitFrameSignal
(
11
);
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
...
...
gframe/event_handler.cpp
View file @
c3bc1e44
...
...
@@ -129,13 +129,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
wCardImg
->
setVisible
(
false
);
mainGame
->
wInfos
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSpectatorSwap
->
setVisible
(
false
);
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
CloseDuelWindow
();
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
...
...
@@ -1462,8 +1456,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
if
(
mainGame
->
wSurrender
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
mainGame
->
fadingList
.
size
())
break
;
...
...
@@ -1908,6 +1901,11 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
break
;
}
case
CHECKBOX_DRAW_SINGLE_CHAIN
:
{
mainGame
->
gameConf
.
draw_single_chain
=
mainGame
->
chkDrawSingleChain
->
isChecked
()
?
1
:
0
;
return
true
;
break
;
}
case
CHECKBOX_PREFER_EXPANSION
:
{
mainGame
->
gameConf
.
prefer_expansion_script
=
mainGame
->
chkPreferExpansionScript
->
isChecked
()
?
1
:
0
;
return
true
;
...
...
@@ -2048,6 +2046,46 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
EET_MOUSE_INPUT_EVENT
:
{
switch
(
event
.
MouseInput
.
Event
)
{
case
irr
:
:
EMIE_LMOUSE_PRESSED_DOWN
:
{
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
position2di
mousepos
=
position2di
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
stText
)
{
if
(
!
mainGame
->
scrCardText
->
isVisible
())
{
break
;
}
is_dragging_cardtext
=
true
;
dragging_cardtext_start_pos
=
mainGame
->
scrCardText
->
getPos
();
dragging_cardtext_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
break
;
}
case
irr
:
:
EMIE_LMOUSE_LEFT_UP
:
{
is_dragging_cardtext
=
false
;
break
;
}
case
irr
:
:
EMIE_MOUSE_MOVED
:
{
if
(
is_dragging_cardtext
)
{
if
(
!
mainGame
->
scrCardText
->
isVisible
())
{
is_dragging_cardtext
=
false
;
break
;
}
int
step
=
mainGame
->
guiFont
->
getDimension
(
L"A"
).
Height
+
mainGame
->
guiFont
->
getKerningHeight
();
int
pos
=
dragging_cardtext_start_pos
+
(
dragging_cardtext_start_y
-
event
.
MouseInput
.
Y
)
/
step
;
int
max
=
mainGame
->
scrCardText
->
getMax
();
if
(
pos
<
0
)
pos
=
0
;
if
(
pos
>
max
)
pos
=
max
;
mainGame
->
scrCardText
->
setPos
(
pos
);
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
guiFont
,
mainGame
->
showingtext
,
pos
);
}
break
;
}
default:
break
;
}
break
;
}
default:
break
;
}
return
false
;
...
...
gframe/game.cpp
View file @
c3bc1e44
This diff is collapsed.
Click to expand it.
gframe/game.h
View file @
c3bc1e44
...
...
@@ -55,6 +55,7 @@ struct Config {
int
window_height
;
bool
resize_popup_menu
;
int
auto_save_replay
;
int
draw_single_chain
;
int
prefer_expansion_script
;
bool
enable_sound
;
bool
enable_music
;
...
...
@@ -162,6 +163,7 @@ public:
void
WaitFrameSignal
(
int
frame
);
void
DrawThumb
(
code_pointer
cp
,
position2di
pos
,
const
std
::
unordered_map
<
int
,
int
>*
lflist
,
bool
drag
=
false
);
void
DrawDeckBd
();
bool
LoadConfigFromFile
(
const
char
*
file
);
void
LoadConfig
();
void
SaveConfig
();
void
ShowCardInfo
(
int
code
,
bool
resize
=
false
);
...
...
@@ -173,6 +175,8 @@ public:
void
ErrorLog
(
const
char
*
msgbuf
);
void
initUtils
();
void
ClearTextures
();
void
CloseGameButtons
();
void
CloseGameWindow
();
void
CloseDuelWindow
();
int
LocalPlayer
(
int
player
);
...
...
@@ -321,6 +325,7 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkWaitChain
;
irr
::
gui
::
IGUICheckBox
*
chkQuickAnimation
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSaveReplay
;
irr
::
gui
::
IGUICheckBox
*
chkDrawSingleChain
;
irr
::
gui
::
IGUIWindow
*
tabSystem
;
irr
::
gui
::
IGUIElement
*
elmTabSystemLast
;
irr
::
gui
::
IGUIScrollBar
*
scrTabSystem
;
...
...
@@ -819,8 +824,9 @@ extern Game* mainGame;
#define SCROLL_TAB_SYSTEM 371
#define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_PREFER_EXPANSION 373
#define CHECKBOX_REGEX 374
#define COMBOBOX_LOCALE 375
#define CHECKBOX_DRAW_SINGLE_CHAIN 374
#define CHECKBOX_REGEX 375
#define COMBOBOX_LOCALE 376
#define BUTTON_DECK_CODE 389
#define BUTTON_DECK_CODE_SAVE 390
...
...
gframe/image_manager.cpp
View file @
c3bc1e44
...
...
@@ -21,6 +21,8 @@ bool ImageManager::Initial() {
tUnknown
=
NULL
;
tUnknownFit
=
NULL
;
tUnknownThumb
=
NULL
;
tLoading
=
NULL
;
tThumbLoadingThreadRunning
=
false
;
tAct
=
GetRandomImage
(
TEXTURE_ACTIVATE
);
tAttack
=
GetRandomImage
(
TEXTURE_ATTACK
);
if
(
!
tAct
)
...
...
@@ -127,12 +129,18 @@ void ImageManager::ClearTexture() {
driver
->
removeTexture
(
tit
->
second
);
}
for
(
auto
tit
=
tThumb
.
begin
();
tit
!=
tThumb
.
end
();
++
tit
)
{
if
(
tit
->
second
)
if
(
tit
->
second
&&
tit
->
second
!=
tLoading
)
driver
->
removeTexture
(
tit
->
second
);
}
tMap
[
0
].
clear
();
tMap
[
1
].
clear
();
tThumb
.
clear
();
tThumbLoadingMutex
.
lock
();
tThumbLoading
.
clear
();
while
(
!
tThumbLoadingCodes
.
empty
())
tThumbLoadingCodes
.
pop
();
tThumbLoadingThreadRunning
=
false
;
tThumbLoadingMutex
.
unlock
();
tFields
.
clear
();
}
void
ImageManager
::
RemoveTexture
(
int
code
)
{
...
...
@@ -174,9 +182,11 @@ void ImageManager::ResizeTexture() {
driver
->
removeTexture
(
tUnknown
);
driver
->
removeTexture
(
tUnknownFit
);
driver
->
removeTexture
(
tUnknownThumb
);
driver
->
removeTexture
(
tLoading
);
tUnknown
=
GetTextureFromFile
(
"textures/unknown.jpg"
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
);
tUnknownFit
=
GetTextureFromFile
(
"textures/unknown.jpg"
,
imgWidthFit
,
imgHeightFit
);
tUnknownThumb
=
GetTextureFromFile
(
"textures/unknown.jpg"
,
imgWidthThumb
,
imgHeightThumb
);
tLoading
=
GetTextureFromFile
(
"textures/cover.jpg"
,
imgWidthThumb
,
imgHeightThumb
);
driver
->
removeTexture
(
tBackGround
);
tBackGround
=
GetRandomImage
(
TEXTURE_DUEL
,
bgWidth
,
bgHeight
);
if
(
!
tBackGround
)
...
...
@@ -342,62 +352,122 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
else
return
mainGame
->
gameConf
.
use_image_scale
?
(
fit
?
tUnknownFit
:
tUnknown
)
:
GetTextureThumb
(
code
);
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
if
(
code
==
0
)
return
tUnknownThumb
;
auto
tit
=
tThumb
.
find
(
code
);
int
width
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
if
(
tit
==
tThumb
.
end
())
{
int
ImageManager
::
LoadThumbThread
()
{
while
(
true
)
{
imageManager
.
tThumbLoadingMutex
.
lock
();
int
code
=
imageManager
.
tThumbLoadingCodes
.
front
();
imageManager
.
tThumbLoadingCodes
.
pop
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
char
file
[
256
];
sprintf
(
file
,
"expansions/pics/thumbnail/%d.png"
,
code
);
irr
::
video
::
I
Texture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
irr
::
video
::
I
Image
*
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
if
(
img
==
NULL
)
{
sprintf
(
file
,
"expansions/pics/thumbnail/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/thumbnail/%d.png"
),
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/thumbnail/%d.jpg"
),
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/thumbnail/%d.png"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/thumbnail/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
&&
mainGame
->
gameConf
.
use_image_scale
)
{
sprintf
(
file
,
"expansions/pics/%d.png"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
if
(
img
==
NULL
)
{
sprintf
(
file
,
"expansions/pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.png"
),
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
mainGame
->
GetLocaleDir
(
"pics/%d.jpg"
),
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/%d.png"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
NULL
)
{
sprintf
(
file
,
"pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
}
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
if
(
img
!=
NULL
)
{
int
width
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
if
(
img
->
getDimension
()
==
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
))
{
img
->
grab
();
imageManager
.
tThumbLoadingMutex
.
lock
();
if
(
imageManager
.
tThumbLoadingThreadRunning
)
imageManager
.
tThumbLoading
[
code
]
=
img
;
imageManager
.
tThumbLoadingMutex
.
unlock
();
}
else
{
irr
::
video
::
IImage
*
destimg
=
imageManager
.
driver
->
createImage
(
img
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
));
imageScaleNNAA
(
img
,
destimg
);
img
->
drop
();
destimg
->
grab
();
imageManager
.
tThumbLoadingMutex
.
lock
();
if
(
imageManager
.
tThumbLoadingThreadRunning
)
imageManager
.
tThumbLoading
[
code
]
=
destimg
;
imageManager
.
tThumbLoadingMutex
.
unlock
();
}
}
else
{
imageManager
.
tThumbLoadingMutex
.
lock
();
if
(
imageManager
.
tThumbLoadingThreadRunning
)
imageManager
.
tThumbLoading
[
code
]
=
NULL
;
imageManager
.
tThumbLoadingMutex
.
unlock
();
}
imageManager
.
tThumbLoadingMutex
.
lock
();
imageManager
.
tThumbLoadingThreadRunning
=
!
imageManager
.
tThumbLoadingCodes
.
empty
();
if
(
!
imageManager
.
tThumbLoadingThreadRunning
)
break
;
imageManager
.
tThumbLoadingMutex
.
unlock
();
}
imageManager
.
tThumbLoadingMutex
.
unlock
();
return
0
;
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
if
(
code
==
0
)
return
tUnknownThumb
;
imageManager
.
tThumbLoadingMutex
.
lock
();
auto
lit
=
tThumbLoading
.
find
(
code
);
if
(
lit
!=
tThumbLoading
.
end
())
{
if
(
lit
->
second
!=
NULL
)
{
char
file
[
256
];
sprintf
(
file
,
"pics/thumbnail/%d.jpg"
,
code
);
irr
::
video
::
ITexture
*
texture
=
driver
->
addTexture
(
file
,
lit
->
second
);
// textures must be added in the main thread due to OpenGL
lit
->
second
->
drop
();
tThumb
[
code
]
=
texture
;
}
else
{
tThumb
[
code
]
=
NULL
;
}
tThumbLoading
.
erase
(
lit
);
}
imageManager
.
tThumbLoadingMutex
.
unlock
();
auto
tit
=
tThumb
.
find
(
code
);
if
(
tit
==
tThumb
.
end
())
{
tThumb
[
code
]
=
tLoading
;
imageManager
.
tThumbLoadingMutex
.
lock
();
tThumbLoadingCodes
.
push
(
code
);
if
(
!
tThumbLoadingThreadRunning
)
{
tThumbLoadingThreadRunning
=
true
;
std
::
thread
(
LoadThumbThread
).
detach
();
}
imageManager
.
tThumbLoadingMutex
.
unlock
();
return
tLoading
;
}
if
(
tit
->
second
)
return
tit
->
second
;
...
...
gframe/image_manager.h
View file @
c3bc1e44
...
...
@@ -4,6 +4,7 @@
#include "config.h"
#include "data_manager.h"
#include <unordered_map>
#include <queue>
namespace
ygo
{
...
...
@@ -25,16 +26,22 @@ public:
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
static
int
LoadThumbThread
();
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
2
];
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tThumb
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
std
::
unordered_map
<
int
,
irr
::
video
::
IImage
*>
tThumbLoading
;
std
::
queue
<
int
>
tThumbLoadingCodes
;
std
::
mutex
tThumbLoadingMutex
;
bool
tThumbLoadingThreadRunning
;
irr
::
IrrlichtDevice
*
device
;
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
ITexture
*
tCover
[
4
];
irr
::
video
::
ITexture
*
tUnknown
;
irr
::
video
::
ITexture
*
tUnknownFit
;
irr
::
video
::
ITexture
*
tUnknownThumb
;
irr
::
video
::
ITexture
*
tLoading
;
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAttack
;
irr
::
video
::
ITexture
*
tNegated
;
...
...
gframe/replay_mode.cpp
View file @
c3bc1e44
...
...
@@ -234,8 +234,7 @@ void ReplayMode::EndDuel() {
mainGame
->
actionSignal
.
Reset
();
mainGame
->
gMutex
.
lock
();
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1501
));
if
(
mainGame
->
wCardSelect
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCardSelect
);
mainGame
->
HideElement
(
mainGame
->
wCardSelect
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
...
...
ocgcore
@
8fcf28ce
Subproject commit
0585a44f2f9e8dc1028423fbdd1f066e7e8db44a
Subproject commit
8fcf28ce5eaeda7b19205e439f7a1986aafc5b76
premake/gframe/ygopro.rc
View file @
c3bc1e44
...
...
@@ -16,8 +16,8 @@ VALUE "InternalName", "KoishiPro"
VALUE "LegalCopyright", "Copyright (C) 2019 Nanahira"
VALUE "OriginalFilename", "ygopro_another.exe"
VALUE "ProductName", "KoishiPro"
VALUE "FileVersion", "
Mopemop
e"
VALUE "ProductVersion", "
Mopemop
e"
VALUE "FileVersion", "
Latitud
e"
VALUE "ProductVersion", "
Latitud
e"
END
END
BLOCK "VarFileInfo"
...
...
script
@
d9c80c81
Subproject commit
856c2ecbc1dbdd60e2d9452d902283d73c27aa09
Subproject commit
d9c80c813f23b8f8758cca8f71661fa31888809f
strings.conf
View file @
c3bc1e44
...
...
@@ -317,6 +317,7 @@
!
system
1262
大师规则3
!
system
1263
新大师规则
!
system
1264
大师规则
2020
!
system
1269
数字灵摆图片
!
system
1270
卡片信息
!
system
1271
消息记录
!
system
1272
清除记录
...
...
@@ -334,7 +335,7 @@
!
system
1284
中
!
system
1285
大
!
system
1286
特大
!
system
1287
数字灵摆图片
!
system
1287
只有连锁
1
也显示连锁动画
!
system
1288
语言(重启后生效)
!
system
1289
默认
!
system
1290
忽略对方发言
...
...
system.conf
View file @
c3bc1e44
...
...
@@ -38,6 +38,7 @@ enable_bot_mode = 1
bot_deck_path
= ./
windbot
/
Decks
quick_animation
=
1
auto_save_replay
=
1
draw_single_chain
=
0
window_maximized
=
0
window_width
=
1024
window_height
=
640
...
...
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