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
3a577c93
Commit
3a577c93
authored
Aug 07, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
constant
parent
9c2d5269
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
18 deletions
+21
-18
gframe/drawing.cpp
gframe/drawing.cpp
+12
-14
gframe/game.cpp
gframe/game.cpp
+4
-4
gframe/game.h
gframe/game.h
+5
-0
No files found.
gframe/drawing.cpp
View file @
3a577c93
...
...
@@ -746,10 +746,10 @@ void Game::DrawSpec() {
switch
(
showcard
)
{
case
1
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
),
position2di
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tMask
,
recti
(
574
,
150
,
574
+
(
showcarddif
>
177
?
177
:
showcarddif
),
404
),
recti
(
254
-
showcarddif
,
0
,
254
-
(
showcarddif
>
177
?
showcarddif
-
177
:
0
),
254
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tMask
,
recti
(
574
,
150
,
574
+
(
showcarddif
>
CARD_IMG_WIDTH
?
CARD_IMG_WIDTH
:
showcarddif
),
404
),
recti
(
CARD_IMG_HEIGHT
-
showcarddif
,
0
,
CARD_IMG_HEIGHT
-
(
showcarddif
>
CARD_IMG_WIDTH
?
showcarddif
-
CARD_IMG_WIDTH
:
0
),
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
showcarddif
+=
15
;
if
(
showcarddif
>=
254
)
{
if
(
showcarddif
>=
CARD_IMG_HEIGHT
)
{
showcard
=
2
;
showcarddif
=
0
;
}
...
...
@@ -757,9 +757,9 @@ void Game::DrawSpec() {
}
case
2
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
),
position2di
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tMask
,
recti
(
574
+
showcarddif
,
150
,
761
,
404
),
recti
(
0
,
0
,
177
-
showcarddif
,
254
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tMask
,
recti
(
574
+
showcarddif
,
150
,
761
,
404
),
recti
(
0
,
0
,
CARD_IMG_WIDTH
-
showcarddif
,
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
showcarddif
+=
15
;
if
(
showcarddif
>=
177
)
{
if
(
showcarddif
>=
CARD_IMG_WIDTH
)
{
showcard
=
0
;
}
break
;
...
...
@@ -777,7 +777,7 @@ void Game::DrawSpec() {
matManager
.
c2d
[
2
]
=
(
showcarddif
<<
24
)
|
0xffffff
;
matManager
.
c2d
[
3
]
=
(
showcarddif
<<
24
)
|
0xffffff
;
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
),
recti
(
574
,
154
,
751
,
404
),
recti
(
0
,
0
,
177
,
254
),
0
,
matManager
.
c2d
,
true
);
recti
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
if
(
showcarddif
<
255
)
showcarddif
+=
17
;
break
;
...
...
@@ -788,7 +788,7 @@ void Game::DrawSpec() {
matManager
.
c2d
[
2
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
3
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
),
recti
(
662
-
showcarddif
*
0.69685
f
,
277
-
showcarddif
,
662
+
showcarddif
*
0.69685
f
,
277
+
showcarddif
),
recti
(
0
,
0
,
177
,
254
),
0
,
matManager
.
c2d
,
true
);
recti
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
if
(
showcarddif
<
127
)
showcarddif
+=
9
;
break
;
...
...
@@ -803,12 +803,12 @@ void Game::DrawSpec() {
}
case
7
:
{
core
::
position2d
<
s32
>
corner
[
4
];
float
y
=
sin
(
showcarddif
*
3.1415926
f
/
180.0
f
)
*
254
;
corner
[
0
]
=
core
::
position2d
<
s32
>
(
574
-
(
254
-
y
)
*
0.3
f
,
404
-
y
);
corner
[
1
]
=
core
::
position2d
<
s32
>
(
751
+
(
254
-
y
)
*
0.3
f
,
404
-
y
);
float
y
=
sin
(
showcarddif
*
3.1415926
f
/
180.0
f
)
*
CARD_IMG_HEIGHT
;
corner
[
0
]
=
core
::
position2d
<
s32
>
(
574
-
(
CARD_IMG_HEIGHT
-
y
)
*
0.3
f
,
404
-
y
);
corner
[
1
]
=
core
::
position2d
<
s32
>
(
751
+
(
CARD_IMG_HEIGHT
-
y
)
*
0.3
f
,
404
-
y
);
corner
[
2
]
=
core
::
position2d
<
s32
>
(
574
,
404
);
corner
[
3
]
=
core
::
position2d
<
s32
>
(
751
,
404
);
irr
::
gui
::
Draw2DImageQuad
(
driver
,
imageManager
.
GetTexture
(
showcardcode
),
rect
<
s32
>
(
0
,
0
,
177
,
254
),
corner
);
irr
::
gui
::
Draw2DImageQuad
(
driver
,
imageManager
.
GetTexture
(
showcardcode
),
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
corner
);
showcardp
++
;
showcarddif
+=
9
;
if
(
showcarddif
>=
90
)
...
...
@@ -1022,8 +1022,6 @@ void Game::WaitFrameSignal(int frame) {
frameSignal
.
Wait
();
}
void
Game
::
DrawThumb
(
code_pointer
cp
,
position2di
pos
,
std
::
unordered_map
<
int
,
int
>*
lflist
)
{
const
int
width
=
44
;
//standard pic size, maybe it should be defined in game.h
const
int
height
=
64
;
int
code
=
cp
->
first
;
int
lcode
=
cp
->
second
.
alias
;
if
(
lcode
==
0
)
...
...
@@ -1032,7 +1030,7 @@ void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, i
if
(
img
==
NULL
)
return
;
//NULL->getSize() will cause a crash
dimension2d
<
u32
>
size
=
img
->
getOriginalSize
();
driver
->
draw2DImage
(
img
,
rect
<
s32
>
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
width
,
pos
.
Y
+
height
),
rect
<
s32
>
(
0
,
0
,
size
.
Width
,
size
.
Height
));
driver
->
draw2DImage
(
img
,
rect
<
s32
>
(
pos
.
X
,
pos
.
Y
,
pos
.
X
+
CARD_THUMB_WIDTH
,
pos
.
Y
+
CARD_THUMB_HEIGHT
),
rect
<
s32
>
(
0
,
0
,
size
.
Width
,
size
.
Height
));
if
(
lflist
->
count
(
lcode
))
{
switch
((
*
lflist
)[
lcode
])
{
...
...
gframe/game.cpp
View file @
3a577c93
...
...
@@ -197,10 +197,10 @@ bool Game::Initialize() {
btnHostPrepStart
=
env
->
addButton
(
rect
<
s32
>
(
230
,
280
,
340
,
305
),
wHostPrepare
,
BUTTON_HP_START
,
dataManager
.
GetSysString
(
1215
));
btnHostPrepCancel
=
env
->
addButton
(
rect
<
s32
>
(
350
,
280
,
460
,
305
),
wHostPrepare
,
BUTTON_HP_CANCEL
,
dataManager
.
GetSysString
(
1210
));
//img
wCardImg
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
1
,
1
,
1
99
,
273
),
true
,
false
,
0
,
-
1
,
true
);
wCardImg
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
1
,
1
,
1
+
CARD_IMG_WIDTH
+
20
,
1
+
CARD_IMG_HEIGHT
+
18
),
true
,
false
,
0
,
-
1
,
true
);
wCardImg
->
setBackgroundColor
(
0xc0c0c0c0
);
wCardImg
->
setVisible
(
false
);
imgCard
=
env
->
addImage
(
rect
<
s32
>
(
10
,
9
,
1
87
,
263
),
wCardImg
);
imgCard
=
env
->
addImage
(
rect
<
s32
>
(
10
,
9
,
1
0
+
CARD_IMG_WIDTH
,
9
+
CARD_IMG_HEIGHT
),
wCardImg
);
imgCard
->
setUseAlphaChannel
(
true
);
//phase
wPhase
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
480
,
310
,
855
,
330
));
...
...
@@ -333,14 +333,14 @@ bool Game::Initialize() {
btnPSAU
->
setImageScale
(
core
::
vector2df
(
0.5
,
0.5
));
btnPSAD
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
155
,
45
,
295
,
185
),
wPosSelect
,
BUTTON_POS_AD
);
btnPSAD
->
setImageScale
(
core
::
vector2df
(
0.5
,
0.5
));
btnPSAD
->
setImage
(
imageManager
.
tCover
[
0
],
rect
<
s32
>
(
0
,
0
,
177
,
254
));
btnPSAD
->
setImage
(
imageManager
.
tCover
[
0
],
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
));
btnPSDU
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
300
,
45
,
440
,
185
),
wPosSelect
,
BUTTON_POS_DU
);
btnPSDU
->
setImageScale
(
core
::
vector2df
(
0.5
,
0.5
));
btnPSDU
->
setImageRotation
(
270
);
btnPSDD
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
445
,
45
,
585
,
185
),
wPosSelect
,
BUTTON_POS_DD
);
btnPSDD
->
setImageScale
(
core
::
vector2df
(
0.5
,
0.5
));
btnPSDD
->
setImageRotation
(
270
);
btnPSDD
->
setImage
(
imageManager
.
tCover
[
0
],
rect
<
s32
>
(
0
,
0
,
177
,
254
));
btnPSDD
->
setImage
(
imageManager
.
tCover
[
0
],
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
));
//card select
wCardSelect
=
env
->
addWindow
(
rect
<
s32
>
(
320
,
100
,
1000
,
400
),
false
,
L""
);
wCardSelect
->
getCloseButton
()
->
setVisible
(
false
);
...
...
gframe/game.h
View file @
3a577c93
...
...
@@ -429,6 +429,11 @@ extern Game* mainGame;
}
#define CARD_IMG_WIDTH 177
#define CARD_IMG_HEIGHT 254
#define CARD_THUMB_WIDTH 44
#define CARD_THUMB_HEIGHT 64
#define UEVENT_EXIT 0x1
#define UEVENT_TOWINDOW 0x2
...
...
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