mirror of
https://github.com/ModOrganizer2/libbsarch.git
synced 2026-07-27 14:06:31 -07:00
29 lines
618 B
C++
29 lines
618 B
C++
#include <iostream>
|
|||
|
|
|
||
|
|
#include "libbsarch.h"
|
||
|
|
|
||
|
|
using namespace std::string_literals;
|
||
|
|
|
||
|
|
#pragma comment(lib, "libbsarch")
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
bsa_archive_t archive = bsa_create();
|
||
|
|
|
||
|
|
bsa_load_from_file(archive, L"test_read.bsa");
|
||
|
|
bsa_close(archive);
|
||
|
|
|
||
|
|
bsa_entry_list_t entries = bsa_entry_list_create();
|
||
|
|
bsa_entry_list_add(entries, L"textures\\grass\\test.dds");
|
||
|
|
|
||
|
|
bsa_create_archive(archive, L"test_write.bsa", baSSE, entries);
|
||
|
|
bsa_add_file_from_disk(archive, L"files", L"files\\textures\\grass\\test.dds");
|
||
|
|
bsa_save(archive);
|
||
|
|
bsa_close(archive);
|
||
|
|
|
||
|
|
bsa_entry_list_free(entries);
|
||
|
|
|
||
|
|
bsa_free(archive);
|
||
|
|
|
||
|
|
printf("test\n");
|
||
|
|
}
|