Skip to content

Commit

Permalink
Fix Obelisk textures and Alley Of Sphinxes textures (TFE).
Browse files Browse the repository at this point in the history
  • Loading branch information
tx00100xt committed Oct 11, 2023
1 parent 0393a41 commit c961706
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 0 deletions.
93 changes: 93 additions & 0 deletions SamTFE/Sources/Entities/MusicHolder.es
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,80 @@ components:


functions:

//***************************************************************
//*************** Fixed Textures on Obelisk *******************
//***************************************************************
void FixTexturesOnObelisk(CTFileName strLevelName)
{
// for each entity in the world
{FOREACHINDYNAMICCONTAINER(GetWorld()->wo_cenEntities, CEntity, iten) {
//CEntity *pen = iten;
// if it is brush entity
if (iten->en_RenderType == CEntity::RT_BRUSH) {
// for each mip in its brush
FOREACHINLIST(CBrushMip, bm_lnInBrush, iten->en_pbrBrush->br_lhBrushMips, itbm) {
// for all sectors in this mip
FOREACHINDYNAMICARRAY(itbm->bm_abscSectors, CBrushSector, itbsc) {
// for all polygons in sector
FOREACHINSTATICARRAY(itbsc->bsc_abpoPolygons, CBrushPolygon, itbpo)
{
CTFileName strTextureName = itbpo->bpo_abptTextures[1].bpt_toTexture.GetName().FileName();
int _Obelisk02Light_found = strncmp((const char *)strTextureName, (const char *) "Obelisk02Light", (size_t) 14 );
if (_Obelisk02Light_found == 0 ){
// REM Settings:
// itbpo->bpo_abptTextures[1].bpt_toTexture.GetName().FileName()
// itbpo->bpo_abptTextures[1].s.bpt_ubBlend
// itbpo->bpo_abptTextures[1].s.bpt_ubFlags
// itbpo->bpo_abptTextures[1].s.bpt_colColor
if ( strLevelName=="KarnakDemo" || strLevelName=="Intro" || strLevelName=="08_Suburbs"
|| strLevelName=="13_Luxor" || strLevelName=="14_SacredYards") {
itbpo->bpo_abptTextures[1].s.bpt_colColor = (C_WHITE| 0x5F);
} else if ( strLevelName=="04_ValleyOfTheKings" || strLevelName=="11_AlleyOfSphinxes" || strLevelName=="12_Karnak"){
itbpo->bpo_abptTextures[1].s.bpt_colColor = (C_GRAY| 0x2F);
}
}
}
}
}
} // END if()
}}
}
//***************************************************************
//*********^** Fixed Textures on Alley Of Sphinxes ************
//***************************************************************
void FixTexturesOnAlleyOfSphinxes(void)
{
// for each entity in the world
{FOREACHINDYNAMICCONTAINER(GetWorld()->wo_cenEntities, CEntity, iten) {
//CEntity *pen = iten;
// if it is brush entity
if (iten->en_RenderType == CEntity::RT_BRUSH) {
// for each mip in its brush
FOREACHINLIST(CBrushMip, bm_lnInBrush, iten->en_pbrBrush->br_lhBrushMips, itbm) {
// for all sectors in this mip
FOREACHINDYNAMICARRAY(itbm->bm_abscSectors, CBrushSector, itbsc) {
// for all polygons in sector
FOREACHINSTATICARRAY(itbsc->bsc_abpoPolygons, CBrushPolygon, itbpo)
{
CTFileName strTextureName = itbpo->bpo_abptTextures[1].bpt_toTexture.GetName().FileName();
int _EyeOfRa_found = strncmp((const char *)strTextureName, (const char *) "EyeOfRa", (size_t) 7 );
int _Wall12_found = strncmp((const char *)strTextureName, (const char *) "Wall12", (size_t) 6 );
int _Wingy02_found = strncmp((const char *)strTextureName, (const char *) "Wingy02", (size_t) 7 );
if (_EyeOfRa_found == 0 || _Wall12_found == 0 || _Wingy02_found == 0){
itbpo->bpo_abptTextures[1].s.bpt_ubBlend = BPT_BLEND_BLEND;
itbpo->bpo_abptTextures[1].s.bpt_colColor = C_GRAY|0x80;
}
}
}
}
} // END if()
}}
}
//***************************************************************
//***************************************************************
//***************************************************************

// count enemies in current world
void CountEnemies(void)
{
Expand Down Expand Up @@ -294,6 +368,25 @@ procedures:
// wait for game to start
autowait(_pTimer->TickQuantum);

// Overlord Stuff
CTString strLevelName = _pNetwork->ga_fnmWorld.FileName();
//CPrintF("[strLevelName ==: %s]\n", (const char*)strLevelName);
CTString strModName = _pShell->GetValue("sys_strModName");
//CPrintF("[strModName ==: %s]\n", (const char*)strModName);

// Fix Obelisk textures
if ( strModName=="" ) {
if ( strLevelName=="04_ValleyOfTheKings" || strLevelName=="11_AlleyOfSphinxes" || strLevelName=="12_Karnak"
|| strLevelName=="13_Luxor" || strLevelName=="KarnakDemo" || strLevelName=="Intro"
|| strLevelName=="08_Suburbs" || strLevelName=="14_SacredYards") {
FixTexturesOnObelisk(strLevelName);
}
}
// Fix Alley Of Sphinxes textures
if ( strModName=="" && strLevelName=="11_AlleyOfSphinxes") {
FixTexturesOnAlleyOfSphinxes();
}

// prepare initial music channel values
ChangeMusicChannel(MT_LIGHT, m_fnMusic0, m_fVolume0);
ChangeMusicChannel(MT_MEDIUM, m_fnMusic1, m_fVolume1);
Expand Down
93 changes: 93 additions & 0 deletions SamTSE/Sources/Entities/MusicHolder.es
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,80 @@ components:


functions:

//***************************************************************
//*************** Fixed Textures on Obelisk *******************
//***************************************************************
void FixTexturesOnObelisk(CTFileName strLevelName)
{
// for each entity in the world
{FOREACHINDYNAMICCONTAINER(GetWorld()->wo_cenEntities, CEntity, iten) {
//CEntity *pen = iten;
// if it is brush entity
if (iten->en_RenderType == CEntity::RT_BRUSH) {
// for each mip in its brush
FOREACHINLIST(CBrushMip, bm_lnInBrush, iten->en_pbrBrush->br_lhBrushMips, itbm) {
// for all sectors in this mip
FOREACHINDYNAMICARRAY(itbm->bm_abscSectors, CBrushSector, itbsc) {
// for all polygons in sector
FOREACHINSTATICARRAY(itbsc->bsc_abpoPolygons, CBrushPolygon, itbpo)
{
CTFileName strTextureName = itbpo->bpo_abptTextures[1].bpt_toTexture.GetName().FileName();
int _Obelisk02Light_found = strncmp((const char *)strTextureName, (const char *) "Obelisk02Light", (size_t) 14 );
if (_Obelisk02Light_found == 0 ){
// REM Settings:
// itbpo->bpo_abptTextures[1].bpt_toTexture.GetName().FileName()
// itbpo->bpo_abptTextures[1].s.bpt_ubBlend
// itbpo->bpo_abptTextures[1].s.bpt_ubFlags
// itbpo->bpo_abptTextures[1].s.bpt_colColor
if ( strLevelName=="KarnakDemo" || strLevelName=="Intro" || strLevelName=="08_Suburbs"
|| strLevelName=="13_Luxor" || strLevelName=="14_SacredYards") {
itbpo->bpo_abptTextures[1].s.bpt_colColor = (C_WHITE| 0x5F);
} else if ( strLevelName=="04_ValleyOfTheKings" || strLevelName=="11_AlleyOfSphinxes" || strLevelName=="12_Karnak"){
itbpo->bpo_abptTextures[1].s.bpt_colColor = (C_GRAY| 0x2F);
}
}
}
}
}
} // END if()
}}
}
//***************************************************************
//*********^** Fixed Textures on Alley Of Sphinxes ************
//***************************************************************
void FixTexturesOnAlleyOfSphinxes(void)
{
// for each entity in the world
{FOREACHINDYNAMICCONTAINER(GetWorld()->wo_cenEntities, CEntity, iten) {
//CEntity *pen = iten;
// if it is brush entity
if (iten->en_RenderType == CEntity::RT_BRUSH) {
// for each mip in its brush
FOREACHINLIST(CBrushMip, bm_lnInBrush, iten->en_pbrBrush->br_lhBrushMips, itbm) {
// for all sectors in this mip
FOREACHINDYNAMICARRAY(itbm->bm_abscSectors, CBrushSector, itbsc) {
// for all polygons in sector
FOREACHINSTATICARRAY(itbsc->bsc_abpoPolygons, CBrushPolygon, itbpo)
{
CTFileName strTextureName = itbpo->bpo_abptTextures[1].bpt_toTexture.GetName().FileName();
int _EyeOfRa_found = strncmp((const char *)strTextureName, (const char *) "EyeOfRa", (size_t) 7 );
int _Wall12_found = strncmp((const char *)strTextureName, (const char *) "Wall12", (size_t) 6 );
int _Wingy02_found = strncmp((const char *)strTextureName, (const char *) "Wingy02", (size_t) 7 );
if (_EyeOfRa_found == 0 || _Wall12_found == 0 || _Wingy02_found == 0){
itbpo->bpo_abptTextures[1].s.bpt_ubBlend = BPT_BLEND_BLEND;
itbpo->bpo_abptTextures[1].s.bpt_colColor = C_GRAY|0x80;
}
}
}
}
} // END if()
}}
}
//***************************************************************
//***************************************************************
//***************************************************************

// count enemies in current world
void CountEnemies(void)
{
Expand Down Expand Up @@ -294,6 +368,25 @@ procedures:
// wait for game to start
autowait(_pTimer->TickQuantum);

// Overlord Stuff
CTString strLevelName = _pNetwork->ga_fnmWorld.FileName();
//CPrintF("[strLevelName ==: %s]\n", (const char*)strLevelName);
CTString strModName = _pShell->GetValue("sys_strModName");
//CPrintF("[strModName ==: %s]\n", (const char*)strModName);

// Fix Obelisk textures
if ( strModName=="" ) {
if ( strLevelName=="04_ValleyOfTheKings" || strLevelName=="11_AlleyOfSphinxes" || strLevelName=="12_Karnak"
|| strLevelName=="13_Luxor" || strLevelName=="KarnakDemo" || strLevelName=="Intro"
|| strLevelName=="08_Suburbs" || strLevelName=="14_SacredYards") {
FixTexturesOnObelisk(strLevelName);
}
}
// Fix Alley Of Sphinxes textures
if ( strModName=="" && strLevelName=="11_AlleyOfSphinxes") {
FixTexturesOnAlleyOfSphinxes();
}

// prepare initial music channel values
ChangeMusicChannel(MT_LIGHT, m_fnMusic0, m_fVolume0);
ChangeMusicChannel(MT_MEDIUM, m_fnMusic1, m_fVolume1);
Expand Down

0 comments on commit c961706

Please sign in to comment.