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
9d765958
Commit
9d765958
authored
Apr 29, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update spec
parent
7c1c7149
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
28 deletions
+43
-28
gframe/drawing.cpp
gframe/drawing.cpp
+8
-6
gframe/game.cpp
gframe/game.cpp
+17
-17
gframe/game.h
gframe/game.h
+2
-0
gframe/image_manager.cpp
gframe/image_manager.cpp
+15
-4
gframe/image_manager.h
gframe/image_manager.h
+1
-1
No files found.
gframe/drawing.cpp
View file @
9d765958
...
@@ -773,11 +773,13 @@ void Game::DrawGUI() {
...
@@ -773,11 +773,13 @@ void Game::DrawGUI() {
env
->
drawAll
();
env
->
drawAll
();
}
}
void
Game
::
DrawSpec
()
{
void
Game
::
DrawSpec
()
{
s32
midx
=
574
+
(
CARD_IMG_WIDTH
*
0.5
);
s32
midy
=
150
+
(
CARD_IMG_HEIGHT
*
0.5
);
if
(
showcard
)
{
if
(
showcard
)
{
switch
(
showcard
)
{
switch
(
showcard
)
{
case
1
:
{
case
1
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tMask
,
Resize
(
574
,
150
,
574
+
(
showcarddif
>
CARD_IMG_WIDTH
?
CARD_IMG_WIDTH
:
showcarddif
),
150
+
CARD_IMG_HEIGHT
),
driver
->
draw2DImage
(
imageManager
.
tMask
,
Resize
CardMid
(
574
,
150
,
574
+
(
showcarddif
>
CARD_IMG_WIDTH
?
CARD_IMG_WIDTH
:
showcarddif
),
150
+
CARD_IMG_HEIGHT
,
midx
,
midy
),
recti
(
CARD_IMG_HEIGHT
-
showcarddif
,
0
,
CARD_IMG_HEIGHT
-
(
showcarddif
>
CARD_IMG_WIDTH
?
showcarddif
-
CARD_IMG_WIDTH
:
0
),
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
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
;
showcarddif
+=
15
;
if
(
showcarddif
>=
CARD_IMG_HEIGHT
)
{
if
(
showcarddif
>=
CARD_IMG_HEIGHT
)
{
...
@@ -788,7 +790,7 @@ void Game::DrawSpec() {
...
@@ -788,7 +790,7 @@ void Game::DrawSpec() {
}
}
case
2
:
{
case
2
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tMask
,
Resize
(
574
+
showcarddif
,
150
,
574
+
CARD_IMG_WIDTH
,
150
+
CARD_IMG_HEIGHT
),
driver
->
draw2DImage
(
imageManager
.
tMask
,
Resize
CardMid
(
574
+
showcarddif
,
150
,
574
+
CARD_IMG_WIDTH
,
150
+
CARD_IMG_HEIGHT
,
midx
,
midy
),
recti
(
0
,
0
,
CARD_IMG_WIDTH
-
showcarddif
,
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
recti
(
0
,
0
,
CARD_IMG_WIDTH
-
showcarddif
,
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
showcarddif
+=
15
;
showcarddif
+=
15
;
if
(
showcarddif
>=
CARD_IMG_WIDTH
)
{
if
(
showcarddif
>=
CARD_IMG_WIDTH
)
{
...
@@ -798,7 +800,7 @@ void Game::DrawSpec() {
...
@@ -798,7 +800,7 @@ void Game::DrawSpec() {
}
}
case
3
:
{
case
3
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tNegated
,
ResizeCard
Hint
(
536
+
showcarddif
,
141
+
showcarddif
,
792
-
showcarddif
,
397
-
showcarddif
),
recti
(
0
,
0
,
128
,
128
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tNegated
,
ResizeCard
Mid
(
536
+
showcarddif
,
141
+
showcarddif
,
792
-
showcarddif
,
397
-
showcarddif
,
midx
,
midy
),
recti
(
0
,
0
,
128
,
128
),
0
,
0
,
true
);
if
(
showcarddif
<
64
)
if
(
showcarddif
<
64
)
showcarddif
+=
4
;
showcarddif
+=
4
;
break
;
break
;
...
@@ -819,7 +821,7 @@ void Game::DrawSpec() {
...
@@ -819,7 +821,7 @@ void Game::DrawSpec() {
matManager
.
c2d
[
1
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
1
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
2
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
2
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
3
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
3
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCard
Hint
(
662
-
showcarddif
*
0.69685
f
,
277
-
showcarddif
,
662
+
showcarddif
*
0.69685
f
,
277
+
showcarddif
),
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCard
Mid
(
662
-
showcarddif
*
0.69685
f
,
277
-
showcarddif
,
662
+
showcarddif
*
0.69685
f
,
277
+
showcarddif
,
midx
,
midy
),
ResizeForced
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
ResizeForced
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
if
(
showcarddif
<
127
)
if
(
showcarddif
<
127
)
showcarddif
+=
9
;
showcarddif
+=
9
;
...
@@ -827,7 +829,7 @@ void Game::DrawSpec() {
...
@@ -827,7 +829,7 @@ void Game::DrawSpec() {
}
}
case
6
:
{
case
6
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tNumber
,
ResizeCard
Hint
(
536
+
showcarddif
,
141
+
showcarddif
,
792
-
showcarddif
,
397
-
showcarddif
),
driver
->
draw2DImage
(
imageManager
.
tNumber
,
ResizeCard
Mid
(
536
+
showcarddif
,
141
+
showcarddif
,
792
-
showcarddif
,
397
-
showcarddif
,
midx
,
midy
),
recti
((
showcardp
%
5
)
*
64
,
(
showcardp
/
5
)
*
64
,
(
showcardp
%
5
+
1
)
*
64
,
(
showcardp
/
5
+
1
)
*
64
),
0
,
0
,
true
);
recti
((
showcardp
%
5
)
*
64
,
(
showcardp
/
5
)
*
64
,
(
showcardp
%
5
+
1
)
*
64
,
(
showcardp
/
5
+
1
)
*
64
),
0
,
0
,
true
);
if
(
showcarddif
<
64
)
if
(
showcarddif
<
64
)
showcarddif
+=
4
;
showcarddif
+=
4
;
...
@@ -840,7 +842,7 @@ void Game::DrawSpec() {
...
@@ -840,7 +842,7 @@ void Game::DrawSpec() {
corner
[
1
]
=
core
::
position2d
<
s32
>
(
751
*
xScale
+
(
CARD_IMG_HEIGHT
*
yScale
-
y
)
*
0.3
f
,
404
*
yScale
-
y
);
corner
[
1
]
=
core
::
position2d
<
s32
>
(
751
*
xScale
+
(
CARD_IMG_HEIGHT
*
yScale
-
y
)
*
0.3
f
,
404
*
yScale
-
y
);
corner
[
2
]
=
core
::
position2d
<
s32
>
(
574
*
xScale
,
404
*
yScale
);
corner
[
2
]
=
core
::
position2d
<
s32
>
(
574
*
xScale
,
404
*
yScale
);
corner
[
3
]
=
core
::
position2d
<
s32
>
(
751
*
xScale
,
404
*
yScale
);
corner
[
3
]
=
core
::
position2d
<
s32
>
(
751
*
xScale
,
404
*
yScale
);
irr
::
gui
::
Draw2DImageQuad
(
driver
,
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeForced
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
corner
);
irr
::
gui
::
Draw2DImageQuad
(
driver
,
imageManager
.
GetTexture
(
showcardcode
,
true
),
ResizeForced
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
corner
);
showcardp
++
;
showcardp
++
;
showcarddif
+=
9
;
showcarddif
+=
9
;
if
(
showcarddif
>=
90
)
if
(
showcarddif
>=
90
)
...
...
gframe/game.cpp
View file @
9d765958
...
@@ -1839,31 +1839,31 @@ recti Game::ResizeCard(s32 x, s32 y, s32 x2, s32 y2) {
...
@@ -1839,31 +1839,31 @@ recti Game::ResizeCard(s32 x, s32 y, s32 x2, s32 y2) {
return
recti
(
x
,
y
,
x2
,
y2
);
return
recti
(
x
,
y
,
x2
,
y2
);
}
}
recti
Game
::
ResizeCardHint
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
recti
Game
::
ResizeCardHint
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
return
ResizeCardMid
(
x
,
y
,
x2
,
y2
,
(
x
+
x2
)
*
0.5
,
(
y
+
y2
)
*
0.5
);
}
position2di
Game
::
ResizeCardHint
(
s32
x
,
s32
y
)
{
return
ResizeCardMid
(
x
,
y
,
x
+
CARD_IMG_WIDTH
*
0.5
,
y
+
CARD_IMG_HEIGHT
*
0.5
);
}
recti
Game
::
ResizeCardMid
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
midx
,
s32
midy
)
{
float
mul
=
xScale
;
float
mul
=
xScale
;
if
(
xScale
>
yScale
)
if
(
xScale
>
yScale
)
mul
=
yScale
;
mul
=
yScale
;
s32
cx
=
(
x2
+
x
)
*
xScale
*
0.5
;
s32
cx
=
midx
*
xScale
;
s32
cy
=
(
y2
+
y
)
*
yScale
*
0.5
;
s32
cy
=
midy
*
yScale
;
s32
lx
=
(
x2
-
x
)
*
mul
*
0.5
;
x
=
cx
+
(
x
-
midx
)
*
mul
;
s32
ly
=
(
y2
-
y
)
*
mul
*
0.5
;
y
=
cy
+
(
y
-
midy
)
*
mul
;
x
=
cx
-
lx
;
x2
=
cx
+
(
x2
-
midx
)
*
mul
;
y
=
cy
-
ly
;
y2
=
cy
+
(
y2
-
midy
)
*
mul
;
x2
=
cx
+
lx
;
y2
=
cy
+
ly
;
return
recti
(
x
,
y
,
x2
,
y2
);
return
recti
(
x
,
y
,
x2
,
y2
);
}
}
position2di
Game
::
ResizeCardHint
(
s32
x
,
s32
y
)
{
position2di
Game
::
ResizeCardMid
(
s32
x
,
s32
y
,
s32
midx
,
s32
midy
)
{
s32
x2
=
x
+
CARD_IMG_WIDTH
;
s32
y2
=
y
+
CARD_IMG_HEIGHT
;
float
mul
=
xScale
;
float
mul
=
xScale
;
if
(
xScale
>
yScale
)
if
(
xScale
>
yScale
)
mul
=
yScale
;
mul
=
yScale
;
s32
cx
=
(
x2
+
x
)
*
xScale
*
0.5
;
s32
cx
=
midx
*
xScale
;
s32
cy
=
(
y2
+
y
)
*
yScale
*
0.5
;
s32
cy
=
midy
*
yScale
;
s32
lx
=
(
x2
-
x
)
*
mul
*
0.5
;
x
=
cx
+
(
x
-
midx
)
*
mul
;
s32
ly
=
(
y2
-
y
)
*
mul
*
0.5
;
y
=
cy
+
(
y
-
midy
)
*
mul
;
x
=
cx
-
lx
;
y
=
cy
-
ly
;
return
position2di
(
x
,
y
);
return
position2di
(
x
,
y
);
}
}
recti
Game
::
ResizeForced
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
recti
Game
::
ResizeForced
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
...
...
gframe/game.h
View file @
9d765958
...
@@ -168,6 +168,8 @@ public:
...
@@ -168,6 +168,8 @@ public:
recti
ResizeCard
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeCard
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeCardHint
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeCardHint
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
position2di
ResizeCardHint
(
s32
x
,
s32
y
);
position2di
ResizeCardHint
(
s32
x
,
s32
y
);
recti
ResizeCardMid
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
midx
,
s32
midy
);
position2di
ResizeCardMid
(
s32
x
,
s32
y
,
s32
midx
,
s32
midy
);
recti
ResizeForced
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeForced
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
void
SetWindowsIcon
();
void
SetWindowsIcon
();
...
...
gframe/image_manager.cpp
View file @
9d765958
...
@@ -147,12 +147,17 @@ void ImageManager::ClearTexture() {
...
@@ -147,12 +147,17 @@ void ImageManager::ClearTexture() {
if
(
tit
->
second
)
if
(
tit
->
second
)
driver
->
removeTexture
(
tit
->
second
);
driver
->
removeTexture
(
tit
->
second
);
}
}
for
(
auto
tit
=
tMap
[
2
].
begin
();
tit
!=
tMap
[
2
].
end
();
++
tit
)
{
if
(
tit
->
second
)
driver
->
removeTexture
(
tit
->
second
);
}
for
(
auto
tit
=
tThumb
.
begin
();
tit
!=
tThumb
.
end
();
++
tit
)
{
for
(
auto
tit
=
tThumb
.
begin
();
tit
!=
tThumb
.
end
();
++
tit
)
{
if
(
tit
->
second
)
if
(
tit
->
second
)
driver
->
removeTexture
(
tit
->
second
);
driver
->
removeTexture
(
tit
->
second
);
}
}
tMap
[
0
].
clear
();
tMap
[
0
].
clear
();
tMap
[
1
].
clear
();
tMap
[
1
].
clear
();
tMap
[
2
].
clear
();
tThumb
.
clear
();
tThumb
.
clear
();
}
}
void
ImageManager
::
RemoveTexture
(
int
code
)
{
void
ImageManager
::
RemoveTexture
(
int
code
)
{
...
@@ -168,6 +173,12 @@ void ImageManager::RemoveTexture(int code) {
...
@@ -168,6 +173,12 @@ void ImageManager::RemoveTexture(int code) {
driver
->
removeTexture
(
tit
->
second
);
driver
->
removeTexture
(
tit
->
second
);
tMap
[
1
].
erase
(
tit
);
tMap
[
1
].
erase
(
tit
);
}
}
tit
=
tMap
[
2
].
find
(
code
);
if
(
tit
!=
tMap
[
2
].
end
())
{
if
(
tit
->
second
)
driver
->
removeTexture
(
tit
->
second
);
tMap
[
2
].
erase
(
tit
);
}
}
}
// 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
)
{
...
@@ -277,8 +288,8 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit, bool forced_f
...
@@ -277,8 +288,8 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit, bool forced_f
width
=
width
*
mainGame
->
xScale
;
width
=
width
*
mainGame
->
xScale
;
height
=
height
*
mainGame
->
yScale
;
height
=
height
*
mainGame
->
yScale
;
}
}
auto
tit
=
tMap
[
f
it
?
1
:
0
].
find
(
code
);
auto
tit
=
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
].
find
(
code
);
if
(
tit
==
tMap
[
f
it
?
1
:
0
].
end
())
{
if
(
tit
==
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
].
end
())
{
char
file
[
256
];
char
file
[
256
];
sprintf
(
file
,
"expansions/pics/%d.png"
,
code
);
sprintf
(
file
,
"expansions/pics/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
...
@@ -295,10 +306,10 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit, bool forced_f
...
@@ -295,10 +306,10 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit, bool forced_f
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
)
{
tMap
[
f
it
?
1
:
0
][
code
]
=
NULL
;
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
][
code
]
=
NULL
;
return
GetTextureThumb
(
code
);
return
GetTextureThumb
(
code
);
}
}
tMap
[
f
it
?
1
:
0
][
code
]
=
img
;
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
][
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
}
}
if
(
tit
->
second
)
if
(
tit
->
second
)
...
...
gframe/image_manager.h
View file @
9d765958
...
@@ -23,7 +23,7 @@ public:
...
@@ -23,7 +23,7 @@ public:
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
2
];
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
3
];
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tThumb
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tThumb
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
irr
::
IrrlichtDevice
*
device
;
irr
::
IrrlichtDevice
*
device
;
...
...
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