MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / OverrideDisplay

Method OverrideDisplay

Source/SysPSP/HLEGraphics/DisplayListDebugger.cpp:601–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599
600
601bool CTextureExplorerDebugMenuOption::OverrideDisplay() const
602{
603 if( !mDisplayTexture )
604 return false;
605
606 CRefPtr<CNativeTexture> texture;
607 u32 texture_width = 32;
608 u32 texture_height = 32;
609 if( mSelectedIdx < mSnapshot.size() )
610 {
611 texture = mSnapshot[ mSelectedIdx ].Texture;
612
613 const TextureInfo & info = mSnapshot[ mSelectedIdx ].Info;
614
615 texture_width = info.GetWidth();
616 texture_height = info.GetHeight();
617 }
618
619 CGraphicsContext::Get()->BeginFrame();
620
621 sceGuDisable(GU_DEPTH_TEST);
622 sceGuDepthMask( GL_TRUE ); // GL_TRUE to disable z-writes
623 sceGuShadeModel( GU_FLAT );
624
625 sceGuTexFilter(GU_NEAREST,GU_NEAREST);
626 sceGuTexScale(1.0f,1.0f);
627 sceGuTexOffset(0.0f,0.0f);
628 sceGuDisable(GU_ALPHA_TEST);
629 sceGuTexFunc(GU_TFX_REPLACE,GU_TCC_RGBA);
630
631 sceGuSetMatrix( GU_PROJECTION, reinterpret_cast< const ScePspFMatrix4 * >( &gMatrixIdentity ) );
632
633 const f32 screen_width( 480.0f );
634 const f32 screen_height( 272.0f );
635
636 if ( mCheckerTexture != nullptr )
637 {
638 u32 num_verts( 2 );
639 TextureVtx* p_verts = (TextureVtx*)sceGuGetMemory(num_verts*sizeof(TextureVtx));
640
641 mCheckerTexture->InstallTexture();
642
643 sceGuDisable(GU_BLEND);
644 sceGuTexWrap(GU_REPEAT,GU_REPEAT);
645
646 p_verts[0].pos = v3( 0.0f, 0.0f, 0.0f );
647 p_verts[0].t0 = v2( 0.0f, 0.0f );
648
649 p_verts[1].pos = v3( screen_width, screen_height, 0.0f );
650 p_verts[1].t0 = v2( screen_width, screen_height );
651
652 sceGuDrawArray(GU_SPRITES,TEXTURE_VERTEX_FLAGS|GU_TRANSFORM_2D,num_verts,nullptr,p_verts);
653 }
654
655 if( texture != nullptr )
656 {
657 u32 num_verts( 2 );
658 TextureVtx* p_verts = (TextureVtx*)sceGuGetMemory(num_verts*sizeof(TextureVtx));

Callers 1

RunMethod · 0.45

Calls 9

sceGuSetMatrixFunction · 0.85
v3Class · 0.85
sizeMethod · 0.80
v2Class · 0.50
GetWidthMethod · 0.45
GetHeightMethod · 0.45
BeginFrameMethod · 0.45
InstallTextureMethod · 0.45
EndFrameMethod · 0.45

Tested by

no test coverage detected