Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
List
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
REIKAI
ygopro
Commits
24fe16fd
Commit
24fe16fd
authored
Mar 14, 2019
by
nanahira
Committed by
mercury233
Mar 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update unknown card display (#12)
parent
a00b05ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
gframe/image_manager.cpp
gframe/image_manager.cpp
+24
-11
gframe/image_manager.h
gframe/image_manager.h
+2
-1
No files found.
gframe/image_manager.cpp
View file @
24fe16fd
...
...
@@ -12,7 +12,9 @@ bool ImageManager::Initial() {
tCover
[
3
]
=
GetTextureFromFile
(
"textures/cover2.jpg"
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
);
if
(
!
tCover
[
3
])
tCover
[
3
]
=
tCover
[
2
];
tUnknown
=
NULL
;
tUnknown
[
0
]
=
NULL
;
tUnknown
[
1
]
=
NULL
;
tUnknown
[
2
]
=
NULL
;
tAct
=
driver
->
getTexture
(
"textures/act.png"
);
tAttack
=
driver
->
getTexture
(
"textures/attack.png"
);
tChain
=
driver
->
getTexture
(
"textures/chain.png"
);
...
...
@@ -60,6 +62,12 @@ void ImageManager::ClearTexture() {
tMap
[
1
].
clear
();
tThumb
.
clear
();
tFields
.
clear
();
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
tUnknown
[
i
]
!=
NULL
)
{
driver
->
removeTexture
(
tUnknown
[
i
]);
tUnknown
[
i
]
=
NULL
;
}
}
}
void
ImageManager
::
RemoveTexture
(
int
code
)
{
auto
tit
=
tMap
[
0
].
find
(
code
);
...
...
@@ -86,8 +94,8 @@ void ImageManager::ResizeTexture() {
tCover
[
1
]
=
GetTextureFromFile
(
"textures/cover2.jpg"
,
imgWidth
,
imgHeight
);
if
(
!
tCover
[
1
])
tCover
[
1
]
=
tCover
[
0
];
driver
->
removeTexture
(
tUnknown
);
tUnknown
=
GetTextureFromFile
(
"textures/unknown.jpg"
,
imgWidth
,
imgHeight
);
//
driver->removeTexture(tUnknown);
//
tUnknown = GetTextureFromFile("textures/unknown.jpg", imgWidth, imgHeight);
driver
->
removeTexture
(
tBackGround
);
tBackGround
=
GetTextureFromFile
(
"textures/bg.jpg"
,
bgWidth
,
bgHeight
);
driver
->
removeTexture
(
tBackGround_menu
);
...
...
@@ -192,9 +200,12 @@ irr::video::ITexture* ImageManager::GetTextureFromFile(char* file, s32 width, s3
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
)
{
if
(
code
==
0
)
return
tUnknown
;
int
width
=
CARD_IMG_WIDTH
;
int
height
=
CARD_IMG_HEIGHT
;
if
(
fit
)
{
...
...
@@ -204,6 +215,8 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
width
=
width
*
mul
;
height
=
height
*
mul
;
}
if
(
code
==
0
)
return
GetTextureUnknown
(
width
,
height
,
fit
?
1
:
0
);
auto
tit
=
tMap
[
fit
?
1
:
0
].
find
(
code
);
if
(
tit
==
tMap
[
fit
?
1
:
0
].
end
())
{
char
file
[
256
];
...
...
@@ -218,19 +231,19 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
return
GetTextureThumb
(
code
);
}
tMap
[
fit
?
1
:
0
][
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
return
(
img
==
NULL
)
?
GetTextureUnknown
(
width
,
height
,
fit
?
1
:
0
)
:
img
;
}
if
(
tit
->
second
)
return
tit
->
second
;
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
)
{
if
(
code
==
0
)
return
tUnknown
;
auto
tit
=
tThumb
.
find
(
code
);
int
width
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
if
(
code
==
0
)
return
GetTextureUnknown
(
width
,
height
,
2
);
if
(
tit
==
tThumb
.
end
())
{
char
file
[
256
];
sprintf
(
file
,
"expansions/pics/thumbnail/%d.jpg"
,
code
);
...
...
@@ -248,12 +261,12 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
}
}
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknown
:
img
;
return
(
img
==
NULL
)
?
GetTextureUnknown
(
width
,
height
,
2
)
:
img
;
}
if
(
tit
->
second
)
return
tit
->
second
;
else
return
tUnknown
;
return
GetTextureUnknown
(
width
,
height
,
2
)
;
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureField
(
int
code
)
{
if
(
code
==
0
)
...
...
gframe/image_manager.h
View file @
24fe16fd
...
...
@@ -15,6 +15,7 @@ public:
void
RemoveTexture
(
int
code
);
void
ResizeTexture
();
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
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
...
...
@@ -25,7 +26,7 @@ public:
irr
::
IrrlichtDevice
*
device
;
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
ITexture
*
tCover
[
4
];
irr
::
video
::
ITexture
*
tUnknown
;
irr
::
video
::
ITexture
*
tUnknown
[
3
]
;
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAttack
;
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