예제 #1
0
static void video_resize_callback(Widget w, XtPointer clientData, XtPointer callData)
{
	PLOT *plot = (PLOT *)clientData;

	video_set(plot);
	return;
}
예제 #2
0
파일: main.c 프로젝트: Abbylester/AKA
function main()
{
video_set( 1024, 768, 32, 2 ) ; 

level_state = 0 ; 

game_init() ; 
 	
sceneManager() ; 

 // MAIN GAME LOOP //
 
	while(1)
	{
		if( level_state == 0 )
		{
			// pause the game
			freeze_mode = 1 ; 
		}
		else
		{
			freeze_mode = 0;
		}
	
	wait(1);
	}
}
예제 #3
0
파일: video.c 프로젝트: kevinjhanna/kernel
void screen_division()
{
  ScreenSegment screen_segment = screen_segment_table[DEBUG];
  int offset;
  for(offset = 0; offset <  screen_segment.char_offset_limit; offset++)
  {
    video_set(DEBUG, offset, screen_segment.line_offset_limit - 1, '-');
  }
}
예제 #4
0
파일: video.c 프로젝트: kevinjhanna/kernel
/*
 * Erase previous written position.
 * Does not support multi lines erasing.
 */
void video_erase_write(int fd)
{
  ScreenSegment* ss = &screen_segment_table[fd];
  if (ss->char_offset > 0)
  {
    ss->char_offset--;
    video_set(fd, ss->char_offset, ss->line_offset, ' ');
    video_move_type_cursor(fd);
  }
}
예제 #5
0
void video_showvideoframe(PLOT *plot, unsigned long long ntime)
{
	struct videodata *plotdata = (struct videodata *)plot->plotdata;
	GROUP *group = plot->group;
	VIDCLOSESTFRAME vcf;

	vcf.ntime = ntime;
	vcf.framenum = -1;
	vid_ctl(group->vidfp, VIDIOGETCLOSESTFRAME, &vcf);
	plotdata->framenum = vcf.framenum;
	video_set(plot);
	return;
}
예제 #6
0
파일: video.c 프로젝트: kevinjhanna/kernel
/*
 *  Cleans a screen segment and starts offset from 0
 */
void clean_screen_segment(int fd)
{
  ScreenSegment ss = screen_segment_table[fd];

  int line;
  int char_pos;
  for (line = 0; line < ss.line_offset_limit; line++)
  {
    for (char_pos = 0; char_pos < ss.char_offset_limit; char_pos++)
    {
      video_set(fd, char_pos, line, ' ');
    }
  }
}
예제 #7
0
int video_display(PLOT *plot)
{
	struct videodata *plotdata = (struct videodata *)plot->plotdata;
	int status = SUCCESS, tstatus;
	GROUP *group = plot->group;

	/*
	** Load the video data, but only if we need to...
	*/
	if (group->viddirty == 1)
	{
		if (load_viddata(&group->vidfp, group->loadedfilename, group->filename, group->entry, 
			&plotdata->nframes, &plotdata->width, &plotdata->height, &plotdata->ncomps,
			&plotdata->microsecs_per_frame,
			&group->ntime) == 0)
		{
			if (plotdata->framedata)
			{
				free(plotdata->framedata);
				plotdata->framedata = (char *)calloc(plotdata->height * plotdata->width, plotdata->ncomps);
			}
			group->viddirty = 0;
			plotdata->image->width = plotdata->width;
			plotdata->image->height = plotdata->height;
			plotdata->image->xoffset = 0;
			plotdata->image->format = ZPixmap; /* XYBitmap, XYPixmap, or ZPixmap */
			plotdata->image->data = NULL;
			plotdata->image->byte_order = LSBFirst;
			plotdata->image->bitmap_unit = 8;
			plotdata->image->bitmap_bit_order = LSBFirst;
			plotdata->image->bitmap_pad = 8;
			plotdata->image->depth = plotdata->ncomps;
			plotdata->image->bytes_per_line = plotdata->width * plotdata->ncomps;
			plotdata->image->bits_per_pixel = plotdata->ncomps * 8;
			plotdata->image->red_mask = 0;
			plotdata->image->green_mask = 0;
			plotdata->image->blue_mask = 0;
			XInitImage(plotdata->image);
			plotdata->image->data = plotdata->framedata;
		}
		else status = ERROR;
	}

	/*
	** Update the plot
	*/
	tstatus = video_set(plot);
	return (status == SUCCESS) ? (tstatus) : (status);
}
예제 #8
0
파일: video.c 프로젝트: kevinjhanna/kernel
void video_write(int fd, char ascii){
  ScreenSegment* ss = &screen_segment_table[fd];
  video_set(fd, ss->char_offset, ss->line_offset, ascii);
  /*
   * We increment one positions since we only
   * count logic characters, not bytes on screen.
   */
  ss->char_offset++;

  if (ss->char_offset == ss->char_offset_limit)
  {
    _video_new_line(fd);
  }

  video_move_type_cursor(fd);
}
예제 #9
0
파일: main.c 프로젝트: Abbylester/AKA
void main()
{

	// initialize game
	
	video_set(1024, 768, 32, 2); 			
	warn_level     = 2;	
 	tex_share      = 1;						
 	mouse_mode = 4;
 	mouse_range = 100000;
 	shadow_stencil = 2;
 	random_seed(0); 
 	
	level_load("eggz.wmb");					// load the level
	wait(2);										// wait two ticks for the level to finish loading
	
	
	
// position the camera
	
		camera.x = 800; 	
		camera.y =  0; 
		camera.z = 500; 					
		camera.pan = 180; 
		camera.tilt = -20 ;
	
		
 	// MAIN GAME LOOP //
 
	while(1)							// start the loop. 
	{	
	
		wait(1);	
	
	}									
	
}