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
8046e437
Commit
8046e437
authored
May 04, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'resize_im_mer' of
https://github.com/purerosefallen/ygopro
parents
f379012e
52cc1b2e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
33 deletions
+19
-33
gframe/drawing.cpp
gframe/drawing.cpp
+9
-9
gframe/game.cpp
gframe/game.cpp
+1
-1
gframe/game.h
gframe/game.h
+1
-1
gframe/image_manager.cpp
gframe/image_manager.cpp
+6
-20
gframe/image_manager.h
gframe/image_manager.h
+2
-2
No files found.
gframe/drawing.cpp
View file @
8046e437
...
...
@@ -778,7 +778,7 @@ void Game::DrawSpec() {
if
(
showcard
)
{
switch
(
showcard
)
{
case
1
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tMask
,
ResizeCardMid
(
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
);
showcarddif
+=
15
;
...
...
@@ -789,7 +789,7 @@ void Game::DrawSpec() {
break
;
}
case
2
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tMask
,
ResizeCardMid
(
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
);
showcarddif
+=
15
;
...
...
@@ -799,7 +799,7 @@ void Game::DrawSpec() {
break
;
}
case
3
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tNegated
,
ResizeCardMid
(
536
+
showcarddif
,
141
+
showcarddif
,
792
-
showcarddif
,
397
-
showcarddif
,
midx
,
midy
),
recti
(
0
,
0
,
128
,
128
),
0
,
0
,
true
);
if
(
showcarddif
<
64
)
showcarddif
+=
4
;
...
...
@@ -810,8 +810,8 @@ void Game::DrawSpec() {
matManager
.
c2d
[
1
]
=
(
showcarddif
<<
24
)
|
0xffffff
;
matManager
.
c2d
[
2
]
=
(
showcarddif
<<
24
)
|
0xffffff
;
matManager
.
c2d
[
3
]
=
(
showcarddif
<<
24
)
|
0xffffff
;
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
,
574
+
CARD_IMG_WIDTH
,
150
+
CARD_IMG_HEIGHT
),
ResizeF
orced
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
),
ResizeCardHint
(
574
,
150
,
574
+
CARD_IMG_WIDTH
,
150
+
CARD_IMG_HEIGHT
),
ResizeF
it
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
if
(
showcarddif
<
255
)
showcarddif
+=
17
;
break
;
...
...
@@ -821,14 +821,14 @@ void Game::DrawSpec() {
matManager
.
c2d
[
1
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
2
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
matManager
.
c2d
[
3
]
=
(
showcarddif
<<
25
)
|
0xffffff
;
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardMid
(
662
-
showcarddif
*
0.69685
f
,
277
-
showcarddif
,
662
+
showcarddif
*
0.69685
f
,
277
+
showcarddif
,
midx
,
midy
),
ResizeF
orced
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
),
ResizeCardMid
(
662
-
showcarddif
*
0.69685
f
,
277
-
showcarddif
,
662
+
showcarddif
*
0.69685
f
,
277
+
showcarddif
,
midx
,
midy
),
ResizeF
it
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
matManager
.
c2d
,
true
);
if
(
showcarddif
<
127
)
showcarddif
+=
9
;
break
;
}
case
6
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
,
true
),
ResizeCardHint
(
574
,
150
));
driver
->
draw2DImage
(
imageManager
.
tNumber
,
ResizeCardMid
(
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
);
if
(
showcarddif
<
64
)
...
...
@@ -848,7 +848,7 @@ void Game::DrawSpec() {
corner
[
1
]
=
core
::
position2d
<
s32
>
(
winx2
+
(
CARD_IMG_HEIGHT
*
mul
-
y
)
*
0.3
f
,
winy
-
y
);
corner
[
2
]
=
core
::
position2d
<
s32
>
(
winx
,
winy
);
corner
[
3
]
=
core
::
position2d
<
s32
>
(
winx2
,
winy
);
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
),
ResizeFit
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
corner
);
showcardp
++
;
showcarddif
+=
9
;
if
(
showcarddif
>=
90
)
...
...
gframe/game.cpp
View file @
8046e437
...
...
@@ -1869,7 +1869,7 @@ position2di Game::ResizeCardMid(s32 x, s32 y, s32 midx, s32 midy) {
y
=
cy
+
(
y
-
midy
)
*
mul
;
return
position2di
(
x
,
y
);
}
recti
Game
::
ResizeF
orced
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
recti
Game
::
ResizeF
it
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
float
mul
=
xScale
;
if
(
xScale
>
yScale
)
mul
=
yScale
;
...
...
gframe/game.h
View file @
8046e437
...
...
@@ -170,7 +170,7 @@ public:
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
ResizeF
orced
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeF
it
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
void
SetWindowsIcon
();
void
FlashWindow
();
...
...
gframe/image_manager.cpp
View file @
8046e437
...
...
@@ -147,17 +147,12 @@ void ImageManager::ClearTexture() {
if
(
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
)
{
if
(
tit
->
second
)
driver
->
removeTexture
(
tit
->
second
);
}
tMap
[
0
].
clear
();
tMap
[
1
].
clear
();
tMap
[
2
].
clear
();
tThumb
.
clear
();
}
void
ImageManager
::
RemoveTexture
(
int
code
)
{
...
...
@@ -173,12 +168,6 @@ void ImageManager::RemoveTexture(int code) {
driver
->
removeTexture
(
tit
->
second
);
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
void
imageScaleNNAA
(
irr
::
video
::
IImage
*
src
,
irr
::
video
::
IImage
*
dest
)
{
...
...
@@ -273,23 +262,20 @@ irr::video::ITexture* ImageManager::GetTextureFromFile(char* file, s32 width, s3
return
driver
->
getTexture
(
file
);
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
,
bool
forced_fit
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
if
(
code
==
0
)
return
tUnknown
;
int
width
=
CARD_IMG_WIDTH
;
int
height
=
CARD_IMG_HEIGHT
;
if
(
f
orced_f
it
)
{
if
(
fit
)
{
float
mul
=
mainGame
->
xScale
;
if
(
mainGame
->
xScale
>
mainGame
->
yScale
)
mul
=
mainGame
->
yScale
;
width
=
width
*
mul
;
height
=
height
*
mul
;
}
else
if
(
fit
)
{
width
=
width
*
mainGame
->
xScale
;
height
=
height
*
mainGame
->
yScale
;
}
auto
tit
=
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
].
find
(
code
);
if
(
tit
==
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
].
end
())
{
auto
tit
=
tMap
[
f
it
?
1
:
0
].
find
(
code
);
if
(
tit
==
tMap
[
f
it
?
1
:
0
].
end
())
{
char
file
[
256
];
sprintf
(
file
,
"expansions/pics/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
...
...
@@ -306,10 +292,10 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit, bool forced_f
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
if
(
img
==
NULL
&&
!
mainGame
->
gameConf
.
use_image_scale
)
{
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
][
code
]
=
NULL
;
tMap
[
f
it
?
1
:
0
][
code
]
=
NULL
;
return
GetTextureThumb
(
code
);
}
tMap
[
f
orced_fit
?
2
:
(
fit
?
1
:
0
)
][
code
]
=
img
;
tMap
[
f
it
?
1
:
0
][
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
}
if
(
tit
->
second
)
...
...
gframe/image_manager.h
View file @
8046e437
...
...
@@ -19,11 +19,11 @@ public:
void
ClearTexture
();
void
RemoveTexture
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
,
bool
forced_fit
=
false
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
3
];
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
;
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