Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
flightgroup.cpp
Go to the documentation of this file.
1 #include "gfx/aux_texture.h"
2 #include "mission.h"
3 #include "flightgroup.h"
4 #include "cmd/unit_generic.h"
5 #include <stdio.h>
6 
7 Flightgroup* Flightgroup::newFlightgroup( const std::string &name,
8  const std::string &type,
9  const std::string &faction,
10  const std::string &order,
11  int num_ships,
12  int num_waves,
13  const std::string &logo_tex,
14  const std::string &logo_alp,
15  Mission *mis )
16 {
17  Flightgroup *fg = mis->findFlightgroup( name, faction );
18  Flightgroup *fgtmp = fg;
19  if (fg == NULL)
20  fg = new Flightgroup;
21  fg->Init( fgtmp, name, type, faction, order, num_ships, num_waves, mis );
22  if ( !logo_tex.empty() ) {
23  if ( logo_alp.empty() )
24  fg->squadLogo = new Texture( logo_tex.c_str(), 0, MIPMAP );
25  else
26  fg->squadLogo = new Texture( logo_tex.c_str(), logo_alp.c_str(), 0, MIPMAP );
27  }
28  return fg;
29 }
31 {
32  if (squadLogo)
33  delete squadLogo;
34 }
35 
37 {
38  printf( "warning: may not work properly" );
39  if (squadLogo)
40  squadLogo = other.squadLogo->Clone();
41  return other;
42 }
43