[freespace2] Patches for music and movies

james tittle tigital at mac.com
Tue Mar 29 14:05:52 EST 2005


On Mar 29, 2005, at 3:08 AM, Taylor Richards wrote:

> Whew!  Alright, the movie code is now in CVS.  I actually managed to 
> get
> the old audio static problem with Pierre's code as well but fixed it
> rather easily.  Kinda sucks since that was the only problem with my 
> code
> from over a year and half ago!  Oh well, Pierre's code is less
> complicated than what I was doing anyway.  It should all be OSX ready,
> except for that movie video corruption thing that I haven't fixed yet,
> but tigital will give the final word on whether or not it needs more
> changes.
>
> If there are any problems speak up and they will be addressed.
>
> Other changes include:
>
> - Better 64-bit OS support.  Unfortunately this will break pilot files
> for the 64-bit users so please keep that in mind.  The pilot files are
> now fully cross-platform once again though and compatible with the
> original Windows pilots (FS2 only).
>
> - Turrets on large ships will now shoot at asteroids in FS1.  Anyone
> playing one of those asteroid field escort missions knows what a pain 
> it
> was before.
>
> - FS1 will build once more and should be compatible with newer versions
> of GCC.
>
> - A couple of very minor bug fixes.

...excellent!  Just synched up, and so far have test fs1 only...the gl 
movie code is very smooth, but osx still has some problems with weird 
pixels, seemingly on color transition borders:  but it's very nice to 
see the movie full speed with sound!  I did notice that the first time 
playing thru the intro.mve the sound and visuals were slightly out of 
sync...however, they were in sync when I played it again from the 
control room (which is cool, because previously the sound didn't play 
at all when playing from the control room)...however, I then played it 
a second and third time in the control room, only to not have 
sound...so obviously something's getting lost here...

> More FS1 changes are coming in the next week in order to get rid of the
> extra VP that you need to play.  It's not going away yet but since the
> VP is there is fix problems that are otherwise code issues it's only a
> matter of time before it's rendered obsolete.

...sounds very good, but no hurry:  I think I'll try to go ahead and 
get a new round of binaries over the next few days (it has been about a 
year)...beforehand, I wanted to pass these minor diffs that I found:

Index: src/graphics/2d.cpp
===================================================================
RCS file: /cvs/cvsroot/freespace2/src/graphics/2d.cpp,v
retrieving revision 1.12
diff -u -B -b -w -r1.12 2d.cpp
--- src/graphics/2d.cpp	4 Jul 2004 11:31:43 -0000	1.12
+++ src/graphics/2d.cpp	29 Mar 2005 18:24:22 -0000
@@ -1243,6 +1243,43 @@

  void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
  {
+	int section_x, section_y;	
+	int x_line, y_line;
+	int bw, bh;
+
+	// d3d and glide support texture poly shiz
+	if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE) 
|| (gr_screen.mode == GR_OPENGL)) && Gr_bitmap_poly){
+		int idx, s_idx;
+		// float u_scale, v_scale;
+		bitmap_section_info *sections;			
+
+		// render all sections
+		bm_get_info(gr_screen.current_bitmap, &bw, &bh, NULL, NULL, NULL, 
&sections);
+		y_line = 0;
+		section_y = 0;
+		for(idx=0; idx<sections->num_y; idx++){
+			x_line = 0;
+			for(s_idx=0; s_idx<sections->num_x; s_idx++){
+				// get the section as a texture in vram					
+				gr_set_bitmap(gr_screen.current_bitmap, 
gr_screen.current_alphablend_mode, gr_screen.current_bitblt_mode, 
gr_screen.current_alpha, s_idx, idx);
+
+				// determine the width and height of this section
+				bm_get_section_size(gr_screen.current_bitmap, s_idx, idx, 
&section_x, &section_y);
+
+				section_x = section_x*w/bw;
+				section_y = section_y*h/bh;
+				// draw as a poly
+				g3_draw_2d_poly_bitmap(x + x_line, y + y_line, section_x, 
section_y, TMAP_FLAG_BITMAP_SECTION);
+				x_line += section_x;
+			}
+			y_line += section_y;
+		}
+
+		// done. whee!
+		return;
+	}			
+
+	// old school bitmaps
  	switch(gr_screen.mode){
  #ifndef PLAT_UNIX
  	case GR_SOFTWARE:
Index: src/graphics/grsoft.cpp
===================================================================
RCS file: /cvs/cvsroot/freespace2/src/graphics/grsoft.cpp,v
retrieving revision 1.10
diff -u -B -b -w -r1.10 grsoft.cpp
--- src/graphics/grsoft.cpp	30 Jul 2002 05:24:38 -0000	1.10
+++ src/graphics/grsoft.cpp	29 Mar 2005 18:24:56 -0000
@@ -1142,7 +1142,7 @@
  			gr_line( mx, my, mx+5, my );
  			gr_line( mx, my, mx, my+5 );
  		} else {
-			gr_set_bitmap(Gr_cursor);
+			gr_set_bitmap(Gr_cursor, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 
1.0f, -1, -1);
  			gr_bitmap( mx, my );
  		}
  	}
@@ -1539,10 +1539,10 @@
  void gr_soft_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, 
int y2, float pct)
  {
  	if ( pct <= 50 )	{
-		gr_set_bitmap(bmap1);
+		gr_set_bitmap(bmap1, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 
1.0f, -1, -1);
  		gr_bitmap(x1, y1);
  	} else {
-		gr_set_bitmap(bmap2);
+		gr_set_bitmap(bmap2, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 
1.0f, -1, -1);
  		gr_bitmap(x2, y2);
  	}	
  }

...whatcha think?

jamie




More information about the freespace2 mailing list