55#include <boost/filesystem/operations.hpp>
70 MMechostr(MSKDEBUG,
"SO3MaterialCreate\n");
73 int group = MMpull(m);
77 if ((s == NIL) || (name == NIL))
83 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
90 std::string groupResource(Ogre::RGN_DEFAULT);
92 groupResource = MMstartstr(m, MTOP(group));
94 if (groupResource.substr(0, 4) !=
"SO3/")
95 groupResource = scene->GetName() + groupResource;
97 std::string matName(MMstartstr(m, MTOP(name)));
99 SMaterial* material = 0;
102 material = scene->CreateMaterial(groupResource, matName);
105 Ogre::LogManager::getSingleton().logMessage(
"Can't Create Material! ", Ogre::LML_CRITICAL,
true);
112 Ogre::LogManager::getSingleton().logMessage(
"Can't Create Material! ", Ogre::LML_CRITICAL,
true);
135 MMechostr(MSKDEBUG,
"SO3MaterialDestroy\n");
138 int mt = MMget(m, 0);
161 MMechostr(MSKDEBUG,
"SO3MaterialGetName\n");
167 return MMpush(m, NIL);
170 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mt));
173 return MMpush(m, NIL);
176 return Mpushstrbloc(m, (
char*)material->GetName().c_str());
191 MMechostr(MSKDEBUG,
"SO3MaterialSetAmbient\n");
194 int color = MMpull(m);
195 int mat = MMget(m, 0);
202 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
214 material->SetAmbientColor(color);
216 MMset(m, 0, ITOM(1));
234 MMechostr(MSKDEBUG,
"SO3MaterialSetAmbientByTechAndPass\n");
237 int color = MMpull(m);
238 int pass = MMpull(m);
240 int mat = MMget(m, 0);
242 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
248 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
256 if (tec != NIL && tec >= 0)
257 tec = (
unsigned int)MTOI(tec);
261 if (pass != NIL && pass >= 0)
262 pass = (
unsigned int)MTOI(pass);
273 STechnique* matTechnique = material->GetTechnique(tec);
276 SPass* matPass = matTechnique->GetPass(pass);
279 matPass->SetAmbientColor(color);
280 MMset(m, 0, ITOM(1));
285 catch (Ogre::Exception)
287 MMechostr(MSKDEBUG,
"SO3MaterialSetAmbientByTechAndPass technique or pass error\n");
307 MMechostr(MSKDEBUG,
"SO3MaterialSetDiffuse\n");
310 int color = MMpull(m);
311 int mat = MMget(m, 0);
318 SMaterial * material = MMgetPointer<SMaterial*>(m, MTOP(mat));
331 material->SetDiffuseColor(color);
332 MMset(m, 0, ITOM(1));
350 MMechostr(MSKDEBUG,
"SO3MaterialSetDiffuseByTechAndPass\n");
353 int color = MMpull(m);
354 int pass = MMpull(m);
356 int mat = MMget(m, 0);
358 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
364 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
372 if (tec != NIL && tec >= 0)
373 tec = (
unsigned int)MTOI(tec);
377 if (pass != NIL && pass >= 0)
378 pass = (
unsigned int)MTOI(pass);
389 STechnique* matTechnique = material->GetTechnique(tec);
392 SPass* matPass = matTechnique->GetPass(pass);
395 matPass->SetDiffuseColor(color);
396 MMset(m, 0, ITOM(1));
401 catch (Ogre::Exception)
403 MMechostr(MSKDEBUG,
"SO3MaterialSetDiffuseByTechAndPass technique or pass error\n");
420 MMechostr(MSKDEBUG,
"SO3MaterialGetReceiveShadows\n");
423 int mat = MMget(m, 0);
430 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
439 if (material->GetReceiveShadows())
441 MMset(m, 0, ITOM(result));
458 MMechostr(MSKDEBUG,
"SO3MaterialSetSelfIllumination\n");
461 int color = MMpull(m);
462 int mat = MMget(m, 0);
469 SMaterial * material = MMgetPointer<SMaterial*>(m, MTOP(mat));
482 material->SetSelfIlluminationColor(color);
484 MMset(m, 0, ITOM(1));
503 MMechostr(MSKDEBUG,
"SO3MaterialSetSelfIlluminationByTechAndPass\n");
506 int color = MMpull(m);
507 int pass = MMpull(m);
509 int mat = MMget(m, 0);
510 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
516 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
524 if (tec != NIL && tec >= 0)
525 tec = (
unsigned int)MTOI(tec);
529 if (pass != NIL && pass >= 0)
530 pass = (
unsigned int)MTOI(pass);
541 STechnique* matTechnique = material->GetTechnique(tec);
544 SPass* matPass = matTechnique->GetPass(pass);
547 matPass->SetSelfIlluminationColor(color);
548 MMset(m, 0, ITOM(1));
553 catch (Ogre::Exception)
555 MMechostr(MSKDEBUG,
"SO3MaterialSetSelfIlluminationByTechAndPass technique or pass error\n");
573 MMechostr(MSKDEBUG,
"SO3MaterialSetSpecular\n");
576 int color = MMpull(m);
577 int mat = MMget(m, 0);
584 SMaterial * material = MMgetPointer<SMaterial*>(m, MTOP(mat));
597 material->SetSpecularColor(color);
599 MMset(m, 0, ITOM(1));
617 MMechostr(MSKDEBUG,
"SO3MaterialSetSpecularByTechAndPass\n");
620 int color = MMpull(m);
621 int pass = MMpull(m);
623 int mat = MMget(m, 0);
625 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
631 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
639 if (tec != NIL && tec >= 0)
640 tec = (
unsigned int)MTOI(tec);
644 if (pass != NIL && pass >= 0)
645 pass = (
unsigned int)MTOI(pass);
656 STechnique* matTechnique = material->GetTechnique(tec);
659 SPass* matPass = matTechnique->GetPass(pass);
662 matPass->SetSpecularColor(color);
663 MMset(m, 0, ITOM(1));
668 catch (Ogre::Exception)
670 MMechostr(MSKDEBUG,
"SO3MaterialSetSpecularByTechAndPass technique or pass error\n");
688 MMechostr(MSKDEBUG,
"SO3MaterialSetShininess\n");
691 int shin = MMpull(m);
692 int mat = MMget(m, 0);
693 if ((shin == NIL) || (mat == NIL))
699 SMaterial * material = MMgetPointer<SMaterial*>(m, MTOP(mat));
707 material->SetShininess(MTOF(shin));
709 MMset(m, 0, ITOM(1));
727 MMechostr(MSKDEBUG,
"SO3MaterialSetShininessByTechAndPass\n");
730 int shin = MMpull(m);
731 int pass = MMpull(m);
733 int mat = MMget(m, 0);
734 if ((shin == NIL) || (mat == NIL) || (tec == NIL) || (pass == NIL))
740 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
748 if (tec != NIL && tec >= 0)
749 tec = (
unsigned int)MTOI(tec);
753 if (pass != NIL && pass >= 0)
754 pass = (
unsigned int)MTOI(pass);
760 STechnique* matTechnique = material->GetTechnique(tec);
763 SPass* matPass = matTechnique->GetPass(pass);
766 matPass->SetShininess(MTOF(shin));
767 MMset(m, 0, ITOM(1));
772 catch (Ogre::Exception)
774 MMechostr(MSKDEBUG,
"SO3MaterialSetShininessByTechAndPass technique or pass error\n");
793 MMechostr(MSKDEBUG,
"SO3MaterialGetDiffuseByTechAndPass\n");
796 int pass = MMpull(m);
798 int mat = MMget(m, 0);
800 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
806 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
815 if (tec != NIL && tec >= 0)
816 tec = (
unsigned int)MTOI(tec);
820 if (pass != NIL && pass >= 0)
821 pass = (
unsigned int)MTOI(pass);
827 STechnique* matTechnique = material->GetTechnique(tec);
830 SPass* matPass = matTechnique->GetPass(pass);
833 MMset(m, 0, ITOM(matPass->GetDiffuseColor()));
838 catch (Ogre::Exception)
840 MMechostr(MSKDEBUG,
"SO3MaterialGetDiffuseByTechAndPass technique or pass error\n");
859 MMechostr(MSKDEBUG,
"SO3MaterialGetAmbientByTechAndPass\n");
862 int pass = MMpull(m);
864 int mat = MMget(m, 0);
866 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
872 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
881 if (tec != NIL && tec >= 0)
882 tec = (
unsigned int)MTOI(tec);
886 if (pass != NIL && pass >= 0)
887 pass = (
unsigned int)MTOI(pass);
893 STechnique* matTechnique = material->GetTechnique(tec);
896 SPass* matPass = matTechnique->GetPass(pass);
899 MMset(m, 0, ITOM(matPass->GetAmbientColor()));
904 catch (Ogre::Exception)
906 MMechostr(MSKDEBUG,
"SO3MaterialGetAmbientByTechAndPass technique or pass error\n");
925 MMechostr(MSKDEBUG,
"SO3MaterialGetSpecularByTechAndPass\n");
928 int pass = MMpull(m);
930 int mat = MMget(m, 0);
932 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
938 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
947 if (tec != NIL && tec >= 0)
948 tec = (
unsigned int)MTOI(tec);
952 if (pass != NIL && pass >= 0)
953 pass = (
unsigned int)MTOI(pass);
959 STechnique* matTechnique = material->GetTechnique(tec);
962 SPass* matPass = matTechnique->GetPass(pass);
965 MMset(m, 0, ITOM(matPass->GetSpecularColor()));
970 catch (Ogre::Exception)
972 MMechostr(MSKDEBUG,
"SO3MaterialGetSpecularByTechAndPass technique or pass error\n");
991 MMechostr(MSKDEBUG,
"SO3MaterialGetShininessByTechAndPass\n");
994 int pass = MMpull(m);
996 int mat = MMget(m, 0);
997 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
1003 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1006 MMechostr(MSKDEBUG,
"material==NULL\n");
1012 if (tec != NIL && tec >= 0)
1013 tec = (
unsigned int)MTOI(tec);
1017 if (pass != NIL && pass >= 0)
1018 pass = (
unsigned int)MTOI(pass);
1024 STechnique* matTechnique = material->GetTechnique(tec);
1027 SPass* matPass = matTechnique->GetPass(pass);
1030 MMset(m, 0, FTOM(matPass->GetShininess()));
1035 catch (Ogre::Exception)
1037 MMechostr(MSKDEBUG,
"SO3MaterialGetShininessByTechAndPass technique or pass error\n");
1056 MMechostr(MSKDEBUG,
"SO3MaterialGetSelfIlluminationByTechAndPass\n");
1059 int pass = MMpull(m);
1060 int tec = MMpull(m);
1061 int mat = MMget(m, 0);
1063 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
1069 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1072 MMechostr(MSKDEBUG,
"material==NULL\n");
1078 if (tec != NIL && tec >= 0)
1079 tec = (
unsigned int)MTOI(tec);
1083 if (pass != NIL && pass >= 0)
1084 pass = (
unsigned int)MTOI(pass);
1090 STechnique* matTechnique = material->GetTechnique(tec);
1093 SPass* matPass = matTechnique->GetPass(pass);
1096 MMset(m, 0, ITOM(matPass->GetSelfIlluminationColor()));
1101 catch (Ogre::Exception)
1103 MMechostr(MSKDEBUG,
"SO3MaterialGetSelfIlluminationByTechAndPass technique or pass error\n");
1121 MMechostr(MSKDEBUG,
"SO3MaterialIsLighting\n");
1124 int state = MMpull(m);
1125 int mat = MMget(m, 0);
1126 if ((mat == NIL) || (state == NIL))
1132 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1135 MMechostr(MSKDEBUG,
"material==NULL\n");
1140 state = MTOI(state);
1141 if (state == SO3_TRUE)
1142 material->SetLightingEnabled(
true);
1144 material->SetLightingEnabled(
false);
1146 MMset(m, 0, ITOM(1));
1161 MMechostr(MSKDEBUG,
"SO3MaterialNumberOfTechniques\n");
1164 int mat = MMget(m, 0);
1171 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1174 MMechostr(MSKDEBUG,
"material==NULL\n");
1181 int nb = material->GetNumTechniques();
1182 for (
int i = 0; i < nb; i++)
1184 if (material->GetTechnique(i))
1188 MMset(m, 0, ITOM(val));
1204 MMechostr(MSKDEBUG,
"SO3MaterialNumberOfPassesByTechnique\n");
1207 int tec = MMpull(m);
1208 int mat = MMget(m, 0);
1209 if ((mat == NIL) || (tec == NIL))
1215 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1218 MMechostr(MSKDEBUG,
"material==NULL\n");
1224 if (tec != NIL && tec >= 0)
1225 tec = (
unsigned int)MTOI(tec);
1231 STechnique* matTechnique = material->GetTechnique(tec);
1236 int nb = matTechnique->GetNumPasses();
1237 for (
int i = 0; i < nb; i++)
1239 if (matTechnique->GetPass(i))
1243 MMset(m, 0, ITOM(val));
1247 catch (Ogre::Exception)
1249 MMechostr(MSKDEBUG,
"SO3MaterialNumberOfPassesByTechnique technique or pass error\n");
1252 MMset(m, 0, ITOM(0));
1269 MMechostr(MSKDEBUG,
"SO3MaterialNumberOfTexturesByTechniqueAndPass\n");
1272 int pass = MMpull(m);
1273 int tec = MMpull(m);
1274 int mat = MMget(m, 0);
1275 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
1281 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1284 MMechostr(MSKDEBUG,
"SO3MaterialNumberOfTexturesByTechniqueAndPass material==NULL\n");
1290 if (tec != NIL && tec >= 0)
1291 tec = (
unsigned int)MTOI(tec);
1295 if (pass != NIL && pass >= 0)
1296 pass = (
unsigned int)MTOI(pass);
1302 STechnique* matTechnique = material->GetTechnique(tec);
1305 SPass* matPass = matTechnique->GetPass(pass);
1308 MMset(m, 0, ITOM(matPass->GetNumTextureUnitStates()));
1313 catch (Ogre::Exception)
1315 MMechostr(MSKDEBUG,
"SO3MaterialNumberOfTexturesByTechniqueAndPass technique or pass error\n");
1318 MMset(m, 0, ITOM(0));
1334 MMechostr(MSKDEBUG,
"SO3MaterialTechniqueGetNameByIndex\n");
1337 int tec = MMpull(m);
1338 int mat = MMpull(m);
1339 if ((mat == NIL) || (tec == NIL))
1345 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1348 MMechostr(MSKDEBUG,
"material==NULL\n");
1354 if (tec != NIL && tec >= 0)
1355 tec = (
unsigned int)MTOI(tec);
1361 STechnique* matTechnique = material->GetTechnique(tec);
1364 Mpushstrbloc(m, (
char*)(matTechnique->GetName().c_str()));
1368 catch (Ogre::Exception)
1370 MMechostr(MSKDEBUG,
"SO3MaterialTechniqueGetNameByIndex technique or pass error\n");
1389 MMechostr(MSKDEBUG,
"SO3MaterialTechniqueGetIndexByName\n");
1392 int nam = MMpull(m);
1393 int mat = MMget(m, 0);
1394 if ((mat == NIL) || (nam == NIL))
1400 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1403 MMechostr(MSKDEBUG,
"material==NULL\n");
1408 if (!material->getOgreMaterialPointer())
1410 MMechostr(MSKDEBUG,
"Ogre Material is NULL\n");
1415 std::string name = MMstartstr(m, MTOP(nam));
1416 int index = material->GetTechniqueIndexByName(name);
1418 MMset(m, 0, ITOM(index));
1435 MMechostr(MSKDEBUG,
"SO3MaterialPassGetNameByIndex\n");
1438 int pass = MMpull(m);
1439 int tec = MMpull(m);
1440 int mat = MMpull(m);
1441 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
1447 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1450 MMechostr(MSKDEBUG,
"material==NULL\n");
1456 if (tec != NIL && tec >= 0)
1457 tec = (
unsigned int)MTOI(tec);
1461 if (pass != NIL && pass >= 0)
1462 pass = (
unsigned int)MTOI(pass);
1468 STechnique* matTechnique = material->GetTechnique(tec);
1471 SPass* matPass = matTechnique->GetPass(pass);
1474 Mpushstrbloc(m, (
char*)(matPass->GetName().c_str()));
1479 catch (Ogre::Exception)
1481 MMechostr(MSKDEBUG,
"SO3MaterialPassGetNameByIndex technique or pass error\n");
1501 MMechostr(MSKDEBUG,
"SO3MaterialPassGetIndexByName\n");
1504 int nam = MMpull(m);
1505 int tec = MMpull(m);
1506 int mat = MMget(m, 0);
1507 if ((mat == NIL) || (nam == NIL) || (tec == NIL))
1513 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1516 MMechostr(MSKDEBUG,
"material==NULL\n");
1521 if (!material->getOgreMaterialPointer())
1523 MMechostr(MSKDEBUG,
"Ogre Material is NULL\n");
1529 if (tec != NIL && tec >= 0)
1530 tec = (
unsigned int)MTOI(tec);
1534 std::string name = MMstartstr(m, MTOP(nam));
1538 STechnique* matTechnique = material->GetTechnique(tec);
1541 int index = matTechnique->GetPassIndexByName(name);
1542 MMset(m, 0, ITOM(index));
1546 catch (Ogre::Exception)
1548 MMechostr(MSKDEBUG,
"SO3MaterialPassGetIndexByName technique error\n");
1569 MMechostr(MSKDEBUG,
"SO3MaterialTextureUnitGetNameByIndex\n");
1572 int index = MMpull(m);
1573 int pass = MMpull(m);
1574 int tec = MMpull(m);
1575 int mat = MMpull(m);
1576 if ((mat == NIL) || (tec == NIL) || (pass == NIL) || (index == NIL))
1582 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1585 MMechostr(MSKDEBUG,
"material==NULL\n");
1591 if (tec != NIL && tec >= 0)
1592 tec = (
unsigned int)MTOI(tec);
1596 if (pass != NIL && pass >= 0)
1597 pass = (
unsigned int)MTOI(pass);
1601 if (index != NIL && index >= 0)
1602 index = (
unsigned int)MTOI(index);
1608 STechnique* matTechnique = material->GetTechnique(tec);
1611 SPass* matPass = matTechnique->GetPass(pass);
1614 std::string txName = matPass->GetTextureUnitName(index);
1615 Mpushstrbloc(m, (
char*)(txName.c_str()));
1620 catch (Ogre::Exception)
1622 MMechostr(MSKDEBUG,
"SO3MaterialTextureUnitGetNameByIndex technique or pass error\n");
1643 MMechostr(MSKDEBUG,
"SO3MaterialTextureUnitGetIndexByName\n");
1646 int nam = MMpull(m);
1647 int pass = MMpull(m);
1648 int tec = MMpull(m);
1649 int mat = MMget(m, 0);
1650 if ((mat == NIL) || (tec == NIL) || (pass == NIL) || (nam == NIL))
1656 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1659 MMechostr(MSKDEBUG,
"material==NULL\n");
1664 if (!material->getOgreMaterialPointer())
1666 MMechostr(MSKDEBUG,
"Ogre Material is NULL\n");
1672 if (tec != NIL && tec >= 0)
1673 tec = (
unsigned int)MTOI(tec);
1677 if (pass != NIL && pass >= 0)
1678 pass = (
unsigned int)MTOI(pass);
1682 std::string name = MMstartstr(m, MTOP(nam));
1685 STechnique* matTechnique = material->GetTechnique(tec);
1688 SPass* matPass = matTechnique->GetPass(pass);
1691 int index = matPass->GetTextureUnitIndexByName(name);
1692 MMset(m, 0, ITOM(index));
1697 catch (Ogre::Exception)
1699 MMechostr(MSKDEBUG,
"SO3MaterialTextureUnitGetIndexByName technique or pass error\n");
1718 MMechostr(MSKDEBUG,
"SO3MaterialSetReceiveShadows\n");
1721 int state = MMpull(m);
1722 int mat = MMget(m, 0);
1723 if ((mat == NIL) || (state == NIL))
1729 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1732 MMechostr(MSKDEBUG,
"material==NULL\n");
1737 state = MTOI(state);
1739 if (state == SO3_TRUE)
1740 material->SetReceiveShadows(
true);
1742 material->SetReceiveShadows(
false);
1744 MMset(m, 0, ITOM(1));
1763 MMechostr(MSKDEBUG,
"SO3MaterialSetTexture\n");
1766 int index = MMpull(m);
1767 int pass = MMpull(m);
1768 int tec = MMpull(m);
1769 int mtx = MMpull(m);
1770 int mat = MMget(m, 0);
1771 if ((mat == NIL) || (tec == NIL) || (pass == NIL))
1777 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1780 MMechostr(MSKDEBUG,
"material==NULL\n");
1785 STexture* texture = 0;
1788 texture = MMgetPointer<STexture*>(m, MTOP(mtx));
1798 if (tec != NIL && tec >= 0)
1799 tec = (
unsigned int)MTOI(tec);
1803 if (pass != NIL && pass >= 0)
1804 pass = (
unsigned int)MTOI(pass);
1808 if (index != NIL && index >= 0)
1809 index = (
unsigned int)MTOI(index);
1815 STechnique* matTechnique = material->GetTechnique(tec);
1818 SPass* matPass = matTechnique->GetPass(pass);
1821 matPass->SetTexture(index, texture);
1822 MMset(m, 0, ITOM(1));
1827 catch (Ogre::Exception)
1829 MMechostr(MSKDEBUG,
"SO3MaterialSetTexture technique or pass error\n");
1850 MMechostr(MSKDEBUG,
"SO3MaterialGetTexture\n");
1853 int index = MMpull(m);
1854 int pass = MMpull(m);
1855 int tec = MMpull(m);
1856 int mat = MMget(m, 0);
1857 if ((mat == NIL) || (tec == NIL) || (pass == NIL) || (index == NIL))
1863 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1866 MMechostr(MSKDEBUG,
"material==NULL\n");
1875 if (tec != NIL && MTOI(tec) >= 0)
1876 tec = (
unsigned int)MTOI(tec);
1880 if (pass != NIL && MTOI(pass) >= 0)
1881 pass = (
unsigned int)MTOI(pass);
1885 if (index != NIL && MTOI(index) >= 0)
1886 index = (
unsigned int)MTOI(index);
1890 SScene* scene = material->GetScene();
1894 STexture* texture = 0;
1895 STechnique* matTechnique = material->GetTechnique(tec);
1898 SPass* matPass = matTechnique->GetPass(pass);
1900 texture = matPass->GetTexture(index);
1905 int tx = OBJfindTH(m,
SO3TEXTURE, SCOL_PTR(texture));
1908 tx = MMfetch(m, tx, OFFOBJMAG);
1919 catch (Ogre::Exception)
1921 MMechostr(MSKDEBUG,
"SO3MaterialGetTexture technique or pass error\n");
1943 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureByType\n");
1946 int itype = MMpull(m);
1947 int pass = MMpull(m);
1948 int tec = MMpull(m);
1949 int mtx = MMpull(m);
1950 int mat = MMget(m, 0);
1951 if ((mat == NIL) || (tec == NIL) || (pass == NIL) || (itype == NIL))
1957 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1960 MMechostr(MSKDEBUG,
"material==NULL\n");
1965 STexture* texture = 0;
1968 texture = MMgetPointer<STexture*>(m, MTOP(mtx));
1978 if (tec != NIL && tec >= 0)
1979 tec = (
unsigned int)MTOI(tec);
1983 if (pass != NIL && pass >= 0)
1984 pass = (
unsigned int)MTOI(pass);
1988 SShaderGenerator::ShaderMapType type = (SShaderGenerator::ShaderMapType)MTOI(itype);
1991 STechnique* matTechnique = material->GetTechnique(tec);
1994 SPass* matPass = matTechnique->GetPass(pass);
1997 matPass->SetTextureByType(texture, type);
1998 MMset(m, 0, ITOM(1));
2003 catch (Ogre::Exception)
2005 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureByType technique or pass error\n");
2026 MMechostr(MSKDEBUG,
"SO3MaterialRemoveTexture\n");
2029 int index = MMpull(m);
2030 int pass = MMpull(m);
2031 int tec = MMpull(m);
2032 int mat = MMget(m, 0);
2033 if ((mat == NIL) || (tec == NIL) || (pass == NIL) || (index == NIL))
2039 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2042 MMechostr(MSKDEBUG,
"material==NULL\n");
2051 if (tec != NIL && MTOI(tec) >= 0)
2052 tec = (
unsigned int)MTOI(tec);
2056 if (pass != NIL && MTOI(pass) >= 0)
2057 pass = (
unsigned int)MTOI(pass);
2061 if (index != NIL && MTOI(index) >= 0)
2062 index = (
unsigned int)MTOI(index);
2068 STechnique* matTechnique = material->GetTechnique(tec);
2071 SPass* matPass = matTechnique->GetPass(pass);
2074 matPass->RemoveTexture(index);
2080 catch (Ogre::Exception)
2082 MMechostr(MSKDEBUG,
"SO3MaterialRemoveTexture technique or pass error\n");
2103 MMechostr(MSKDEBUG,
"SO3MaterialTextureUnitGetIndexByType\n");
2106 int itype = MMpull(m);
2107 int pass = MMpull(m);
2108 int tec = MMpull(m);
2109 int mat = MMget(m, 0);
2110 if ((mat == NIL) || (tec == NIL) || (pass == NIL) || (itype == NIL))
2116 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2119 MMechostr(MSKDEBUG,
"material==NULL\n");
2128 if (tec != NIL && MTOI(tec) >= 0)
2129 tec = (
unsigned int)MTOI(tec);
2133 if (pass != NIL && MTOI(pass) >= 0)
2134 pass = (
unsigned int)MTOI(pass);
2138 SShaderGenerator::ShaderMapType type = (SShaderGenerator::ShaderMapType)MTOI(itype);
2139 SScene* scene = material->GetScene();
2143 STechnique* matTechnique = material->GetTechnique(tec);
2146 SPass* matPass = matTechnique->GetPass(pass);
2149 int tindex = matPass->GetTextureUnitByType(type);
2152 MMpush(m, ITOM(tindex));
2158 catch (Ogre::Exception)
2160 MMechostr(MSKDEBUG,
"SO3MaterialTextureUnitGetIndexByType technique or pass error\n");
2180 MMechostr(MSKDEBUG,
"SO3GetSceneTexture\n");
2183 int name = MMpull(m);
2184 int group = MMpull(m);
2186 int s = MMget(m, 0);
2187 if ((s == NIL) || (name == NIL))
2193 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2200 std::string tmpTextureName = MMstartstr(m, MTOP(name));
2202 std::string groupResource(Ogre::RGN_DEFAULT);
2204 groupResource = MMstartstr(m, MTOP(group));
2206 if (groupResource.substr(0, 4) !=
"SO3/")
2207 groupResource = scene->GetName() + groupResource;
2212 STexture* texture = scene->GetTexture(groupResource, tmpTextureName);
2215 int tx = OBJfindTH(m,
SO3TEXTURE, SCOL_PTR(texture));
2218 tx = MMfetch(m, tx, OFFOBJMAG);
2249 MMechostr(MSKDEBUG,
"SO3TextureCreate\n");
2252 int h = MTOI(MMpull(m));
2253 int w = MTOI(MMpull(m));
2254 int group = MMpull(m);
2255 int file = MMpull(m);
2256 int name = MMpull(m);
2257 int s = MMget(m, 0);
2258 if ((s == NIL) || (name == NIL))
2264 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2271 std::string tmpTextureName = MMstartstr(m, MTOP(name));
2273 std::string groupResource(Ogre::RGN_DEFAULT);
2275 groupResource = MMstartstr(m, MTOP(group));
2277 if (groupResource.substr(0, 4) !=
"SO3/")
2278 groupResource = scene->GetName() + groupResource;
2283 boost::filesystem::path filePath;
2286 filePath = MMstartstr(m, MTOP(file));
2288 Mpushstrbloc(m, filePath.generic_string().c_str());
2289 if ((MMpush(m, Msearchinsyspak(m,
"_PtoScol"))) < 0)
2291 MMechostr(0,
"\nSO3TextureCreate : error interpreting _PtoScol");
2298 int ipscol = MMpull(m);
2304 if (!Ogre::ResourceGroupManager::getSingleton().resourceExists(groupResource, filePath.generic_string()))
2305 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(filePath.generic_string(),
"ScolFileSystem", groupResource);
2314 filePath = MMstartstr(m, MTOP(ipscol));
2318 STexture* texture = 0;
2320 if (filePath.empty() && ((
w <= 0) || (h <= 0)))
2323 MMechostr(MSKRUNTIME,
"SO3TextureCreate : Texture creation failed ! bad texture size\n");
2329 texture = scene->CreateTexture(groupResource, tmpTextureName, filePath.generic_string(),
w, h);
2330 if (texture == 0 || !texture->getOgreTexturePointer())
2332 scene->DeleteTexture(texture);
2334 MMechostr(MSKRUNTIME,
"SO3TextureCreate : Texture creation failed ! > %s", tmpTextureName.c_str());
2341 MMechostr(MSKRUNTIME,
"SO3TextureCreate : Texture creation failed ! > %s", tmpTextureName.c_str());
2359 MMechostr(MSKDEBUG,
"SO3TextureDestroy\n");
2362 int tx = MMget(m, 0);
2384 MMechostr(MSKDEBUG,
"SO3TextureGetName\n");
2394 STexture* texture = MMgetPointer<STexture*>(m, MTOP(tx));
2395 if (texture == NULL)
2401 return Mpushstrbloc(m, (
char*)texture->GetName().c_str());
2415 MMechostr(MSKDEBUG,
"SO3TextureManagerGetMemoryUsage\n");
2418 int s = MMget(m, 0);
2425 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2432 size_t count = scene->O3TextureManager->getMemoryUsage();
2433 MMset(m, 0, ITOM(count));
2449 MMechostr(MSKDEBUG,
"SO3TextureBlit\n");
2452 int bitm = MMpull(m);
2453 int tx = MMget(m, 0);
2467 STexture* texture = MMgetPointer<STexture*>(m, MTOP(tx));
2479 OB = (PtrObjVoid)MMstart(m, MTOP(bitm));
2480 if (OB->Type != OBJ_TYPE_BITMAP << 1 || OB->Buffer == 0)
2485 B = (PtrObjBitmap)MMstart(m, MTOP(OB->Buffer));
2493 texture->BlitTexture(B);
2495 MMset(m, 0, ITOM(1));
2511 MMechostr(MSKDEBUG,
"SO3TextureBlitAlpha\n");
2514 int alphaBitmap = MMpull(m);
2515 int tx = MMget(m, 0);
2523 if ((alphaBitmap == NIL))
2525 MMechostr(MSKDEBUG,
"alphaBitmap==NIL\n");
2530 STexture* texture = MMgetPointer<STexture*>(m, MTOP(tx));
2539 int colorLayer = MMfetch(m, MTOP(alphaBitmap), 0);
2540 int alphaLayer = MMfetch(m, MTOP(alphaBitmap), 1);
2543 PtrObjBitmap Bcolor;
2544 OBcolor = (PtrObjVoid)MMstart(m, MTOP(colorLayer));
2545 if (OBcolor->Type != OBJ_TYPE_BITMAP << 1 || OBcolor->Buffer == 0)
2550 Bcolor = (PtrObjBitmap)MMstart(m, MTOP(OBcolor->Buffer));
2552 if (Bcolor->bits == 0)
2559 PtrObjBitmap Balpha;
2560 OBalpha = (PtrObjVoid)MMstart(m, MTOP(alphaLayer));
2561 if (OBalpha->Type != OBJ_TYPE_BITMAP << 1 || OBalpha->Buffer == 0)
2566 Balpha = (PtrObjBitmap)MMstart(m, MTOP(OBalpha->Buffer));
2568 if (Balpha->bits == 0)
2574 texture->BlitAlphaTexture(Bcolor, Balpha);
2576 MMset(m, 0, ITOM(1));
2595 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureUScroll\n");
2598 int scrollValue = MMpull(m);
2599 int textureUnit = MMpull(m);
2600 int pass = MMpull(m);
2601 int technique = MMpull(m);
2602 int mat = MMget(m, 0);
2605 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL) || (scrollValue == NIL))
2612 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2620 technique = MTOI(technique);
2622 textureUnit = MTOI(textureUnit);
2623 float value = MTOF(scrollValue);
2627 STechnique* matTechnique = material->GetTechnique(technique);
2630 SPass* matPass = matTechnique->GetPass(pass);
2633 matPass->SetTextureUScroll(textureUnit, value);
2634 MMset(m, 0, ITOM(1));
2639 catch (Ogre::Exception& e)
2641 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
2662 MMechostr(MSKDEBUG,
"SO3MaterialGetTextureUScroll\n");
2665 int textureUnit = MMpull(m);
2666 int pass = MMpull(m);
2667 int technique = MMpull(m);
2668 int mat = MMget(m, 0);
2671 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL))
2678 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2686 technique = MTOI(technique);
2688 textureUnit = MTOI(textureUnit);
2692 STechnique* matTechnique = material->GetTechnique(technique);
2695 SPass* matPass = matTechnique->GetPass(pass);
2698 float value = matPass->GetTextureUScroll(textureUnit);
2699 MMset(m, 0, FTOM(value));
2704 catch (Ogre::Exception& e)
2706 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
2727 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureVScroll\n");
2730 int scrollValue = MMpull(m);
2731 int textureUnit = MMpull(m);
2732 int pass = MMpull(m);
2733 int technique = MMpull(m);
2734 int mat = MMget(m, 0);
2737 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL) || (scrollValue == NIL))
2744 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2752 technique = MTOI(technique);
2754 textureUnit = MTOI(textureUnit);
2755 float value = MTOF(scrollValue);
2759 STechnique* matTechnique = material->GetTechnique(technique);
2762 SPass* matPass = matTechnique->GetPass(pass);
2765 matPass->SetTextureVScroll(textureUnit, value);
2766 MMset(m, 0, ITOM(1));
2771 catch (Ogre::Exception& e)
2773 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
2794 MMechostr(MSKDEBUG,
"SO3MaterialGetTextureVScroll\n");
2797 int textureUnit = MMpull(m);
2798 int pass = MMpull(m);
2799 int technique = MMpull(m);
2800 int mat = MMget(m, 0);
2803 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL))
2810 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2818 technique = MTOI(technique);
2820 textureUnit = MTOI(textureUnit);
2824 STechnique* matTechnique = material->GetTechnique(technique);
2827 SPass* matPass = matTechnique->GetPass(pass);
2830 float value = matPass->GetTextureVScroll(textureUnit);
2831 MMset(m, 0, FTOM(value));
2836 catch (Ogre::Exception& e)
2838 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
2859 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureUScale\n");
2862 int scaleValue = MMpull(m);
2863 int textureUnit = MMpull(m);
2864 int pass = MMpull(m);
2865 int technique = MMpull(m);
2866 int mat = MMget(m, 0);
2869 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL) || (scaleValue == NIL))
2876 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2884 technique = MTOI(technique);
2886 textureUnit = MTOI(textureUnit);
2887 float value = MTOF(scaleValue);
2891 STechnique* matTechnique = material->GetTechnique(technique);
2894 SPass* matPass = matTechnique->GetPass(pass);
2897 matPass->SetTextureUScale(textureUnit, value);
2898 MMset(m, 0, ITOM(1));
2903 catch (Ogre::Exception& e)
2905 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
2926 MMechostr(MSKDEBUG,
"SO3MaterialGetTextureUScale\n");
2929 int textureUnit = MMpull(m);
2930 int pass = MMpull(m);
2931 int technique = MMpull(m);
2932 int mat = MMget(m, 0);
2935 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL))
2942 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2950 technique = MTOI(technique);
2952 textureUnit = MTOI(textureUnit);
2956 STechnique* matTechnique = material->GetTechnique(technique);
2959 SPass* matPass = matTechnique->GetPass(pass);
2962 float value = matPass->GetTextureUScale(textureUnit);
2963 MMset(m, 0, FTOM(value));
2968 catch (Ogre::Exception& e)
2970 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
2991 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureVScale\n");
2994 int scaleValue = MMpull(m);
2995 int textureUnit = MMpull(m);
2996 int pass = MMpull(m);
2997 int technique = MMpull(m);
2998 int mat = MMget(m, 0);
3001 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL) || (scaleValue == NIL))
3008 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3016 technique = MTOI(technique);
3018 textureUnit = MTOI(textureUnit);
3019 float value = MTOF(scaleValue);
3023 STechnique* matTechnique = material->GetTechnique(technique);
3026 SPass* matPass = matTechnique->GetPass(pass);
3029 matPass->SetTextureVScale(textureUnit, value);
3030 MMset(m, 0, ITOM(1));
3035 catch (Ogre::Exception& e)
3037 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3058 MMechostr(MSKDEBUG,
"SO3MaterialGetTextureVScale\n");
3061 int textureUnit = MMpull(m);
3062 int pass = MMpull(m);
3063 int technique = MMpull(m);
3064 int mat = MMget(m, 0);
3067 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL))
3074 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3082 technique = MTOI(technique);
3084 textureUnit = MTOI(textureUnit);
3088 STechnique* matTechnique = material->GetTechnique(technique);
3091 SPass* matPass = matTechnique->GetPass(pass);
3094 float value = matPass->GetTextureVScale(textureUnit);
3095 MMset(m, 0, FTOM(value));
3100 catch (Ogre::Exception& e)
3102 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3123 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureRotate\n");
3126 int rotationAngle = MMpull(m);
3127 int textureUnit = MMpull(m);
3128 int pass = MMpull(m);
3129 int technique = MMpull(m);
3130 int mat = MMget(m, 0);
3133 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL) || (rotationAngle == NIL))
3140 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3148 technique = MTOI(technique);
3150 textureUnit = MTOI(textureUnit);
3151 float angle = MTOF(rotationAngle);
3155 STechnique* matTechnique = material->GetTechnique(technique);
3158 SPass* matPass = matTechnique->GetPass(pass);
3161 matPass->SetTextureRotate(textureUnit, angle);
3162 MMset(m, 0, ITOM(1));
3167 catch (Ogre::Exception& e)
3169 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3189 MMechostr(MSKDEBUG,
"SO3MaterialGetTextureRotate\n");
3192 int textureUnit = MMpull(m);
3193 int pass = MMpull(m);
3194 int technique = MMpull(m);
3195 int mat = MMget(m, 0);
3198 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL))
3205 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3213 technique = MTOI(technique);
3215 textureUnit = MTOI(textureUnit);
3219 STechnique* matTechnique = material->GetTechnique(technique);
3222 SPass* matPass = matTechnique->GetPass(pass);
3225 float value = matPass->GetTextureRotate(textureUnit);
3226 MMset(m, 0, FTOM(value));
3231 catch (Ogre::Exception& e)
3233 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3254 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureBlendFactor\n");
3257 int ifactor = MMpull(m);
3258 int textureUnit = MMpull(m);
3259 int pass = MMpull(m);
3260 int technique = MMpull(m);
3261 int mat = MMget(m, 0);
3264 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL))
3271 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3279 technique = MTOI(technique);
3281 textureUnit = MTOI(textureUnit);
3283 float factor = 1.0f;
3285 factor = std::min(MTOF(ifactor), 1.0f);
3289 STechnique* matTechnique = material->GetTechnique(technique);
3292 SPass* matPass = matTechnique->GetPass(pass);
3295 matPass->SetTextureUnitColorBlendModeFactor(textureUnit, factor);
3296 MMset(m, 0, ITOM(1));
3301 catch (Ogre::Exception& e)
3303 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3323 MMechostr(MSKDEBUG,
"SO3MaterialGetTextureBlendFactor\n");
3326 int textureUnit = MMpull(m);
3327 int pass = MMpull(m);
3328 int technique = MMpull(m);
3329 int mat = MMget(m, 0);
3332 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL))
3339 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3347 technique = MTOI(technique);
3349 textureUnit = MTOI(textureUnit);
3353 STechnique* matTechnique = material->GetTechnique(technique);
3356 SPass* matPass = matTechnique->GetPass(pass);
3359 MMset(m, 0, FTOM(matPass->GetTextureUnitColorBlendModeFactor(textureUnit)));
3364 catch (Ogre::Exception& e)
3366 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3388 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureRotateAnimation\n");
3391 int rotationSpeed = MMpull(m);
3392 int textureUnit = MMpull(m);
3393 int pass = MMpull(m);
3394 int technique = MMpull(m);
3395 int mat = MMget(m, 0);
3398 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL) || (rotationSpeed == NIL))
3405 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3413 technique = MTOI(technique);
3415 textureUnit = MTOI(textureUnit);
3416 float speed = MTOF(rotationSpeed);
3420 STechnique* matTechnique = material->GetTechnique(technique);
3423 SPass* matPass = matTechnique->GetPass(pass);
3426 matPass->SetTextureRotateAnimation(textureUnit, speed);
3427 MMset(m, 0, ITOM(1));
3432 catch (Ogre::Exception& e)
3434 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3456 MMechostr(MSKDEBUG,
"SO3MaterialSetTextureScrollAnimation\n");
3459 int speedVertical = MMpull(m);
3460 int speedHorizontal = MMpull(m);
3461 int textureUnit = MMpull(m);
3462 int pass = MMpull(m);
3463 int technique = MMpull(m);
3464 int mat = MMget(m, 0);
3467 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (textureUnit == NIL) || (speedHorizontal == NIL) || (speedVertical == NIL))
3474 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3482 technique = MTOI(technique);
3484 textureUnit = MTOI(textureUnit);
3485 float valueH = MTOF(speedHorizontal);
3486 float valueV = MTOF(speedVertical);
3490 STechnique* matTechnique = material->GetTechnique(technique);
3493 SPass* matPass = matTechnique->GetPass(pass);
3496 matPass->SetTextureScrollAnimation(textureUnit, valueH, valueV);
3497 MMset(m, 0, ITOM(1));
3502 catch (Ogre::Exception& e)
3504 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3523 MMechostr(MSKDEBUG,
"SO3MaterialGetPassVertexProgramParameters\n");
3526 int pass = MMpull(m);
3527 int technique = MMpull(m);
3528 int mat = MMpull(m);
3531 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
3538 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3546 technique = MTOI(technique);
3551 STechnique* matTechnique = material->GetTechnique(technique);
3554 SPass* matPass = matTechnique->GetPass(pass);
3559 const Ogre::GpuConstantDefinitionMap& programParameters = matPass->GetVertexProgramParameters().map;
3560 Ogre::GpuConstantDefinitionMap::const_iterator iProgramParameters = programParameters.begin();
3561 while (iProgramParameters != programParameters.end())
3563 if (k = Mpushstrbloc(m, (
char*)(iProgramParameters->first).c_str()))
3566 if (k = MMpush(m, ITOM(
static_cast<int>(iProgramParameters->second.constType))))
3569 if (MMpush(m, ITOM(2)))
3571 if (k = MBdeftab(m))
3574 iProgramParameters++;
3580 iProgramParameters = programParameters.begin();
3581 while (iProgramParameters != programParameters.end())
3583 if (MMpush(m, ITOM(2)))
3585 if (k = MBdeftab(m))
3588 iProgramParameters++;
3594 catch (Ogre::Exception& e)
3596 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3609 MMechostr(MSKDEBUG,
"SO3MaterialSetPassVertexProgramAutoParameter\n");
3612 int scolParamOption = MMpull(m);
3613 int scolParamType = MMpull(m);
3614 int scolParamName = MMpull(m);
3615 int pass = MMpull(m);
3616 int technique = MMpull(m);
3617 int mat = MMget(m, 0);
3620 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (scolParamName == NIL) || (scolParamType == NIL))
3627 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3635 technique = MTOI(technique);
3640 STechnique* matTechnique = material->GetTechnique(technique);
3643 SPass* matPass = matTechnique->GetPass(pass);
3646 int paramOption = 0;
3647 if (scolParamOption != NIL)
3648 paramOption = MTOI(scolParamOption);
3650 std::string paramName = MMstartstr(m, MTOP(scolParamName));
3651 Ogre::GpuProgramParameters::AutoConstantType paramType =
static_cast<Ogre::GpuProgramParameters::AutoConstantType
>(MTOI(scolParamType));
3652 matPass->SetVertexProgramAutoParameter(paramName, paramType, paramOption);
3656 catch (Ogre::Exception& e)
3658 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3671 MMechostr(MSKDEBUG,
"SO3MaterialSetPassVertexProgramParameter\n");
3674 int scolParamValue = MMpull(m);
3675 int scolParamName = MMpull(m);
3676 int pass = MMpull(m);
3677 int technique = MMpull(m);
3678 int mat = MMget(m, 0);
3681 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (scolParamName == NIL) || (scolParamValue == NIL))
3688 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3696 technique = MTOI(technique);
3701 STechnique* matTechnique = material->GetTechnique(technique);
3704 SPass* matPass = matTechnique->GetPass(pass);
3707 std::string paramName = MMstartstr(m, MTOP(scolParamName));
3708 std::string paramValue = MMstartstr(m, MTOP(scolParamValue));
3709 matPass->SetVertexProgramParameter(paramName, paramValue);
3713 catch (Ogre::Exception& e)
3715 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3734 MMechostr(MSKDEBUG,
"SO3MaterialGetPassFragmentProgramParameters\n");
3737 int pass = MMpull(m);
3738 int technique = MMpull(m);
3739 int mat = MMpull(m);
3742 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
3749 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3757 technique = MTOI(technique);
3762 STechnique* matTechnique = material->GetTechnique(technique);
3765 SPass* matPass = matTechnique->GetPass(pass);
3770 const Ogre::GpuConstantDefinitionMap& programParameters = matPass->GetFragmentProgramParameters().map;
3771 Ogre::GpuConstantDefinitionMap::const_iterator iProgramParameters = programParameters.begin();
3772 while (iProgramParameters != programParameters.end())
3774 if (k = Mpushstrbloc(m, (
char*)(iProgramParameters->first).c_str()))
3777 if (k = MMpush(m, ITOM(
static_cast<int>(iProgramParameters->second.constType))))
3780 if (MMpush(m, ITOM(2)))
3782 if (k = MBdeftab(m))
3785 iProgramParameters++;
3791 iProgramParameters = programParameters.begin();
3792 while (iProgramParameters != programParameters.end())
3794 if (MMpush(m, ITOM(2)))
3796 if (k = MBdeftab(m))
3799 iProgramParameters++;
3805 catch (Ogre::Exception& e)
3807 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3820 MMechostr(MSKDEBUG,
"SO3MaterialSetPassFragmentProgramAutoParameter\n");
3823 int scolParamOption = MMpull(m);
3824 int scolParamType = MMpull(m);
3825 int scolParamName = MMpull(m);
3826 int pass = MMpull(m);
3827 int technique = MMpull(m);
3828 int mat = MMget(m, 0);
3831 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (scolParamName == NIL) || (scolParamType == NIL))
3838 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3846 technique = MTOI(technique);
3851 STechnique* matTechnique = material->GetTechnique(technique);
3854 SPass* matPass = matTechnique->GetPass(pass);
3857 int paramOption = 0;
3858 if (scolParamOption != NIL)
3859 paramOption = MTOI(scolParamOption);
3861 std::string paramName = MMstartstr(m, MTOP(scolParamName));
3862 Ogre::GpuProgramParameters::AutoConstantType paramType =
static_cast<Ogre::GpuProgramParameters::AutoConstantType
>(MTOI(scolParamType));
3863 matPass->SetFragmentProgramAutoParameter(paramName, paramType, paramOption);
3867 catch (Ogre::Exception& e)
3869 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3882 MMechostr(MSKDEBUG,
"SO3MaterialSetPassFragmentProgramParameter\n");
3885 int scolParamValue = MMpull(m);
3886 int scolParamName = MMpull(m);
3887 int pass = MMpull(m);
3888 int technique = MMpull(m);
3889 int mat = MMget(m, 0);
3892 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (scolParamName == NIL) || (scolParamValue == NIL))
3899 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3907 technique = MTOI(technique);
3912 STechnique* matTechnique = material->GetTechnique(technique);
3915 SPass* matPass = matTechnique->GetPass(pass);
3918 std::string paramName = MMstartstr(m, MTOP(scolParamName));
3919 std::string paramValue = MMstartstr(m, MTOP(scolParamValue));
3920 matPass->SetFragmentProgramParameter(paramName, paramValue);
3924 catch (Ogre::Exception& e)
3926 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
3948 MMechostr(MSKDEBUG,
"SO3MaterialSetPassAlphaRejection\n");
3951 int scolRejectCoverage = MMpull(m);
3952 int scolRejectValue = MMpull(m);
3953 int scolRejectFunction = MMpull(m);
3954 int pass = MMpull(m);
3955 int technique = MMpull(m);
3956 int mat = MMget(m, 0);
3959 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
3966 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
3974 technique = MTOI(technique);
3979 STechnique* matTechnique = material->GetTechnique(technique);
3982 SPass* matPass = matTechnique->GetPass(pass);
3986 bool rejectCoverage;
3987 if (scolRejectCoverage == NIL)
3988 rejectCoverage = matPass->GetAlphaToCoverage();
3990 (MTOI(scolRejectCoverage) == 1) ? rejectCoverage = true : rejectCoverage =
false;
3992 unsigned char rejectValue = 0x0;
3993 if (scolRejectValue == NIL)
3994 rejectValue = matPass->GetAlphaRejectionValue();
3996 rejectValue =
static_cast<unsigned char>(MTOI(scolRejectValue));
3998 SPass::CompareFunction rejectFunction;
3999 if (scolRejectFunction == NIL)
4000 rejectFunction = matPass->GetAlphaRejectionFunction();
4002 rejectFunction =
static_cast<SPass::CompareFunction
>(MTOI(scolRejectFunction));
4004 matPass->SetAlphaRejection(rejectFunction, rejectValue, rejectCoverage);
4005 MMset(m, 0, ITOM(1));
4013 catch (Ogre::Exception& e)
4015 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4034 MMechostr(MSKDEBUG,
"SO3MaterialGetPassAlphaRejectionFunction\n");
4037 int pass = MMpull(m);
4038 int technique = MMpull(m);
4039 int mat = MMget(m, 0);
4042 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4049 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4057 technique = MTOI(technique);
4062 STechnique* matTechnique = material->GetTechnique(technique);
4065 SPass* matPass = matTechnique->GetPass(pass);
4067 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetAlphaRejectionFunction())));
4074 catch (Ogre::Exception& e)
4076 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4095 MMechostr(MSKDEBUG,
"SO3MaterialGetPassAlphaRejectionValue\n");
4098 int pass = MMpull(m);
4099 int technique = MMpull(m);
4100 int mat = MMget(m, 0);
4103 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4110 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4118 technique = MTOI(technique);
4123 STechnique* matTechnique = material->GetTechnique(technique);
4126 SPass* matPass = matTechnique->GetPass(pass);
4128 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetAlphaRejectionValue())));
4135 catch (Ogre::Exception& e)
4137 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4156 MMechostr(MSKDEBUG,
"SO3MaterialGetPassAlphaToCoverage\n");
4159 int pass = MMpull(m);
4160 int technique = MMpull(m);
4161 int mat = MMget(m, 0);
4164 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4171 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4179 technique = MTOI(technique);
4184 STechnique* matTechnique = material->GetTechnique(technique);
4187 SPass* matPass = matTechnique->GetPass(pass);
4189 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetAlphaToCoverage() ? 1 : 0)));
4196 catch (Ogre::Exception& e)
4198 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4217 MMechostr(MSKDEBUG,
"SO3MaterialGetPassDepthCheckEnabled\n");
4220 int pass = MMpull(m);
4221 int technique = MMpull(m);
4222 int mat = MMget(m, 0);
4225 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4232 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4240 technique = MTOI(technique);
4245 STechnique* matTechnique = material->GetTechnique(technique);
4248 SPass* matPass = matTechnique->GetPass(pass);
4250 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetDepthCheckEnabled() ? 1 : 0)));
4257 catch (Ogre::Exception& e)
4259 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4279 MMechostr(MSKDEBUG,
"SO3MaterialSetPassDepthCheckEnabled\n");
4282 int scolDepthCheck = MMpull(m);
4283 int pass = MMpull(m);
4284 int technique = MMpull(m);
4285 int mat = MMget(m, 0);
4288 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (scolDepthCheck == NIL))
4295 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4303 technique = MTOI(technique);
4308 STechnique* matTechnique = material->GetTechnique(technique);
4311 SPass* matPass = matTechnique->GetPass(pass);
4314 matPass->SetDepthCheckEnabled((MTOI(scolDepthCheck) == 1) ?
true :
false);
4315 MMset(m, 0, ITOM(1));
4323 catch (Ogre::Exception& e)
4325 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4344 MMechostr(MSKDEBUG,
"SO3MaterialGetPassDepthWriteEnabled\n");
4347 int pass = MMpull(m);
4348 int technique = MMpull(m);
4349 int mat = MMget(m, 0);
4352 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4359 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4367 technique = MTOI(technique);
4372 STechnique* matTechnique = material->GetTechnique(technique);
4375 SPass* matPass = matTechnique->GetPass(pass);
4377 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetDepthWriteEnabled() ? 1 : 0)));
4384 catch (Ogre::Exception& e)
4386 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4406 MMechostr(MSKDEBUG,
"SO3MaterialSetPassDepthWriteEnabled\n");
4409 int scolDepthWrite = MMpull(m);
4410 int pass = MMpull(m);
4411 int technique = MMpull(m);
4412 int mat = MMget(m, 0);
4415 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (scolDepthWrite == NIL))
4422 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4430 technique = MTOI(technique);
4435 STechnique* matTechnique = material->GetTechnique(technique);
4438 SPass* matPass = matTechnique->GetPass(pass);
4441 matPass->SetDepthWriteEnabled((MTOI(scolDepthWrite) == 1) ?
true :
false);
4442 MMset(m, 0, ITOM(1));
4450 catch (Ogre::Exception& e)
4452 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4471 MMechostr(MSKDEBUG,
"SO3MaterialGetPassDepthFunction\n");
4474 int pass = MMpull(m);
4475 int technique = MMpull(m);
4476 int mat = MMget(m, 0);
4479 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4486 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4494 technique = MTOI(technique);
4499 STechnique* matTechnique = material->GetTechnique(technique);
4502 SPass* matPass = matTechnique->GetPass(pass);
4504 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetDepthFunction())));
4511 catch (Ogre::Exception& e)
4513 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4533 MMechostr(MSKDEBUG,
"SO3MaterialSetPassDepthFunction\n");
4536 int scolDepthFunction = MMpull(m);
4537 int pass = MMpull(m);
4538 int technique = MMpull(m);
4539 int mat = MMget(m, 0);
4542 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (scolDepthFunction == NIL))
4549 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4557 technique = MTOI(technique);
4562 STechnique* matTechnique = material->GetTechnique(technique);
4565 SPass* matPass = matTechnique->GetPass(pass);
4568 matPass->SetDepthFunction(
static_cast<SPass::CompareFunction
>(MTOI(scolDepthFunction)));
4569 MMset(m, 0, ITOM(1));
4577 catch (Ogre::Exception& e)
4579 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4598 MMechostr(MSKDEBUG,
"SO3MaterialGetPassColourWriteEnabled\n");
4601 int pass = MMpull(m);
4602 int technique = MMpull(m);
4603 int mat = MMget(m, 0);
4606 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4613 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4621 technique = MTOI(technique);
4626 STechnique* matTechnique = material->GetTechnique(technique);
4629 SPass* matPass = matTechnique->GetPass(pass);
4631 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetColourWriteEnabled() ? 1 : 0)));
4638 catch (Ogre::Exception& e)
4640 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4660 MMechostr(MSKDEBUG,
"SO3MaterialSetPassColourWriteEnabled\n");
4663 int cwrite = MMpull(m);
4664 int pass = MMpull(m);
4665 int technique = MMpull(m);
4666 int mat = MMget(m, 0);
4669 if ((mat == NIL) || (technique == NIL) || (pass == NIL) || (cwrite == NIL))
4676 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4684 technique = MTOI(technique);
4689 STechnique* matTechnique = material->GetTechnique(technique);
4692 SPass* matPass = matTechnique->GetPass(pass);
4695 matPass->SetColourWriteEnabled((MTOI(cwrite) != 0) ?
true :
false);
4696 MMset(m, 0, ITOM(1));
4704 catch (Ogre::Exception& e)
4706 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4725 MMechostr(MSKDEBUG,
"SO3MaterialGetPassSourceBlendFactor\n");
4728 int pass = MMpull(m);
4729 int technique = MMpull(m);
4730 int mat = MMget(m, 0);
4733 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4740 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4748 technique = MTOI(technique);
4753 STechnique* matTechnique = material->GetTechnique(technique);
4756 SPass* matPass = matTechnique->GetPass(pass);
4758 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetSourceBlendFactor())));
4765 catch (Ogre::Exception& e)
4767 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4786 MMechostr(MSKDEBUG,
"SO3MaterialGetPassDestBlendFactor\n");
4789 int pass = MMpull(m);
4790 int technique = MMpull(m);
4791 int mat = MMget(m, 0);
4794 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4801 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4809 technique = MTOI(technique);
4814 STechnique* matTechnique = material->GetTechnique(technique);
4817 SPass* matPass = matTechnique->GetPass(pass);
4819 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetDestBlendFactor())));
4826 catch (Ogre::Exception& e)
4828 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4847 MMechostr(MSKDEBUG,
"SO3MaterialGetPassSourceBlendFactorAlpha\n");
4850 int pass = MMpull(m);
4851 int technique = MMpull(m);
4852 int mat = MMget(m, 0);
4855 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4862 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4870 technique = MTOI(technique);
4875 STechnique* matTechnique = material->GetTechnique(technique);
4878 SPass* matPass = matTechnique->GetPass(pass);
4880 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetSourceBlendFactorAlpha())));
4887 catch (Ogre::Exception& e)
4889 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4908 MMechostr(MSKDEBUG,
"SO3MaterialGetPassDestBlendFactorAlpha\n");
4911 int pass = MMpull(m);
4912 int technique = MMpull(m);
4913 int mat = MMget(m, 0);
4916 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4923 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
4931 technique = MTOI(technique);
4936 STechnique* matTechnique = material->GetTechnique(technique);
4939 SPass* matPass = matTechnique->GetPass(pass);
4941 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetDestBlendFactorAlpha())));
4948 catch (Ogre::Exception& e)
4950 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
4973 MMechostr(MSKDEBUG,
"SO3MaterialSetPassSceneBlending\n");
4976 int scolDestFactorAlpha = MMpull(m);
4977 int scolSourceFactorAlpha = MMpull(m);
4978 int scolDestFactor = MMpull(m);
4979 int scolSourceFactor = MMpull(m);
4980 int pass = MMpull(m);
4981 int technique = MMpull(m);
4982 int mat = MMget(m, 0);
4985 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
4992 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5000 technique = MTOI(technique);
5005 STechnique* matTechnique = material->GetTechnique(technique);
5008 SPass* matPass = matTechnique->GetPass(pass);
5012 SPass::SceneBlendFactor sourceFactor;
5013 if (scolSourceFactor == NIL)
5014 sourceFactor = matPass->GetSourceBlendFactor();
5016 sourceFactor =
static_cast<SPass::SceneBlendFactor
>(
static_cast<int>(MTOI(scolSourceFactor)));
5018 SPass::SceneBlendFactor destFactor;
5019 if (scolDestFactor == NIL)
5020 destFactor = matPass->GetDestBlendFactor();
5022 destFactor =
static_cast<SPass::SceneBlendFactor
>(
static_cast<int>(MTOI(scolDestFactor)));
5024 if (scolSourceFactorAlpha == NIL && scolDestFactorAlpha == NIL)
5026 matPass->SetSceneBlending(sourceFactor, destFactor);
5030 SPass::SceneBlendFactor sourceFactorAlpha;
5031 if (scolSourceFactorAlpha == NIL)
5032 sourceFactorAlpha = matPass->GetSourceBlendFactorAlpha();
5034 sourceFactorAlpha =
static_cast<SPass::SceneBlendFactor
>(
static_cast<int>(MTOI(scolSourceFactorAlpha)));
5036 SPass::SceneBlendFactor destFactorAlpha;
5037 if (scolDestFactorAlpha == NIL)
5038 destFactorAlpha = matPass->GetDestBlendFactorAlpha();
5040 destFactorAlpha =
static_cast<SPass::SceneBlendFactor
>(
static_cast<int>(MTOI(scolDestFactorAlpha)));
5042 matPass->SetSceneBlending(sourceFactor, destFactor, sourceFactorAlpha, destFactorAlpha);
5045 MMset(m, 0, ITOM(1));
5053 catch (Ogre::Exception& e)
5055 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5074 MMechostr(MSKDEBUG,
"SO3MaterialGetPassSceneBlendingOperation\n");
5077 int pass = MMpull(m);
5078 int technique = MMpull(m);
5079 int mat = MMget(m, 0);
5082 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5089 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5097 technique = MTOI(technique);
5102 STechnique* matTechnique = material->GetTechnique(technique);
5105 SPass* matPass = matTechnique->GetPass(pass);
5107 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetSceneBlendingOperation())));
5114 catch (Ogre::Exception& e)
5116 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5135 MMechostr(MSKDEBUG,
"SO3MaterialGetPassSceneBlendingOperationAlpha\n");
5138 int pass = MMpull(m);
5139 int technique = MMpull(m);
5140 int mat = MMget(m, 0);
5143 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5150 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5158 technique = MTOI(technique);
5163 STechnique* matTechnique = material->GetTechnique(technique);
5166 SPass* matPass = matTechnique->GetPass(pass);
5168 MMset(m, 0, ITOM(
static_cast<int>(matPass->GetSceneBlendingOperationAlpha())));
5175 catch (Ogre::Exception& e)
5177 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5198 MMechostr(MSKDEBUG,
"SO3MaterialSetPassSceneBlendingOperation\n");
5201 int scolOperation = MMpull(m);
5202 int scolOperationAlpha = MMpull(m);
5203 int pass = MMpull(m);
5204 int technique = MMpull(m);
5205 int mat = MMget(m, 0);
5208 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5215 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5223 technique = MTOI(technique);
5228 STechnique* matTechnique = material->GetTechnique(technique);
5231 SPass* matPass = matTechnique->GetPass(pass);
5235 SPass::SceneBlendOperation operation;
5236 if (scolOperation == NIL)
5237 operation = matPass->GetSceneBlendingOperation();
5239 operation =
static_cast<SPass::SceneBlendOperation
>(
static_cast<int>(MTOI(scolOperation)));
5241 SPass::SceneBlendOperation operationAlpha;
5242 if (scolOperationAlpha == NIL)
5243 operationAlpha = matPass->GetSceneBlendingOperationAlpha();
5245 operationAlpha =
static_cast<SPass::SceneBlendOperation
>(
static_cast<int>(MTOI(scolOperationAlpha)));
5247 matPass->SetSceneBlendingOperation(operation, operationAlpha);
5248 MMset(m, 0, ITOM(1));
5256 catch (Ogre::Exception& e)
5258 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5278 MMechostr(MSKDEBUG,
"SO3MaterialSetPassCullingEnable\n");
5281 int bcull = MMpull(m);
5282 int pass = MMpull(m);
5283 int technique = MMpull(m);
5284 int mat = MMget(m, 0);
5287 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5294 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5302 technique = MTOI(technique);
5307 STechnique* matTechnique = material->GetTechnique(technique);
5310 SPass* matPass = matTechnique->GetPass(pass);
5313 matPass->SetCullingMode(((MTOI(bcull) > 0) ?
true :
false));
5314 MMset(m, 0, ITOM(1));
5322 catch (Ogre::Exception& e)
5324 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5343 MMechostr(MSKDEBUG,
"SO3MaterialGetPassCullingEnable\n");
5346 int pass = MMpull(m);
5347 int technique = MMpull(m);
5348 int mat = MMget(m, 0);
5351 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5358 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5366 technique = MTOI(technique);
5371 STechnique* matTechnique = material->GetTechnique(technique);
5374 SPass* matPass = matTechnique->GetPass(pass);
5376 MMset(m, 0, ITOM(matPass->GetCullingMode() ? 1 : 0));
5383 catch (Ogre::Exception& e)
5385 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5406 MMechostr(MSKDEBUG,
"SO3MaterialSetPassUseVertexColor\n");
5409 int bstate = MMpull(m);
5410 int pass = MMpull(m);
5411 int technique = MMpull(m);
5412 int mat = MMget(m, 0);
5415 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5422 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5430 technique = MTOI(technique);
5435 STechnique* matTechnique = material->GetTechnique(technique);
5438 SPass* matPass = matTechnique->GetPass(pass);
5441 matPass->SetUseVertexColor(((MTOI(bstate) > 0) ?
true :
false));
5442 MMset(m, 0, ITOM(1));
5450 catch (Ogre::Exception& e)
5452 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5471 MMechostr(MSKDEBUG,
"SO3MaterialGetPassUseVertexColor\n");
5474 int pass = MMpull(m);
5475 int technique = MMpull(m);
5476 int mat = MMget(m, 0);
5479 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5486 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5494 technique = MTOI(technique);
5499 STechnique* matTechnique = material->GetTechnique(technique);
5502 SPass* matPass = matTechnique->GetPass(pass);
5504 MMset(m, 0, ITOM(matPass->GetUseVertexColor() ? 1 : 0));
5511 catch (Ogre::Exception& e)
5513 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5530 MMechostr(MSKDEBUG,
"SO3MaterialAddTechnique\n");
5533 int mat = MMget(m, 0);
5543 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5552 material->AddTechnique();
5553 MMset(m, 0, ITOM(1));
5555 catch (Ogre::Exception& e)
5557 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5575 MMechostr(MSKDEBUG,
"SO3MaterialRemoveTechnique\n");
5578 int tech = MMpull(m);
5579 int mat = MMget(m, 0);
5582 if (mat == NIL || tech == NIL)
5589 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5598 material->RemoveTechnique(MTOI(tech));
5599 MMset(m, 0, ITOM(1));
5601 catch (Ogre::Exception& e)
5603 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5622 MMechostr(MSKDEBUG,
"SO3MaterialSetTechniqueSchemeName\n");
5625 int schem = MMpull(m);
5626 int tech = MMpull(m);
5627 int mat = MMget(m, 0);
5630 if (mat == NIL || tech == NIL)
5636 std::string scheme =
"";
5638 scheme = MMstartstr(m, MTOP(schem));
5641 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5650 STechnique* matTechnique = material->GetTechnique(MTOI(tech));
5652 matTechnique->SetSchemeName(scheme);
5654 MMset(m, 0, ITOM(1));
5656 catch (Ogre::Exception& e)
5658 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5676 MMechostr(MSKDEBUG,
"SO3MaterialAddPass\n");
5679 int tech = MMpull(m);
5680 int mat = MMget(m, 0);
5683 if (mat == NIL || tech == NIL)
5690 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5699 STechnique* matTechnique = material->GetTechnique(MTOI(tech));
5701 matTechnique->AddPass();
5702 MMset(m, 0, ITOM(1));
5704 catch (Ogre::Exception& e)
5706 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5725 MMechostr(MSKDEBUG,
"SO3MaterialRemovePass\n");
5728 int pass = MMpull(m);
5729 int tech = MMpull(m);
5730 int mat = MMget(m, 0);
5733 if (mat == NIL || tech == NIL || pass == NIL)
5740 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5749 STechnique* matTechnique = material->GetTechnique(MTOI(tech));
5751 matTechnique->RemovePass(MTOI(pass));
5752 MMset(m, 0, ITOM(1));
5754 catch (Ogre::Exception& e)
5756 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5776 MMechostr(MSKDEBUG,
"SO3MaterialSetPassPolygonMode\n");
5779 int imode = MMpull(m);
5780 int pass = MMpull(m);
5781 int technique = MMpull(m);
5782 int mat = MMget(m, 0);
5785 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5792 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5800 technique = MTOI(technique);
5803 SPass::PolygonMode pmode = SPass::SO3_POLYGONMODE_SOLID;
5805 pmode = (SPass::PolygonMode)(MTOI(imode));
5809 STechnique* matTechnique = material->GetTechnique(technique);
5812 SPass* matPass = matTechnique->GetPass(pass);
5815 matPass->SetPolygonMode(pmode);
5816 MMset(m, 0, ITOM(1));
5824 catch (Ogre::Exception& e)
5826 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5845 MMechostr(MSKDEBUG,
"SO3MaterialGetPassPolygonMode\n");
5848 int pass = MMpull(m);
5849 int technique = MMpull(m);
5850 int mat = MMget(m, 0);
5853 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5860 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5868 technique = MTOI(technique);
5873 STechnique* matTechnique = material->GetTechnique(technique);
5876 SPass* matPass = matTechnique->GetPass(pass);
5879 MMset(m, 0, ITOM(matPass->GetPolygonMode()));
5887 catch (Ogre::Exception& e)
5889 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5909 MMechostr(MSKDEBUG,
"SO3MaterialSetPassPointSize\n");
5912 int isize = MMpull(m);
5913 int pass = MMpull(m);
5914 int technique = MMpull(m);
5915 int mat = MMget(m, 0);
5918 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5925 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
5933 technique = MTOI(technique);
5938 fsize = MTOF(isize);
5942 STechnique* matTechnique = material->GetTechnique(technique);
5945 SPass* matPass = matTechnique->GetPass(pass);
5948 matPass->SetPointSize(fsize);
5949 MMset(m, 0, ITOM(1));
5957 catch (Ogre::Exception& e)
5959 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
5978 MMechostr(MSKDEBUG,
"SO3MaterialGetPassPointSize\n");
5981 int pass = MMpull(m);
5982 int technique = MMpull(m);
5983 int mat = MMget(m, 0);
5986 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
5993 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
6001 technique = MTOI(technique);
6006 STechnique* matTechnique = material->GetTechnique(technique);
6009 SPass* matPass = matTechnique->GetPass(pass);
6012 MMset(m, 0, FTOM(matPass->GetPointSize()));
6020 catch (Ogre::Exception& e)
6022 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
6043 MMechostr(MSKDEBUG,
"SO3MaterialSetPassLighting\n");
6046 int istate = MMpull(m);
6047 int pass = MMpull(m);
6048 int technique = MMpull(m);
6049 int mat = MMget(m, 0);
6052 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
6059 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
6067 technique = MTOI(technique);
6071 if ((istate != NIL) && (MTOI(istate) > 0))
6076 STechnique* matTechnique = material->GetTechnique(technique);
6079 SPass* matPass = matTechnique->GetPass(pass);
6082 matPass->SetLightingEnabled(state);
6083 MMset(m, 0, ITOM(1));
6091 catch (Ogre::Exception& e)
6093 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
6112 MMechostr(MSKDEBUG,
"SO3MaterialGetPassLighting\n");
6115 int pass = MMpull(m);
6116 int technique = MMpull(m);
6117 int mat = MMget(m, 0);
6120 if ((mat == NIL) || (technique == NIL) || (pass == NIL))
6127 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
6135 technique = MTOI(technique);
6140 STechnique* matTechnique = material->GetTechnique(technique);
6143 SPass* matPass = matTechnique->GetPass(pass);
6146 MMset(m, 0, ITOM(matPass->GetLightingEnabled() ? 1 : 0));
6154 catch (Ogre::Exception& e)
6156 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
6175 MMechostr(MSKDEBUG,
"SO3MaterialSetIgnoreSlicePlane\n");
6178 int istate = MMpull(m);
6179 int mat = MMget(m, 0);
6189 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
6197 if ((istate != NIL) && (MTOI(istate) > 0))
6202 material->SetIgnoreSlicePlane(state);
6203 MMset(m, 0, ITOM(1));
6205 catch (Ogre::Exception& e)
6207 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
6225 MMechostr(MSKDEBUG,
"SO3MaterialExport\n");
6228 int ipath = MMpull(m);
6229 int mat = MMget(m, 0);
6239 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
6247 boost::filesystem::path spath;
6249 spath = MMstartstr(m, MTOP(ipath));
6253 material->WriteMaterialFile(spath.generic_string());
6254 MMset(m, 0, ITOM(1));
6256 catch (Ogre::Exception& e)
6258 MMechostr(MSKRUNTIME,
"An exception has occurred: %s\n", e.what());
6276 MMechostr(MSKDEBUG,
"SO3MaterialGetScriptPath\n");
6279 int mat = MMget(m, 0);
6289 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
6296 std::string path = material->getOgreMaterialPointer()->getOrigin();
6304 Mpushstrbloc(m, (
char*)path.c_str());
6320 MMechostr(MSKDEBUG,
"SO3MaterialCountInScript\n");
6323 int ipath = MMget(m, 0);
6333 boost::filesystem::path spath;
6335 spath = MMstartstr(m, MTOP(ipath));
6343 int numMats = SMaterial::CountMaterialsInScript(spath.generic_string());
6345 MMset(m, 0, ITOM(numMats));
6361 MMechostr(MSKDEBUG,
"SO3MaterialRewriteScript\n");
6364 int ipath = MMget(m, 0);
6374 boost::filesystem::path spath;
6376 spath = MMstartstr(m, MTOP(ipath));
6384 SMaterial::UpdateMaterialScript(spath.generic_string());
6386 MMset(m, 0, ITOM(1));
6393 {
"SO3_MAP_AMBIENT", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_AMBIENT) },
6394 {
"SO3_MAP_DIFFUSE", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_DIFFUSE) },
6395 {
"SO3_MAP_SPECULAR", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_SPECULAR) },
6396 {
"SO3_MAP_EMISSIVE", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_EMISSIVE) },
6397 {
"SO3_MAP_NORMAL", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_NORMAL) },
6398 {
"SO3_MAP_REFLECTION", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_REFLECTION) },
6399 {
"SO3_MAP_REFMASK", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_REFMASK) },
6400 {
"SO3_MAP_ROUGHNESS", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_ROUGHNESS) },
6401 {
"SO3_MAP_OPACITY", TYPVAR,
"I", SCOL_TYPTYPE(SShaderGenerator::MAP_OPACITY) },
6402 {
"SO3_POLYGONMODE_POINTS", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_POLYGONMODE_POINTS) },
6403 {
"SO3_POLYGONMODE_WIREFRAME", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_POLYGONMODE_WIREFRAME) },
6404 {
"SO3_POLYGONMODE_SOLID", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_POLYGONMODE_SOLID) },
6405 {
"SO3_COMPARE_FUNCTION_ALWAYS_FAIL", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_ALWAYS_FAIL) },
6406 {
"SO3_COMPARE_FUNCTION_ALWAYS_PASS", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_ALWAYS_PASS) },
6407 {
"SO3_COMPARE_FUNCTION_LESS", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_LESS) },
6408 {
"SO3_COMPARE_FUNCTION_LESS_EQUAL", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_LESS_EQUAL) },
6409 {
"SO3_COMPARE_FUNCTION_EQUAL", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_EQUAL) },
6410 {
"SO3_COMPARE_FUNCTION_NOT_EQUAL", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_NOT_EQUAL) },
6411 {
"SO3_COMPARE_FUNCTION_GREATER_EQUAL", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_GREATER_EQUAL) },
6412 {
"SO3_COMPARE_FUNCTION_GREATER", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_COMPARE_FUNCTION_GREATER) },
6413 {
"SO3_SCENE_BLEND_OPERATION_ADD", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_OPERATION_ADD) },
6414 {
"SO3_SCENE_BLEND_OPERATION_SUBTRACT", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_OPERATION_SUBTRACT) },
6415 {
"SO3_SCENE_BLEND_OPERATION_REVERSE_SUBTRACT", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_OPERATION_REVERSE_SUBTRACT) },
6416 {
"SO3_SCENE_BLEND_OPERATION_MIN", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_OPERATION_MIN) },
6417 {
"SO3_SCENE_BLEND_OPERATION_MAX", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_OPERATION_MAX) },
6418 {
"SO3_SCENE_BLEND_FACTOR_ONE", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_ONE) },
6419 {
"SO3_SCENE_BLEND_FACTOR_ZERO", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_ZERO) },
6420 {
"SO3_SCENE_BLEND_FACTOR_DEST_COLOUR", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_DEST_COLOUR) },
6421 {
"SO3_SCENE_BLEND_FACTOR_SOURCE_COLOUR", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_SOURCE_COLOUR) },
6422 {
"SO3_SCENE_BLEND_FACTOR_ONE_MINUS_DEST_COLOUR", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_ONE_MINUS_DEST_COLOUR) },
6423 {
"SO3_SCENE_BLEND_FACTOR_ONE_MINUS_SOURCE_COLOUR", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_ONE_MINUS_SOURCE_COLOUR) },
6424 {
"SO3_SCENE_BLEND_FACTOR_DEST_ALPHA", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_DEST_ALPHA) },
6425 {
"SO3_SCENE_BLEND_FACTOR_SOURCE_ALPHA", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_SOURCE_ALPHA) },
6426 {
"SO3_SCENE_BLEND_FACTOR_ONE_MINUS_DEST_ALPHA", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_ONE_MINUS_DEST_ALPHA) },
6427 {
"SO3_SCENE_BLEND_FACTOR_ONE_MINUS_SOURCE_ALPHA", TYPVAR,
"I", SCOL_TYPTYPE(SPass::SO3_SCENE_BLEND_FACTOR_ONE_MINUS_SOURCE_ALPHA) },
6428 {
"SO3MaterialCreate", 3,
"fun [SO3_SCENE S S] SO3_MATERIAL",
SO3MaterialCreate },
6464 {
"SO3TextureCreate", 6,
"fun [SO3_SCENE S P S I I] SO3_TEXTURE",
SO3TextureCreate },
6468 {
"SO3TextureBlit", 2,
"fun [SO3_TEXTURE ObjBitmap] I",
SO3TextureBlit },
int SCOLloadMaterial(mmachine m, cbmachine w)
Load the SO3Engine Viewport function.
int SO3MaterialSetPassFragmentProgramParameter(mmachine m)
int SCOLfreeMaterial()
free the SO3Engine Viewport function
NativeDefinition natSO3Mat[]
int SO3MaterialSetPassVertexProgramParameter(mmachine m)
int SO3MaterialSetPassVertexProgramAutoParameter(mmachine m)
int SO3MaterialSetPassFragmentProgramAutoParameter(mmachine m)
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
int createTexture(mmachine m, STexture *curTexture, SScene *curScene)
int createMaterial(mmachine m, SMaterial *curMaterial, SScene *curScene)
Base class for SO3 custom exception.
virtual const std::string & GetFullDescription() const
int SO3MaterialSetAmbient(mmachine m)
SO3MaterialSetAmbient : defines ambient color of a material.
int SO3MaterialSetTextureVScroll(mmachine m)
SO3MaterialSetTextureVScroll : Sets the translation offset of the texture, ie scrolls the texture,...
int SO3MaterialSetTechniqueSchemeName(mmachine m)
SO3MaterialSetTechniqueSchemeName : Set a technique scheme name on a material.
int SO3MaterialSetTextureScrollAnimation(mmachine m)
SO3MaterialSetTextureScrollAnimation : Set a scroll animation on the texture.
int SO3TextureDestroy(mmachine m)
SO3TextureDestroy : Destroy a texture unit.
int SO3MaterialSetDiffuse(mmachine m)
SO3MaterialSetDiffuse : defines diffuse color of a material.
int SO3GetSceneTexture(mmachine m)
SO3GetSceneTexture : Get a texture from a scene.
int SO3MaterialSetAmbientByTechAndPass(mmachine m)
SO3MaterialSetAmbientByTechAndPass : defines ambient color by technique and pass of a material.
int SO3MaterialTextureUnitGetNameByIndex(mmachine m)
SO3MaterialTextureUnitGetNameByIndex : return the name of a texture unit.
int SO3MaterialSetPassLighting(mmachine m)
SO3MaterialSetPassLighting : Sets pass lighting state.
int SO3MaterialGetPassVertexProgramParameters(mmachine m)
SO3MaterialGetPassVertexProgramParameters : Retrieve all the vertex program parameters than can be se...
int SO3MaterialSetSelfIllumination(mmachine m)
SO3MaterialSetSelfIllumination : defines self illuminaton color of a material.
int SO3MaterialTextureUnitGetIndexByType(mmachine m)
SO3MaterialTextureUnitGetIndexByType : Get a texture from a material by it's type.
int SO3MaterialSetPassDepthWriteEnabled(mmachine m)
SO3MaterialSetPassDepthWriteEnabled : Set if the pass must write a validated fragment depth informati...
int SO3MaterialSetShininessByTechAndPass(mmachine m)
SO3MaterialSetShininessByTechAndPass : defines shininess value by technique and pass of a material.
int SO3MaterialTechniqueGetIndexByName(mmachine m)
SO3MaterialTechniqueGetIndexByName : return the index of a technique by name.
int SO3TextureBlit(mmachine m)
SO3TextureBlit : Blit a ObjBitmap on a texture.
int SO3TextureCreate(mmachine m)
SO3TextureCreate : Create a texture unit.
int SO3MaterialGetPassLighting(mmachine m)
SO3MaterialGetPassLighting : Get pass lighting state.
int SO3MaterialCreate(mmachine m)
main include
int SO3MaterialSetTextureRotateAnimation(mmachine m)
SO3MaterialSetTextureRotateAnimation : Set a rotate animation on the texture.
int SO3TextureBlitAlpha(mmachine m)
SO3TextureBlitAlpha : Blit a AlphaBitmap on a texture.
int SO3MaterialNumberOfTechniques(mmachine m)
SO3MaterialNumberOfTechniques : Get the number of techniques.
int SO3MaterialAddTechnique(mmachine m)
SO3MaterialAddTechnique : Add a technique on a material.
int SO3MaterialDestroy(mmachine m)
SO3MaterialDestroy : Destroy a material.
int SO3MaterialGetPassDestBlendFactor(mmachine m)
SO3MaterialGetPassDestBlendFactor : Retrieve pass destination blend factor.
int SO3MaterialNumberOfTexturesByTechniqueAndPass(mmachine m)
SO3MaterialNumberOfTexturesByTechniqueAndPass : Get the number of textures by technique and pass.
int SO3MaterialPassGetNameByIndex(mmachine m)
SO3MaterialPassGetNameByIndex : return the name of a pass.
int SO3MaterialSetPassDepthCheckEnabled(mmachine m)
SO3MaterialSetPassDepthCheckEnabled : Set if the pass must check depth to validate fragments.
int SO3MaterialGetPassAlphaRejectionFunction(mmachine m)
SO3MaterialGetPassAlphaRejectionFunction : Retrieve the alpha rejection function.
int SO3MaterialGetPassUseVertexColor(mmachine m)
SO3MaterialGetPassUseVertexColor : Gets pass vertex color state.
int SO3MaterialGetName(mmachine m)
SO3MaterialGetName : Return the material name.
int SO3MaterialGetPassDepthCheckEnabled(mmachine m)
SO3MaterialGetPassDepthCheckEnabled : Retrieve if the pass use depth checking to validate fragments.
int SO3MaterialSetPassUseVertexColor(mmachine m)
SO3MaterialSetPassUseVertexColor : Sets pass vertex color state.
int SO3MaterialTechniqueGetNameByIndex(mmachine m)
SO3MaterialTechniqueGetNameByIndex : return the name of a technique.
int SO3MaterialGetTextureRotate(mmachine m)
SO3MaterialGetTextureRotate : Gets the rotation of the texture.
int SO3MaterialRemovePass(mmachine m)
SO3MaterialRemovePass : Remove a pass on a material technique.
int SO3MaterialGetPassDestBlendFactorAlpha(mmachine m)
SO3MaterialGetPassDestBlendFactorAlpha : Retrieve pass destination blend factor for alpha.
int SO3MaterialGetPassFragmentProgramParameters(mmachine m)
SO3MaterialGetPassFragmentProgramParameters : Retrieve all the fragment program parameters than can b...
int SO3MaterialGetPassAlphaRejectionValue(mmachine m)
SO3MaterialGetPassAlphaRejectionValue : Retrieve the alpha rejection value.
int SO3MaterialGetTextureVScroll(mmachine m)
SO3MaterialGetTextureVScroll : Gets the translation offset of the texture, ie scrolls the texture,...
int SO3MaterialSetTextureUScale(mmachine m)
SO3MaterialSetTextureUScale : Sets the scale value of the texture, for the U value.
int SO3MaterialGetSpecularByTechAndPass(mmachine m)
SO3MaterialGetSpecularByTechAndPass : Get the specular color by Technique and Pass.
int SO3MaterialGetTextureBlendFactor(mmachine m)
SO3MaterialGetTextureBlendFactor : Gets the texture blend factor.
int SO3MaterialGetShininessByTechAndPass(mmachine m)
SO3MaterialGetShininessByTechAndPass : Get the Shininess value by Technique and Pass.
int SO3MaterialSetDiffuseByTechAndPass(mmachine m)
SO3MaterialSetDiffuseByTechAndPass : defines diffuse color by technique and pass of a material.
int SO3MaterialGetReceiveShadows(mmachine m)
SO3MaterialGetReceiveShadows : Get the receive shadow state for material.
int SO3MaterialSetPassColourWriteEnabled(mmachine m)
SO3MaterialSetPassColourWriteEnabled : Set if the pass must write the colour.
int SO3MaterialSetTextureVScale(mmachine m)
SO3MaterialSetTextureVScale : Sets the scale of the texture, for the V value.
int SO3MaterialGetPassPolygonMode(mmachine m)
SO3MaterialGetPassPolygonMode : Get pass polygon mode.
int SO3MaterialSetPassSceneBlending(mmachine m)
SO3MaterialSetPassSceneBlending : Sets pass scene blending.
int SO3MaterialTextureUnitGetIndexByName(mmachine m)
SO3MaterialTextureUnitGetIndexByName : return the index of a Texture unit by name.
int SO3MaterialCountInScript(mmachine m)
SO3MaterialCountInScript : Gets the number of materials in a material script.
int SO3MaterialRewriteScript(mmachine m)
SO3MaterialRewriteScript : Rewrite a material script (usefull to remove deleted materials)
int SO3MaterialGetPassSourceBlendFactor(mmachine m)
SO3MaterialGetPassSourceBlendFactor : Retrieve pass source blend factor.
int SO3MaterialGetSelfIlluminationByTechAndPass(mmachine m)
SO3MaterialGetSelfIlluminationByTechAndPass : Get the self illumination color by Technique and Pass.
int SO3MaterialGetPassColourWriteEnabled(mmachine m)
SO3MaterialGetPassColourWriteEnabled : Retrieve if the pass use colour write when a fragment is valid...
int SO3MaterialIsLighting(mmachine m)
SO3MaterialIsLighting : defines light state for a material.
int SO3MaterialSetPassPointSize(mmachine m)
SO3MaterialSetPassPointSize : Sets pass point size.
int SO3MaterialGetPassSceneBlendingOperation(mmachine m)
SO3MaterialGetPassSceneBlendingOperation : Retrieve pass scene blending operation.
int SO3MaterialGetTexture(mmachine m)
SO3MaterialGetTexture : Get a texture from a material.
int SO3MaterialPassGetIndexByName(mmachine m)
SO3MaterialPassGetIndexByName : return the index of a pass by name.
int SO3MaterialGetPassSourceBlendFactorAlpha(mmachine m)
SO3MaterialGetPassSourceBlendFactorAlpha : Retrieve pass source blend factor for alpha.
int SO3MaterialSetIgnoreSlicePlane(mmachine m)
SO3MaterialSetIgnoreSlicePlane : Set the material ignore slice plane state.
int SO3MaterialGetPassDepthFunction(mmachine m)
SO3MaterialGetPassDepthFunction : Retrieve the function used to compare a fragment depth to depth buf...
int SO3MaterialSetSpecular(mmachine m)
SO3MaterialSetSpecular : defines specular color of a material.
int SO3MaterialGetPassAlphaToCoverage(mmachine m)
SO3MaterialGetPassAlphaToCoverage : Retrieve if the pass use alpha to coverage method.
int SO3MaterialSetReceiveShadows(mmachine m)
SO3MaterialSetReceiveShadows : defines receive shadow state for a given material.
int SO3TextureManagerGetMemoryUsage(mmachine m)
SO3TextureManagerGetMemoryUsage : Return the memory usage of all textures in the scene.
int SO3MaterialGetTextureVScale(mmachine m)
SO3MaterialGetTextureVScale : Gets the scale of the texture, for the V value.
int SO3TextureGetName(mmachine m)
SO3TextureGetName : Return the name of a texture.
int SO3MaterialSetSpecularByTechAndPass(mmachine m)
SO3MaterialSetSpecularByTechAndPass : defines specular color by technique and pass of a material.
int SO3MaterialSetSelfIlluminationByTechAndPass(mmachine m)
SO3MaterialSetSelfIlluminationByTechAndPass : defines self illumination color by technique and pass o...
int SO3MaterialRemoveTexture(mmachine m)
SO3MaterialRemoveTexture : Remove a texture from a material.
int SO3MaterialGetTextureUScale(mmachine m)
SO3MaterialGetTextureUScale : Gets the scale of the texture, for the U value.
int SO3MaterialGetPassCullingEnable(mmachine m)
SO3MaterialGetPassCullingEnable : Gets pass culling state.
int SO3MaterialSetShininess(mmachine m)
SO3MaterialSetShininess : defines shininess value of a material.
int SO3MaterialSetPassCullingEnable(mmachine m)
SO3MaterialSetPassCullingEnable : Sets pass culling state.
int SO3MaterialSetTextureUScroll(mmachine m)
SO3MaterialSetTextureUScroll : Sets the translation offset of the texture, ie scrolls the texture,...
int SO3MaterialGetAmbientByTechAndPass(mmachine m)
SO3MaterialGetAmbientByTechAndPass : Get the ambient color by Technique and Pass.
int SO3MaterialGetScriptPath(mmachine m)
SO3MaterialGetScriptPath : Gets the material script path.
int SO3MaterialSetTextureRotate(mmachine m)
SO3MaterialSetTextureRotate : Rotate the texture.
int SO3MaterialSetTextureBlendFactor(mmachine m)
SO3MaterialSetTextureBlendFactor : Set the texture blend factor (used for reflection map)
int SO3MaterialExport(mmachine m)
SO3MaterialExport : Write a material script to a file.
int SO3MaterialGetDiffuseByTechAndPass(mmachine m)
SO3MaterialGetDiffuseByTechAndPass : Get the diffuse color by Technique and Pass.
int SO3MaterialSetPassSceneBlendingOperation(mmachine m)
SO3MaterialSetPassSceneBlendingOperation : Sets pass scene blending operation.
int SO3MaterialSetPassPolygonMode(mmachine m)
SO3MaterialSetPassPolygonMode : Sets pass polygon mode.
int SO3MaterialGetPassDepthWriteEnabled(mmachine m)
SO3MaterialGetPassDepthWriteEnabled : Retrieve if the pass use depth write when a fragment is validat...
int SO3MaterialSetTexture(mmachine m)
SO3MaterialSetTexture : Set a texture on a material.
int SO3MaterialGetPassSceneBlendingOperationAlpha(mmachine m)
SO3MaterialGetPassSceneBlendingOperationAlpha : Retrieve pass scene blending operation for alpha.
int SO3MaterialSetTextureByType(mmachine m)
SO3MaterialSetTextureByType : Set a texture on a material by type.
int SO3MaterialSetPassDepthFunction(mmachine m)
SO3MaterialSetPassDepthFunction : Sets the compare function to use to compare a fragment depth with d...
int SO3MaterialAddPass(mmachine m)
SO3MaterialAddPass : Add a pass on a material technique.
int SO3MaterialGetPassPointSize(mmachine m)
SO3MaterialGetPassPointSize : Get pass point size.
int SO3MaterialGetTextureUScroll(mmachine m)
SO3MaterialGetTextureUScroll : Gets the translation offset of the texture, ie scrolls the texture,...
int SO3MaterialNumberOfPassesByTechnique(mmachine m)
SO3MaterialNumberOfPassesByTechnique : Get the number of passes by technique.
int SO3MaterialRemoveTechnique(mmachine m)
SO3MaterialRemoveTechnique : Remove a technique on a material.
int SO3MaterialSetPassAlphaRejection(mmachine m)
SO3MaterialSetPassAlphaRejection : Sets alpha rejection parameters.