"level5",
"level6",
"level7_combine",
- "xor_small"
+ "xor_small",
+ "sort"
};
#pragma pack(push,1)
world.initialzed = 0;
}
+static void io_reset(void)
+{
+ for( int i = 0; i < arrlen( world.io ); i ++ )
+ {
+ struct cell_terminal *term = &world.io[i];
+
+ for( int j = 0; j < term->run_count; j ++ )
+ term->runs[j].recv_count = 0;
+ }
+}
+
static void map_reclassify( v2i start, v2i end, int update_texbuffer );
static int map_load( const char *str, const char *name )
{
if( !*c )
break;
+ if( *c == '\r' ) { c ++; continue; } // fuck off windows
+
if( *c == ';' )
{
c ++;
-
+
+ if( *c == '\r' ) c ++;
+
// Parse attribs
if( *c != '\n' )
{
while( *c )
{
+ if( *c == '\r' ) { c ++; continue; }
+
if( reg_start < reg_end )
{
struct cell_terminal *terminal = &world.io[ reg_start ];
vg_success( "Map '%s' loaded! (%u:%u)\n", name, world.w, world.h );
+ io_reset();
+
strncpy( world.map_name, name, vg_list_size( world.map_name )-1 );
world.initialzed = 1;
return 1;
}
}
-static void io_reset(void)
-{
- for( int i = 0; i < arrlen( world.io ); i ++ )
- {
- struct cell_terminal *term = &world.io[i];
-
- for( int j = 0; j < term->run_count; j ++ )
- term->runs[j].recv_count = 0;
- }
-}
-
static void simulation_stop(void)
{
world.simulating = 0;
if( argc >= 1 )
{
// Save current level
- if( console_save_map( 0, NULL ) )
- if( console_load_map( argc, argv ) )
- {
- simulation_stop();
- return 1;
- }
+ console_save_map( 0, NULL );
+ if( console_load_map( argc, argv ) )
+ {
+ simulation_stop();
+ return 1;
+ }
}
else
{
world.sim_run ++;
world.sim_frame = 0;
world.sim_start = vg_time;
+ world.num_fishes = 0;
continue;
}
else