src/softbody2/FrameWork/DRGText.cpp
HRESULT CDRGText::ResizeAllStrings()
{
	DRGString	*pCurrString = pFirstString;

	float Hdifference = (float)pDRGWrapper->m_dwRenderWidth / (float)dwLastScreenHRes;
	float Vdifference = (float)pDRGWrapper->m_dwRenderHeight / (float)dwLastScreenVRes;


	while (pCurrString !=NULL) //while not null
	{
		for (int i = 0; i<pCurrString->iStringLen*6; i++)
		{
			//offset verts by change in resolution X current position
			pCurrString->pVerts[i].sx = (Hdifference * pCurrString->pVerts[i].sx);
			pCurrString->pVerts[i].sy = (Vdifference * pCurrString->pVerts[i].sy);
		}
		pCurrString = pCurrString->pNext;
	}

	dwLastScreenHRes = pDRGWrapper->m_dwRenderWidth;
	dwLastScreenVRes = pDRGWrapper->m_dwRenderHeight;
	
	return S_OK; //return the last DrawPrim result.	
}
/////////////////////////////////////////////////////////////////
// ResizeAllStrings() steps through the linked list of strings
// multiplyinging each vertex x and y positions by the change from
// the old resolution to the new one. For example, if going from 
// 800x600 to 1600x1200, it would multiply all positions by 2.
// It should be noted that the possibility exists for some error
// here if strings are resized many times. 
/////////////////////////////////////////////////////////////////
ResizeAllStrings() steps through the linked list of strings
multiplyinging each vertex x and y positions by the change from
the old resolution to the new one. For example, if going from
800x600 to 1600x1200, it would multiply all positions by 2.
It should be noted that the possibility exists for some error
here if strings are resized many times.
ResizeAllStrings () steps through the linked list of strings multiplyinging each vertex x and y positions by the change from the old resolution to the new one . For example if going from 800x600 to 1600x1200 it would multiply all positions by 2 . It should be noted that the possibility exists for some error here if strings are resized many times .
HRESULT CDRGText::ResizeAllStrings()
{
	DRGString	*pCurrString = pFirstString;
	float Hdifference = (float)pDRGWrapper->m_dwRenderWidth / (float)dwLastScreenHRes;
	float Vdifference = (float)pDRGWrapper->m_dwRenderHeight / (float)dwLastScreenVRes;
	while (pCurrString !=NULL) 
	{
		for (int i = 0; i<pCurrString->iStringLen*6; i++)
		{
			pCurrString->pVerts[i].sx = (Hdifference * pCurrString->pVerts[i].sx);
			pCurrString->pVerts[i].sy = (Vdifference * pCurrString->pVerts[i].sy);
		}
		pCurrString = pCurrString->pNext;
	}
	dwLastScreenHRes = pDRGWrapper->m_dwRenderWidth;
	dwLastScreenVRes = pDRGWrapper->m_dwRenderHeight;
	return S_OK; 
}
HRESULT CDRGText :: ResizeAllStrings ( ) { DRGString * pCurrString = pFirstString ; float Hdifference = ( float ) pDRGWrapper -> m_dwRenderWidth / ( float ) dwLastScreenHRes ; float Vdifference = ( float ) pDRGWrapper -> m_dwRenderHeight / ( float ) dwLastScreenVRes ; while ( pCurrString != NULL ) { for ( int i = 0 ; i < pCurrString -> iStringLen * 6 ; i ++ ) { pCurrString -> pVerts [ i ] . sx = ( Hdifference * pCurrString -> pVerts [ i ] . sx ) ; pCurrString -> pVerts [ i ] . sy = ( Vdifference * pCurrString -> pVerts [ i ] . sy ) ; } pCurrString = pCurrString -> pNext ; } dwLastScreenHRes = pDRGWrapper -> m_dwRenderWidth ; dwLastScreenVRes = pDRGWrapper -> m_dwRenderHeight ; return S_OK ; }
ResizeAllStrings() steps through the linked list of strings
multiplyinging each vertex x and y positions by the change from
the old resolution to the new one.
ResizeAllStrings () steps through the linked list of strings multiplyinging each vertex x and y positions by the change from the old resolution to the new one .
//while not null //offset verts by change in resolution X current position //return the last DrawPrim result.	