MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / DrawImage

Method DrawImage

CrySystem/ScriptObjectSystem.cpp:1288–1318  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// !draw an sprite on screen @param nTid texture id @param nPx x position(the screen is normalized at 800x600) @param nPy y position(the screen is normalized at 800x600) @param w width @param h height @param nMode blending mode (the number mus

Source from the content-addressed store, hash-verified

1286 R_BLEND_MODE__ADD_SIGNED 14
1287*/
1288int CScriptObjectSystem::DrawImage(IFunctionHandler *pH)
1289{
1290 CHECK_PARAMETERS(6);
1291
1292 USER_DATA nTid;
1293 int nPx;
1294 int nPy;
1295 int w;
1296 int h;
1297 int nMode;
1298 //pH->GetParam(1,nTid);
1299 int nCookie=0;
1300 pH->GetParamUDVal(1,nTid,nCookie);
1301 if(nTid && (nCookie==USER_DATA_TEXTURE))
1302 {
1303 pH->GetParam(2,nPx);
1304 pH->GetParam(3,nPy);
1305 pH->GetParam(4,w);
1306 pH->GetParam(5,h);
1307 pH->GetParam(6,nMode);
1308
1309 if (nMode!=0)
1310 m_pRenderer->SetState(GS_NODEPTHTEST | sGetBlendState(nMode));
1311
1312 m_pRenderer->Draw2dImage((float)nPx,(float)nPy,(float)w,(float)h,nTid, 0.f, 1.f, 1.f, 0.f);
1313
1314 if (nMode!=0)
1315 m_pRenderer->SetState(GS_DEPTHWRITE);
1316 }
1317 return pH->EndFunction();
1318}
1319/////////////////////////////////////////////////////////////////////////////////
1320/////////////////////////////////////////////////////////////////////////////////
1321/*!draw an sprite on screen

Callers

nothing calls this directly

Calls 6

sGetBlendStateFunction · 0.85
EndFunctionMethod · 0.80
GetParamUDValMethod · 0.45
GetParamMethod · 0.45
SetStateMethod · 0.45
Draw2dImageMethod · 0.45

Tested by

no test coverage detected