MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / CreateBackgroundEffect

Function CreateBackgroundEffect

Descent3/TelComEffects.cpp:867–904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865
866extern tTelComInfo Telcom_system;
867bool CreateBackgroundEffect(TCBKGDESC* desc, int monitor, int screen, int id) {
868 ASSERT(desc);
869 int efxtype = -1;
870 switch (desc->type) {
871 case TC_BACK_STATIC:
872 efxtype = EFX_BACKGROUND;
873 break;
874 default:
875 Int3();
876 }
877 if (efxtype == -1)
878 return false;
879 // Creates an instance of the Effect
880 int efxnum = EfxCreate(efxtype, monitor, screen, id);
881 if (efxnum == -1)
882 return false;
883 tceffect *tce = &TCEffects[efxnum];
884
885 if (desc->caps & TCBGD_COLOR)
886 tce->color = desc->color;
887 else
888 tce->color = GR_BLUE;
889 if (desc->caps & TCBGD_WAITTIME)
890 tce->start_time = desc->waittime;
891 else
892 tce->start_time = 0;
893
894 tce->pos_x = 0;
895 tce->pos_y = 0;
896 tce->w = Telcom_system.Monitor_coords[monitor].right - Telcom_system.Monitor_coords[monitor].left;
897 tce->h = Telcom_system.Monitor_coords[monitor].bottom - Telcom_system.Monitor_coords[monitor].top;
898
899 switch (tce->type) {
900 case EFX_BACKGROUND:
901 return CreateBackground(tce);
902 }
903 return false;
904}
905
906bool CreatePolyModelEffect(TCPOLYDESC* desc, int monitor, int screen, int id) {
907 ASSERT(desc);

Callers 9

TelComMainMenuFunction · 0.85
TelcomCreateDummyScreenFunction · 0.85
TelComSingleShipSelectFunction · 0.85
TelComGoalStatusFunction · 0.85
TelComCargoFunction · 0.85
TelComAutoMapFunction · 0.85
PBStartScreenFunction · 0.85

Calls 2

EfxCreateFunction · 0.85
CreateBackgroundFunction · 0.85

Tested by

no test coverage detected