mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'milek-dev' into gfx-work
This commit is contained in:
@@ -16,6 +16,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "Globals.h"
|
||||
#include "simulation.h"
|
||||
#include "Train.h"
|
||||
#include "dictionary.h"
|
||||
#include "sceneeditor.h"
|
||||
#include "renderer.h"
|
||||
#include "uilayer.h"
|
||||
@@ -129,6 +130,9 @@ eu07_application::init( int Argc, char *Argv[] ) {
|
||||
if( ( result = init_audio() ) != 0 ) {
|
||||
return result;
|
||||
}
|
||||
if( ( result = init_data() ) != 0 ) {
|
||||
return result;
|
||||
}
|
||||
m_taskqueue.init();
|
||||
if( ( result = init_modes() ) != 0 ) {
|
||||
return result;
|
||||
@@ -752,6 +756,23 @@ eu07_application::init_audio() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
eu07_application::init_data() {
|
||||
|
||||
// HACK: grab content of the first {} block in load_unit_weights using temporary parser, then parse it normally. on any error our weight list will be empty string
|
||||
auto loadweights { cParser( cParser( "data/load_weights.txt", cParser::buffer_FILE ).getToken<std::string>( true, "{}" ), cParser::buffer_TEXT ) };
|
||||
while( true == loadweights.getTokens( 2 ) ) {
|
||||
std::pair<std::string, float> weightpair;
|
||||
loadweights
|
||||
>> weightpair.first
|
||||
>> weightpair.second;
|
||||
weightpair.first.erase( weightpair.first.end() - 1 ); // trim trailing ':' from the key
|
||||
simulation::Weights.emplace( weightpair.first, weightpair.second );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
eu07_application::init_modes() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user