| 906 | } |
| 907 | |
| 908 | void PostEffect::_setupTexture( U32 stage, GFXTexHandle &inputTex, const RectI *inTexViewport ) |
| 909 | { |
| 910 | const String &texFilename = mTexFilename[ stage ]; |
| 911 | |
| 912 | GFXTexHandle theTex; |
| 913 | NamedTexTarget *namedTarget = NULL; |
| 914 | |
| 915 | RectI viewport = GFX->getViewport(); |
| 916 | |
| 917 | if ( texFilename.compare( "$inTex", 0, String::NoCase ) == 0 ) |
| 918 | { |
| 919 | theTex = inputTex; |
| 920 | |
| 921 | if ( inTexViewport ) |
| 922 | { |
| 923 | viewport = *inTexViewport; |
| 924 | } |
| 925 | else if ( theTex ) |
| 926 | { |
| 927 | viewport.set( 0, 0, theTex->getWidth(), theTex->getHeight() ); |
| 928 | } |
| 929 | } |
| 930 | else if ( texFilename.compare( "$backBuffer", 0, String::NoCase ) == 0 ) |
| 931 | { |
| 932 | theTex = PFXMGR->getBackBufferTex(); |
| 933 | |
| 934 | // Always use the GFX viewport when reading from the backbuffer |
| 935 | } |
| 936 | else if ( texFilename.isNotEmpty() && texFilename[0] == '#' ) |
| 937 | { |
| 938 | namedTarget = NamedTexTarget::find( texFilename.c_str() + 1 ); |
| 939 | if ( namedTarget ) |
| 940 | { |
| 941 | theTex = namedTarget->getTexture( 0 ); |
| 942 | viewport = namedTarget->getViewport(); |
| 943 | } |
| 944 | } |
| 945 | else |
| 946 | { |
| 947 | theTex = mTextures[ stage ]; |
| 948 | if ( theTex ) |
| 949 | viewport.set( 0, 0, theTex->getWidth(), theTex->getHeight() ); |
| 950 | } |
| 951 | |
| 952 | mActiveTextures[ stage ] = theTex; |
| 953 | mActiveNamedTarget[ stage ] = namedTarget; |
| 954 | mActiveTextureViewport[ stage ] = viewport; |
| 955 | |
| 956 | if ( theTex.isValid() ) |
| 957 | GFX->setTexture( stage, theTex ); |
| 958 | } |
| 959 | |
| 960 | void PostEffect::_setupTransforms() |
| 961 | { |
nothing calls this directly
no test coverage detected