MCPcopy Create free account
hub / github.com/carbonengine/trinity / py__init__

Function py__init__

trinity/RenderJob/TriStepRenderTexture_Blue.cpp:12–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11#if BLUE_WITH_PYTHON
12static PyObject* py__init__( PyObject* self, PyObject* args )
13{
14 TriStepRenderTexture* pThis = BluePythonCast<TriStepRenderTexture*>( self );
15
16 PyObject* pyTexture = NULL;
17
18 if( !PyArg_ParseTuple( args, "|O", &pyTexture ) )
19 {
20 return NULL;
21 }
22
23 if( pyTexture && pyTexture != Py_None )
24 {
25 Tr2RenderTarget* rt = BluePythonCast<Tr2RenderTarget*>( pyTexture );
26 if( rt )
27 {
28 pThis->SetTexture( rt );
29 Py_RETURN_NONE;
30 }
31
32 Tr2DepthStencil* ds = BluePythonCast<Tr2DepthStencil*>( pyTexture );
33 if( ds )
34 {
35 pThis->SetTexture( ds );
36 Py_RETURN_NONE;
37 }
38
39 ITr2TextureProvider* texture = BluePythonCast<ITr2TextureProvider*>( pyTexture );
40 if( texture )
41 {
42 pThis->SetTexture( texture );
43 Py_RETURN_NONE;
44 }
45
46 Tr2AtlasTexture* atlasTexture = BluePythonCast<Tr2AtlasTexture*>( pyTexture );
47 if( atlasTexture )
48 {
49 pThis->SetTexture( atlasTexture );
50 Py_RETURN_NONE;
51 }
52
53 PyErr_SetString( PyExc_TypeError, "Expected a Tr2RenderTarget, Tr2AtlasTexture, or TriTextureRes" );
54 return NULL;
55 }
56
57 Py_RETURN_NONE;
58}
59#endif
60
61const Be::ClassInfo* TriStepRenderTexture::ExposeToBlue()

Calls 1

SetTextureMethod · 0.45

Tested by

no test coverage detected