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
9c64a422
Commit
9c64a422
authored
Mar 03, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add myfopen
parent
0bf79949
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
8 deletions
+20
-8
gframe/config.h
gframe/config.h
+12
-0
gframe/data_manager.cpp
gframe/data_manager.cpp
+2
-2
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+4
-4
gframe/replay.cpp
gframe/replay.cpp
+1
-1
No files found.
gframe/config.h
View file @
9c64a422
...
...
@@ -72,6 +72,18 @@ inline FILE* mywfopen(const wchar_t* filename, const char* mode) {
return
fp
;
}
#ifdef _WIN32
inline
FILE
*
myfopen
(
const
char
*
filename
,
const
char
*
mode
)
{
wchar_t
wfilename
[
256
]{};
BufferIO
::
DecodeUTF8
(
filename
,
wfilename
);
wchar_t
wmode
[
20
]{};
BufferIO
::
CopyCharArray
(
mode
,
wmode
);
return
_wfopen
(
wfilename
,
wmode
);
}
#else
#define myfopen std::fopen
#endif
#include <irrlicht.h>
using
namespace
irr
;
using
namespace
core
;
...
...
gframe/data_manager.cpp
View file @
9c64a422
...
...
@@ -108,7 +108,7 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
return
ret
;
}
bool
DataManager
::
LoadStrings
(
const
char
*
file
)
{
FILE
*
fp
=
std
::
fopen
(
file
,
"r"
);
FILE
*
fp
=
my
fopen
(
file
,
"r"
);
if
(
!
fp
)
return
false
;
char
linebuf
[
TEXT_LINE_SIZE
]{};
...
...
@@ -431,7 +431,7 @@ unsigned char* DataManager::ReadScriptFromIrrFS(const char* script_name, int* sl
return
scriptBuffer
;
}
unsigned
char
*
DataManager
::
ReadScriptFromFile
(
const
char
*
script_name
,
int
*
slen
)
{
FILE
*
fp
=
std
::
fopen
(
script_name
,
"rb"
);
FILE
*
fp
=
my
fopen
(
script_name
,
"rb"
);
if
(
!
fp
)
return
nullptr
;
size_t
len
=
std
::
fread
(
scriptBuffer
,
1
,
sizeof
scriptBuffer
,
fp
);
...
...
gframe/deck_manager.cpp
View file @
9c64a422
...
...
@@ -10,7 +10,7 @@ DeckManager deckManager;
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
auto
cur
=
_lfList
.
rend
();
FILE
*
fp
=
std
::
fopen
(
path
,
"r"
);
FILE
*
fp
=
my
fopen
(
path
,
"r"
);
char
linebuf
[
256
]{};
wchar_t
strBuffer
[
256
]{};
if
(
fp
)
{
...
...
gframe/game.cpp
View file @
9c64a422
...
...
@@ -1282,7 +1282,7 @@ void Game::RefreshBot() {
if
(
!
gameConf
.
enable_bot_mode
)
return
;
botInfo
.
clear
();
FILE
*
fp
=
std
::
fopen
(
"bot.conf"
,
"r"
);
FILE
*
fp
=
my
fopen
(
"bot.conf"
,
"r"
);
char
linebuf
[
256
]{};
char
strbuf
[
256
]{};
if
(
fp
)
{
...
...
@@ -1335,7 +1335,7 @@ void Game::RefreshBot() {
}
}
void
Game
::
LoadConfig
()
{
FILE
*
fp
=
std
::
fopen
(
"system.conf"
,
"r"
);
FILE
*
fp
=
my
fopen
(
"system.conf"
,
"r"
);
if
(
!
fp
)
return
;
char
linebuf
[
CONFIG_LINE_SIZE
]{};
...
...
@@ -1473,7 +1473,7 @@ void Game::LoadConfig() {
std
::
fclose
(
fp
);
}
void
Game
::
SaveConfig
()
{
FILE
*
fp
=
std
::
fopen
(
"system.conf"
,
"w"
);
FILE
*
fp
=
my
fopen
(
"system.conf"
,
"w"
);
std
::
fprintf
(
fp
,
"#config file
\n
#nickname & gamename should be less than 20 characters
\n
"
);
char
linebuf
[
CONFIG_LINE_SIZE
];
std
::
fprintf
(
fp
,
"use_d3d = %d
\n
"
,
gameConf
.
use_d3d
?
1
:
0
);
...
...
@@ -1726,7 +1726,7 @@ void Game::AddDebugMsg(const char* msg) {
}
}
void
Game
::
ErrorLog
(
const
char
*
msg
)
{
FILE
*
fp
=
std
::
fopen
(
"error.log"
,
"a"
);
FILE
*
fp
=
my
fopen
(
"error.log"
,
"a"
);
if
(
!
fp
)
return
;
time_t
nowtime
=
std
::
time
(
nullptr
);
...
...
gframe/replay.cpp
View file @
9c64a422
...
...
@@ -24,7 +24,7 @@ void Replay::BeginRecord() {
#else
if
(
is_recording
)
std
::
fclose
(
fp
);
fp
=
std
::
fopen
(
"./replay/_LastReplay.yrp"
,
"wb"
);
fp
=
my
fopen
(
"./replay/_LastReplay.yrp"
,
"wb"
);
if
(
!
fp
)
return
;
#endif
...
...
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