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
YGOPRO-520DIY
ygopro
Commits
b5bf7990
Commit
b5bf7990
authored
Feb 20, 2025
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace irr::s32, irr::u32
parent
95fb0997
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
415 additions
and
415 deletions
+415
-415
gframe/client_card.h
gframe/client_card.h
+3
-3
gframe/client_field.cpp
gframe/client_field.cpp
+6
-6
gframe/deck_con.cpp
gframe/deck_con.cpp
+6
-6
gframe/drawing.cpp
gframe/drawing.cpp
+11
-11
gframe/duelclient.cpp
gframe/duelclient.cpp
+6
-6
gframe/event_handler.cpp
gframe/event_handler.cpp
+15
-15
gframe/game.cpp
gframe/game.cpp
+341
-341
gframe/game.h
gframe/game.h
+16
-16
gframe/image_manager.cpp
gframe/image_manager.cpp
+9
-9
gframe/image_manager.h
gframe/image_manager.h
+1
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-1
No files found.
gframe/client_card.h
View file @
b5bf7990
...
@@ -15,9 +15,9 @@ public:
...
@@ -15,9 +15,9 @@ public:
irr
::
core
::
vector3df
curRot
;
irr
::
core
::
vector3df
curRot
;
irr
::
core
::
vector3df
dPos
;
irr
::
core
::
vector3df
dPos
;
irr
::
core
::
vector3df
dRot
;
irr
::
core
::
vector3df
dRot
;
u32
curAlpha
{
255
};
irr
::
u32
curAlpha
{
255
};
u32
dAlpha
{
0
};
irr
::
u32
dAlpha
{
0
};
u32
aniFrame
{
0
};
irr
::
u32
aniFrame
{
0
};
bool
is_moving
{
false
};
bool
is_moving
{
false
};
bool
is_fading
{
false
};
bool
is_fading
{
false
};
bool
is_hovered
{
false
};
bool
is_hovered
{
false
};
...
...
gframe/client_field.cpp
View file @
b5bf7990
...
@@ -431,7 +431,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
...
@@ -431,7 +431,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
chain_code
));
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
chain_code
));
else
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_SORT_CARD
)
{
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_SORT_CARD
)
{
...
@@ -486,7 +486,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
...
@@ -486,7 +486,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
}
}
mainGame
->
stCardPos
[
i
]
->
setVisible
(
true
);
mainGame
->
stCardPos
[
i
]
->
setVisible
(
true
);
mainGame
->
stCardPos
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
+
i
*
125
,
30
,
startpos
+
120
+
i
*
125
,
50
));
mainGame
->
stCardPos
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
+
i
*
125
,
30
,
startpos
+
120
+
i
*
125
,
50
));
}
}
if
(
selectable_cards
.
size
()
<=
5
)
{
if
(
selectable_cards
.
size
()
<=
5
)
{
for
(
int
i
=
selectable_cards
.
size
();
i
<
5
;
++
i
)
{
for
(
int
i
=
selectable_cards
.
size
();
i
<
5
;
++
i
)
{
...
@@ -519,7 +519,7 @@ void ClientField::ShowChainCard() {
...
@@ -519,7 +519,7 @@ void ClientField::ShowChainCard() {
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
code
));
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
code
));
else
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
...
@@ -538,7 +538,7 @@ void ClientField::ShowChainCard() {
...
@@ -538,7 +538,7 @@ void ClientField::ShowChainCard() {
else
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
else
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
}
}
mainGame
->
stCardPos
[
i
]
->
setVisible
(
true
);
mainGame
->
stCardPos
[
i
]
->
setVisible
(
true
);
mainGame
->
stCardPos
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
+
i
*
125
,
30
,
startpos
+
120
+
i
*
125
,
50
));
mainGame
->
stCardPos
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
+
i
*
125
,
30
,
startpos
+
120
+
i
*
125
,
50
));
}
}
if
(
selectable_cards
.
size
()
<=
5
)
{
if
(
selectable_cards
.
size
()
<=
5
)
{
for
(
int
i
=
selectable_cards
.
size
();
i
<
5
;
++
i
)
{
for
(
int
i
=
selectable_cards
.
size
();
i
<
5
;
++
i
)
{
...
@@ -574,7 +574,7 @@ void ClientField::ShowLocationCard() {
...
@@ -574,7 +574,7 @@ void ClientField::ShowLocationCard() {
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardDisplay
[
i
],
display_cards
[
i
]
->
code
));
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardDisplay
[
i
],
display_cards
[
i
]
->
code
));
else
else
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
]
->
controler
+
2
]);
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
]
->
controler
+
2
]);
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardDisplay
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardDisplay
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardDisplay
[
i
]
->
setVisible
(
true
);
mainGame
->
btnCardDisplay
[
i
]
->
setVisible
(
true
);
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
...
@@ -607,7 +607,7 @@ void ClientField::ShowLocationCard() {
...
@@ -607,7 +607,7 @@ void ClientField::ShowLocationCard() {
mainGame
->
stDisplayPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
mainGame
->
stDisplayPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
}
}
mainGame
->
stDisplayPos
[
i
]
->
setVisible
(
true
);
mainGame
->
stDisplayPos
[
i
]
->
setVisible
(
true
);
mainGame
->
stDisplayPos
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
+
i
*
125
,
30
,
startpos
+
120
+
i
*
125
,
50
));
mainGame
->
stDisplayPos
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
+
i
*
125
,
30
,
startpos
+
120
+
i
*
125
,
50
));
}
}
if
(
display_cards
.
size
()
<=
5
)
{
if
(
display_cards
.
size
()
<=
5
)
{
for
(
int
i
=
display_cards
.
size
();
i
<
5
;
++
i
)
{
for
(
int
i
=
display_cards
.
size
();
i
<
5
;
++
i
)
{
...
...
gframe/deck_con.cpp
View file @
b5bf7990
...
@@ -137,7 +137,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -137,7 +137,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
return
false
;
return
false
;
switch
(
event
.
EventType
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
irr
::
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
if
(((
mainGame
->
wCategories
->
isVisible
()
&&
id
!=
BUTTON_CATEGORY_OK
)
||
if
(((
mainGame
->
wCategories
->
isVisible
()
&&
id
!=
BUTTON_CATEGORY_OK
)
||
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
||
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
||
(
mainGame
->
wLinkMarks
->
isVisible
()
&&
id
!=
BUTTON_MARKERS_OK
)
||
(
mainGame
->
wLinkMarks
->
isVisible
()
&&
id
!=
BUTTON_MARKERS_OK
)
||
...
@@ -1683,8 +1683,8 @@ void DeckBuilder::ShowBigCard(int code, float zoom) {
...
@@ -1683,8 +1683,8 @@ void DeckBuilder::ShowBigCard(int code, float zoom) {
auto
img
=
imageManager
.
GetBigPicture
(
code
,
zoom
);
auto
img
=
imageManager
.
GetBigPicture
(
code
,
zoom
);
mainGame
->
imgBigCard
->
setImage
(
img
);
mainGame
->
imgBigCard
->
setImage
(
img
);
auto
size
=
img
->
getSize
();
auto
size
=
img
->
getSize
();
s32
left
=
mainGame
->
window_size
.
Width
/
2
-
size
.
Width
/
2
;
irr
::
s32
left
=
mainGame
->
window_size
.
Width
/
2
-
size
.
Width
/
2
;
s32
top
=
mainGame
->
window_size
.
Height
/
2
-
size
.
Height
/
2
;
irr
::
s32
top
=
mainGame
->
window_size
.
Height
/
2
-
size
.
Height
/
2
;
mainGame
->
imgBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
imgBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
mainGame
->
gMutex
.
lock
();
mainGame
->
gMutex
.
lock
();
...
@@ -1696,7 +1696,7 @@ void DeckBuilder::ShowBigCard(int code, float zoom) {
...
@@ -1696,7 +1696,7 @@ void DeckBuilder::ShowBigCard(int code, float zoom) {
mainGame
->
env
->
getRootGUIElement
()
->
bringToFront
(
mainGame
->
wBigCard
);
mainGame
->
env
->
getRootGUIElement
()
->
bringToFront
(
mainGame
->
wBigCard
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
}
}
void
DeckBuilder
::
ZoomBigCard
(
s32
centerx
,
s32
centery
)
{
void
DeckBuilder
::
ZoomBigCard
(
irr
::
s32
centerx
,
irr
::
s32
centery
)
{
if
(
bigcard_zoom
>=
4
)
if
(
bigcard_zoom
>=
4
)
bigcard_zoom
=
4
;
bigcard_zoom
=
4
;
if
(
bigcard_zoom
<=
0.2
f
)
if
(
bigcard_zoom
<=
0.2
f
)
...
@@ -1711,8 +1711,8 @@ void DeckBuilder::ZoomBigCard(s32 centerx, s32 centery) {
...
@@ -1711,8 +1711,8 @@ void DeckBuilder::ZoomBigCard(s32 centerx, s32 centery) {
}
}
float
posx
=
(
float
)(
centerx
-
pos
.
UpperLeftCorner
.
X
)
/
pos
.
getWidth
();
float
posx
=
(
float
)(
centerx
-
pos
.
UpperLeftCorner
.
X
)
/
pos
.
getWidth
();
float
posy
=
(
float
)(
centery
-
pos
.
UpperLeftCorner
.
Y
)
/
pos
.
getHeight
();
float
posy
=
(
float
)(
centery
-
pos
.
UpperLeftCorner
.
Y
)
/
pos
.
getHeight
();
s32
left
=
centerx
-
size
.
Width
*
posx
;
irr
::
s32
left
=
centerx
-
size
.
Width
*
posx
;
s32
top
=
centery
-
size
.
Height
*
posy
;
irr
::
s32
top
=
centery
-
size
.
Height
*
posy
;
mainGame
->
imgBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
imgBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
irr
::
core
::
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
}
}
...
...
gframe/drawing.cpp
View file @
b5bf7990
...
@@ -413,9 +413,9 @@ void Game::DrawCard(ClientCard* pcard) {
...
@@ -413,9 +413,9 @@ void Game::DrawCard(ClientCard* pcard) {
}
}
}
}
template
<
typename
T
>
template
<
typename
T
>
void
Game
::
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
T
&
text
,
const
irr
::
core
::
rect
<
s32
>&
position
,
const
irr
::
core
::
rect
<
s32
>&
padding
,
void
Game
::
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
T
&
text
,
const
irr
::
core
::
rect
<
irr
::
s32
>&
position
,
const
irr
::
core
::
rect
<
irr
::
s32
>&
padding
,
irr
::
video
::
SColor
color
,
irr
::
video
::
SColor
shadowcolor
,
bool
hcenter
,
bool
vcenter
,
const
irr
::
core
::
rect
<
s32
>*
clip
)
{
irr
::
video
::
SColor
color
,
irr
::
video
::
SColor
shadowcolor
,
bool
hcenter
,
bool
vcenter
,
const
irr
::
core
::
rect
<
irr
::
s32
>*
clip
)
{
irr
::
core
::
rect
<
s32
>
shadowposition
=
irr
::
core
::
recti
(
position
.
UpperLeftCorner
.
X
-
padding
.
UpperLeftCorner
.
X
,
position
.
UpperLeftCorner
.
Y
-
padding
.
UpperLeftCorner
.
Y
,
irr
::
core
::
rect
<
irr
::
s32
>
shadowposition
=
irr
::
core
::
recti
(
position
.
UpperLeftCorner
.
X
-
padding
.
UpperLeftCorner
.
X
,
position
.
UpperLeftCorner
.
Y
-
padding
.
UpperLeftCorner
.
Y
,
position
.
LowerRightCorner
.
X
-
padding
.
LowerRightCorner
.
X
,
position
.
LowerRightCorner
.
Y
-
padding
.
LowerRightCorner
.
Y
);
position
.
LowerRightCorner
.
X
-
padding
.
LowerRightCorner
.
X
,
position
.
LowerRightCorner
.
Y
-
padding
.
LowerRightCorner
.
Y
);
font
->
drawUstring
(
text
,
shadowposition
,
shadowcolor
,
hcenter
,
vcenter
,
clip
);
font
->
drawUstring
(
text
,
shadowposition
,
shadowcolor
,
hcenter
,
vcenter
,
clip
);
font
->
drawUstring
(
text
,
position
,
color
,
hcenter
,
vcenter
,
clip
);
font
->
drawUstring
(
text
,
position
,
color
,
hcenter
,
vcenter
,
clip
);
...
@@ -808,8 +808,8 @@ void Game::DrawGUI() {
...
@@ -808,8 +808,8 @@ void Game::DrawGUI() {
env
->
drawAll
();
env
->
drawAll
();
}
}
void
Game
::
DrawSpec
()
{
void
Game
::
DrawSpec
()
{
s32
midx
=
574
+
(
CARD_IMG_WIDTH
*
0.5
);
irr
::
s32
midx
=
574
+
(
CARD_IMG_WIDTH
*
0.5
);
s32
midy
=
150
+
(
CARD_IMG_HEIGHT
*
0.5
);
irr
::
s32
midy
=
150
+
(
CARD_IMG_HEIGHT
*
0.5
);
if
(
showcard
)
{
if
(
showcard
)
{
switch
(
showcard
)
{
switch
(
showcard
)
{
case
1
:
{
case
1
:
{
...
@@ -874,11 +874,11 @@ void Game::DrawSpec() {
...
@@ -874,11 +874,11 @@ void Game::DrawSpec() {
float
mul
=
xScale
;
float
mul
=
xScale
;
if
(
xScale
>
yScale
)
if
(
xScale
>
yScale
)
mul
=
yScale
;
mul
=
yScale
;
irr
::
core
::
vector2d
<
s32
>
corner
[
4
];
irr
::
core
::
vector2d
<
irr
::
s32
>
corner
[
4
];
float
y
=
sin
(
showcarddif
*
3.1415926
f
/
180.0
f
)
*
CARD_IMG_HEIGHT
*
mul
;
float
y
=
sin
(
showcarddif
*
3.1415926
f
/
180.0
f
)
*
CARD_IMG_HEIGHT
*
mul
;
s32
winx
=
midx
*
xScale
+
(
574
-
midx
)
*
mul
;
irr
::
s32
winx
=
midx
*
xScale
+
(
574
-
midx
)
*
mul
;
s32
winx2
=
midx
*
xScale
+
(
751
-
midx
)
*
mul
;
irr
::
s32
winx2
=
midx
*
xScale
+
(
751
-
midx
)
*
mul
;
s32
winy
=
midy
*
yScale
+
(
404
-
midy
)
*
mul
;
irr
::
s32
winy
=
midy
*
yScale
+
(
404
-
midy
)
*
mul
;
corner
[
0
]
=
irr
::
core
::
vector2d
<
s32
>
(
winx
-
(
CARD_IMG_HEIGHT
*
mul
-
y
)
*
0.3
f
,
winy
-
y
);
corner
[
0
]
=
irr
::
core
::
vector2d
<
s32
>
(
winx
-
(
CARD_IMG_HEIGHT
*
mul
-
y
)
*
0.3
f
,
winy
-
y
);
corner
[
1
]
=
irr
::
core
::
vector2d
<
s32
>
(
winx2
+
(
CARD_IMG_HEIGHT
*
mul
-
y
)
*
0.3
f
,
winy
-
y
);
corner
[
1
]
=
irr
::
core
::
vector2d
<
s32
>
(
winx2
+
(
CARD_IMG_HEIGHT
*
mul
-
y
)
*
0.3
f
,
winy
-
y
);
corner
[
2
]
=
irr
::
core
::
vector2d
<
s32
>
(
winx
,
winy
);
corner
[
2
]
=
irr
::
core
::
vector2d
<
s32
>
(
winx
,
winy
);
...
@@ -1134,7 +1134,7 @@ void Game::DrawThumb(code_pointer cp, irr::core::vector2di pos, const LFList* lf
...
@@ -1134,7 +1134,7 @@ void Game::DrawThumb(code_pointer cp, irr::core::vector2di pos, const LFList* lf
irr
::
video
::
ITexture
*
img
=
imageManager
.
GetTextureThumb
(
code
);
irr
::
video
::
ITexture
*
img
=
imageManager
.
GetTextureThumb
(
code
);
if
(
img
==
nullptr
)
if
(
img
==
nullptr
)
return
;
//nullptr->getSize() will cause a crash
return
;
//nullptr->getSize() will cause a crash
irr
::
core
::
dimension2d
<
u32
>
size
=
img
->
getOriginalSize
();
irr
::
core
::
dimension2d
<
irr
::
u32
>
size
=
img
->
getOriginalSize
();
irr
::
core
::
recti
dragloc
=
mainGame
->
Resize
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
CARD_THUMB_WIDTH
,
pos
.
Y
+
CARD_THUMB_HEIGHT
);
irr
::
core
::
recti
dragloc
=
mainGame
->
Resize
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
CARD_THUMB_WIDTH
,
pos
.
Y
+
CARD_THUMB_HEIGHT
);
irr
::
core
::
recti
limitloc
=
mainGame
->
Resize
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
20
,
pos
.
Y
+
20
);
irr
::
core
::
recti
limitloc
=
mainGame
->
Resize
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
20
,
pos
.
Y
+
20
);
irr
::
core
::
recti
otloc
=
Resize
(
pos
.
X
+
7
,
pos
.
Y
+
50
,
pos
.
X
+
37
,
pos
.
Y
+
65
);
irr
::
core
::
recti
otloc
=
Resize
(
pos
.
X
+
7
,
pos
.
Y
+
50
,
pos
.
X
+
37
,
pos
.
Y
+
65
);
...
@@ -1143,7 +1143,7 @@ void Game::DrawThumb(code_pointer cp, irr::core::vector2di pos, const LFList* lf
...
@@ -1143,7 +1143,7 @@ void Game::DrawThumb(code_pointer cp, irr::core::vector2di pos, const LFList* lf
limitloc
=
irr
::
core
::
recti
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
20
*
mainGame
->
xScale
,
pos
.
Y
+
20
*
mainGame
->
yScale
);
limitloc
=
irr
::
core
::
recti
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
20
*
mainGame
->
xScale
,
pos
.
Y
+
20
*
mainGame
->
yScale
);
otloc
=
irr
::
core
::
recti
(
pos
.
X
+
7
,
pos
.
Y
+
50
*
mainGame
->
yScale
,
pos
.
X
+
37
*
mainGame
->
xScale
,
pos
.
Y
+
65
*
mainGame
->
yScale
);
otloc
=
irr
::
core
::
recti
(
pos
.
X
+
7
,
pos
.
Y
+
50
*
mainGame
->
yScale
,
pos
.
X
+
37
*
mainGame
->
xScale
,
pos
.
Y
+
65
*
mainGame
->
yScale
);
}
}
driver
->
draw2DImage
(
img
,
dragloc
,
irr
::
core
::
rect
<
s32
>
(
0
,
0
,
size
.
Width
,
size
.
Height
));
driver
->
draw2DImage
(
img
,
dragloc
,
irr
::
core
::
rect
<
irr
::
s32
>
(
0
,
0
,
size
.
Width
,
size
.
Height
));
auto
lfit
=
lflist
->
content
.
find
(
lcode
);
auto
lfit
=
lflist
->
content
.
find
(
lcode
);
if
(
lfit
!=
lflist
->
content
.
end
())
{
if
(
lfit
!=
lflist
->
content
.
end
())
{
switch
(
lfit
->
second
)
{
switch
(
lfit
->
second
)
{
...
...
gframe/duelclient.cpp
View file @
b5bf7990
...
@@ -1900,23 +1900,23 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -1900,23 +1900,23 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
else
startpos
=
155
;
else
startpos
=
155
;
if
(
positions
&
0x1
)
{
if
(
positions
&
0x1
)
{
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnPSAU
,
code
));
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnPSAU
,
code
));
mainGame
->
btnPSAU
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSAU
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSAU
->
setVisible
(
true
);
mainGame
->
btnPSAU
->
setVisible
(
true
);
startpos
+=
145
;
startpos
+=
145
;
}
else
mainGame
->
btnPSAU
->
setVisible
(
false
);
}
else
mainGame
->
btnPSAU
->
setVisible
(
false
);
if
(
positions
&
0x2
)
{
if
(
positions
&
0x2
)
{
mainGame
->
btnPSAD
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSAD
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSAD
->
setVisible
(
true
);
mainGame
->
btnPSAD
->
setVisible
(
true
);
startpos
+=
145
;
startpos
+=
145
;
}
else
mainGame
->
btnPSAD
->
setVisible
(
false
);
}
else
mainGame
->
btnPSAD
->
setVisible
(
false
);
if
(
positions
&
0x4
)
{
if
(
positions
&
0x4
)
{
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnPSDU
,
code
));
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnPSDU
,
code
));
mainGame
->
btnPSDU
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSDU
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSDU
->
setVisible
(
true
);
mainGame
->
btnPSDU
->
setVisible
(
true
);
startpos
+=
145
;
startpos
+=
145
;
}
else
mainGame
->
btnPSDU
->
setVisible
(
false
);
}
else
mainGame
->
btnPSDU
->
setVisible
(
false
);
if
(
positions
&
0x8
)
{
if
(
positions
&
0x8
)
{
mainGame
->
btnPSDD
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSDD
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
startpos
,
45
,
startpos
+
140
,
185
));
mainGame
->
btnPSDD
->
setVisible
(
true
);
mainGame
->
btnPSDD
->
setVisible
(
true
);
startpos
+=
145
;
startpos
+=
145
;
}
else
mainGame
->
btnPSDD
->
setVisible
(
false
);
}
else
mainGame
->
btnPSDD
->
setVisible
(
false
);
...
@@ -3672,7 +3672,7 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -3672,7 +3672,7 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame
->
cbANNumber
->
setSelected
(
0
);
mainGame
->
cbANNumber
->
setSelected
(
0
);
if
(
quickmode
)
{
if
(
quickmode
)
{
mainGame
->
cbANNumber
->
setVisible
(
false
);
mainGame
->
cbANNumber
->
setVisible
(
false
);
mainGame
->
btnANNumberOK
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
20
,
195
,
210
,
230
));
mainGame
->
btnANNumberOK
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
20
,
195
,
210
,
230
));
mainGame
->
btnANNumberOK
->
setEnabled
(
false
);
mainGame
->
btnANNumberOK
->
setEnabled
(
false
);
irr
::
core
::
recti
pos
=
mainGame
->
wANNumber
->
getRelativePosition
();
irr
::
core
::
recti
pos
=
mainGame
->
wANNumber
->
getRelativePosition
();
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
250
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
250
;
...
@@ -3682,7 +3682,7 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -3682,7 +3682,7 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame
->
btnANNumber
[
i
]
->
setVisible
(
false
);
mainGame
->
btnANNumber
[
i
]
->
setVisible
(
false
);
}
}
mainGame
->
cbANNumber
->
setVisible
(
true
);
mainGame
->
cbANNumber
->
setVisible
(
true
);
mainGame
->
btnANNumberOK
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
80
,
60
,
150
,
85
));
mainGame
->
btnANNumberOK
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
80
,
60
,
150
,
85
));
irr
::
core
::
recti
pos
=
mainGame
->
wANNumber
->
getRelativePosition
();
irr
::
core
::
recti
pos
=
mainGame
->
wANNumber
->
getRelativePosition
();
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
95
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
95
;
mainGame
->
wANNumber
->
setRelativePosition
(
pos
);
mainGame
->
wANNumber
->
setRelativePosition
(
pos
);
...
...
gframe/event_handler.cpp
View file @
b5bf7990
...
@@ -22,7 +22,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -22,7 +22,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EET_GUI_EVENT
:
{
case
irr
:
:
EET_GUI_EVENT
:
{
if
(
mainGame
->
fadingList
.
size
())
if
(
mainGame
->
fadingList
.
size
())
break
;
break
;
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
irr
::
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
switch
(
event
.
GUIEvent
.
EventType
)
{
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
switch
(
id
)
{
switch
(
id
)
{
...
@@ -898,7 +898,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -898,7 +898,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
chain_code
));
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
chain_code
));
else
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
+
pos
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
+
pos
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
// text
// text
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SORT_CARD
)
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SORT_CARD
)
{
...
@@ -961,7 +961,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -961,7 +961,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
display_cards
[
i
+
pos
]
->
code
));
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
display_cards
[
i
+
pos
]
->
code
));
else
else
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
+
pos
]
->
controler
+
2
]);
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
+
pos
]
->
controler
+
2
]);
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
...
@@ -1075,8 +1075,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1075,8 +1075,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
hovered_location
=
0
;
hovered_location
=
0
;
irr
::
core
::
vector2di
pos
=
mainGame
->
ResizeReverse
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
core
::
vector2di
pos
=
mainGame
->
ResizeReverse
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
core
::
vector2di
mousepos
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
core
::
vector2di
mousepos
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
s32
x
=
pos
.
X
;
irr
::
s32
x
=
pos
.
X
;
s32
y
=
pos
.
Y
;
irr
::
s32
y
=
pos
.
Y
;
if
(
x
<
300
)
if
(
x
<
300
)
break
;
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
)
{
if
(
mainGame
->
gameConf
.
control_mode
==
1
)
{
...
@@ -1498,8 +1498,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1498,8 +1498,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
bool
should_show_tip
=
false
;
bool
should_show_tip
=
false
;
irr
::
core
::
vector2di
pos
=
mainGame
->
ResizeReverse
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
core
::
vector2di
pos
=
mainGame
->
ResizeReverse
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
core
::
vector2di
mousepos
=
irr
::
core
::
vector2di
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
core
::
vector2di
mousepos
=
irr
::
core
::
vector2di
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
s32
x
=
pos
.
X
;
irr
::
s32
x
=
pos
.
X
;
s32
y
=
pos
.
Y
;
irr
::
s32
y
=
pos
.
Y
;
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
x
<
300
)
{
if
(
x
<
300
)
{
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
...
@@ -1830,7 +1830,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1830,7 +1830,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
bool
ClientField
::
OnCommonEvent
(
const
irr
::
SEvent
&
event
)
{
bool
ClientField
::
OnCommonEvent
(
const
irr
::
SEvent
&
event
)
{
switch
(
event
.
EventType
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
irr
::
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
switch
(
event
.
GUIEvent
.
EventType
)
{
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_ELEMENT_HOVERED
:
{
case
irr
:
:
gui
::
EGET_ELEMENT_HOVERED
:
{
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
irr
::
gui
::
EGUIET_EDIT_BOX
)
{
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
irr
::
gui
::
EGUIET_EDIT_BOX
)
{
...
@@ -1991,7 +1991,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -1991,7 +1991,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
return
true
;
break
;
break
;
}
}
u32
pos
=
mainGame
->
scrCardText
->
getPos
();
irr
::
u32
pos
=
mainGame
->
scrCardText
->
getPos
();
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
guiFont
,
mainGame
->
showingtext
,
pos
);
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
guiFont
,
mainGame
->
showingtext
,
pos
);
return
true
;
return
true
;
break
;
break
;
...
@@ -2005,13 +2005,13 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -2005,13 +2005,13 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
SCROLL_TAB_HELPER
:
{
case
SCROLL_TAB_HELPER
:
{
irr
::
core
::
rect
<
s32
>
pos
=
mainGame
->
tabHelper
->
getRelativePosition
();
irr
::
core
::
rect
<
irr
::
s32
>
pos
=
mainGame
->
tabHelper
->
getRelativePosition
();
mainGame
->
tabHelper
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
mainGame
->
scrTabHelper
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
mainGame
->
tabHelper
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
mainGame
->
scrTabHelper
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
return
true
;
return
true
;
break
;
break
;
}
}
case
SCROLL_TAB_SYSTEM
:
{
case
SCROLL_TAB_SYSTEM
:
{
irr
::
core
::
rect
<
s32
>
pos
=
mainGame
->
tabSystem
->
getRelativePosition
();
irr
::
core
::
rect
<
irr
::
s32
>
pos
=
mainGame
->
tabSystem
->
getRelativePosition
();
mainGame
->
tabSystem
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
mainGame
->
scrTabSystem
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
mainGame
->
tabSystem
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
mainGame
->
scrTabSystem
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
return
true
;
return
true
;
break
;
break
;
...
@@ -2466,12 +2466,12 @@ void ClientField::ShowCardInfoInList(ClientCard* pcard, irr::gui::IGUIElement* e
...
@@ -2466,12 +2466,12 @@ void ClientField::ShowCardInfoInList(ClientCard* pcard, irr::gui::IGUIElement* e
}
}
if
(
str
.
length
()
>
0
)
{
if
(
str
.
length
()
>
0
)
{
parent
->
addChild
(
mainGame
->
stCardListTip
);
parent
->
addChild
(
mainGame
->
stCardListTip
);
irr
::
core
::
rect
<
s32
>
ePos
=
element
->
getRelativePosition
();
irr
::
core
::
rect
<
irr
::
s32
>
ePos
=
element
->
getRelativePosition
();
s32
x
=
(
ePos
.
UpperLeftCorner
.
X
+
ePos
.
LowerRightCorner
.
X
)
/
2
;
irr
::
s32
x
=
(
ePos
.
UpperLeftCorner
.
X
+
ePos
.
LowerRightCorner
.
X
)
/
2
;
s32
y
=
ePos
.
LowerRightCorner
.
Y
;
irr
::
s32
y
=
ePos
.
LowerRightCorner
.
Y
;
mainGame
->
SetStaticText
(
mainGame
->
stCardListTip
,
320
,
mainGame
->
guiFont
,
str
.
c_str
());
mainGame
->
SetStaticText
(
mainGame
->
stCardListTip
,
320
,
mainGame
->
guiFont
,
str
.
c_str
());
irr
::
core
::
dimension2d
<
unsigned
int
>
dTip
=
mainGame
->
guiFont
->
getDimension
(
mainGame
->
stCardListTip
->
getText
())
+
irr
::
core
::
dimension2d
<
unsigned
int
>
(
10
,
10
);
irr
::
core
::
dimension2d
<
unsigned
int
>
dTip
=
mainGame
->
guiFont
->
getDimension
(
mainGame
->
stCardListTip
->
getText
())
+
irr
::
core
::
dimension2d
<
unsigned
int
>
(
10
,
10
);
s32
w
=
dTip
.
Width
/
2
;
irr
::
s32
w
=
dTip
.
Width
/
2
;
if
(
x
-
w
<
10
)
if
(
x
-
w
<
10
)
x
=
w
+
10
;
x
=
w
+
10
;
if
(
x
+
w
>
670
)
if
(
x
+
w
>
670
)
...
...
gframe/game.cpp
View file @
b5bf7990
This source diff could not be displayed because it is too large. You can
view the blob
instead.
gframe/game.h
View file @
b5bf7990
...
@@ -145,8 +145,8 @@ public:
...
@@ -145,8 +145,8 @@ public:
bool
Initialize
();
bool
Initialize
();
void
MainLoop
();
void
MainLoop
();
void
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
f32
left
,
f32
right
,
f32
bottom
,
f32
top
,
f32
znear
,
f32
zfar
);
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
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
irr
::
u32
cWidth
,
irr
::
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
std
::
wstring
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
std
::
wstring
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
irr
::
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
irr
::
u32
pos
=
0
);
void
LoadExpansions
();
void
LoadExpansions
();
void
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
,
bool
selectlastused
=
true
);
void
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
,
bool
selectlastused
=
true
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
...
@@ -204,26 +204,26 @@ public:
...
@@ -204,26 +204,26 @@ public:
void
OnResize
();
void
OnResize
();
void
ResizeChatInputWindow
();
void
ResizeChatInputWindow
();
irr
::
core
::
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
irr
::
core
::
recti
Resize
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
);
irr
::
core
::
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
dx
,
s32
dy
,
s32
dx2
,
s32
dy2
);
irr
::
core
::
recti
Resize
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
,
irr
::
s32
dx
,
irr
::
s32
dy
,
irr
::
s32
dx2
,
irr
::
s32
dy2
);
irr
::
core
::
vector2di
Resize
(
s32
x
,
s32
y
);
irr
::
core
::
vector2di
Resize
(
irr
::
s32
x
,
irr
::
s32
y
);
irr
::
core
::
vector2di
ResizeReverse
(
s32
x
,
s32
y
);
irr
::
core
::
vector2di
ResizeReverse
(
irr
::
s32
x
,
irr
::
s32
y
);
irr
::
core
::
recti
ResizePhaseHint
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
width
);
irr
::
core
::
recti
ResizePhaseHint
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
,
irr
::
s32
width
);
irr
::
core
::
recti
ResizeWin
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
irr
::
core
::
recti
ResizeWin
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
);
irr
::
core
::
recti
ResizeCardImgWin
(
s32
x
,
s32
y
,
s32
mx
,
s32
my
);
irr
::
core
::
recti
ResizeCardImgWin
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
mx
,
irr
::
s32
my
);
irr
::
core
::
recti
ResizeCardHint
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
irr
::
core
::
recti
ResizeCardHint
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
);
irr
::
core
::
vector2di
ResizeCardHint
(
s32
x
,
s32
y
);
irr
::
core
::
vector2di
ResizeCardHint
(
irr
::
s32
x
,
irr
::
s32
y
);
irr
::
core
::
recti
ResizeCardMid
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
midx
,
s32
midy
);
irr
::
core
::
recti
ResizeCardMid
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
,
irr
::
s32
midx
,
irr
::
s32
midy
);
irr
::
core
::
vector2di
ResizeCardMid
(
s32
x
,
s32
y
,
s32
midx
,
s32
midy
);
irr
::
core
::
vector2di
ResizeCardMid
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
midx
,
irr
::
s32
midy
);
irr
::
core
::
recti
ResizeFit
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
irr
::
core
::
recti
ResizeFit
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
);
void
SetWindowsIcon
();
void
SetWindowsIcon
();
void
SetWindowsScale
(
float
scale
);
void
SetWindowsScale
(
float
scale
);
void
FlashWindow
();
void
FlashWindow
();
void
SetCursor
(
irr
::
gui
::
ECURSOR_ICON
icon
);
void
SetCursor
(
irr
::
gui
::
ECURSOR_ICON
icon
);
template
<
typename
T
>
template
<
typename
T
>
static
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
T
&
text
,
const
irr
::
core
::
rect
<
s32
>&
position
,
const
irr
::
core
::
rect
<
s32
>&
padding
,
static
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
T
&
text
,
const
irr
::
core
::
rect
<
irr
::
s32
>&
position
,
const
irr
::
core
::
rect
<
irr
::
s32
>&
padding
,
irr
::
video
::
SColor
color
=
0xffffffff
,
irr
::
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
irr
::
core
::
rect
<
s32
>*
clip
=
nullptr
);
irr
::
video
::
SColor
color
=
0xffffffff
,
irr
::
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
irr
::
core
::
rect
<
irr
::
s32
>*
clip
=
nullptr
);
std
::
mutex
gMutex
;
std
::
mutex
gMutex
;
Signal
frameSignal
;
Signal
frameSignal
;
...
...
gframe/image_manager.cpp
View file @
b5bf7990
...
@@ -129,7 +129,7 @@ void ImageManager::ResizeTexture() {
...
@@ -129,7 +129,7 @@ void ImageManager::ResizeTexture() {
// function by Warr1024, from https://github.com/minetest/minetest/issues/2419 , modified
// function by Warr1024, from https://github.com/minetest/minetest/issues/2419 , modified
void
imageScaleNNAA
(
irr
::
video
::
IImage
*
src
,
irr
::
video
::
IImage
*
dest
)
{
void
imageScaleNNAA
(
irr
::
video
::
IImage
*
src
,
irr
::
video
::
IImage
*
dest
)
{
double
sx
,
sy
,
minsx
,
maxsx
,
minsy
,
maxsy
,
area
,
ra
,
ga
,
ba
,
aa
,
pw
,
ph
,
pa
;
double
sx
,
sy
,
minsx
,
maxsx
,
minsy
,
maxsy
,
area
,
ra
,
ga
,
ba
,
aa
,
pw
,
ph
,
pa
;
u32
dy
,
dx
;
irr
::
u32
dy
,
dx
;
irr
::
video
::
SColor
pxl
;
irr
::
video
::
SColor
pxl
;
// Cache rectsngle boundaries.
// Cache rectsngle boundaries.
...
@@ -138,7 +138,7 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
...
@@ -138,7 +138,7 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
// Walk each destination image pixel.
// Walk each destination image pixel.
// Note: loop y around x for better cache locality.
// Note: loop y around x for better cache locality.
irr
::
core
::
dimension2d
<
u32
>
dim
=
dest
->
getDimension
();
irr
::
core
::
dimension2d
<
irr
::
u32
>
dim
=
dest
->
getDimension
();
for
(
dy
=
0
;
dy
<
dim
.
Height
;
dy
++
)
for
(
dy
=
0
;
dy
<
dim
.
Height
;
dy
++
)
for
(
dx
=
0
;
dx
<
dim
.
Width
;
dx
++
)
{
for
(
dx
=
0
;
dx
<
dim
.
Width
;
dx
++
)
{
...
@@ -176,7 +176,7 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
...
@@ -176,7 +176,7 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
// Get source pixel and add it to totals, weighted
// Get source pixel and add it to totals, weighted
// by covered area and alpha.
// by covered area and alpha.
pxl
=
src
->
getPixel
((
u32
)
sx
,
(
u32
)
sy
);
pxl
=
src
->
getPixel
((
irr
::
u32
)
sx
,
(
irr
::
u32
)
sy
);
area
+=
pa
;
area
+=
pa
;
ra
+=
pa
*
pxl
.
getRed
();
ra
+=
pa
*
pxl
.
getRed
();
ga
+=
pa
*
pxl
.
getGreen
();
ga
+=
pa
*
pxl
.
getGreen
();
...
@@ -199,16 +199,16 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
...
@@ -199,16 +199,16 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
dest
->
setPixel
(
dx
,
dy
,
pxl
);
dest
->
setPixel
(
dx
,
dy
,
pxl
);
}
}
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureFromFile
(
const
char
*
file
,
s32
width
,
s32
height
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureFromFile
(
const
char
*
file
,
irr
::
s32
width
,
irr
::
s32
height
)
{
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
(
file
);
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
file
);
if
(
srcimg
==
nullptr
)
if
(
srcimg
==
nullptr
)
return
nullptr
;
return
nullptr
;
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
))
{
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
))
{
texture
=
driver
->
addTexture
(
file
,
srcimg
);
texture
=
driver
->
addTexture
(
file
,
srcimg
);
}
else
{
}
else
{
irr
::
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
));
irr
::
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
));
imageScaleNNAA
(
srcimg
,
destimg
);
imageScaleNNAA
(
srcimg
,
destimg
);
texture
=
driver
->
addTexture
(
file
,
destimg
);
texture
=
driver
->
addTexture
(
file
,
destimg
);
destimg
->
drop
();
destimg
->
drop
();
...
@@ -274,7 +274,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
...
@@ -274,7 +274,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
texture
=
driver
->
addTexture
(
file
,
srcimg
);
texture
=
driver
->
addTexture
(
file
,
srcimg
);
}
else
{
}
else
{
auto
origsize
=
srcimg
->
getDimension
();
auto
origsize
=
srcimg
->
getDimension
();
irr
::
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
origsize
.
Width
*
zoom
,
origsize
.
Height
*
zoom
));
irr
::
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
origsize
.
Width
*
zoom
,
origsize
.
Height
*
zoom
));
imageScaleNNAA
(
srcimg
,
destimg
);
imageScaleNNAA
(
srcimg
,
destimg
);
texture
=
driver
->
addTexture
(
file
,
destimg
);
texture
=
driver
->
addTexture
(
file
,
destimg
);
destimg
->
drop
();
destimg
->
drop
();
...
@@ -307,14 +307,14 @@ int ImageManager::LoadThumbThread() {
...
@@ -307,14 +307,14 @@ int ImageManager::LoadThumbThread() {
if
(
img
!=
nullptr
)
{
if
(
img
!=
nullptr
)
{
int
width
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
int
width
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
if
(
img
->
getDimension
()
==
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
))
{
if
(
img
->
getDimension
()
==
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
))
{
img
->
grab
();
img
->
grab
();
imageManager
.
tThumbLoadingMutex
.
lock
();
imageManager
.
tThumbLoadingMutex
.
lock
();
if
(
imageManager
.
tThumbLoadingThreadRunning
)
if
(
imageManager
.
tThumbLoadingThreadRunning
)
imageManager
.
tThumbLoading
[
code
]
=
img
;
imageManager
.
tThumbLoading
[
code
]
=
img
;
imageManager
.
tThumbLoadingMutex
.
unlock
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
}
else
{
}
else
{
irr
::
video
::
IImage
*
destimg
=
imageManager
.
driver
->
createImage
(
img
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
width
,
height
));
irr
::
video
::
IImage
*
destimg
=
imageManager
.
driver
->
createImage
(
img
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
));
imageScaleNNAA
(
img
,
destimg
);
imageScaleNNAA
(
img
,
destimg
);
img
->
drop
();
img
->
drop
();
destimg
->
grab
();
destimg
->
grab
();
...
...
gframe/image_manager.h
View file @
b5bf7990
...
@@ -16,7 +16,7 @@ public:
...
@@ -16,7 +16,7 @@ public:
void
ClearTexture
();
void
ClearTexture
();
void
RemoveTexture
(
int
code
);
void
RemoveTexture
(
int
code
);
void
ResizeTexture
();
void
ResizeTexture
();
irr
::
video
::
ITexture
*
GetTextureFromFile
(
const
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTextureFromFile
(
const
char
*
file
,
irr
::
s32
width
,
irr
::
s32
height
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetBigPicture
(
int
code
,
float
zoom
);
irr
::
video
::
ITexture
*
GetBigPicture
(
int
code
,
float
zoom
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
...
...
gframe/menu_handler.cpp
View file @
b5bf7990
...
@@ -33,7 +33,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -33,7 +33,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
switch
(
event
.
EventType
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
case
irr
:
:
EET_GUI_EVENT
:
{
irr
::
gui
::
IGUIElement
*
caller
=
event
.
GUIEvent
.
Caller
;
irr
::
gui
::
IGUIElement
*
caller
=
event
.
GUIEvent
.
Caller
;
s32
id
=
caller
->
getID
();
irr
::
s32
id
=
caller
->
getID
();
if
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
{
if
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
{
mainGame
->
wQuery
->
getParent
()
->
bringToFront
(
mainGame
->
wQuery
);
mainGame
->
wQuery
->
getParent
()
->
bringToFront
(
mainGame
->
wQuery
);
break
;
break
;
...
...
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