Esempio n. 1
0
void cr_Draw_Creadits(CREDIT_SURFACE * cs, int y)
{
  int dy;
  int i;

  ddxCleareSurfaceColorDisplay(0);

  for (i = 0; i < CREDIT_SURFACES; i++)
    if (cs[i].iSurface != -1)
      if ((cs[i].y + ddxGetHight(cs[i].iSurface)) > y && (cs[i].y < y + 768)) {
        dy = cs[i].y - y;

        if (dy < 0)             //obrazek vyjizdi nahore ven
          ddxBitBltDisplay(cs[i].x, 0, ddxGetWidth(cs[i].iSurface),
            ddxGetHight(cs[i].iSurface) + dy, cs[i].iSurface, 0, dy * -1);
        else if (cs[i].y + ddxGetHight(cs[i].iSurface) > y + 768)       //obrazek vjizni zespodu
        {
          int dm = (cs[i].y + ddxGetHight(cs[i].iSurface)) - (y + 768);

          ddxBitBltDisplay(cs[i].x, dy, ddxGetWidth(cs[i].iSurface),
            ddxGetHight(cs[i].iSurface) - dm, cs[i].iSurface, 0, 0);
        }
        else
          ddxBitBltDisplay(cs[i].x, dy, ddxGetWidth(cs[i].iSurface),
            ddxGetHight(cs[i].iSurface), cs[i].iSurface, 0, 0);

      }

  DisplayFrame();
  spracuj_spravy(0);
}
Esempio n. 2
0
void BasicMessageBox( TEXTCHAR *title, TEXTCHAR *content )
{
    PCOMMON msg;
    TEXTCHAR *start, *end;
    TEXTCHAR msgtext[256];
    int done = 0, okay = 0;
    int y = 5;
    msg = CreateFrame( title, 0, 0, 312, 120, 0, frame );
    end = start = content;
    do
    {
        while( end[0] && end[0] != '\n' )
            end++;
        if( end[0] )
        {
            MemCpy( msgtext, start, end-start );
            msgtext[end-start] = 0;
            //end[0] = 0;
            MakeTextControl( msg, 5, y, 302, 16, -1
                             , msgtext, 0 );
            //end[0] = '\n';
            end = start = end+1;
            y += 18;
        }
        else
            MakeTextControl( msg, 5, y, 302, 16, -1
                             , start, 0 );
    } while( end[0] );
    //AddExitButton( msg, &done );
    AddCommonButtons( msg, NULL, &okay );
    DisplayFrame( msg );
    CommonLoop( &okay, NULL );
    DestroyFrame( &msg );
}
Esempio n. 3
0
void CreateGPSGridDisplay( void )
{
	PSI_CONTROL frame;
	frame = CreateFrame( WIDE("GPS Grid Display"), 640, 480, 640, 480, BORDER_RESIZABLE|BORDER_NORMAL, NULL );

	AddCommonDraw( frame, DrawGrid) ;

	AddTimer( 300, UpdateGrid, (uintptr_t)frame );
	DisplayFrame( frame );
	return;
}
Esempio n. 4
0
static int win32_gui_data_exchange( vo_driver_t * vo_driver, int data_type, void * data )
{
  win32_driver_t  *win32_driver = ( win32_driver_t * ) vo_driver;

  switch( data_type )
    {

    case GUI_WIN32_MOVED_OR_RESIZED:
      UpdateRect( win32_driver->win32_visual );
      DisplayFrame( win32_driver );
      break;
    case XINE_GUI_SEND_DRAWABLE_CHANGED:
    {
      HRESULT result;
      HWND newWndHnd = (HWND) data;

	  /* set cooperative level */
	  result = IDirectDraw_SetCooperativeLevel( win32_driver->ddobj, newWndHnd, DDSCL_NORMAL );
      if( result != DD_OK )
      {
        Error( 0, "SetCooperativeLevel : error 0x%lx", result );
        return 0;
      }
      /* associate our clipper with new window */
	  result = IDirectDrawClipper_SetHWnd( win32_driver->ddclipper, 0, newWndHnd );
      if( result != DD_OK )
      {
        Error( 0, "ddclipper->SetHWnd : error 0x%lx", result );
        return 0;
      }
      /* store our objects in our visual struct */
	  win32_driver->win32_visual->WndHnd = newWndHnd;
	  /* update video area and redraw current frame */
      UpdateRect( win32_driver->win32_visual );
      DisplayFrame( win32_driver );
      break;
    }
  }

  return 0;
}
Esempio n. 5
0
PSI_NAMESPACE 

PSI_PROC( void, SimpleMessageBox )( PCOMMON parent, CTEXTSTR title, CTEXTSTR content )
{
	PCOMMON msg;
	CTEXTSTR start, end;
	TEXTCHAR msgtext[256];
	int okay = 0;
	int y = 5;
	uint32_t width, height;
	uint32_t title_width, greatest_width;
#ifdef USE_INTERFACES
	GetMyInterface();
#endif
	GetStringSize( content, &width, &height );
	title_width = GetStringSize( title, NULL, NULL );
	if( title_width > width )
		greatest_width = title_width;
	else
		greatest_width = width;
	msg = CreateFrame( title, 0, 0
						 , greatest_width + 10, height + (COMMON_BUTTON_PAD * 3) + COMMON_BUTTON_HEIGHT
						 , 0, parent );
	end = start = content;
	do
	{
		while( end[0] && end[0] != '\n' )
			end++;
		if( end[0] )
		{
			MemCpy( msgtext, (POINTER)start, end-start );
			msgtext[end-start] = 0;
			//end[0] = 0;
			MakeTextControl( msg, COMMON_BUTTON_PAD, y
							  , greatest_width, height
							  , -1, msgtext, 0 );
			//end[0] = '\n';
			end = start = end+1;
			y += height;
		}
		else
			MakeTextControl( msg, COMMON_BUTTON_PAD, y
							  , greatest_width, height
							  , -1, start, 0 );
	} while( end[0] );
	//AddExitButton( msg, &done );
	AddCommonButtons( msg, NULL, &okay );
	lprintf( WIDE("show message box") );
	DisplayFrame( msg );
	CommonWait( msg );
	DestroyFrame( &msg );
}
Esempio n. 6
0
uintptr_t CPROC Thread1( PTHREAD thread )
{
   while( 1 )
	if( !pc )
	{
      EnterCriticalSec( &cs );
		pc = CreateFrame( "test frame", 0, 0, 256, 256, 0, NULL );
      DisplayFrame( pc );
      LeaveCriticalSec( &cs );
	}
	else
      Relinquish();
   return 0;
}
Esempio n. 7
0
static int win32_gui_data_exchange( vo_driver_t * vo_driver, int data_type, void * data )
{
	win32_driver_t * win32_driver = ( win32_driver_t * ) vo_driver;

	switch( data_type )
	{
		case GUI_WIN32_MOVED_OR_RESIZED:
			UpdateRect( win32_driver->win32_visual );
			DisplayFrame( win32_driver );
		break;
	}

  return 0;
}
Esempio n. 8
0
int SimpleUserQueryEx( TEXTSTR result, int reslen, CTEXTSTR question, PSI_CONTROL pAbove, void (CPROC*query_success_callback)(uintptr_t, LOGICAL), uintptr_t query_user_data )
{
	PSI_CONTROL pf, pc;
	struct user_query_info *query_state = New( struct user_query_info );
	int32_t mouse_x, mouse_y;

	//int Done = FALSE, Okay = FALSE;
	pf = CreateFrame( NULL, 0, 0, 280, 65, 0, pAbove );
	SetCommonUserData( pf, (uintptr_t)query_state );
	query_state->pf = pf;
	query_state->Done = FALSE;
	query_state->Okay = FALSE;
	query_state->result = result;
	query_state->reslen = reslen;
	pc = MakeTextControl( pf, 5, 2, 320, 18, TXT_STATIC, question, TEXT_NORMAL );

	query_state->edit = MakeEditControl( pf, 5, 23, 270, 14, TXT_STATIC, NULL, 0 );
	AddCommonButtons( pf, &query_state->Done, &query_state->Okay );
	SetButtonPushMethod( GetControl( pf, IDOK ), OkayClicked, (uintptr_t)query_state );
	SetButtonPushMethod( GetControl( pf, IDCANCEL ), CancelClicked, (uintptr_t)query_state );
	GetMousePosition( &mouse_x, &mouse_y );
	MoveFrame( pf, mouse_x - 140, mouse_y - 30 );
	//lprintf( WIDE("Show query....") );
	DisplayFrame( pf );
	SetCommonFocus( query_state->edit );

	query_state->query_success = query_success_callback;
	if( !query_success_callback )
	{
		int okay;
		CommonWait( pf );
		if( query_state->Okay )
		{
			GetControlText( query_state->edit, result, reslen );
		}
		DestroyFrame( &pf );
		okay = query_state->Okay;
		Release( query_state );
		return okay;
	}
	else
	{
		query_state->query_success = query_success_callback;
		query_state->query_user_data = query_user_data;
		return 0;
	}

}
Esempio n. 9
0
int main( void )
{
	PSI_CONTROL frame = CreateFrame( WIDE("test scrolling texts"), 0, 0, 1024, 768, 0, NULL );
	if( frame )
	{
		t1 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 5, 300, 15, -1, WIDE("Scroll This Text...") );
		t2 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 25, 300, 15, -1, WIDE("Scroll This Text...") );
		t3 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 45, 300, 15, -1, WIDE("Scroll This Text...") );
		SetControlAlignment( t3, TEXT_CENTER );
		t4 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 65, 300, 15, -1, WIDE("Scroll This Text...") );
		SetControlAlignment( t4, TEXT_CENTER );
		DisplayFrame( frame );
		AddTimer( 50, DoScroll, 0 );
		CommonWait( frame );
	}
}
void PlayIntro()
{
	//WriteDebug("Play Start.\n");
	if (setupcfg.music)
	{
#ifdef RELEASETYPE_DEMO
		BASS_StreamPlay(str,FALSE,0);
#else
		mvxSystem_Play();
#endif
		//WriteDebug("Music Start.\n");
	}
	int StartTime=timeGetTime();
	int Time=0;
	while (!Done)
	{
		if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg); 
		}
		else if (Keys[VK_ESCAPE]) Done=true;
		else
		{
			glDisable(GL_SCISSOR_TEST);

			glClear(0x4100);

#ifdef RELEASETYPE_DEMO
			if (setupcfg.music) Time=(int)(BASS_ChannelBytes2Seconds(str,BASS_ChannelGetPosition(str))*100.0f);
#else
			if (setupcfg.music) Time=(int)(mvxSystem_GetSync()/10.0f);
#endif
			else                Time=(int)((timeGetTime()-StartTime)/10);
			//Time+=10;
			
			DisplayFrame(Time, MaterialList, SceneList, WorldList, EventList, EventNum);

			SwapBuffers(hDC);
			//Sleep(10);
			//if (Time>10140) Done=true;
		}
	}
}
Esempio n. 11
0
void ShowMediaPanel( struct my_button *media )
{
    INDEX idx;
    struct media_control_panel *panel;
    LIST_FORALL( l.controls, idx, struct media_control_panel *, panel )
    {
        if( panel->media == media )
            break;
    }
    if( !panel )
    {
        PSI_CONTROL newPanel = MakeNamedControl( NULL, MyName, 0, 0, 500, 75, -1 );
        MyValidatedControlData(struct media_control_panel*,  new_panel, newPanel );
        panel = new_panel;
        panel->media = media;
        panel->flags.playing = 1; // is playing, otherwise media panel wouldn't be showing...
        panel->knob = MakeNamedControl( newPanel, CONTROL_SCROLL_KNOB_NAME, 0, 0, 50, 50, -1 );
        panel->knob_image = LoadImageFile( WIDE( "images/dial2a.png" ) );
        SetScrollKnobImage( panel->knob, panel->knob_image );
        SetScrollKnobEvent( panel->knob, KnobTick, (uintptr_t)panel );
        panel->stop_button = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 0, 50, 25, -1, "Stop" );
        SetButtonPushMethod( panel->stop_button, stop_pushed, (uintptr_t)panel );
#ifdef _DEBUG
        panel->debug_mem_button = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 100, 55, 100, 25, -1, "Debug Memory" );
        SetButtonPushMethod( panel->debug_mem_button, debug_mem, (uintptr_t)panel );
#endif
        panel->pause_button = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 25, 50, 25, -1, "Pause" );
        SetButtonPushMethod( panel->pause_button, pause_pushed, (uintptr_t)panel );
        panel->progress = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 50, 50, 25, -1, "???" );
        //panel->progress = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 75, 50, 25, -1, "???" );
        panel->seek_slider = MakeNamedControl( newPanel, SLIDER_CONTROL_NAME,100, 0, 400, 50, -1 );
        SetSliderOptions( panel->seek_slider, SLIDER_HORIZ );
        SetSliderValues( panel->seek_slider, 0, 0, 10000 );  // 100.00%
        SetSliderUpdateHandler( panel->seek_slider, seek_changed, (uintptr_t)panel );
        DisplayFrame( newPanel );
    }
    else
    {
        // have an existing panel to just show.
        RevealCommon( panel->panel );
    }
    ffmpeg_SetPositionUpdateCallback( panel->media->file, video_position_update, (uintptr_t)panel );
}
Esempio n. 12
0
SaneWinMain( argc, argv )
{
	PSI_CONTROL frame;
	PSI_CONTROL clock;
	if( argc > 1 )
		frame = NULL;
   else
		frame = CreateFrame( WIDE("blah"), 0, 0, 500, 500, BORDER_RESIZABLE|BORDER_NORMAL, NULL );
	clock = MakeNamedControl( frame, WIDE("Basic Clock Widget"), 0, 0, 350, 350, -1 );
	if( frame )
		SetControlText( frame, WIDE("CLock Test Widet") );
	SetControlText( clock, WIDE("CLock Test Widet") );
   if( !frame )
		SetCommonBorder( clock,BORDER_RESIZABLE|BORDER_NORMAL );
	DisplayFrame( frame?frame:clock );
   MakeClockAnalog( clock );
	while( 1 )
      WakeableSleep( 1000 );

}
Esempio n. 13
0
int main( void )
#endif
{
    PSI_CONTROL frame = CreateFrame( "Test Some Controls", 0, 0, 0, 0, BORDER_RESIZABLE, NULL );
    DisplayFrame( frame );
    {
        int n = 0;
        PSI_CONTROL controls[10][10];
        int x, y;
        for( x = 0; x < 10; x++ )
            for( y = 0; y < 10; y++ )
            {
                controls[x][y] = MakeNamedCaptionedControl( frame, "Button", x*15 + 5, y*15+5, 15, 15, -1, "B" );
                //SmudgeCommon( controls[x][y] );
            }
        Sleep( 5000 );
        //DisplayFrame( frame );
        //Relinquish();
        //WakeableSleep( 10000 );
        do
        {
            n++;
            for( x = 0; x < 10; x++ )
                for( y = 0; y < 10; y++ )
                    HideCommon( controls[x][y] );

            Sleep( 200 );

            for( x = 0; x < 10; x++ )
                for( y = 0; y < 10; y++ )
                    RevealCommon( controls[x][y] );
            Sleep( 200 );
        } while( 100 > n );
    }
    DestroyFrame( &frame );
    return 0;
}
void main(void)
{
    uint8_t *pFilledFrame   = NULL;
    uint8_t *pDisplayFrame  = NULL;
    bool     bDisplayEnabled = false;

    adi_initComponents(); /* auto-generated code */

    /* Adjust the core frequency */
    if (adi_pwr_Init (PROC_CLOCK_IN, PROC_MAX_CORE_CLOCK, PROC_MAX_SYS_CLOCK, PROC_MIN_VCO_CLOCK) != ADI_PWR_SUCCESS)
    {
        printf ("Failed to initialize Power service\n");
        return;
    }
    if(adi_pwr_SetFreq(PROC_REQ_CORE_CLOCK, PROC_REQ_SYS_CLOCK)!= ADI_PWR_SUCCESS )
    {
        printf ("Failed to initialize Power service\n");
        return;
    }

    /* Configure the Software controlled switches on BF609 EZ-Board */
    //ConfigSoftSwitches_BF609();
#if defined(VIDEOLOOPBACKYUV_720P)
    FINBOARD_CLK_Synth_Config_OUT4_74_25_MHz();
#else
    FINBOARD_CLK_Synth_Config_OUT4_27_00_MHz();
#endif
    FINBOARD_LED_Drivers_Init();
    FINBOARD_LED_Drivers_Config(1);

    /* Configure the sensor */
    if(ConfigureSensor() != SUCCESS)
    {
        printf("Failed to configure Sensor \n");
        return;
    }

    /* Configure the sensor for display */
    if(ConfigureEncoder() != SUCCESS)
    {
        printf("Failed to configure LCD \n");
        return;
    }
    FINBOARD_ADV7511_16bit_Mode();

    /* Submit the frame for filling */
    if(SubmitEmptyVideoFrame() != SUCCESS)
    {
        printf("Failed to submit empty video frame to the sensor \n");
        return;
    }

    /* Submit the next frame for filling */
    if(SubmitEmptyVideoFrame() != SUCCESS)
    {
        printf("Failed to submit empty video frame to the sensor \n");
        return;
    }

    /* Enable the sensor to capture the frames */
    if(EnableSensor(true) != SUCCESS)
    {
        printf("Failed to enable sensor \n");
        return;
    }

#if (EXAMPLE_TIMEOUT > 0)
    while(NumFilledFrames < EXAMPLE_TIMEOUT)
#else
    while(1)
#endif
    {
        /* Get filled frame from sensor */
        if(GetFilledVideoFrame(&pFilledFrame) != SUCCESS)
        {
            printf("Failed to get filled frame from the sensor \n");
            return;
        }

        if(pFilledFrame != NULL)
        {
            NumFilledFrames++;

            pDisplayFrame = pFilledFrame;

            /* Submit the next frame for filling */
            if(SubmitEmptyVideoFrame() != SUCCESS)
            {
                printf("Failed to submit empty video frame to the sensor \n");
                return;
            }

            if(bDisplayEnabled == false)
            {
                /* Submit the filled frame to encoder for display */
                if(DisplayFrame(pDisplayFrame) != SUCCESS)
                {
                    printf("Failed to submit the filled frame to LCD for display \n");
                    return;
                }
            }

            if(NumFilledFrames == 2)
            {
                /* Enable video display after submitting two frames */
                if(EnableDisplay(true) != SUCCESS)
                {
                    printf("Failed to enable video display \n");
                    return;
                }

                bDisplayEnabled = true;
            }
        }

        if(bDisplayEnabled == true)
        {
              uint8_t *pFrame;

              if(GetDisplayedFrame((void **)&pFrame) != SUCCESS)
              {
                  printf("Failed to get the displayed frame \n");
              }

              /* Submit the filled frame to the encoder for display */
              if(DisplayFrame(pDisplayFrame) != SUCCESS)
              {
                  printf("Failed to submit the filled frame to encoder for display \n");
                  return;
              }
          }
       }

   FINBOARD_LED_Drivers_Config(0);
    printf("All done \n");
}
Esempio n. 15
0
static void win32_display_frame( vo_driver_t * vo_driver, vo_frame_t * vo_frame )
{
	win32_driver_t * win32_driver = ( win32_driver_t * ) vo_driver;
	win32_frame_t * win32_frame = ( win32_frame_t * ) vo_frame;
	int offset;
	int size;

	// if the required width, height or format has changed
	// then recreate the secondary buffer

	if( ( win32_driver->req_format	!= win32_frame->format	) ||
		( win32_driver->width		!= win32_frame->width	) ||
		( win32_driver->height		!= win32_frame->height	) )
	{
		CreateSecondary( win32_driver, win32_frame->width, win32_frame->height, win32_frame->format );
	}

	// determine desired ratio

	win32_driver->ratio = win32_frame->ratio;

	// lock our surface to update its contents

	win32_driver->contents = Lock( win32_driver->secondary );

	// surface unavailable, skip frame render

	if( !win32_driver->contents )
	{
		vo_frame->free( vo_frame );
		return;
	}

	// if our actual frame format is the native screen
	// pixel format, we need to convert it

	if( win32_driver->act_format == IMGFMT_NATIVE )
	{
		// use the software color conversion functions
		// to rebuild the frame in our native screen
		// pixel format ... this is slow

		if( win32_driver->req_format == XINE_IMGFMT_YV12 )
		{
			// convert from yv12 to native
			// screen pixel format

#if NEW_YUV
			win32_driver->yuv2rgb->configure( win32_driver->yuv2rgb,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width, win32_driver->width/2,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width * win32_driver->bytespp );
#else
			yuv2rgb_setup( win32_driver->yuv2rgb,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width, win32_driver->width/2,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width * win32_driver->bytespp );

#endif

			win32_driver->yuv2rgb->yuv2rgb_fun( win32_driver->yuv2rgb,
										win32_driver->contents,
										win32_frame->vo_frame.base[0],
										win32_frame->vo_frame.base[1],
										win32_frame->vo_frame.base[2] );
		}

		if( win32_driver->req_format == XINE_IMGFMT_YUY2 )
		{
			// convert from yuy2 to native
			// screen pixel format
#if NEW_YUV
			win32_driver->yuv2rgb->configure( win32_driver->yuv2rgb,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width, win32_driver->width/2,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width * win32_driver->bytespp );
#else

			yuv2rgb_setup( win32_driver->yuv2rgb,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width, win32_driver->width/2,
						   win32_driver->width, win32_driver->height,
						   win32_driver->width * win32_driver->bytespp );

#endif
			win32_driver->yuv2rgb->yuy22rgb_fun( win32_driver->yuv2rgb,
										win32_driver->contents,
										win32_frame->vo_frame.base[0] );
		}

#if RGB_SUPPORT
		if( win32_driver->req_format == IMGFMT_RGB )
		{
			// convert from 24 bit rgb to native
			// screen pixel format

			// TODO : rgb2rgb conversion
		}
#endif
	}
	else
	{
		// the actual format is identical to our
		// stream format. we just need to copy it

		switch(win32_frame->format)
		{
		    case XINE_IMGFMT_YV12:
			{
				vo_frame_t *frame;
				uint8_t *img;

				frame = vo_frame;
				img = (uint8_t *)win32_driver->contents;

				offset = 0;
				size = frame->pitches[0] * frame->height;
		        memcpy( img+offset, frame->base[0], size);

				offset += size;
				size = frame->pitches[2]* frame->height / 2;
				memcpy( img+offset, frame->base[2], size);
				
				offset += size;
				size = frame->pitches[1] * frame->height / 2;
				memcpy( img+offset, frame->base[1], size);
			}
				break;
			case XINE_IMGFMT_YUY2:
		        memcpy( win32_driver->contents, win32_frame->vo_frame.base[0], win32_frame->vo_frame.pitches[0] * win32_frame->vo_frame.height * 2);
				break;
			default:
		        memcpy( win32_driver->contents, win32_frame->vo_frame.base[0], win32_frame->vo_frame.pitches[0] * win32_frame->vo_frame.height * 2);
				break;
		}
	}

	// unlock the surface 

	Unlock( win32_driver->secondary );

	// scale, clip and display our frame

	DisplayFrame( win32_driver );

	// tag our frame as displayed
    if((win32_driver->current != NULL) && (win32_driver->current != vo_frame)) {
        vo_frame->free(&win32_driver->current->vo_frame);
	}
    win32_driver->current = vo_frame;  
}
Esempio n. 16
0
AUI_ERRCODE background_draw_handler(LPVOID bg)
{
	Background  *   back    = reinterpret_cast<Background *>(bg);
	aui_Surface	*   surface = (back)    ? back->TheSurface() : NULL;
	aui_Mouse *     mouse   = (g_c3ui)  ? g_c3ui->TheMouse() : NULL;

    if (!mouse || !g_tiledMap)
    {
        // Busy initialising: postpone drawing until ready.
        return AUI_ERRCODE_INVALIDPARAM;
    }

	if (g_modalWindow > 0)
    {
		g_screenManager->LockSurface(surface);
		g_tiledMap->DrawChatText();
		g_screenManager->UnlockSurface();

		return AUI_ERRCODE_OK;
	}

	g_tiledMap->UpdateMixFromMap(surface);

	if (g_theProfileDB->IsWaterAnim())
    {
        g_tiledMap->DrawWater();
    }

	g_theTradePool->Draw(surface);
	g_tiledMap->RepaintSprites(surface, g_tiledMap->GetMapViewRect(), false);

	if (g_director)
    {
		g_director->GarbageCollectItems();
	}

	g_tiledMap->DrawUnfinishedMove(surface);

	POINT pos;
	pos.y = mouse->Y() - back->Y();
	if (pos.y < back->Height())
	{
		g_tiledMap->DrawHiliteMouseTile(surface);
		g_tiledMap->DrawLegalMove(surface);
	}

#ifdef _PLAYTEST
	switch(g_debugOwner)
    {
#ifdef _DEBUG
	case k_DEBUG_OWNER_CRC:
		if(g_dataCheck) {
			g_dataCheck->DisplayCRC(surface);
			g_tiledMap->InvalidateMix();
		}
		break;
	case k_DEBUG_OWNER_NETWORK_CHAT:
		g_network.DisplayChat(surface);
		g_tiledMap->InvalidateMix();
		break;
#endif
	case k_DEBUG_OWNER_COMMANDLINE:
		g_commandLine.DisplayOutput(surface);
		g_tiledMap->InvalidateMix();
		break;
    case k_DEBUG_OWNER_FRAME_RATE:
        DisplayFrame (surface);
        break;
	default:
		break;
	}
#endif // _PLAYTEST

	g_tiledMap->CopyMixDirtyRects(back->GetDirtyList());
	g_tiledMap->ClearMixDirtyRects();

	return AUI_ERRCODE_OK;
}
Esempio n. 17
0
static void win32_display_frame( vo_driver_t * vo_driver, vo_frame_t * vo_frame )
{
  win32_driver_t  *win32_driver = ( win32_driver_t * ) vo_driver;
  win32_frame_t   *win32_frame  = ( win32_frame_t * ) vo_frame;


  /* if the required width, height or format has changed
   * then recreate the secondary buffer */

  if( ( win32_driver->req_format	!= win32_frame->format	) ||
      ( win32_driver->width		!= win32_frame->width	) ||
      ( win32_driver->height		!= win32_frame->height	) )
    {
      CreateSecondary( win32_driver, win32_frame->width, win32_frame->height, win32_frame->format );
    }

  /* determine desired ratio */

  win32_driver->ratio = win32_frame->ratio;

  /* lock our surface to update its contents */

  win32_driver->contents = Lock( win32_driver, win32_driver->secondary );

  /* surface unavailable, skip frame render */

  if( !win32_driver->contents )
    {
      vo_frame->free( vo_frame );
      return;
    }

  /* if our actual frame format is the native screen
   * pixel format, we need to convert it */

  if( win32_driver->act_format == IMGFMT_NATIVE )
    {
      /* use the software color conversion functions
       * to rebuild the frame in our native screen
       * pixel format ... this is slow */

      if( win32_driver->req_format == XINE_IMGFMT_YV12 )
	{
	  /* convert from yv12 to native
	   * screen pixel format */

#if NEW_YUV
	  win32_driver->yuv2rgb->configure( win32_driver->yuv2rgb,
					    win32_driver->width, win32_driver->height,
					    win32_frame->vo_frame.pitches[0], win32_frame->vo_frame.pitches[1],
					    win32_driver->width, win32_driver->height,
					    win32_driver->width * win32_driver->bytespp);
#else
	  yuv2rgb_setup( win32_driver->yuv2rgb,
			 win32_driver->width, win32_driver->height,
			 win32_frame->vo_frame.pitches[0], win32_frame->vo_frame.pitches[1],
			 win32_driver->width, win32_driver->height,
			 win32_driver->width * win32_driver->bytespp );

#endif

	  win32_driver->yuv2rgb->yuv2rgb_fun( win32_driver->yuv2rgb,
					      win32_driver->contents,
					      win32_frame->vo_frame.base[0],
					      win32_frame->vo_frame.base[1],
					      win32_frame->vo_frame.base[2] );
	}

      if( win32_driver->req_format == XINE_IMGFMT_YUY2 )
	{
	  /* convert from yuy2 to native
	   * screen pixel format */
#if NEW_YUV
	  win32_driver->yuv2rgb->configure( win32_driver->yuv2rgb,
					    win32_driver->width, win32_driver->height,
					    win32_frame->vo_frame.pitches[0], win32_frame->vo_frame.pitches[0] / 2,
					    win32_driver->width, win32_driver->height,
					    win32_driver->width * win32_driver->bytespp );
#else

	  yuv2rgb_setup( win32_driver->yuv2rgb,
			 win32_driver->width, win32_driver->height,
			 win32_frame->vo_frame.pitches[0], win32_frame->vo_frame.pitches[0] / 2,
			 win32_driver->width, win32_driver->height,
			 win32_driver->width * win32_driver->bytespp );

#endif
	  win32_driver->yuv2rgb->yuy22rgb_fun( win32_driver->yuv2rgb,
					       win32_driver->contents,
					       win32_frame->vo_frame.base[0] );
	}

#if RGB_SUPPORT
      if( win32_driver->req_format == IMGFMT_RGB )
	{
	  /* convert from 24 bit rgb to native
	   * screen pixel format */

	  /* TODO : rgb2rgb conversion */
	}
#endif
    }
  else
    {
      /* the actual format is identical to our
       * stream format. we just need to copy it */

    int line;
    uint8_t * src;
    vo_frame_t * frame = vo_frame;
    uint8_t * dst = (uint8_t *)win32_driver->contents;

    switch(win32_frame->format)
	{
      case XINE_IMGFMT_YV12:
        src = frame->base[0];
        for (line = 0; line < frame->height ; line++){
          xine_fast_memcpy( dst, src, frame->width);
          src += vo_frame->pitches[0];
          dst += win32_driver->ddsd.lPitch;
        }

        src = frame->base[2];
        for (line = 0; line < frame->height/2 ; line++){
          xine_fast_memcpy( dst, src, frame->width/2);
          src += vo_frame->pitches[2];
          dst += win32_driver->ddsd.lPitch/2;
        }

        src = frame->base[1];
        for (line = 0; line < frame->height/2 ; line++){
          xine_fast_memcpy( dst, src, frame->width/2);
          src += vo_frame->pitches[1];
          dst += win32_driver->ddsd.lPitch/2;
        }
	  break;

	case XINE_IMGFMT_YUY2:
	default:
      src = frame->base[0];
      for (line = 0; line < frame->height ; line++){
	    xine_fast_memcpy( dst, src, frame->width*2);
	    src += vo_frame->pitches[0];
	    dst += win32_driver->ddsd.lPitch;
	  }
	  break;
	}
  }

  /* unlock the surface  */

  Unlock( win32_driver->secondary );

  /* scale, clip and display our frame */

  DisplayFrame( win32_driver );

  /* tag our frame as displayed */
  if((win32_driver->current != NULL) && ((vo_frame_t *)win32_driver->current != vo_frame)) {
    vo_frame->free(&win32_driver->current->vo_frame);
  }
  win32_driver->current = (win32_frame_t *)vo_frame;

}
Esempio n. 18
0
void c_gamePKG::Frame()
{
	DisplayFrame();
	InputFrame();
	DlgDisplayFrame();
}