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
005ab23b
Commit
005ab23b
authored
May 08, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typo
parent
9f9ca37b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
gframe/drawing.cpp
gframe/drawing.cpp
+1
-1
gframe/image_manager.cpp
gframe/image_manager.cpp
+10
-10
gframe/image_manager.h
gframe/image_manager.h
+5
-5
No files found.
gframe/drawing.cpp
View file @
005ab23b
...
@@ -1262,7 +1262,7 @@ void Game::DrawDeckBd() {
...
@@ -1262,7 +1262,7 @@ void Game::DrawDeckBd() {
driver
->
draw2DRectangle
(
Resize
(
805
,
160
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
805
,
160
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
159
,
1020
,
630
));
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
159
,
1020
,
630
));
}
}
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
constexpr
int
MAX_RESULT
=
9
;
constexpr
int
MAX_RESULT
=
9
;
#else
#else
constexpr
int
MAX_RESULT
=
7
;
constexpr
int
MAX_RESULT
=
7
;
...
...
gframe/image_manager.cpp
View file @
005ab23b
#include "image_manager.h"
#include "image_manager.h"
#include "game.h"
#include "game.h"
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
#include <thread>
#include <thread>
#endif
#endif
#ifdef _OPENMP
#ifdef _OPENMP
...
@@ -22,7 +22,7 @@ bool ImageManager::Initial() {
...
@@ -22,7 +22,7 @@ bool ImageManager::Initial() {
tUnknownFit
=
nullptr
;
tUnknownFit
=
nullptr
;
tUnknownThumb
=
nullptr
;
tUnknownThumb
=
nullptr
;
tBigPicture
=
nullptr
;
tBigPicture
=
nullptr
;
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
tLoading
=
nullptr
;
tLoading
=
nullptr
;
tThumbLoadingThreadRunning
=
false
;
tThumbLoadingThreadRunning
=
false
;
#endif
#endif
...
@@ -66,7 +66,7 @@ void ImageManager::ClearTexture() {
...
@@ -66,7 +66,7 @@ void ImageManager::ClearTexture() {
driver
->
removeTexture
(
tit
->
second
);
driver
->
removeTexture
(
tit
->
second
);
}
}
for
(
auto
tit
=
tThumb
.
begin
();
tit
!=
tThumb
.
end
();
++
tit
)
{
for
(
auto
tit
=
tThumb
.
begin
();
tit
!=
tThumb
.
end
();
++
tit
)
{
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
if
(
tit
->
second
&&
tit
->
second
!=
tLoading
)
if
(
tit
->
second
&&
tit
->
second
!=
tLoading
)
#else
#else
if
(
tit
->
second
)
if
(
tit
->
second
)
...
@@ -80,7 +80,7 @@ void ImageManager::ClearTexture() {
...
@@ -80,7 +80,7 @@ void ImageManager::ClearTexture() {
tMap
[
0
].
clear
();
tMap
[
0
].
clear
();
tMap
[
1
].
clear
();
tMap
[
1
].
clear
();
tThumb
.
clear
();
tThumb
.
clear
();
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
tThumbLoadingMutex
.
lock
();
tThumbLoadingMutex
.
lock
();
tThumbLoading
.
clear
();
tThumbLoading
.
clear
();
while
(
!
tThumbLoadingCodes
.
empty
())
while
(
!
tThumbLoadingCodes
.
empty
())
...
@@ -123,7 +123,7 @@ void ImageManager::ResizeTexture() {
...
@@ -123,7 +123,7 @@ void ImageManager::ResizeTexture() {
driver
->
removeTexture
(
tUnknown
);
driver
->
removeTexture
(
tUnknown
);
driver
->
removeTexture
(
tUnknownFit
);
driver
->
removeTexture
(
tUnknownFit
);
driver
->
removeTexture
(
tUnknownThumb
);
driver
->
removeTexture
(
tUnknownThumb
);
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
driver
->
removeTexture
(
tLoading
);
driver
->
removeTexture
(
tLoading
);
tLoading
=
GetTextureFromFile
(
"textures/cover.jpg"
,
imgWidthThumb
,
imgHeightThumb
);
tLoading
=
GetTextureFromFile
(
"textures/cover.jpg"
,
imgWidthThumb
,
imgHeightThumb
);
#endif
#endif
...
@@ -298,7 +298,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
...
@@ -298,7 +298,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
tBigPicture
=
texture
;
tBigPicture
=
texture
;
return
texture
;
return
texture
;
}
}
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
int
ImageManager
::
LoadThumbThread
()
{
int
ImageManager
::
LoadThumbThread
()
{
while
(
true
)
{
while
(
true
)
{
imageManager
.
tThumbLoadingMutex
.
lock
();
imageManager
.
tThumbLoadingMutex
.
lock
();
...
@@ -354,11 +354,11 @@ int ImageManager::LoadThumbThread() {
...
@@ -354,11 +354,11 @@ int ImageManager::LoadThumbThread() {
imageManager
.
tThumbLoadingMutex
.
unlock
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
return
0
;
return
0
;
}
}
#endif // YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#endif // YGOPRO_USE_THUMB_LOAD_TH
RE
AD
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
if
(
code
==
0
)
if
(
code
==
0
)
return
tUnknownThumb
;
return
tUnknownThumb
;
#ifndef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifndef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
auto
tit
=
tThumb
.
find
(
code
);
auto
tit
=
tThumb
.
find
(
code
);
if
(
tit
==
tThumb
.
end
())
{
if
(
tit
==
tThumb
.
end
())
{
char
file
[
256
];
char
file
[
256
];
...
@@ -381,7 +381,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -381,7 +381,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
tThumb
[
code
]
=
img
;
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
}
}
#else // YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#else // YGOPRO_USE_THUMB_LOAD_TH
RE
AD
imageManager
.
tThumbLoadingMutex
.
lock
();
imageManager
.
tThumbLoadingMutex
.
lock
();
auto
lit
=
tThumbLoading
.
find
(
code
);
auto
lit
=
tThumbLoading
.
find
(
code
);
if
(
lit
!=
tThumbLoading
.
end
())
{
if
(
lit
!=
tThumbLoading
.
end
())
{
...
@@ -409,7 +409,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -409,7 +409,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
imageManager
.
tThumbLoadingMutex
.
unlock
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
return
tLoading
;
return
tLoading
;
}
}
#endif // YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#endif // YGOPRO_USE_THUMB_LOAD_TH
RE
AD
if
(
tit
->
second
)
if
(
tit
->
second
)
return
tit
->
second
;
return
tit
->
second
;
else
else
...
...
gframe/image_manager.h
View file @
005ab23b
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
#define IMAGEMANAGER_H
#define IMAGEMANAGER_H
#ifndef _OPENMP
#ifndef _OPENMP
#define YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#define YGOPRO_USE_THUMB_LOAD_TH
RE
AD
#endif
#endif
#include "config.h"
#include "config.h"
#include "data_manager.h"
#include "data_manager.h"
#include <unordered_map>
#include <unordered_map>
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
#include <queue>
#include <queue>
#include <mutex>
#include <mutex>
#endif
#endif
...
@@ -27,14 +27,14 @@ public:
...
@@ -27,14 +27,14 @@ public:
irr
::
video
::
ITexture
*
GetBigPicture
(
int
code
,
float
zoom
);
irr
::
video
::
ITexture
*
GetBigPicture
(
int
code
,
float
zoom
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
static
int
LoadThumbThread
();
static
int
LoadThumbThread
();
#endif
#endif
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
2
];
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
2
];
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tThumb
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tThumb
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
std
::
unordered_map
<
int
,
irr
::
video
::
IImage
*>
tThumbLoading
;
std
::
unordered_map
<
int
,
irr
::
video
::
IImage
*>
tThumbLoading
;
std
::
queue
<
int
>
tThumbLoadingCodes
;
std
::
queue
<
int
>
tThumbLoadingCodes
;
std
::
mutex
tThumbLoadingMutex
;
std
::
mutex
tThumbLoadingMutex
;
...
@@ -47,7 +47,7 @@ public:
...
@@ -47,7 +47,7 @@ public:
irr
::
video
::
ITexture
*
tUnknownFit
;
irr
::
video
::
ITexture
*
tUnknownFit
;
irr
::
video
::
ITexture
*
tUnknownThumb
;
irr
::
video
::
ITexture
*
tUnknownThumb
;
irr
::
video
::
ITexture
*
tBigPicture
;
irr
::
video
::
ITexture
*
tBigPicture
;
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
irr
::
video
::
ITexture
*
tLoading
;
irr
::
video
::
ITexture
*
tLoading
;
#endif
#endif
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAct
;
...
...
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