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
nanahira
ygopro
Commits
2362a622
Commit
2362a622
authored
Mar 29, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fh' into test
parents
3bc07cdf
f4ea5ae4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
gframe/data_manager.cpp
gframe/data_manager.cpp
+10
-2
gframe/game.cpp
gframe/game.cpp
+10
-0
No files found.
gframe/data_manager.cpp
View file @
2362a622
...
@@ -11,7 +11,13 @@ IFileSystem* DataManager::FileSystem;
...
@@ -11,7 +11,13 @@ IFileSystem* DataManager::FileSystem;
DataManager
dataManager
;
DataManager
dataManager
;
bool
DataManager
::
LoadDB
(
const
wchar_t
*
wfile
)
{
bool
DataManager
::
LoadDB
(
const
wchar_t
*
wfile
)
{
char
file
[
256
];
BufferIO
::
EncodeUTF8
(
wfile
,
file
);
#ifdef _WIN32
IReadFile
*
reader
=
FileSystem
->
createAndOpenFile
(
wfile
);
IReadFile
*
reader
=
FileSystem
->
createAndOpenFile
(
wfile
);
#else
IReadFile
*
reader
=
FileSystem
->
createAndOpenFile
(
file
);
#endif
if
(
reader
==
NULL
)
if
(
reader
==
NULL
)
return
false
;
return
false
;
spmemvfs_db_t
db
;
spmemvfs_db_t
db
;
...
@@ -22,8 +28,6 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
...
@@ -22,8 +28,6 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
reader
->
read
(
mem
->
data
,
mem
->
total
);
reader
->
read
(
mem
->
data
,
mem
->
total
);
reader
->
drop
();
reader
->
drop
();
(
mem
->
data
)[
mem
->
total
]
=
'\0'
;
(
mem
->
data
)[
mem
->
total
]
=
'\0'
;
char
file
[
256
];
BufferIO
::
EncodeUTF8
(
wfile
,
file
);
if
(
spmemvfs_open_db
(
&
db
,
file
,
mem
)
!=
SQLITE_OK
)
if
(
spmemvfs_open_db
(
&
db
,
file
,
mem
)
!=
SQLITE_OK
)
return
Error
(
&
db
);
return
Error
(
&
db
);
sqlite3
*
pDB
=
db
.
handle
;
sqlite3
*
pDB
=
db
.
handle
;
...
@@ -362,9 +366,13 @@ byte* DataManager::ScriptReaderEx(const char* script_name, int* slen) {
...
@@ -362,9 +366,13 @@ byte* DataManager::ScriptReaderEx(const char* script_name, int* slen) {
return
ScriptReader
(
second
,
slen
);
return
ScriptReader
(
second
,
slen
);
}
}
byte
*
DataManager
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
byte
*
DataManager
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
#ifdef _WIN32
wchar_t
fname
[
256
];
wchar_t
fname
[
256
];
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
IReadFile
*
reader
=
FileSystem
->
createAndOpenFile
(
fname
);
IReadFile
*
reader
=
FileSystem
->
createAndOpenFile
(
fname
);
#else
IReadFile
*
reader
=
FileSystem
->
createAndOpenFile
(
script_name
);
#endif
if
(
reader
==
NULL
)
if
(
reader
==
NULL
)
return
0
;
return
0
;
size_t
size
=
reader
->
getSize
();
size_t
size
=
reader
->
getSize
();
...
...
gframe/game.cpp
View file @
2362a622
...
@@ -943,7 +943,13 @@ void Game::LoadExpansions() {
...
@@ -943,7 +943,13 @@ void Game::LoadExpansions() {
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".zip"
,
4
))
{
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".zip"
,
4
))
{
wchar_t
fpath
[
1024
];
wchar_t
fpath
[
1024
];
myswprintf
(
fpath
,
L"./expansions/%ls"
,
name
);
myswprintf
(
fpath
,
L"./expansions/%ls"
,
name
);
#ifdef _WIN32
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
);
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
);
#else
char
upath
[
1024
];
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
dataManager
.
FileSystem
->
addFileArchive
(
upath
,
true
,
false
);
#endif
}
}
});
});
for
(
u32
i
=
0
;
i
<
DataManager
::
FileSystem
->
getFileArchiveCount
();
++
i
)
{
for
(
u32
i
=
0
;
i
<
DataManager
::
FileSystem
->
getFileArchiveCount
();
++
i
)
{
...
@@ -959,7 +965,11 @@ void Game::LoadExpansions() {
...
@@ -959,7 +965,11 @@ void Game::LoadExpansions() {
if
(
wcsrchr
(
fname
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
fname
,
'.'
),
L".cdb"
,
4
))
if
(
wcsrchr
(
fname
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
fname
,
'.'
),
L".cdb"
,
4
))
dataManager
.
LoadDB
(
fname
);
dataManager
.
LoadDB
(
fname
);
if
(
wcsrchr
(
fname
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
fname
,
'.'
),
L".conf"
,
5
))
{
if
(
wcsrchr
(
fname
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
fname
,
'.'
),
L".conf"
,
5
))
{
#ifdef _WIN32
IReadFile
*
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
fname
);
IReadFile
*
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
fname
);
#else
IReadFile
*
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
uname
);
#endif
dataManager
.
LoadStrings
(
reader
);
dataManager
.
LoadStrings
(
reader
);
}
}
}
}
...
...
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