| 806 | } |
| 807 | |
| 808 | RpAtomic* custom_bubble_render(RpAtomic* atomic) |
| 809 | { |
| 810 | RwCullMode old_cull_mode; |
| 811 | F32 fade = shared.missle_model->Alpha; |
| 812 | F32 fresnel_coeff; |
| 813 | F32 env_coeff; |
| 814 | |
| 815 | RwRenderStateGet(rwRENDERSTATECULLMODE, (void*)&old_cull_mode); |
| 816 | RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)1); |
| 817 | iDrawSetFBMSK(0xFFFFFFFF); |
| 818 | AtomicDisableMatFX(atomic); |
| 819 | RpSkinAtomicSetType(atomic, rpSKINTYPEMATFX); |
| 820 | (*gAtomicRenderCallBack)(atomic); |
| 821 | iDrawSetFBMSK(0); |
| 822 | if (current_tweak->material.fresnel_texture != 0) |
| 823 | { |
| 824 | fresnel_coeff = current_tweak->material.fresnel_coeff * fade; |
| 825 | iModelSetMaterialAlpha( |
| 826 | atomic, |
| 827 | (S32)(current_tweak->material.fresnel_alpha * 255.0f * fade + 0.5f) & 0xFF); |
| 828 | gFXSurfaceFlags = 0x10; |
| 829 | xFXAtomicEnvMapSetup(atomic, current_tweak->material.fresnel_texture, |
| 830 | fresnel_coeff); |
| 831 | gFXSurfaceFlags = 0; |
| 832 | (*gAtomicRenderCallBack)(atomic); |
| 833 | } |
| 834 | if (current_tweak->material.env_texture != 0) |
| 835 | { |
| 836 | env_coeff = current_tweak->material.env_coeff * fade; |
| 837 | iModelSetMaterialAlpha( |
| 838 | atomic, (S32)(current_tweak->material.env_alpha * 255.0f * fade + 0.5f) & 0xFF); |
| 839 | AtomicDisableMatFX(atomic); |
| 840 | gFXSurfaceFlags = 0x10; |
| 841 | xFXAtomicEnvMapSetup(atomic, current_tweak->material.env_texture, env_coeff); |
| 842 | gFXSurfaceFlags = 0; |
| 843 | (*gAtomicRenderCallBack)(atomic); |
| 844 | } |
| 845 | RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)old_cull_mode); |
| 846 | |
| 847 | return atomic; |
| 848 | } |
| 849 | |
| 850 | void init_states() |
| 851 | { |
nothing calls this directly
no test coverage detected