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
d411fc66
Commit
d411fc66
authored
Jun 27, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update unknown card display
parent
235391f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
gframe/image_manager.cpp
gframe/image_manager.cpp
+23
-9
gframe/image_manager.h
gframe/image_manager.h
+2
-1
No files found.
gframe/image_manager.cpp
View file @
d411fc66
...
@@ -21,7 +21,10 @@ bool ImageManager::Initial() {
...
@@ -21,7 +21,10 @@ bool ImageManager::Initial() {
tCover
[
1
]
=
GetRandomImage
(
TEXTURE_COVER_S
);
tCover
[
1
]
=
GetRandomImage
(
TEXTURE_COVER_S
);
if
(
!
tCover
[
1
])
if
(
!
tCover
[
1
])
tCover
[
1
]
=
tCover
[
0
];
tCover
[
1
]
=
tCover
[
0
];
tUnknown
=
driver
->
getTexture
(
"textures/unknown.jpg"
);
//tUnknown = driver->getTexture("textures/unknown.jpg");
tUnknown
[
0
]
=
NULL
;
tUnknown
[
1
]
=
NULL
;
tUnknown
[
2
]
=
NULL
;
tAct
=
GetRandomImage
(
TEXTURE_ACTIVATE
);
tAct
=
GetRandomImage
(
TEXTURE_ACTIVATE
);
tAttack
=
GetRandomImage
(
TEXTURE_ATTACK
);
tAttack
=
GetRandomImage
(
TEXTURE_ATTACK
);
if
(
!
tAct
)
if
(
!
tAct
)
...
@@ -155,6 +158,12 @@ void ImageManager::ClearTexture() {
...
@@ -155,6 +158,12 @@ void ImageManager::ClearTexture() {
tMap
[
0
].
clear
();
tMap
[
0
].
clear
();
tMap
[
1
].
clear
();
tMap
[
1
].
clear
();
tThumb
.
clear
();
tThumb
.
clear
();
tThumb
.
clear
();
for
(
int
i
=
0
;
i
<
3
;
++
i
)
if
(
tUnknown
[
i
]
!=
NULL
)
{
driver
->
removeTexture
(
tUnknown
[
i
]);
tUnknown
[
i
]
=
NULL
;
}
}
}
void
ImageManager
::
RemoveTexture
(
int
code
)
{
void
ImageManager
::
RemoveTexture
(
int
code
)
{
auto
tit
=
tMap
[
0
].
find
(
code
);
auto
tit
=
tMap
[
0
].
find
(
code
);
...
@@ -263,9 +272,12 @@ irr::video::ITexture* ImageManager::GetTextureFromFile(char* file, s32 width, s3
...
@@ -263,9 +272,12 @@ irr::video::ITexture* ImageManager::GetTextureFromFile(char* file, s32 width, s3
return
driver
->
getTexture
(
file
);
return
driver
->
getTexture
(
file
);
}
}
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureUnknown
(
s32
width
,
s32
height
,
int
index
)
{
if
(
tUnknown
[
index
]
==
NULL
)
tUnknown
[
index
]
=
GetTextureFromFile
(
"textures/unknown.jpg"
,
width
,
height
);
return
tUnknown
[
index
];
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
if
(
code
==
0
)
return
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
)
{
...
@@ -275,6 +287,8 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
...
@@ -275,6 +287,8 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
width
=
width
*
mul
;
width
=
width
*
mul
;
height
=
height
*
mul
;
height
=
height
*
mul
;
}
}
if
(
code
==
0
)
return
GetTextureUnknown
(
width
,
height
,
fit
?
1
:
0
);
auto
tit
=
tMap
[
fit
?
1
:
0
].
find
(
code
);
auto
tit
=
tMap
[
fit
?
1
:
0
].
find
(
code
);
if
(
tit
==
tMap
[
fit
?
1
:
0
].
end
())
{
if
(
tit
==
tMap
[
fit
?
1
:
0
].
end
())
{
char
file
[
256
];
char
file
[
256
];
...
@@ -297,19 +311,19 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
...
@@ -297,19 +311,19 @@ 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
)
?
GetTextureUnknown
(
width
,
height
,
fit
?
1
:
0
)
:
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
?
GetTextureUnknown
(
width
,
height
,
fit
?
1
:
0
)
:
GetTextureThumb
(
code
);
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
if
(
code
==
0
)
return
tUnknown
;
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
;
if
(
code
==
0
)
return
GetTextureUnknown
(
width
,
height
,
2
);
if
(
tit
==
tThumb
.
end
())
{
if
(
tit
==
tThumb
.
end
())
{
char
file
[
256
];
char
file
[
256
];
sprintf
(
file
,
"expansions/pics/thumbnail/%d.png"
,
code
);
sprintf
(
file
,
"expansions/pics/thumbnail/%d.png"
,
code
);
...
@@ -343,12 +357,12 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -343,12 +357,12 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
}
}
}
}
tThumb
[
code
]
=
img
;
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
return
(
img
==
NULL
)
?
GetTextureUnknown
(
width
,
height
,
2
)
:
img
;
}
}
if
(
tit
->
second
)
if
(
tit
->
second
)
return
tit
->
second
;
return
tit
->
second
;
else
else
return
tUnknown
;
return
GetTextureUnknown
(
width
,
height
,
2
)
;
}
}
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 @
d411fc66
...
@@ -19,6 +19,7 @@ public:
...
@@ -19,6 +19,7 @@ public:
void
ClearTexture
();
void
ClearTexture
();
void
RemoveTexture
(
int
code
);
void
RemoveTexture
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTextureFromFile
(
char
*
file
,
s32
width
,
s32
height
);
irr
::
video
::
ITexture
*
GetTextureUnknown
(
s32
width
,
s32
height
,
int
index
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
...
@@ -29,7 +30,7 @@ public:
...
@@ -29,7 +30,7 @@ public:
irr
::
IrrlichtDevice
*
device
;
irr
::
IrrlichtDevice
*
device
;
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
ITexture
*
tCover
[
2
];
irr
::
video
::
ITexture
*
tCover
[
2
];
irr
::
video
::
ITexture
*
tUnknown
;
irr
::
video
::
ITexture
*
tUnknown
[
3
]
;
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAttack
;
irr
::
video
::
ITexture
*
tAttack
;
irr
::
video
::
ITexture
*
tNegated
;
irr
::
video
::
ITexture
*
tNegated
;
...
...
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