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
f9f6e20c
Commit
f9f6e20c
authored
Mar 14, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'resize' into test
parents
5dc3b379
5326648a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
gframe/image_manager.cpp
gframe/image_manager.cpp
+18
-7
gframe/image_manager.h
gframe/image_manager.h
+2
-0
strings.conf
strings.conf
+1
-0
No files found.
gframe/image_manager.cpp
View file @
f9f6e20c
...
@@ -13,6 +13,8 @@ bool ImageManager::Initial() {
...
@@ -13,6 +13,8 @@ bool ImageManager::Initial() {
if
(
!
tCover
[
3
])
if
(
!
tCover
[
3
])
tCover
[
3
]
=
tCover
[
2
];
tCover
[
3
]
=
tCover
[
2
];
tUnknown
=
NULL
;
tUnknown
=
NULL
;
tUnknownFit
=
NULL
;
tUnknownThumb
=
NULL
;
tAct
=
driver
->
getTexture
(
"textures/act.png"
);
tAct
=
driver
->
getTexture
(
"textures/act.png"
);
tAttack
=
driver
->
getTexture
(
"textures/attack.png"
);
tAttack
=
driver
->
getTexture
(
"textures/attack.png"
);
tChain
=
driver
->
getTexture
(
"textures/chain.png"
);
tChain
=
driver
->
getTexture
(
"textures/chain.png"
);
...
@@ -78,6 +80,11 @@ void ImageManager::RemoveTexture(int code) {
...
@@ -78,6 +80,11 @@ void ImageManager::RemoveTexture(int code) {
void
ImageManager
::
ResizeTexture
()
{
void
ImageManager
::
ResizeTexture
()
{
irr
::
s32
imgWidth
=
CARD_IMG_WIDTH
*
mainGame
->
xScale
;
irr
::
s32
imgWidth
=
CARD_IMG_WIDTH
*
mainGame
->
xScale
;
irr
::
s32
imgHeight
=
CARD_IMG_HEIGHT
*
mainGame
->
yScale
;
irr
::
s32
imgHeight
=
CARD_IMG_HEIGHT
*
mainGame
->
yScale
;
irr
::
s32
imgWidthThumb
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
irr
::
s32
imgHeightThumb
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
float
mul
=
(
mainGame
->
xScale
>
mainGame
->
yScale
)
?
mainGame
->
yScale
:
mainGame
->
xScale
;
irr
::
s32
imgWidthFit
=
CARD_IMG_WIDTH
*
mul
;
irr
::
s32
imgHeightFit
=
CARD_IMG_HEIGHT
*
mul
;
irr
::
s32
bgWidth
=
1024
*
mainGame
->
xScale
;
irr
::
s32
bgWidth
=
1024
*
mainGame
->
xScale
;
irr
::
s32
bgHeight
=
640
*
mainGame
->
yScale
;
irr
::
s32
bgHeight
=
640
*
mainGame
->
yScale
;
driver
->
removeTexture
(
tCover
[
0
]);
driver
->
removeTexture
(
tCover
[
0
]);
...
@@ -87,7 +94,11 @@ void ImageManager::ResizeTexture() {
...
@@ -87,7 +94,11 @@ void ImageManager::ResizeTexture() {
if
(
!
tCover
[
1
])
if
(
!
tCover
[
1
])
tCover
[
1
]
=
tCover
[
0
];
tCover
[
1
]
=
tCover
[
0
];
driver
->
removeTexture
(
tUnknown
);
driver
->
removeTexture
(
tUnknown
);
tUnknown
=
GetTextureFromFile
(
"textures/unknown.jpg"
,
imgWidth
,
imgHeight
);
driver
->
removeTexture
(
tUnknownFit
);
driver
->
removeTexture
(
tUnknownThumb
);
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
);
driver
->
removeTexture
(
tBackGround
);
driver
->
removeTexture
(
tBackGround
);
tBackGround
=
GetTextureFromFile
(
"textures/bg.jpg"
,
bgWidth
,
bgHeight
);
tBackGround
=
GetTextureFromFile
(
"textures/bg.jpg"
,
bgWidth
,
bgHeight
);
driver
->
removeTexture
(
tBackGround_menu
);
driver
->
removeTexture
(
tBackGround_menu
);
...
@@ -194,7 +205,7 @@ irr::video::ITexture* ImageManager::GetTextureFromFile(char* file, s32 width, s3
...
@@ -194,7 +205,7 @@ irr::video::ITexture* ImageManager::GetTextureFromFile(char* file, s32 width, s3
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
if
(
code
==
0
)
if
(
code
==
0
)
return
tUnknown
;
return
fit
?
tUnknownFit
:
tUnknown
;
int
width
=
CARD_IMG_WIDTH
;
int
width
=
CARD_IMG_WIDTH
;
int
height
=
CARD_IMG_HEIGHT
;
int
height
=
CARD_IMG_HEIGHT
;
if
(
fit
)
{
if
(
fit
)
{
...
@@ -218,16 +229,16 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
...
@@ -218,16 +229,16 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
return
GetTextureThumb
(
code
);
return
GetTextureThumb
(
code
);
}
}
tMap
[
fit
?
1
:
0
][
code
]
=
img
;
tMap
[
fit
?
1
:
0
][
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
return
(
img
==
NULL
)
?
(
fit
?
tUnknownFit
:
tUnknown
)
:
img
;
}
}
if
(
tit
->
second
)
if
(
tit
->
second
)
return
tit
->
second
;
return
tit
->
second
;
else
else
return
mainGame
->
gameConf
.
use_image_scale
?
tUnknown
:
GetTextureThumb
(
code
);
return
mainGame
->
gameConf
.
use_image_scale
?
(
fit
?
tUnknownFit
:
tUnknown
)
:
GetTextureThumb
(
code
);
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
if
(
code
==
0
)
if
(
code
==
0
)
return
tUnknown
;
return
tUnknown
Thumb
;
auto
tit
=
tThumb
.
find
(
code
);
auto
tit
=
tThumb
.
find
(
code
);
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
;
...
@@ -248,12 +259,12 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -248,12 +259,12 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
}
}
}
}
tThumb
[
code
]
=
img
;
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
return
(
img
==
NULL
)
?
tUnknown
Thumb
:
img
;
}
}
if
(
tit
->
second
)
if
(
tit
->
second
)
return
tit
->
second
;
return
tit
->
second
;
else
else
return
tUnknown
;
return
tUnknown
Thumb
;
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureField
(
int
code
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureField
(
int
code
)
{
if
(
code
==
0
)
if
(
code
==
0
)
...
...
gframe/image_manager.h
View file @
f9f6e20c
...
@@ -26,6 +26,8 @@ public:
...
@@ -26,6 +26,8 @@ public:
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
ITexture
*
tCover
[
4
];
irr
::
video
::
ITexture
*
tCover
[
4
];
irr
::
video
::
ITexture
*
tUnknown
;
irr
::
video
::
ITexture
*
tUnknown
;
irr
::
video
::
ITexture
*
tUnknownFit
;
irr
::
video
::
ITexture
*
tUnknownThumb
;
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAttack
;
irr
::
video
::
ITexture
*
tAttack
;
irr
::
video
::
ITexture
*
tNegated
;
irr
::
video
::
ITexture
*
tNegated
;
...
...
strings.conf
View file @
f9f6e20c
...
@@ -132,6 +132,7 @@
...
@@ -132,6 +132,7 @@
!
system
569
请选择[%
ls
]的位置
!
system
569
请选择[%
ls
]的位置
!
system
570
请选择要变成不能使用的卡片区域
!
system
570
请选择要变成不能使用的卡片区域
!
system
571
请选择要移动到的位置
!
system
571
请选择要移动到的位置
!
system
572
请选择要放置指示物的卡
!
system
1000
卡组
!
system
1000
卡组
!
system
1001
手卡
!
system
1001
手卡
!
system
1002
怪兽区
!
system
1002
怪兽区
...
...
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