Player Icons/model sprite to the rescue!!!
Because I don't like multiplayer, I deleted many of the MP code, because of that I also deleted the player icon code, yes I know it was dumb, but I didn't knew better at the time...
So I remembered those icons and went to see on the original fhdoom source code how they were done, I saw they use the model sprite! so I decided to use the code to create sprites easely ingame.
Here is the main code that creates the sprites. Will show the full code if asked or like me just see how the player icons were made.
Because I don't like multiplayer, I deleted many of the MP code, because of that I also deleted the player icon code, yes I know it was dumb, but I didn't knew better at the time...
So I remembered those icons and went to see on the original fhdoom source code how they were done, I saw they use the model sprite! so I decided to use the code to create sprites easely ingame.
Here is the main code that creates the sprites. Will show the full code if asked or like me just see how the player icons were made.
Code Select
idSprite::idSprite(c_string matName, const vec3 &origin, const mat3 &axis, f32 width, f32 hight) {
FreeSprite();
ZeroStruct(spriteEnt);
spriteEnt.origin = origin;
spriteEnt.axis = axis;
spriteEnt.shaderParms[SHADERPARM_RED] = 1.0f;
spriteEnt.shaderParms[SHADERPARM_GREEN] = 1.0f;
spriteEnt.shaderParms[SHADERPARM_BLUE] = 1.0f;
spriteEnt.shaderParms[SHADERPARM_ALPHA] = 1.0f;
spriteEnt.shaderParms[SHADERPARM_SPRITE_WIDTH] = width;
spriteEnt.shaderParms[SHADERPARM_SPRITE_HEIGHT] = hight;
spriteEnt.hModel = renderModelManager->FindModel("_sprite");
spriteEnt.callback = NULL;
spriteEnt.numJoints = 0;
spriteEnt.joints = NULL;
spriteEnt.customSkin = 0;
spriteEnt.noShadow = true;
spriteEnt.noSelfShadow = true;
spriteEnt.customShader = declManager->FindMaterial(matName);
spriteEnt.referenceShader = 0;
spriteEnt.bounds = spriteEnt.hModel->Bounds(&spriteEnt);
spriteHandle = gameRenderWorld->AddEntityDef(&spriteEnt);
}