commit 56b0fb87b2d0c85ff3ca570ea0a5a44fa666d0f9
Author: niffiwan <niffiwan.scp@gmail.com>
Date:   Tue Aug 19 21:33:04 2014 +1000

    Partial fix for mantis 2932
    
    Convert viewed cutscenes

diff --git a/code/pilotfile/csg_convert.cpp b/code/pilotfile/csg_convert.cpp
index 9369fd2..209af62 100644
--- a/code/pilotfile/csg_convert.cpp
+++ b/code/pilotfile/csg_convert.cpp
@@ -12,6 +12,7 @@
 #include "stats/medals.h"
 #include "cfile/cfilesystem.h"
 #include "menuui/techmenu.h"
+#include "cutscene/cutscenes.h"
 
 #include <iostream>
 #include <sstream>
@@ -1102,6 +1103,34 @@ void pilotfile_convert::csg_export_variables()
 	endSection();
 }
 
+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++;
+		}
+	}
+
+	// output cutscene data in new format
+	cfwrite_uint(viewableScenes, cfp);
+
+	for(cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut) {
+		if(cut->viewable)
+			cfwrite_string_len(cut->filename, cfp);
+	}
+
+	endSection();
+}
+
 void pilotfile_convert::csg_export()
 {
 	Assert( cfp != NULL );
@@ -1122,7 +1151,7 @@ void pilotfile_convert::csg_export()
 	csg_export_redalert();
 	csg_export_hud();
 	csg_export_variables();
-
+	csg_export_cutscenes();
 
 	// and... we're done! :)
 }
diff --git a/code/pilotfile/pilotfile_convert.h b/code/pilotfile/pilotfile_convert.h
index a18d56e..300f1c7 100644
--- a/code/pilotfile/pilotfile_convert.h
+++ b/code/pilotfile/pilotfile_convert.h
@@ -283,7 +283,8 @@ class pilotfile_convert {
 				Settings		= 0x0010,
 				RedAlert		= 0x0011,
 				Variables		= 0x0012,
-				Missions		= 0x0013
+				Missions		= 0x0013,
+				Cutscenes		= 0x0014,
 			};
 		};
 
@@ -343,5 +344,6 @@ class pilotfile_convert {
 		void csg_export_redalert();
 		void csg_export_hud();
 		void csg_export_variables();
+		void csg_export_cutscenes();
 };
 
