Animation parsing was completely broken. It was all incorrect. A3 is not variable length animations.

This commit is contained in:
jaynus 2015-05-10 18:18:40 -07:00
parent ad150e3c00
commit 62e441fb1d
6 changed files with 93 additions and 40 deletions

View File

@ -20,15 +20,16 @@ namespace ace {
stream_.read((char *)&min_phase, sizeof(float));
stream_.read((char *)&max_phase, sizeof(float));
stream_.read((char *)&junk, sizeof(uint32_t));
stream_.read((char *)&junk2, sizeof(uint32_t));
//stream_.read((char *)&junk, sizeof(uint32_t));
//stream_.read((char *)&junk2, sizeof(uint32_t));
stream_.read((char *)&source_address, sizeof(uint32_t));
float buffer[4];
stream_.read((char *)buffer, sizeof(float) * 4);
return;
// THIS IS ALL WRONG
// ARMA3 HAS FIXED 4-FLOAT TRANSFORMS
switch (type) {
// rotations

View File

@ -1,6 +1,6 @@
init:
#debug_render:
#register_vehicle:\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d,2,4050.18;3802.55;5.075
debug_render:
register_vehicle:\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d,2,4050.18;3802.55;5.075
#hit:2,\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d,[],2,Sh_120mm_APFSDS,650,27,19100,50,10,708.602;235.609;-85.6468,-2.1748;0.139648;-1.35955,0.942743;0.31346;-0.113925,-1;6.1914e-007;0.000794772,-2.17383;0.139404;-1.32366,708.602;235.609;-85.6468
#register_vehicle:\a3\structures_f\mil\BagFence\BagFence_Long_F.p3d,0,4050.18;3802.55;5.075
#hit:0,A3\Structures_F\Mil\BagFence\BagFence_Long_F.p3d,[],0,B_65x39_Caseless,1295,264,11300,0,0,-16.5091;729.003;-177.406,0.2854;-0.239258;0.0619297,-0.0219989;0.971421;-0.236342,0.00232643;-0.999479;0.0321913

View File

@ -0,0 +1,69 @@
#include "shared.hpp"
#include "pbo\archive.hpp"
#include "membuf.hpp"
#include "logging.hpp"
#include "p3d\model.hpp"
INITIALIZE_EASYLOGGINGPP
int main(int argc, char **argv) {
//ace::p3d::parser _parser;
el::Configurations log_conf;
log_conf.setGlobally(el::ConfigurationType::Filename, "logs/pbo_parser.log");
#ifdef _DEBUG
el::Loggers::reconfigureAllLoggers(el::ConfigurationType::Format, "[%datetime] - %level - {%loc}t:%thread- %msg");
//%d%M%Y-%H:%m:%s.%g
#else
el::Loggers::reconfigureAllLoggers(el::ConfigurationType::Format, "%datetime-{%level}- %msg");
#endif
std::fstream filestream;
ace::pbo::archive_p _archive = nullptr;
if (argc < 2) {
LOG(ERROR) << "No pbo name provided";
return -1;
}
filestream.open(argv[1], std::ios::binary | std::ios::in);
if (!filestream.good()) {
LOG(ERROR) << "Cannot open file";
return -1;
}
_archive = std::make_shared<ace::pbo::archive>(filestream);
LOG(INFO) << "Archive opened: " << argv[1];
LOG(INFO) << "\t" << _archive->info->name << "=" << _archive->info->data;
LOG(INFO) << "Entries: " << _archive->entries.size();
for (ace::pbo::entry_p & entry : _archive->entries) {
LOG(INFO) << "\t" << entry->filename;
LOG(INFO) << "\t\t" << "Size=" << entry->size << ", StorageSize=" << entry->storage_size << ", offset=" << entry->offset + _archive->begin_data_offset;
if (entry->filename == argv[2]) {
ace::pbo::file_p test_file = std::make_shared<ace::pbo::file>();
bool result = _archive->get_file(filestream, entry, test_file);
if (result) {
LOG(INFO) << "File Read";
LOG(INFO) << "--------------------------------";
ace::membuf _memory_buffer((char *)test_file->data, test_file->size);
std::istream _data_stream(&_memory_buffer);
ace::p3d::model_p _model = std::make_shared<ace::p3d::model>(_data_stream);
LOG(INFO) << "--------------------------------";
} else {
LOG(ERROR) << "READ OF TEST FILE FAILED!!!!";
}
}
}
getchar();
return 0;
}

View File

@ -1,8 +1,7 @@
#include "shared.hpp"
#include "pbo\archive.hpp"
#include "membuf.hpp"
#include "logging.hpp"
#include "p3d\model.hpp"
#include "pbo/search.hpp"
INITIALIZE_EASYLOGGINGPP
@ -11,7 +10,7 @@ int main(int argc, char **argv) {
//ace::p3d::parser _parser;
el::Configurations log_conf;
log_conf.setGlobally(el::ConfigurationType::Filename, "logs/server.log");
log_conf.setGlobally(el::ConfigurationType::Filename, "logs/pbo_search.log");
#ifdef _DEBUG
el::Loggers::reconfigureAllLoggers(el::ConfigurationType::Format, "[%datetime] - %level - {%loc}t:%thread- %msg");
@ -33,36 +32,12 @@ int main(int argc, char **argv) {
return -1;
}
_archive = std::make_shared<ace::pbo::archive>(filestream);
LOG(INFO) << "Archive opened: " << argv[1];
LOG(INFO) << "\t" << _archive->info->name << "=" << _archive->info->data;
LOG(INFO) << "Entries: " << _archive->entries.size();
ace::pbo::search _pbo_searcher(".*\.p3d");
for (ace::pbo::entry_p & entry : _archive->entries) {
LOG(INFO) << "\t" << entry->filename;
LOG(INFO) << "\t\t" << "Size=" << entry->size << ", StorageSize=" << entry->storage_size << ", offset=" << entry->offset + _archive->begin_data_offset;
if (entry->filename == argv[2]) {
ace::pbo::file_p test_file = std::make_shared<ace::pbo::file>();
bool result = _archive->get_file(filestream, entry, test_file);
if (result) {
LOG(INFO) << "File Read";
LOG(INFO) << "--------------------------------";
ace::membuf _memory_buffer((char *)test_file->data, test_file->size);
std::istream _data_stream(&_memory_buffer);
ace::p3d::model_p _model = std::make_shared<ace::p3d::model>(_data_stream);
LOG(INFO) << "--------------------------------";
} else {
LOG(ERROR) << "READ OF TEST FILE FAILED!!!!";
}
}
for (auto & kv : _pbo_searcher.file_index()) {
LOG(INFO) << "Index: " << kv.first << " : " << kv.second;
}
getchar();
return 0;

View File

@ -73,8 +73,8 @@ namespace ace {
bool controller::reset(const arguments &_args, std::string & result) {
vehicles.clear();
if (!ace::model_collection::get().ready()) {
ace::model_collection::get().init();
if (!ace::model_collection::get().ready()) {
ace::model_collection::get().init();
}
return true;

View File

@ -60,6 +60,14 @@ namespace ace {
}
_BatchEffect->SetView(XMLoadFloat4x4(&_View));
_BatchEffect->SetProjection(XMLoadFloat4x4(&_Projection));
CommonStates states(_pd3dDevice);
_pImmediateContext->OMSetBlendState(states.Opaque(), nullptr, 0xFFFFFFFF);
_pImmediateContext->OMSetDepthStencilState(states.DepthNone(), 0);
_pImmediateContext->RSSetState(states.CullCounterClockwise());
_BatchEffect->Apply(_pImmediateContext);
_pImmediateContext->IASetInputLayout(_pBatchInputLayout);
}
bool penetration_display::step(void) {