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
YGOPRO-520DIY
ygopro
Commits
f746bf7d
Commit
f746bf7d
authored
Jun 17, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refa expansions image load
parent
f249d420
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
20 deletions
+42
-20
gframe/image_manager.cpp
gframe/image_manager.cpp
+42
-20
No files found.
gframe/image_manager.cpp
View file @
f746bf7d
...
@@ -330,8 +330,11 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
...
@@ -330,8 +330,11 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
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
];
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
nullptr
;
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.png"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
if
(
img
==
nullptr
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
...
@@ -373,8 +376,11 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
...
@@ -373,8 +376,11 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
}
}
irr
::
video
::
ITexture
*
texture
;
irr
::
video
::
ITexture
*
texture
;
char
file
[
256
];
char
file
[
256
];
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.jpg"
,
code
);
irr
::
video
::
IImage
*
srcimg
=
nullptr
;
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
file
);
if
(
srcimg
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.jpg"
,
code
);
srcimg
=
driver
->
createImageFromFile
(
file
);
}
if
(
srcimg
==
nullptr
)
{
if
(
srcimg
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"pics/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"pics/%d.jpg"
,
code
);
srcimg
=
driver
->
createImageFromFile
(
file
);
srcimg
=
driver
->
createImageFromFile
(
file
);
...
@@ -402,8 +408,11 @@ int ImageManager::LoadThumbThread() {
...
@@ -402,8 +408,11 @@ int ImageManager::LoadThumbThread() {
imageManager
.
tThumbLoadingCodes
.
pop
();
imageManager
.
tThumbLoadingCodes
.
pop
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
char
file
[
256
];
char
file
[
256
];
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/thumbnail/%d.png"
,
code
);
irr
::
video
::
IImage
*
img
=
nullptr
;
irr
::
video
::
IImage
*
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/thumbnail/%d.png"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
nullptr
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/thumbnail/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/thumbnail/%d.jpg"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
...
@@ -425,8 +434,10 @@ int ImageManager::LoadThumbThread() {
...
@@ -425,8 +434,10 @@ int ImageManager::LoadThumbThread() {
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
}
if
(
img
==
nullptr
&&
mainGame
->
gameConf
.
use_image_scale
)
{
if
(
img
==
nullptr
&&
mainGame
->
gameConf
.
use_image_scale
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.png"
,
code
);
if
(
img
==
nullptr
)
{
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.png"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
nullptr
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.jpg"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
...
@@ -488,24 +499,29 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -488,24 +499,29 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
auto
tit
=
tThumb
.
find
(
code
);
auto
tit
=
tThumb
.
find
(
code
);
if
(
tit
==
tThumb
.
end
()
&&
!
mainGame
->
gameConf
.
use_image_load_background_thread
)
{
if
(
tit
==
tThumb
.
end
()
&&
!
mainGame
->
gameConf
.
use_image_load_background_thread
)
{
char
file
[
256
];
char
file
[
256
];
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/thumbnail/%d.jpg"
,
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
;
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
)
;
irr
::
video
::
ITexture
*
img
=
nullptr
;
if
(
img
==
NULL
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"pics/thumbnail/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"
expansions/
pics/thumbnail/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
}
if
(
img
==
NULL
&&
mainGame
->
gameConf
.
use_image_scale
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"
expansions/pics
/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"
pics/thumbnail
/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
}
if
(
img
==
nullptr
&&
mainGame
->
gameConf
.
use_image_scale
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"pics/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
}
}
}
tThumb
[
code
]
=
img
;
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
return
(
img
==
nullptr
)
?
tUnknownThumb
:
img
;
}
}
if
(
tit
==
tThumb
.
end
()
||
tit
->
second
==
tLoading
)
{
if
(
tit
==
tThumb
.
end
()
||
tit
->
second
==
tLoading
)
{
imageManager
.
tThumbLoadingMutex
.
lock
();
imageManager
.
tThumbLoadingMutex
.
lock
();
...
@@ -544,8 +560,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -544,8 +560,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
auto
tit
=
tFields
.
find
(
code
);
auto
tit
=
tFields
.
find
(
code
);
if
(
tit
==
tFields
.
end
())
{
if
(
tit
==
tFields
.
end
())
{
char
file
[
256
];
char
file
[
256
];
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
nullptr
;
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
}
if
(
img
==
nullptr
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
...
@@ -588,8 +607,11 @@ irr::video::ITexture* ImageManager::GetTextureField(int code) {
...
@@ -588,8 +607,11 @@ irr::video::ITexture* ImageManager::GetTextureField(int code) {
auto
tit
=
tFields
.
find
(
code
);
auto
tit
=
tFields
.
find
(
code
);
if
(
tit
==
tFields
.
end
())
{
if
(
tit
==
tFields
.
end
())
{
char
file
[
256
];
char
file
[
256
];
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.png"
,
code
);
irr
::
video
::
ITexture
*
img
=
nullptr
;
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.png"
,
code
);
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
}
if
(
img
==
nullptr
)
{
if
(
img
==
nullptr
)
{
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics/field/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
img
=
GetTextureFromFile
(
file
,
512
*
mainGame
->
xScale
,
512
*
mainGame
->
yScale
);
...
...
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