示例#1
0
文件: DotNode.cpp 项目: heyx3/Manbil
void DotNode::WriteMyOutputs(std::string & outCode) const
{
    std::string vecType = VectorF(GetInputs()[0].GetSize(), 0).GetGLSLType();

    outCode += "\tfloat " + GetOutputName(0) +
               " = dot(" + GetInputs()[0].GetValue() + ", " +
               GetInputs()[1].GetValue() + ");\n";
}
示例#2
0
文件: StepNode.cpp 项目: heyx3/K1LL
void StepNode::WriteMyOutputs(std::string& outCode) const
{
    outCode += "\t" + VectorF::GetGLSLType(GetOutputSize(0)) + " " + GetOutputName(0) +
                   " = step(" + GetInputs()[1].GetValue() + ", " + GetInputs()[0].GetValue() + ");\n";
}
示例#3
0
DWORD CWorkThread::Run()
{
	BOOL  bRet;
	DWORD dwWait;
	m_pWnd->PostMessage(WTM_START, 0, 0);

	while (1)
	{
		dwWait = ::WaitForSingleObject(g_hTaskEvent, INFINITE);
		if (dwWait != WAIT_OBJECT_0)
		{
			OutputDebugString(_T("WorkThread Error Exit!\n"));
			break;
		}

		//开始播放
		m_pWnd->PostMessage(WTM_PROC, WTS_WAIT_PLAY, 0);
		bRet = m_qiyiPlayer.Play(m_szFileName);
		if(!bRet)
		{
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_WAIT_TIMEOUT);
			continue;
		}

		//打开进程内存
		m_pWnd->PostMessage(WTM_PROC, WTS_FIND_MEM, 0);
		bRet = m_procMem.Open(m_qiyiPlayer.GetPid());
		if (!bRet)
		{
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_OPEN_ERROR);
			m_qiyiPlayer.Close();
			continue;
		}
		
		//搜索内存
		LPCVOID lpBase = m_procMem.Find((LPVOID)g_biMatchData, sizeof(g_biMatchData));
		if (lpBase == 0)
		{
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_FIND_FAIL);
			m_qiyiPlayer.Close();
			continue;
		}

		//打开QSV文件
		m_pWnd->PostMessage(WTM_PROC, WTS_LOAD_QIYI, 0);
		bRet = m_qiyiFile.Open(m_szFileName);
		if(!bRet)
		{
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_OPENFILE_FAIL);
			continue;
		}
		INT nCount = m_qiyiFile.GetSectionCount();

		//读取解密数据
		lpBase = (LPCVOID)((BYTE*)lpBase - QSV_INFO_SIZE);
		QIYI_INFO *pInfo = (QIYI_INFO*)malloc(sizeof(QIYI_INFO) * nCount);
		if (pInfo == NULL)
		{
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_MALLOC_FAIL);
			m_qiyiFile.Close();
			m_qiyiPlayer.Close();
			continue;
		}
		m_procMem.Read(lpBase, pInfo, nCount*sizeof(QIYI_INFO));
		m_qiyiPlayer.Close();

		//创建FLV
		bRet = m_flvFile.Create(GetOutputName());
		if (!bRet)
		{
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_CREATE_FAIL);
			m_qiyiFile.Close();
			continue;
		}

		//合成FLV文件
		bRet = ProcessFile(pInfo, nCount);
		m_flvFile.Close();
		m_qiyiFile.Close();

		if (bRet)
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_NONE);
		else
			m_pWnd->PostMessage(WTM_RESULT, 0, WTE_FLV_INVALID);
		//释放QSV头部
		free(pInfo);
	}
	return 0;
}
示例#4
0
void ReflectNode::WriteMyOutputs(std::string & outCode) const
{
    outCode += "\t" + VectorF(GetOutputSize(0), 0).GetGLSLType() + " " + GetOutputName(0) +
        " = reflect(" + GetInputs()[0].GetValue() + ", " + GetInputs()[1].GetValue() + ");\n";
}