예제 #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
파일: ReflectNode.cpp 프로젝트: heyx3/K1LL
void ReflectNode::WriteMyOutputs(std::string & outCode) const
{
    outCode += "\t" + VectorF(GetOutputSize(0), 0).GetGLSLType() + " " + GetOutputName(0) +
        " = reflect(" + GetInputs()[0].GetValue() + ", " + GetInputs()[1].GetValue() + ");\n";
}