예제 #1
0
파일: plr.cpp 프로젝트: sobczyk/fs2open
void pilotfile::plr_write_hud()
{
    int idx;

    startSection(Section::HUD);

    // flags
    cfwrite_int(HUD_config.show_flags, cfp);
    cfwrite_int(HUD_config.show_flags2, cfp);

    cfwrite_int(HUD_config.popup_flags, cfp);
    cfwrite_int(HUD_config.popup_flags2, cfp);

    // settings
    cfwrite_ubyte(HUD_config.num_msg_window_lines, cfp);

    cfwrite_int(HUD_config.rp_flags, cfp);
    cfwrite_int(HUD_config.rp_dist, cfp);

    // basic colors
    cfwrite_int(HUD_config.main_color, cfp);
    cfwrite_int(HUD_color_alpha, cfp);

    // gauge-specific colors
    cfwrite_int(NUM_HUD_GAUGES, cfp);

    for (idx = 0; idx < NUM_HUD_GAUGES; idx++) {
        cfwrite_ubyte(HUD_config.clr[idx].red, cfp);
        cfwrite_ubyte(HUD_config.clr[idx].green, cfp);
        cfwrite_ubyte(HUD_config.clr[idx].blue, cfp);
        cfwrite_ubyte(HUD_config.clr[idx].alpha, cfp);
    }

    endSection();
}
예제 #2
0
	void Elevator::nextSection()
	{
		if (forward)
		{
			if (section + 2 == controlPoints.size())
			{
				forward = false;
			}
			else
			{
				++section;
			}
		}
		else
		{
			if (section == 0)
			{
				forward = true;
			}
			else
			{
				--section;
			}
		}

		startSection();
	}
예제 #3
0
void pilotfile_convert::csg_export_cutscenes() {
	SCP_vector<cutscene_info>::iterator cut;

	startSection(Section::Cutscenes);

	// convert the old int bitfield to the new vector
	// the 32 is the size-in-bits of the old int on all platforms
	// supported by FSO prior to 3.7.0
	size_t size = Cutscenes.size();
	size_t viewableScenes = 0;
	for (size_t j=0; j<size && j<32; ++j) {
		if ( csg->cutscenes & (1<<j) ) {
			Cutscenes.at(j).viewable = true;
			viewableScenes++;
		}
	}

	// Check for possible overflow because we can only write 32 bit integers
	Assertion(viewableScenes <= std::numeric_limits<uint>::max(), "Too many viewable cutscenes! Maximum is %ud!", std::numeric_limits<uint>::max());

	// output cutscene data in new format
	cfwrite_uint((uint)viewableScenes, cfp);

	for(cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut) {
		if(cut->viewable)
			cfwrite_string_len(cut->filename, cfp);
	}

	endSection();
}
예제 #4
0
파일: plr.cpp 프로젝트: sobczyk/fs2open
void pilotfile::plr_write_multiplayer()
{
    startSection(Section::Multiplayer);

    // netgame options
    cfwrite_ubyte(p->m_server_options.squad_set, cfp);
    cfwrite_ubyte(p->m_server_options.endgame_set, cfp);
    cfwrite_int(p->m_server_options.flags, cfp);
    cfwrite_uint(p->m_server_options.respawn, cfp);
    cfwrite_ubyte(p->m_server_options.max_observers, cfp);
    cfwrite_ubyte(p->m_server_options.skill_level, cfp);
    cfwrite_ubyte(p->m_server_options.voice_qos, cfp);
    cfwrite_int(p->m_server_options.voice_token_wait, cfp);
    cfwrite_int(p->m_server_options.voice_record_time, cfp);
    cfwrite_int((int)p->m_server_options.mission_time_limit, cfp);
    cfwrite_int(p->m_server_options.kill_limit, cfp);

    // local options
    cfwrite_int(p->m_local_options.flags, cfp);
    cfwrite_int(p->m_local_options.obj_update_level, cfp);

    // netgame protocol
    cfwrite_int(Multi_options_g.protocol, cfp);

    endSection();
}
void pilotfile_convert::plr_export_multiplayer()
{
	startSection(Section::Multiplayer);

	// netgame options
	cfwrite_ubyte(plr->multi_squad_set, cfp);
	cfwrite_ubyte(plr->multi_endgame_set, cfp);
	cfwrite_int(plr->multi_flags, cfp);
	cfwrite_uint(plr->multi_respawn, cfp);
	cfwrite_ubyte(plr->multi_max_observers, cfp);
	cfwrite_ubyte(plr->multi_skill_level, cfp);
	cfwrite_ubyte(plr->multi_voice_qos, cfp);
	cfwrite_int(plr->multi_voice_token_wait, cfp);
	cfwrite_int(plr->multi_voice_record_time, cfp);
	cfwrite_int(plr->multi_time_limit, cfp);
	cfwrite_int(plr->multi_kill_limit, cfp);

	// local options
	cfwrite_int(plr->multi_local_flags, cfp);
	cfwrite_int(plr->multi_local_update_level, cfp);

	// netgame protocol
	cfwrite_int(plr->net_protocol, cfp);

	endSection();
}
예제 #6
0
void pilotfile_convert::csg_export_techroom()
{
	int list_size = 0;
	int idx;
	ubyte visible;

	startSection(Section::Techroom);

	// visible ships
	list_size = (int)csg->ships_techroom.size();

	for (idx = 0; idx < list_size; idx++) {
		visible = csg->ships_techroom[idx] ? 1 : 0;
		cfwrite_ubyte(visible, cfp);
	}

	// visible weapons
	list_size = (int)csg->weapons_techroom.size();

	for (idx = 0; idx < list_size; idx++) {
		visible = csg->weapons_techroom[idx] ? 1 : 0;
		cfwrite_ubyte(visible, cfp);
	}

	// visible intel entries
	list_size = (int)csg->intel_techroom.size();

	for (idx = 0; idx < list_size; idx++) {
		visible = csg->intel_techroom[idx] ? 1 : 0;
		cfwrite_ubyte(visible, cfp);
	}

	endSection();
}
예제 #7
0
void pilotfile::plr_write_flags()
{
	startSection(Section::Flags);

	// tips
	cfwrite_ubyte((unsigned char)p->tips, cfp);

	// saved flags
	cfwrite_int(p->save_flags, cfp);

	// listing mode (single or campaign missions)
	cfwrite_int(p->readyroom_listing_mode, cfp);

	// briefing auto-play
	cfwrite_int(p->auto_advance, cfp);

	// special rank setting (to avoid having to read all stats on verify)
	// should be multi only from now on
	cfwrite_int(multi_stats.rank, cfp);

	// What game mode we were in last on this pilot
	cfwrite_int(p->player_was_multi, cfp);

	// which language was this pilot created with
	cfwrite_string_len(p->language, cfp);

	endSection();
}
예제 #8
0
	void Elevator::start()
	{
		position = controlPoints[0].getLocation();
		section = 0;
		forward = true;
		startSection();
	}
void pilotfile_convert::plr_export_hud()
{
	int idx;

	startSection(Section::HUD);

	// flags
	cfwrite_int(plr->hud_show_flags, cfp);
	cfwrite_int(plr->hud_show_flags2, cfp);

	cfwrite_int(plr->hud_popup_flags, cfp);
	cfwrite_int(plr->hud_popup_flags2, cfp);

	// settings
	cfwrite_ubyte(plr->hud_num_lines, cfp);

	cfwrite_int(plr->hud_rp_flags, cfp);
	cfwrite_int(plr->hud_rp_dist, cfp);

	// basic colors
	cfwrite_int(0, cfp);	// color
	cfwrite_int(8, cfp);	// alpha

	// gauge-specific colors
	cfwrite_int(39, cfp);

	for (idx = 0; idx < 39; idx++) {
		cfwrite_ubyte(plr->hud_colors[idx][0], cfp);
		cfwrite_ubyte(plr->hud_colors[idx][1], cfp);
		cfwrite_ubyte(plr->hud_colors[idx][2], cfp);
		cfwrite_ubyte(plr->hud_colors[idx][3], cfp);
	}

	endSection();
}
예제 #10
0
void QgsDxfExport::writeHeaderAC1018( QTextStream& stream )
{
  stream << "999\n";
  stream << "DXF created from QGIS\n";
  startSection();
  stream << "  2\n";
  stream << "HEADER\n";
  //ACADVER
  stream << "  9\n";
  stream << "$ACADVER\n";
  stream << "  1\n";
  stream << "AC1018\n";

  QgsRectangle ext = dxfExtent();
  if ( !ext.isEmpty() )
  {
    //EXTMIN
    stream << "  9\n";
    stream << "$EXTMIN\n";
    stream << " 10\n";
    stream << ext.xMinimum() << "\n";
    stream << " 20\n";
    stream << ext.yMinimum() << "\n";
    stream << " 30\n";
    stream << "0\n";
    //EXTMAX
    stream << "  9\n";
    stream << "$EXTMAX\n";
    stream << " 10\n";
    stream << ext.xMaximum() << "\n";
    stream << " 20\n";
    stream << ext.yMaximum() << "\n";
    stream << " 30\n";
    stream << "0\n";
  }
  //LTSCALE
  stream << "  9\n";
  stream << "$LTSCALE\n";
  stream << " 40\n";
  stream << "1.0\n";
  //PDMODE
  stream << "  9\n";
  stream << "$PDMODE\n";
  stream << " 70\n";
  stream << "33\n";
  //PDSIZE
  stream << "  9\n";
  stream << "$PDSIZE\n";
  stream << " 40\n";
  stream << "1\n";
  endSection();
  //PSLTSCALE
  stream << "  9\n";
  stream << "$PSLTSCALE\n";
  stream << " 70\n";
  stream << "0\n";
}
예제 #11
0
void QgsDxfExport::writeBlocks()
{
  startSection();
  writeGroup( 2, "BLOCKS" );

  //iterate through all layers and get symbol layer pointers
  QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2* > > slList;
  if ( mSymbologyExport != NoSymbology )
  {
    slList = symbolLayers();
  }

  QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2* > >::const_iterator slIt = slList.constBegin();
  for ( ; slIt != slList.constEnd(); ++slIt )
  {
    QgsMarkerSymbolLayerV2* ml = dynamic_cast< QgsMarkerSymbolLayerV2*>( slIt->first );
    if ( ml )
    {
      //if point symbol layer and no data defined properties: write block
      QgsRenderContext ct;
      QgsSymbolV2RenderContext ctx( ct, QgsSymbolV2::MapUnit, slIt->second->alpha(), false, slIt->second->renderHints(), 0 );
      ml->startRender( ctx );

      //markers with data defined properties are inserted inline
      if ( hasDataDefinedProperties( ml, slIt->second ) )
      {
        continue;
        // ml->stopRender( ctx );
      }
      writeGroup( 0, "BLOCK" );
      writeGroup( 8, 0 );
      QString blockName = QString( "symbolLayer%1" ).arg( mBlockCounter++ );
      writeGroup( 2, blockName );
      writeGroup( 70, 64 );

      //x/y/z coordinates of reference point
      //todo: consider anchor point
      // double size = ml->size();
      // size *= mapUnitScaleFactor( mSymbologyScaleDenominator, ml->sizeUnit(), mMapUnits );
      writeGroup( 10, 0 );
      writeGroup( 20, 0 );
      writeGroup( 30, 0 );
      writeGroup( 3, blockName );

      ml->writeDxf( *this, mapUnitScaleFactor( mSymbologyScaleDenominator, ml->sizeUnit(), mMapUnits ), "0", &ctx, 0 ); //maplayer 0 -> block receives layer from INSERT statement

      writeGroup( 0, "ENDBLK" );
      writeGroup( 8, 0 );

      mPointSymbolBlocks.insert( ml, blockName );
      ml->stopRender( ctx );
    }
  }
  endSection();
}
예제 #12
0
void pilotfile::csg_write_flags()
{
	startSection(Section::Flags);

	// tips
	cfwrite_ubyte((ubyte)p->tips, cfp);

	// avoid having to read everything to get the rank
	cfwrite_int(p->stats.rank, cfp);

	endSection();
}
예제 #13
0
void pilotfile_convert::csg_export_flags()
{
	startSection(Section::Flags);

	// tips
	cfwrite_ubyte((ubyte)plr->tips, cfp);

	// special rank
	cfwrite_int(csg->stats.rank, cfp);

	endSection();
}
예제 #14
0
void pilotfile::csg_write_lastmissions()
{
	int i;

	startSection(Section::LastMissions);

	// store list of most recently played missions
	cfwrite_int(Num_recent_missions, cfp);
	for (i=0; i<Num_recent_missions; i++) {
		cfwrite_string_len(Recent_missions[i], cfp);
	}

	endSection();
}
예제 #15
0
파일: Elevator.cpp 프로젝트: odanek/duel6r
    void Elevator::start() {
        position = controlPoints[0].getLocation();
        section = 0;
        forward = true;
        remainingWait = 0;

        if (controlPoints.size() > 1) {
            startSection();
        } else {
            distance = 0;
            travelled = 0;
            velocity = Vector::ZERO;
        }
    }
예제 #16
0
void pilotfile::csg_write_loadout()
{
	int idx, j;

	startSection(Section::Loadout);

	// base info
	cfwrite_string_len(Player_loadout.filename, cfp);
	cfwrite_string_len(Player_loadout.last_modified, cfp);

	// ship pool
	for (idx = 0; idx < static_cast<int>(Ship_info.size()); idx++) {
		cfwrite_int(Player_loadout.ship_pool[idx], cfp);
	}

	// weapon pool
	for (idx = 0; idx < Num_weapon_types; idx++) {
		cfwrite_int(Player_loadout.weapon_pool[idx], cfp);
	}

	// play ship loadout
	cfwrite_ushort(MAX_WSS_SLOTS, cfp);

	for (idx = 0; idx < MAX_WSS_SLOTS; idx++) {
		wss_unit *slot = &Player_loadout.unit_data[idx];

		// ship
		cfwrite_int(slot->ship_class, cfp);

		// primary weapons
		cfwrite_int(MAX_SHIP_PRIMARY_BANKS, cfp);

		for (j = 0; j < MAX_SHIP_PRIMARY_BANKS; j++) {
			cfwrite_int(slot->wep[j], cfp);
			cfwrite_int(slot->wep_count[j], cfp);
		}

		// secondary weapons
		cfwrite_int(MAX_SHIP_SECONDARY_BANKS, cfp);

		for (j = 0; j < MAX_SHIP_SECONDARY_BANKS; j++) {
			cfwrite_int(slot->wep[j+MAX_SHIP_PRIMARY_BANKS], cfp);
			cfwrite_int(slot->wep_count[j+MAX_SHIP_PRIMARY_BANKS], cfp);
		}
	}

	endSection();
}
예제 #17
0
void pilotfile_convert::csg_export_loadout()
{
	startSection(Section::Loadout);

	// base info
	cfwrite_string_len(csg->loadout.filename.c_str(), cfp);
	cfwrite_string_len(csg->loadout.last_modified.c_str(), cfp);

	// ship pool
	size_t list_size = csg->loadout.ship_pool.size();

	for (size_t idx = 0; idx < list_size; idx++) {
		cfwrite_int(csg->loadout.ship_pool[idx], cfp);
	}

	// weapon pool
	list_size = csg->loadout.weapon_pool.size();

	for (size_t idx = 0; idx < list_size; idx++) {
		cfwrite_int(csg->loadout.weapon_pool[idx], cfp);
	}

	// play ship loadout
	cfwrite_ushort(12, cfp);

	for (size_t idx = 0; idx < 12; idx++) {
		// ship
		cfwrite_int(csg->loadout.slot[idx].ship_index, cfp);

		// primary weapons
		cfwrite_int(3, cfp);

		for (size_t j = 0; j < 3; j++) {
			cfwrite_int(csg->loadout.slot[idx].wep[j], cfp);
			cfwrite_int(csg->loadout.slot[idx].wep_count[j], cfp);
		}

		// secondary weapons
		cfwrite_int(4, cfp);

		for (size_t j = 0; j < 4; j++) {
			cfwrite_int(csg->loadout.slot[idx].wep[j+3], cfp);
			cfwrite_int(csg->loadout.slot[idx].wep_count[j+3], cfp);
		}
	}

	endSection();
}
예제 #18
0
파일: plr.cpp 프로젝트: sobczyk/fs2open
void pilotfile::plr_write_stats_multi()
{
    int idx, list_size = 0;

    startSection(Section::ScoringMulti);

    // global, all-time stats
    cfwrite_int(multi_stats.score, cfp);
    cfwrite_int(multi_stats.rank, cfp);
    cfwrite_int(multi_stats.assists, cfp);
    cfwrite_int(multi_stats.kill_count, cfp);
    cfwrite_int(multi_stats.kill_count_ok, cfp);
    cfwrite_int(multi_stats.bonehead_kills, cfp);

    cfwrite_uint(multi_stats.p_shots_fired, cfp);
    cfwrite_uint(multi_stats.p_shots_hit, cfp);
    cfwrite_uint(multi_stats.p_bonehead_hits, cfp);

    cfwrite_uint(multi_stats.s_shots_fired, cfp);
    cfwrite_uint(multi_stats.s_shots_hit, cfp);
    cfwrite_uint(multi_stats.s_bonehead_hits, cfp);

    cfwrite_uint(multi_stats.flight_time, cfp);
    cfwrite_uint(multi_stats.missions_flown, cfp);
    cfwrite_int((int)multi_stats.last_flown, cfp);
    cfwrite_int((int)multi_stats.last_backup, cfp);

    // ship kills (contains medals across all mods, not just current)
    list_size = (int)multi_stats.ship_kills.size();
    cfwrite_int(list_size, cfp);

    for (idx = 0; idx < list_size; idx++) {
        cfwrite_string_len(multi_stats.ship_kills[idx].name.c_str(), cfp);
        cfwrite_int(multi_stats.ship_kills[idx].val, cfp);
    }

    // medals earned (contains medals across all mods, not just current)
    list_size = (int)multi_stats.medals_earned.size();
    cfwrite_int(list_size, cfp);

    for (idx = 0; idx < list_size; idx++) {
        cfwrite_string_len(multi_stats.medals_earned[idx].name.c_str(), cfp);
        cfwrite_int(multi_stats.medals_earned[idx].val, cfp);
    }

    endSection();
}
예제 #19
0
void pilotfile::csg_write_controls()
{
	int idx;

	startSection(Section::Controls);

	cfwrite_ushort(CCFG_MAX, cfp);

	for (idx = 0; idx < CCFG_MAX; idx++) {
		cfwrite_short(Control_config[idx].key_id, cfp);
		cfwrite_short(Control_config[idx].joy_id, cfp);
		// placeholder? for future mouse_id?
		cfwrite_short(-1, cfp);
	}

	endSection();
}
예제 #20
0
void pilotfile::csg_write_techroom()
{
	int idx;
	ubyte visible;

	startSection(Section::Techroom);

	// visible ships
	for (idx = 0; idx < Num_ship_classes; idx++) {
		// only visible if not in techroom by default
		if ( (Ship_info[idx].flags & SIF_IN_TECH_DATABASE) && !(Ship_info[idx].flags2 & SIF2_DEFAULT_IN_TECH_DATABASE) ) {
			visible = 1;
		} else {
			visible = 0;
		}

		cfwrite_ubyte(visible, cfp);
	}

	// visible weapons
	for (idx = 0; idx < Num_weapon_types; idx++) {
		// only visible if not in techroom by default
		if ( (Weapon_info[idx].wi_flags & WIF_IN_TECH_DATABASE) && !(Weapon_info[idx].wi_flags2 & WIF2_DEFAULT_IN_TECH_DATABASE) ) {
			visible = 1;
		} else {
			visible = 0;
		}

		cfwrite_ubyte(visible, cfp);
	}

	// visible intel entries
	for (idx = 0; idx < Intel_info_size; idx++) {
		// only visible if not in techroom by default
		if ( (Intel_info[idx].flags & IIF_IN_TECH_DATABASE) && !(Intel_info[idx].flags & IIF_DEFAULT_IN_TECH_DATABASE) ) {
			visible = 1;
		} else {
			visible = 0;
		}

		cfwrite_ubyte(visible, cfp);
	}

	endSection();
}
예제 #21
0
void pilotfile::csg_write_techroom()
{
	int idx;
	ubyte visible;

	startSection(Section::Techroom);

	// visible ships
    for (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it) {
        if ((it->flags[Ship::Info_Flags::In_tech_database]) && !(it->flags[Ship::Info_Flags::Default_in_tech_database])) {
            visible = 1;
        }
        else {
            visible = 0;
        }

        cfwrite_ubyte(visible, cfp);
    }

	// visible weapons
	for (idx = 0; idx < Num_weapon_types; idx++) {
		// only visible if not in techroom by default
		if ( (Weapon_info[idx].wi_flags & WIF_IN_TECH_DATABASE) && !(Weapon_info[idx].wi_flags2 & WIF2_DEFAULT_IN_TECH_DATABASE) ) {
			visible = 1;
		} else {
			visible = 0;
		}

		cfwrite_ubyte(visible, cfp);
	}

	// visible intel entries
	for (idx = 0; idx < Intel_info_size; idx++) {
		// only visible if not in techroom by default
		if ( (Intel_info[idx].flags & IIF_IN_TECH_DATABASE) && !(Intel_info[idx].flags & IIF_DEFAULT_IN_TECH_DATABASE) ) {
			visible = 1;
		} else {
			visible = 0;
		}

		cfwrite_ubyte(visible, cfp);
	}

	endSection();
}
예제 #22
0
void pilotfile_convert::plr_export_info()
{
	startSection(Section::Info);

	// pilot image
	cfwrite_string_len(plr->image_filename, cfp);

	// squad name
	cfwrite_string_len(plr->squad_name, cfp);

	// squad image
	cfwrite_string_len(plr->squad_filename, cfp);

	// active campaign
	cfwrite_string_len(plr->current_campaign, cfp);

	endSection();
}
예제 #23
0
파일: plr.cpp 프로젝트: sobczyk/fs2open
void pilotfile::plr_write_info()
{
    startSection(Section::Info);

    // pilot image
    cfwrite_string_len(p->image_filename, cfp);

    // multi squad name
    cfwrite_string_len(p->m_squad_name, cfp);

    // squad image
    cfwrite_string_len(p->m_squad_filename, cfp);

    // active campaign
    cfwrite_string_len(p->current_campaign, cfp);

    endSection();
}
예제 #24
0
void QgsDxfExport::writeHeader()
{
  writeGroup( 999, "DXF created from QGIS" );
  startSection();
  writeGroup( 2, "HEADER" );

  //ACADVER
  writeGroup( 9, "$ACADVER" );
  writeGroup( 1, "AC1009" );

  QgsRectangle ext = dxfExtent();
  if ( !ext.isEmpty() )
  {
    //EXTMIN
    writeGroup( 9, "$EXTMIN" );
    writeGroup( 10, ext.xMinimum() );
    writeGroup( 20, ext.yMinimum() );
    writeGroup( 30, 0.0 );

    //EXTMAX
    writeGroup( 9, "$EXTMAX" );
    writeGroup( 10, ext.xMaximum() );
    writeGroup( 20, ext.yMaximum() );
    writeGroup( 30, 0.0 );
  }

  //LTSCALE
  writeGroup( 9, "$LTSCALE" );
  writeGroup( 40, 1.0 );

  //PDMODE
  writeGroup( 9, "$PDMODE" );
  writeGroup( 70, 33 );

  //PDSIZE
  writeGroup( 9, "$PDSIZE" );
  writeGroup( 40, 1 );

  //PSLTSCALE
  writeGroup( 9, "$PSLTSCALE" );
  writeGroup( 70, 0 );

  endSection();
}
예제 #25
0
void pilotfile_convert::csg_export_variables()
{
	int list_size = 0;
	int idx;

	startSection(Section::Variables);

	list_size = (int)csg->variables.size();

	cfwrite_int(list_size, cfp);

	for (idx = 0; idx < list_size; idx++) {
		cfwrite_int(csg->variables[idx].type, cfp);
		cfwrite_string_len(csg->variables[idx].text, cfp);
		cfwrite_string_len(csg->variables[idx].variable_name, cfp);
	}

	endSection();
}
예제 #26
0
void pilotfile::csg_write_cutscenes() {
	SCP_vector<cutscene_info>::iterator cut;

	startSection(Section::Cutscenes);

	size_t viewableScenes = 0;
	for(cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut) {
		if(cut->viewable)
			viewableScenes ++;
	}
	cfwrite_uint(viewableScenes, cfp);

	for(cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut) {
		if(cut->viewable)
			cfwrite_string_len(cut->filename, cfp);
	}

	endSection();
}
예제 #27
0
파일: plr.cpp 프로젝트: sobczyk/fs2open
void pilotfile::plr_write_variables()
{
    int list_size = 0;
    int idx;

    startSection(Section::Variables);

    list_size = (int)p->variables.size();

    cfwrite_int(list_size, cfp);

    for (idx = 0; idx < list_size; idx++) {
        cfwrite_int(p->variables[idx].type, cfp);
        cfwrite_string_len(p->variables[idx].text, cfp);
        cfwrite_string_len(p->variables[idx].variable_name, cfp);
    }

    endSection();
}
예제 #28
0
void pilotfile_convert::csg_export_stats()
{
	startSection(Section::Scoring);

	// scoring stats
	cfwrite_int(csg->stats.score, cfp);
	cfwrite_int(csg->stats.rank, cfp);
	cfwrite_int(csg->stats.assists, cfp);
	cfwrite_int(csg->stats.kill_count, cfp);
	cfwrite_int(csg->stats.kill_count_ok, cfp);
	cfwrite_int(csg->stats.bonehead_kills, cfp);

	cfwrite_uint(csg->stats.p_shots_fired, cfp);
	cfwrite_uint(csg->stats.p_shots_hit, cfp);
	cfwrite_uint(csg->stats.p_bonehead_hits, cfp);

	cfwrite_uint(csg->stats.s_shots_fired, cfp);
	cfwrite_uint(csg->stats.s_shots_hit, cfp);
	cfwrite_uint(csg->stats.s_bonehead_hits, cfp);

	cfwrite_uint(csg->stats.flight_time, cfp);
	cfwrite_uint(csg->stats.missions_flown, cfp);
	cfwrite_int((int)csg->stats.last_flown, cfp);
	cfwrite_int((int)csg->stats.last_backup, cfp);

	// ship kills (scoring)
	size_t list_size = csg->stats.ship_kills.size();
	for (size_t idx = 0; idx < list_size; idx++) {
		cfwrite_int(csg->stats.ship_kills[idx].val, cfp);
	}

	// medals earned (scoring)
	list_size = csg->stats.medals_earned.size();
	for (size_t idx = 0; idx < list_size; idx++) {
		cfwrite_int(csg->stats.medals_earned[idx].val, cfp);
	}

	endSection();
}
예제 #29
0
void pilotfile::csg_write_stats()
{
	int idx;

	startSection(Section::Scoring);

	// scoring stats
	cfwrite_int(p->stats.score, cfp);
	cfwrite_int(p->stats.rank, cfp);
	cfwrite_int(p->stats.assists, cfp);
	cfwrite_int(p->stats.kill_count, cfp);
	cfwrite_int(p->stats.kill_count_ok, cfp);
	cfwrite_int(p->stats.bonehead_kills, cfp);

	cfwrite_uint(p->stats.p_shots_fired, cfp);
	cfwrite_uint(p->stats.p_shots_hit, cfp);
	cfwrite_uint(p->stats.p_bonehead_hits, cfp);

	cfwrite_uint(p->stats.s_shots_fired, cfp);
	cfwrite_uint(p->stats.s_shots_hit, cfp);
	cfwrite_uint(p->stats.s_bonehead_hits, cfp);

	cfwrite_uint(p->stats.flight_time, cfp);
	cfwrite_uint(p->stats.missions_flown, cfp);
	cfwrite_int((int)p->stats.last_flown, cfp);
	cfwrite_int((int)p->stats.last_backup, cfp);

	// ship kills (scoring)
	for (idx = 0; idx < static_cast<int>(Ship_info.size()); idx++) {
		cfwrite_int(p->stats.kills[idx], cfp);
	}

	// medals earned (scoring)
	for (idx = 0; idx < Num_medals; idx++) {
		cfwrite_int(p->stats.medal_counts[idx], cfp);
	}

	endSection();
}
예제 #30
0
void pilotfile::csg_write_settings()
{
	startSection(Section::Settings);

	// sound/voice/music
	cfwrite_float(Master_sound_volume, cfp);
	cfwrite_float(Master_event_music_volume, cfp);
	cfwrite_float(Master_voice_volume, cfp);

	cfwrite_int(Briefing_voice_enabled, cfp);

	// skill level
	cfwrite_int(Game_skill_level, cfp);

	// input options
	cfwrite_int(Use_mouse_to_fly, cfp);
	cfwrite_int(Mouse_sensitivity, cfp);
	cfwrite_int(Joy_sensitivity, cfp);
	cfwrite_int(Joy_dead_zone_size, cfp);

	endSection();
}