[openjk] 11/130: Implement close method
Simon McVittie
smcv at debian.org
Fri Oct 28 11:09:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository openjk.
commit 605bb4b4df20ab4814a75263df8d2586d13dba93
Author: bibendovsky <bibendovsky at NOSTROMO>
Date: Sun Jul 3 22:16:00 2016 +0300
Implement close method
---
shared/qcommon/ojk_sg_archive.cpp | 13 +++++++++----
shared/qcommon/ojk_sg_archive_fwd.h | 6 ------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/shared/qcommon/ojk_sg_archive.cpp b/shared/qcommon/ojk_sg_archive.cpp
index 224fc57..7bf9a5f 100644
--- a/shared/qcommon/ojk_sg_archive.cpp
+++ b/shared/qcommon/ojk_sg_archive.cpp
@@ -10,8 +10,6 @@ namespace sg {
Archive::Archive() :
archive_mode_(),
- paths_(get_max_path_count()),
- path_index_(),
file_handle_(),
io_buffer_(),
io_buffer_offset_()
@@ -92,8 +90,15 @@ bool Archive::create(
void Archive::close()
{
- throw ArchiveException(
- "Not implemented.");
+ archive_mode_ = ArchiveMode::none;
+
+ if (file_handle_ != 0) {
+ ::FS_FCloseFile(file_handle_);
+ file_handle_ = 0;
+ }
+
+ io_buffer_.clear();
+ io_buffer_offset_ = 0;
}
void Archive::read_chunk(
diff --git a/shared/qcommon/ojk_sg_archive_fwd.h b/shared/qcommon/ojk_sg_archive_fwd.h
index 5cd3502..5c6a3f3 100644
--- a/shared/qcommon/ojk_sg_archive_fwd.h
+++ b/shared/qcommon/ojk_sg_archive_fwd.h
@@ -152,12 +152,6 @@ private:
// An archive mode.
ArchiveMode archive_mode_;
- // Saved game paths.
- Paths paths_;
-
- // Current path index.
- int path_index_;
-
// A handle to a file.
int32_t file_handle_;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git
More information about the Pkg-games-commits
mailing list