forked from teamnwah/openmw-tes3coop
Tested and fixed BSA archive loader for Ogre, added test script
parent
1779dc1f7c
commit
310e3a8038
@ -0,0 +1,38 @@
|
||||
#include <Ogre.h>
|
||||
#include <iostream>
|
||||
|
||||
// This is a test of the BSA archive handler for OGRE.
|
||||
|
||||
#include "../bsa_archive.cpp"
|
||||
|
||||
using namespace Ogre;
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
// Disable Ogre logging
|
||||
new LogManager;
|
||||
Log *log = LogManager::getSingleton().createLog("");
|
||||
log->setDebugOutputEnabled(false);
|
||||
|
||||
// Set up Root
|
||||
Root *root = new Root("","","");
|
||||
|
||||
// Add the archive manager
|
||||
ArchiveManager::getSingleton().addArchiveFactory( new BSAArchiveFactory );
|
||||
|
||||
// Add Morrowind.bsa
|
||||
ResourceGroupManager::getSingleton().
|
||||
addResourceLocation("../../data/Morrowind.bsa", "BSA", "General");
|
||||
|
||||
// Pick a sample file
|
||||
String tex = "textures\\tx_natural_cavern_wall13.dds";
|
||||
cout << "Opening file: " << tex << endl;
|
||||
|
||||
// Get it from the resource system
|
||||
DataStreamPtr data = ResourceGroupManager::getSingleton().openResource(tex, "General");
|
||||
|
||||
cout << "Size: " << data->size() << endl;
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
Reading Morrowind.bsa
|
||||
First 10 files in archive:
|
||||
meshes\m\probe_journeyman_01.nif (6276 bytes @126646784)
|
||||
textures\menu_rightbuttonup_top.dds (256 bytes @218533676)
|
||||
textures\menu_rightbuttonup_right.dds (256 bytes @218533420)
|
||||
textures\menu_rightbuttonup_left.dds (256 bytes @218533164)
|
||||
textures\menu_rightbuttondown_top.dds (256 bytes @218531820)
|
||||
meshes\b\b_n_redguard_f_skins.nif (41766 bytes @17810510)
|
||||
meshes\b\b_n_redguard_m_skins.nif (41950 bytes @18103839)
|
||||
meshes\b\b_n_redguard_f_wrist.nif (2355 bytes @17858864)
|
||||
meshes\b\b_n_redguard_m_foot.nif (4141 bytes @17862813)
|
||||
meshes\b\b_n_redguard_m_knee.nif (2085 bytes @18098833)
|
||||
Does file 'meshes\r\xnetch_betty.nif' exist?
|
||||
Yes.
|
||||
53714 bytes
|
||||
Does file 'humdrum' exist?
|
||||
No.
|
@ -0,0 +1,2 @@
|
||||
Opening file: textures\tx_natural_cavern_wall13.dds
|
||||
Size: 43808
|
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
make || exit
|
||||
|
||||
mkdir -p output
|
||||
|
||||
PROGS=*_test
|
||||
|
||||
for a in $PROGS; do
|
||||
if [ -f "output/$a.out" ]; then
|
||||
echo "Running $a:"
|
||||
$a | diff output/$a.out -
|
||||
else
|
||||
echo "Creating $a.out"
|
||||
$a > "output/$a.out"
|
||||
git add "output/$a.out"
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue