32 static char THIS_FILE[] = __FILE__;
64 : CDialog(
MaterialDialog::IDD, pParent), solid(0), material(0), doc(0)
127 if (!pDX->m_bSaveAndValidate) {
191 strcpy_s(material->name, mMaterialName);
192 strcpy_s(material->shader, mMaterialShader);
194 material->ambient_value = mAmbientValue;
195 material->diffuse_value = mDiffuseValue;
196 material->specular_value = mSpecularValue;
197 material->emissive_value = mEmissiveValue;
198 material->power = mPowerValue;
199 material->brilliance = mBrillianceValue;
200 material->bump = mBumpValue;
202 material->shadow = mShadowList.GetCurSel() ?
true :
false;
204 material->Ka =
ColorValue(material->ambient_color) * material->ambient_value;
205 material->Kd =
ColorValue(material->diffuse_color) * material->diffuse_value;
206 material->Ks =
ColorValue(material->specular_color) * material->specular_value;
207 material->Ke =
ColorValue(material->emissive_color) * material->emissive_value;
209 material->CreateThumbnail();
211 InvalidateRect(NULL, FALSE);
275 CColorDialog chooser(crgb);
277 if (chooser.DoModal() == IDOK) {
278 crgb = chooser.GetColor();
290 CColorDialog chooser(crgb);
292 if (chooser.DoModal() == IDOK) {
293 crgb = chooser.GetColor();
305 CColorDialog chooser(crgb);
307 if (chooser.DoModal() == IDOK) {
308 crgb = chooser.GetColor();
320 CColorDialog chooser(crgb);
322 if (chooser.DoModal() == IDOK) {
323 crgb = chooser.GetColor();
332 CWnd* wnd = GetDlgItem(nIDCtl);
351 ::FillRect(lpDrawItemStruct->hDC,
352 &lpDrawItemStruct->rcItem,
374 CFileDialog ofd(TRUE,
"pcx");
376 ofd.m_ofn.lpstrFilter =
"All Image Files\0*.bmp; *.dds; *.jpg; *.pcx; *.png; *.tga\0Bitmap Files (*.bmp)\0*.bmp\0JPEG Files (*.jpg)\0*.pcx\0PCX Files (*.pcx)\0*.pcx\0PNG Files (*.png)\0*.png\0Truevision Targa Files (*.tga)\0*.png\0All Files\0*.*\0\0";
377 ofd.m_ofn.lpstrFile = filename;
378 ofd.m_ofn.nMaxFile =
sizeof(filename);
380 if (ofd.DoModal() != IDOK)
384 sprintf_s(tex_name,
"%s", ofd.GetFileName().GetBuffer(0));
542 mtl = &emergency_material;
600 strcpy_s(mtl->
name,
"(new)");
635 for (
int i = 0; i < s->
NumPolys(); i++) {