Advertisement
Guest User

Untitled

a guest
Nov 27th, 2017
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. void lcars_RenderViewScreen(void){
  2. char i;
  3. int vWidth = 228, vHeight = 173;
  4. for( i = 0; i <= (sizeof(MapData)/sizeof(MapObject_t)); i++){
  5. MapObject_t *object = &MapData[i];
  6. if( object->type == OBJ_SHIP || object->type == OBJ_PROJ ){
  7. Relativity_t data = GetPositional(PlayerData->Position.coords[0], PlayerData->Position.coords[1], PlayerData->Position.coords[2], object->Position.coords[0], object->Position.coords[1], object->Position.coords[2]);
  8. if( data.distance <= VISUAL_RANGE ){
  9. if( (abs(data.xyOffset - PlayerData->Position.angles[0]) <= 45) && (abs(data.zOffset - PlayerData->Position.angles[1]) <= 45) ){
  10. int xcoord = data.xyOffset - PlayerData->Position.angles[0] + 45;
  11. char ycoord = data.zOffset - PlayerData->Position.angles[1] +45;
  12. char scale = 10-(data.distance / 2000);
  13. xcoord = (xcoord * vWidth) / 91;
  14. ycoord = (ycoord * vHeight) / 91;
  15. if(object->type == OBJ_SHIP)
  16. gfx_ScaledTransparentSprite_NoClip(sprite_BorgSphere, xcoord, ycoord, scale, scale);
  17. if(object->type == OBJ_PROJ)
  18. gfx_ScaledTransparentSprite_NoClip(sprite_Phaser, xcoord, ycoord, scale, scale);
  19. }
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement