コード例 #1
0
ファイル: menu_cheats.c プロジェクト: Dnawrkshp/ArtemisPS3
/*
 * User Cheats Game Selection Menu
 */
void Draw_UserCheatsMenu_Ani()
{
    int c = 0, w = 0, h = 0;
    
    int div = 12, max = MENU_ANI_MAX, ani = 0;
    for (ani = 0; ani < max; ani++)
    {
        tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL);
        
        tiny3d_AlphaTest(1, 0x0, TINY3D_ALPHA_FUNC_GEQUAL);
        
        tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA,
            0x00000303 | 0x00000000,
            TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD);
        
        tiny3d_Project2D();
        
        u8 icon_a = (u8)(((ani * 2) > 0xFF) ? 0xFF : (ani * 2));
        
		DrawHeader_Ani(menu_textures[header_ico_cht_png_index], "Cheats", "User List", 0x00000000, 0xffffffff, ani, div);
        
        int _game_a = (int)(icon_a - (max / 2)) * 2;
        if (_game_a > 0xFF)
            _game_a = 0xFF;
        u8 game_a = (u8)(_game_a < 0 ? 0 : _game_a);
        DrawGameList(menu_old_sel[1], user_game_list, user_game_count, game_a);
        
        tiny3d_Flip();
        
        if (_game_a == 0xFF)
            return;
    }
}
コード例 #2
0
ファイル: main.c プロジェクト: Estwald/PSDK3v2
s32 main(s32 argc, const char* argv[])
{
	padInfo padinfo;
	padData paddata;
	int i;
	
	tiny3d_Init(1024*1024);

	ioPadInit(7);

	// Load texture

    LoadTexture();

	
	// Ok, everything is setup. Now for the main loop.
	while(1) {

        /* DRAWING STARTS HERE */

        // clear the screen, buffer Z and initializes environment to 2D

        tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL);

        // Enable alpha Test
        tiny3d_AlphaTest(1, 0x10, TINY3D_ALPHA_FUNC_GEQUAL);

        // Enable alpha blending.
        tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA,
            TINY3D_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA | TINY3D_BLEND_FUNC_DST_ALPHA_ZERO,
            TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD);
      

		// Check the pads.
		ioPadGetInfo(&padinfo);

		for(i = 0; i < MAX_PADS; i++){

			if(padinfo.status[i]){
				ioPadGetData(i, &paddata);
				
				if(paddata.BTN_CROSS){
					return 0;
				}
			}
			
		}

        drawScene(); // Draw

        /* DRAWING FINISH HERE */

        tiny3d_Flip();
		
	}

	return 0;
}
コード例 #3
0
ファイル: menu_cheats.c プロジェクト: Dnawrkshp/ArtemisPS3
void Draw_CheatsMenu_Options_Ani_Exit(void)
{
	int c = 0, w = 0, h = 0;

	int div = 12, max = MENU_ANI_MAX, ani = 0, left = MENU_SPLIT_OFF;
	for (ani = max - 1; ani >= 0; ani--)
	{
		tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL);

		tiny3d_AlphaTest(1, 0x0, TINY3D_ALPHA_FUNC_GEQUAL);

		tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA,
			0x00000303 | 0x00000000,
			TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD);

		tiny3d_Project2D();

		u8 icon_a = (u8)((int)(((848 - left) / 848.0) * 255.0));
		left = MENU_SPLIT_OFF + ((max - ani) * div * 3);
		if (left > 848)
			left = 848;

		u8 rgbVal = 0xFF;
		rgbVal -= (u8)((848 - left) / div);
		if (rgbVal < 0xD0)
			rgbVal = 0xD0;
		Draw_CheatsMenu_Selection(menu_old_sel[5], (rgbVal << 24) | (rgbVal << 16) | (rgbVal << 8) | 0xFF);

		DrawTexture(menu_textures[edit_shadow_png_index], left - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -marginVertical, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (marginVertical * 2), icon_a);
		DrawHeader(menu_textures[header_ico_opt_png_index], left, "Cheat Option", selected_centry.name, 0x00000000 | icon_a, 0xffffffff, 1);

		int _game_a = (int)(icon_a - (max / 2)) * 2;
		if (_game_a > 0xFF)
			_game_a = 0xFF;
		u8 game_a = (u8)(_game_a < 0 ? 0 : _game_a);

		//DrawOptions(selected_centry.options[option_index], game_a, 18, menu_old_sel[7]);
		//DrawScrollBar2(menu_old_sel[7], selected_centry.options[option_index].size, 18, 700, game_a);

		tiny3d_Flip();

		if (left == 848)
			return;
	}
}
コード例 #4
0
ファイル: menu_cheats.c プロジェクト: Dnawrkshp/ArtemisPS3
void Draw_CheatsMenu_View_Ani(void)
{
    int c = 0, w = 0, h = 0;
    
	int div = 12, max = MENU_ANI_MAX, ani = 0, left = MENU_SPLIT_OFF;
    for (ani = 0; ani < max; ani++)
    {
        tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL);
        
        tiny3d_AlphaTest(1, 0x0, TINY3D_ALPHA_FUNC_GEQUAL);
        
        tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA,
            0x00000303 | 0x00000000,
            TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD);
        
        tiny3d_Project2D();
        
		u8 icon_a = (u8)(((ani * 4 + 0x40) > 0xFF) ? 0xFF : (ani * 4 + 0x40));
		left = 848 - (ani * div * 3);
		if (left < MENU_SPLIT_OFF)
			left = MENU_SPLIT_OFF;


		u8 rgbVal = 0xFF;
		rgbVal -= (u8)((848 - left) / div);
		if (rgbVal < 0xD0)
			rgbVal = 0xD0;
		Draw_CheatsMenu_Selection(menu_sel, (rgbVal << 24) | (rgbVal << 16) | (rgbVal << 8) | 0xFF);

		DrawTexture(menu_textures[edit_shadow_png_index], left - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -marginVertical, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (marginVertical * 2), icon_a);
		DrawHeader(menu_textures[header_ico_opt_png_index], left, "Cheat View", selected_centry.name, 0x00000000 | icon_a, 0xffffffff, 1);

		u8 game_a = (u8)(icon_a < 0x8F ? 0 : icon_a);
		int nlines = DrawCodes(selected_centry, game_a, 20, left, menu_old_sel[6]);
		DrawScrollBar(menu_old_sel[6], nlines, 20, 800, game_a);
		
		tiny3d_Flip();

		if ((848 - (ani * div * 3)) < (MENU_SPLIT_OFF / 2))
			return;
    }
}
コード例 #5
0
ファイル: main.c プロジェクト: 3calabera/tiny3d
s32 main(s32 argc, const char* argv[])
{
	PadInfo padinfo;
	PadData paddata;
	int i;
    int frame = 0;
	
	tiny3d_Init(1024*1024);

	ioPadInit(7);
    
    SysLoadModule(SYSMODULE_PNGDEC);

    atexit(exiting); // Tiny3D register the event 3 and do exit() call when you exit  to the menu

	// Load texture

    LoadTexture();

   
	
	// Ok, everything is setup. Now for the main loop.
	while(1) {

        /* DRAWING STARTS HERE */

        // clear the screen, buffer Z and initializes environment to 2D
        
        tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL);
        
        // Enable alpha Test
        tiny3d_AlphaTest(1, 0x10, TINY3D_ALPHA_FUNC_GEQUAL);

        // Enable alpha blending.
        tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA,
            NV30_3D_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA | NV30_3D_BLEND_FUNC_DST_ALPHA_ZERO,
            TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD);


        drawScene(frame);

        frame++;

		// Check the pads.
		ioPadGetInfo(&padinfo);

		for(i = 0; i < MAX_PADS; i++){

			if(padinfo.status[i]){
				ioPadGetData(i, &paddata);
				
				if(paddata.BTN_CROSS){
					return 0;
				}
			}
			
		}

        /* DRAWING FINISH HERE */

        tiny3d_Flip();
		
	}

	return 0;
}
コード例 #6
0
ファイル: main.c プロジェクト: Estwald/PSDK3v2
s32 main(s32 argc, const char* argv[])
{

	tiny3d_Init(1024*1024);

	ioPadInit(7);

    atexit(exiting); // Tiny3D register the event 3 and do exit() call when you exit  to the menu

	// Load texture

    LoadTexture();

	
	// Ok, everything is setup. Now for the main loop.
	while(1) {

        static long frame_count = 0;


        /* DRAWING STARTS HERE */

        // clear the screen, buffer Z and initializes environment to 2D

        double sx = (double) Video_Resolution.width;
        double sy = (double) Video_Resolution.height;
        double px = (double) (1000 + videoscale_x)/1000.0;
        double py = (double) (1000 + videoscale_y)/1000.0;
        
        tiny3d_UserViewport(1, 
            (float) ((sx - sx * px) / 2.0), // 2D position
            (float) ((sy - sy * py) / 2.0), 
            (float) ((sx * px) / 848.0),    // 2D scale
            (float) ((sy * py) / 512.0),
            (((float) Video_Resolution.width) / 1920.0f) * (float) (1000 + videoscale_x)/1000.0f,  // 3D scale
            (((float) Video_Resolution.height) / 1080.0f) * (float) (1000 + videoscale_y)/1000.0f);

        tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL);

        // Enable alpha Test
        tiny3d_AlphaTest(1, 0x10, TINY3D_ALPHA_FUNC_GEQUAL);

        // Enable alpha blending.
        tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA,
            TINY3D_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA | TINY3D_BLEND_FUNC_DST_ALPHA_ZERO,
            TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD);
      
        ps3pad_read();

        if(!(frame_count & 3)) {
            if(old_pad & BUTTON_UP) {if(videoscale_y > -179) videoscale_y--;}
            if(old_pad & BUTTON_DOWN) {if(videoscale_y < 10) videoscale_y++;}
            if(old_pad & BUTTON_LEFT) {if(videoscale_x > -199) videoscale_x--;}
            if(old_pad & BUTTON_RIGHT) {if(videoscale_x < 10) videoscale_x++;}
        }

        
        if(new_pad & BUTTON_CROSS) break;

        drawScene(); // Draw

        /* DRAWING FINISH HERE */

        tiny3d_Flip();
        
        frame_count++;
		
	}
	
	return 0;
}
コード例 #7
0
ファイル: main.c プロジェクト: cloned67/tiny3d
s32 main(s32 argc, const char* argv[])
{
	PadInfo padinfo;
	PadData paddata;
	int i;
	
	tiny3d_Init(1024*1024);

	ioPadInit(7);
    
    SysLoadModule(SYSMODULE_PNGDEC);

	// Load texture

    LoadTexture();

    /* data for the ghost */

    ghost[0].x     = 0.0f;
    ghost[0].y     = 0.0f;
    ghost[0].dx    = 1.5f;
    ghost[0].dy    = 1.5f;
    ghost[0].frame = 0;
    ghost[0].color = 0xffffff80;

    ghost[1].x     = (847.0f - 64.0f);
    ghost[1].y     = 0.0f;
    ghost[1].dx    = -1.5f;
    ghost[1].dy    = 1.5f;
    ghost[1].frame = 0;
    ghost[1].color = 0x8f8fff80;

    ghost[2].x     = 0.0f;
    ghost[2].y     = (511.0f - 64.0f);
    ghost[2].dx    = 1.5f;
    ghost[2].dy    = -1.5f;
    ghost[2].frame = 0;
    ghost[2].color = 0xff8f8f80;

    ghost[3].x     = (847.0f - 64.0f);
    ghost[3].y     = (511.0f - 64.0f);
    ghost[3].dx    = -1.5f;
    ghost[3].dy    = -1.5f;
    ghost[3].frame = 0;
    ghost[3].color = 0x8fff8f80;
	
	// Ok, everything is setup. Now for the main loop.
	while(1) {

        /* DRAWING STARTS HERE */

        // clear the screen, buffer Z and initializes environment to 2D

        tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL);

        // Enable alpha Test
        tiny3d_AlphaTest(1, 0x10, TINY3D_ALPHA_FUNC_GEQUAL);

        // Enable alpha blending.
        tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA,
            NV30_3D_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA | NV30_3D_BLEND_FUNC_DST_ALPHA_ZERO,
            TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD);
      

		// Check the pads.
		ioPadGetInfo(&padinfo);

		for(i = 0; i < MAX_PADS; i++){

			if(padinfo.status[i]){
				ioPadGetData(i, &paddata);
				
				if(paddata.BTN_CROSS){
					return 0;
				}
			}
			
		}

        drawScene(); // Draw

        /* DRAWING FINISH HERE */

        tiny3d_Flip();
		
	}
	
    SysUnloadModule(SYSMODULE_PNGDEC);

	return 0;
}