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

Function CreateBitmapEffect

Descent3/TelComEffects.cpp:763–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

761}
762
763bool CreateBitmapEffect(TCBMPDESC* desc, int monitor, int screen, int id) {
764 ASSERT(desc);
765 int efxtype = -1;
766 switch (desc->type) {
767 case TC_BMP_STATIC:
768 efxtype = EFX_BMP_STATIC;
769 break;
770 case TC_BMP_BLUR:
771 efxtype = EFX_BMP_BLUR;
772 break;
773 case TC_BMP_SCANLINE:
774 efxtype = EFX_BMP_SCANLINE;
775 break;
776 case TC_BMP_INVERT:
777 efxtype = EFX_BMP_INVERT;
778 break;
779 case TC_BMP_STRETCH:
780 efxtype = EFX_BMP_STRETCH;
781 break;
782 default:
783 Int3();
784 }
785 if (efxtype == -1)
786 return false;
787
788 // Creates an instance of the Effect
789 int efxnum = EfxCreate(efxtype, monitor, screen, id);
790 if (efxnum == -1)
791 return false;
792 tceffect *tce = &TCEffects[efxnum];
793
794 if (desc->caps & TCBD_XY) {
795 tce->pos_x = desc->x;
796 tce->pos_y = desc->y;
797 } else {
798 tce->pos_x = tce->pos_y = 0;
799 }
800 if (desc->caps & TCBD_WAITTIME)
801 tce->start_time = desc->waittime;
802 else
803 tce->start_time = 0;
804 if (desc->caps & TCBD_SPEED)
805 tce->speed = desc->speed;
806 else
807 tce->speed = 1;
808 tce->flags = desc->flags;
809
810 switch (tce->type) {
811 case EFX_BMP_STATIC:
812 return CreateBmpStatic(tce, desc->filename);
813 case EFX_BMP_BLUR:
814 return CreateBmpBlur(tce, desc->filename);
815 case EFX_BMP_SCANLINE:
816 return CreateBmpScanline(tce, desc->filename);
817 case EFX_BMP_INVERT:
818 return CreateBmpInvert(tce, desc->filename);
819 case EFX_BMP_STRETCH:
820 return CreateBmpStretch(tce, desc->filename);

Callers 9

TelComMainMenuFunction · 0.85
TelcomCreateDummyScreenFunction · 0.85
TelComSingleShipSelectFunction · 0.85
TCSSPutButtonsOnScreenFunction · 0.85
TelComGoalStatusFunction · 0.85
PBAddBmpEffectFunction · 0.85
PBStartScreenFunction · 0.85

Calls 6

EfxCreateFunction · 0.85
CreateBmpStaticFunction · 0.85
CreateBmpBlurFunction · 0.85
CreateBmpScanlineFunction · 0.85
CreateBmpInvertFunction · 0.85
CreateBmpStretchFunction · 0.85

Tested by

no test coverage detected