This worked in Crimson Editor. But I transfered to VS2005 for UMMU. Compiled with no errors. all works but my texture change.
I have a texture change from green to red and back depending on conditions.
But I get no textures to show up for the specific item. All other textures show up.
Here are where the conditions are found:
I have a texture change from green to red and back depending on conditions.
But I get no textures to show up for the specific item. All other textures show up.
Code:
#define STRICT
#define ORBITER_MODULE
#define ENG 1
#include "LSPOD.h"
#include "orbitersdk.h"
#include "OrbiterSoundSDK3.h"
MESHHANDLE POD = oapiLoadMeshGlobal ("LSPOD");
SURFHANDLE red_tex= oapiLoadTexture ("LSPOD/LSPOD_RED.dds");
SURFHANDLE green_tex= oapiLoadTexture ("LSPOD/LSPOD_GREEN.dds ");
SURFHANDLE red1_tex= oapiLoadTexture ("LSPOD/LSPOD_RED1.dds");
SURFHANDLE green1_tex= oapiLoadTexture ("LSPOD/LSPOD_GREEN1.dds ");
VISHANDLE MainExternalMeshVisual = 0;
Code:
if (level10==1) PCL=1;
if (level10==0) PCL=0;
if (level11==1) PCL1=1;
if (level11==0) PCL1=0;
if (level8==1) PCL2=1;
if (level8==0) PCL2=0;
if (level9==1) PCL3=1;
if (level9==0) PCL3=0;
TextureChange();
Code:
void LSPOD::TextureChange()
{
if ((MainExternalMeshVisual != 0) & ((PCL==1)|(PCL1==1)))
oapiSetTexture (MainExternalMeshVisual,11,red1_tex );
if ((MainExternalMeshVisual != 0) & ((PCL==0)& (PCL1==0)))
oapiSetTexture(MainExternalMeshVisual,11,green1_tex );
if ((MainExternalMeshVisual != 0) & ((PCL2==1)|(PCL3==1)))
oapiSetTexture (MainExternalMeshVisual,12,red_tex );
if ((MainExternalMeshVisual != 0) & ((PCL2==0)& (PCL3==0)))
oapiSetTexture(MainExternalMeshVisual,12,green_tex );
}
Code:
H file:
void clbkPostStep (double simtt, double simdt, double mjd);
void clbkFocusChanged(bool getfocus,OBJHANDLE hNewVessel,OBJHANDLE hOldVessel);
void TextureChange();