Ejemplo n.º 1
0
void	CBlender_Compile::r_Pass		(LPCSTR _vs, LPCSTR _gs, LPCSTR _ps, bool bFog, BOOL bZtest, BOOL bZwrite,	BOOL bABlend, D3DBLEND abSRC, D3DBLEND abDST, BOOL aTest, u32 aRef)
{
	RS.Invalidate			();
	ctable.clear			();
	passTextures.clear		();
	passMatrices.clear		();
	passConstants.clear		();
	dwStage					= 0;

	// Setup FF-units (Z-buffer, blender)
	PassSET_ZB				(bZtest,bZwrite);
	PassSET_Blend			(bABlend,abSRC,abDST,aTest,aRef);
	PassSET_LightFog		(FALSE,bFog);

	// Create shaders
	SPS* ps					= DEV->_CreatePS			(_ps);
	SVS* vs					= DEV->_CreateVS			(_vs);
	SGS* gs					= DEV->_CreateGS			(_gs);
	dest.ps					= ps;
	dest.vs					= vs;
	dest.gs					= gs;
	ctable.merge			(&ps->constants);
	ctable.merge			(&vs->constants);
	ctable.merge			(&gs->constants);
	SetMapping				();

	// Last Stage - disable
	if (0==stricmp(_ps,"null"))	{
		RS.SetTSS				(0,D3DTSS_COLOROP,D3DTOP_DISABLE);
		RS.SetTSS				(0,D3DTSS_ALPHAOP,D3DTOP_DISABLE);
	}
}
Ejemplo n.º 2
0
void VSkyLayer::SerializeX( VArchive &ar )
{
  char iVersion = 0;
  if (ar.IsLoading())
  {
    ar >> iVersion; VVERIFY(iVersion==0 && "Invalid sky serialization version");

    // main properties
    char mapping;
    ar >> mapping;
    ar >> m_vMappingParams;
    ar >> m_vColor;
    ar >> m_vTextureTransform;
    ar >> m_vScrollSpeed;
    SetMapping((VIS_SKY_MappingType)mapping);

    // textures
    float fProgressStep = mapping==VIS_SKYMAPPING_CUBEMAP ? 100.f/6.f : 100.f;
    float fProgress = 0.f;
    VMemoryTempBuffer<FS_MAX_PATH> buffer;
    SAFE_LOAD_TEXTURE(m_spTexture, mapping==VIS_SKYMAPPING_SPHERICAL || mapping==VIS_SKYMAPPING_CYLINDRICAL);
    for (int i=0;i<6;i++)
      SAFE_LOAD_TEXTURE(m_spCubemapFace[i],mapping==VIS_SKYMAPPING_CUBEMAP);

  } else
Ejemplo n.º 3
0
VSkyLayer::VSkyLayer() 
  : m_vColor(1.f,1.f,1.f,1.f), m_vTextureTransform(1.f,1.f,0.f,0.f),
  m_pOwnerSky(NULL)
{
  SetMapping(VIS_SKYMAPPING_SPHERICAL);
  SetHeightScale(2.5f);
  SetHeightPos(0.f);
}
Ejemplo n.º 4
0
void CRygCtrl::OnPaint()
{
    CPaintDC dc(this);
    SetMapping(&dc);
    dc.SelectStockObject(DKGRAY_BRUSH);
    dc.RoundRect(RectRnd, Point);
    for (int i = 0; i < 3; i++)
        UpdateColor(&dc, i);
}
Ejemplo n.º 5
0
//	Reverts to the active settings at program startup
void
MouseSettings::Revert()
{
	SetClickSpeed(fOriginalSettings.click_speed);
	SetMouseSpeed(fOriginalSettings.accel.speed);
	SetMouseType(fOriginalSettings.type);
	SetAccelerationFactor(fOriginalSettings.accel.accel_factor);
	SetMouseMode(fOriginalMode);
	SetFocusFollowsMouseMode(fOriginalFocusFollowsMouseMode);
	SetAcceptFirstClick(fOriginalAcceptFirstClick);

	SetMapping(fOriginalSettings.map);
}
Ejemplo n.º 6
0
VSkyLayer &VSkyLayer::operator = (const VSkyLayer &other)
{
  m_vColor = other.m_vColor;
  m_vMappingParams = other.m_vMappingParams;
  m_vTextureTransform = other.m_vTextureTransform;
  m_vScrollSpeed = other.m_vScrollSpeed;
  m_spTexture = other.m_spTexture;
  for (int i=0;i<6;i++)
    m_spCubemapFace[i] = other.m_spCubemapFace[i];

  SetMapping(other.m_eMapping);

  return *this;
}
Ejemplo n.º 7
0
void EditorUI::ConvertToS3O()
{
	static int texW = 256;
	static int texH = 256;
	
	texW = atoi (fltk::input ("Enter texture width: ", SPrintf("%d", texW).c_str()));
	texH = atoi (fltk::input ("Enter texture height: ", SPrintf("%d", texH).c_str()));
	std::string name_ext = fltk::filename_name (filename.c_str());
	std::string name (name_ext.c_str(), fltk::filename_ext (name_ext.c_str()));
	if (model->ConvertToS3O(GetFilePath(filename) + "/" + name + "_tex.bmp", texW, texH)) {
		// Update the UI
		SetModelTexture (0, model->texBindings[0].texture.Get());
		SetMapping (MAPPING_S3O);
		BACKUP_POINT("Converted to S3O texturing");
	} else
		BackupManager::Get().ReloadLast ();
	Update();
}
Ejemplo n.º 8
0
void EditorUI::SetModel (Model *mdl)
{
	SAFE_DELETE(model);
	model = mdl;

	objectViewer->Update();
	viewsGroup->redraw ();
	mappingChooser->value (mdl->mapping);
	SetMapping (mdl->mapping);

	inputTexture1->value(0);
	inputTexture2->value(0);

	for (unsigned int a=0;a<mdl->texBindings.size();a++) 
		SetModelTexture (a, mdl->texBindings[a].texture.Get());

	Update ();
}
Ejemplo n.º 9
0
// Resets the settings to the system defaults
void
MouseSettings::Defaults()
{
	SetClickSpeed(kDefaultClickSpeed);
	SetMouseSpeed(kDefaultMouseSpeed);
	SetMouseType(kDefaultMouseType);
	SetAccelerationFactor(kDefaultAccelerationFactor);
	SetMouseMode(B_NORMAL_MOUSE);
	SetFocusFollowsMouseMode(B_NORMAL_FOCUS_FOLLOWS_MOUSE);
	SetAcceptFirstClick(kDefaultAcceptFirstClick);

	mouse_map map;
	if (get_mouse_map(&map) == B_OK) {
		map.button[0] = B_PRIMARY_MOUSE_BUTTON;
		map.button[1] = B_SECONDARY_MOUSE_BUTTON;
		map.button[2] = B_TERTIARY_MOUSE_BUTTON;
		SetMapping(map);
	}
}
Ejemplo n.º 10
0
void EditorUI::SetModel (Model *mdl)
{
    model = mdl;
    modelDrawer->SetModel (mdl);

    objectViewer->Update();
    viewsGroup->redraw ();
    mappingChooser->value (mdl->mapping);
    SetMapping (mdl->mapping);

    inputTexture1->value(0);
    inputTexture2->value(0);

    for (int a=0; a<2; a++) {
        if (mdl->textures[a])
            SetModelTexture (a, mdl->textures [a]);

        fltk::FileInput *input = a ? inputTexture2 : inputTexture1;
        input->value (mdl->textureNames [a].c_str());
    }

    Update ();
}
Ejemplo n.º 11
0
void	CBlender_Compile::PassEnd			()
{
	// Last Stage - disable
	RS.SetTSS				(Stage(),D3DTSS_COLOROP,D3DTOP_DISABLE);
	RS.SetTSS				(Stage(),D3DTSS_ALPHAOP,D3DTOP_DISABLE);

	SPass	proto;
	// Create pass
	proto.state		= DEV->_CreateState		(RS.GetContainer());
	proto.ps		= DEV->_CreatePS			(pass_ps);
	proto.vs		= DEV->_CreateVS			(pass_vs);
	ctable.merge	(&proto.ps->constants);
	ctable.merge	(&proto.vs->constants);
#if defined(USE_DX10) || defined(USE_DX11)
	proto.gs		= DEV->_CreateGS			(pass_gs);
	ctable.merge	(&proto.gs->constants);
#	ifdef	USE_DX11
	proto.hs		= DEV->_CreateHS			(pass_hs);
	ctable.merge	(&proto.hs->constants);
	proto.ds		= DEV->_CreateDS			(pass_ds);
	ctable.merge	(&proto.ds->constants);
	proto.cs		= DEV->_CreateCS			(pass_cs);
	ctable.merge	(&proto.cs->constants);
#	endif
#endif	//	USE_DX10
	SetMapping				();
	proto.constants	= DEV->_CreateConstantTable(ctable);
	proto.T 		= DEV->_CreateTextureList	(passTextures);
#ifdef _EDITOR
	proto.M			= DEV->_CreateMatrixList	(passMatrices);
#endif
	proto.C			= DEV->_CreateConstantList	(passConstants);

	ref_pass	_pass_		= DEV->_CreatePass			(proto);
	SH->passes.push_back	(_pass_);
}
Ejemplo n.º 12
0
	//-------------------------------------------------------------------------------------------------
	void VideoRamBank::Restore()
	{
		SetMapping(oldVRAMCRMappingValue);
	}
Ejemplo n.º 13
0
	//-------------------------------------------------------------------------------------------------
	void VideoRamBank::AssignToLCD()
	{
		oldVRAMCRMappingValue = *controlRegister;
		SetMapping(0);
	}