示例#1
0
文件: tmix.c 项目: AEonZR/GtkRadiant
int	SetVars(char *name)
{
    if (!GetScriptInfo(name))
        return(false);

    if (!CheckVars())
        return(false);

    destsize = out.w * out.h;

    out.cw = out.w / xcharsize;
    out.ch = out.h / ycharsize;

    if ((usagemap = (long *)SafeMalloc(destsize * 4, "")) == NULL)
        return(false);
    if ((outpixels = (long *)SafeMalloc(destsize * 4, "")) == NULL)
        return(false);
    if ((bmptemp = (void *)SafeMalloc(destsize * 4, "")) == NULL)
        return(false);
    if ((map = (byte *)SafeMalloc(destsize / (xcharsize * ycharsize), "")) == NULL)
        return(false);

    if (GetFileDimensions() == false)
        return(false);

    if (dosort)
        SortInNames();

    return(true);
}
示例#2
0
STDMETHODIMP CIMacroScriptImp :: GetScriptInfo (LPCSTR pcName, 
												DWORD *pdwInfo) 
{
	ASSERT(pcName);

CMacro *pM = NULL;		
CEnumMacroScripts *pEn = NULL;

HRESULT hr = m_pMacroScripts -> GetEnum (&pEn);
	if (FAILED(hr)) return hr; 		
		
// pMakro -> AddRef(), wenn aufindbar !!!
	hr = pEn -> FindByName (pcName, &pM);
	pEn -> Release();
	
	if (FAILED(hr) || S_FALSE == GetScode(hr)) 	return hr;

LPSTREAM pIStream = NULL;
	
	if(m_pIStream) {
		m_pIStream -> Release(); m_pIStream = NULL;
	}

CString str = pcName;
								// ADDREF()
	hr = OpenOrCreateStream(str, &m_pIStream);
	if(FAILED(hr)) {
		pM -> Release(); return hr;
	}

ebFILEHEADER Head;
	hr = pM -> GetIPersistStream() -> LoadHeader (m_pIStream, &Head);
	pM -> Release();			// kein Header
	if (FAILED(hr)) return hr; 

// Header, aber kein Code
	*pdwInfo = GetScriptInfo (&Head);

return hr;
} 
示例#3
0
int AssFile::GetScriptInfoAsInt(std::string const& key) const {
	return atoi(GetScriptInfo(key).c_str());
}