Ignore:
Timestamp:
Apr 29, 2011, 9:18:23 PM (11 years ago)
Author:
Sam Hocevar
Message:

ps3: make everything compile on the PS3. Of course, nothing links yet
because so much support is missing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/view.cpp

    r524 r555  
    55 *
    66 *  This software was released into the Public Domain. As with most public
    7  *  domain software, no warranty is made or implied by Crack dot Com or
    8  *  Jonathan Clark.
     7 *  domain software, no warranty is made or implied by Crack dot Com, by
     8 *  Jonathan Clark, or by Sam Hocevar.
    99 */
    1010
    11 #include "config.h"
     11#if defined HAVE_CONFIG_H
     12#   include "config.h"
     13#endif
    1214
    1315#include <unistd.h>
     
    182184}
    183185
    184 char cur_user_name[20]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
     186static char cur_user_name[20] = { 0 };
    185187
    186188char const *get_login()
    187189{
    188     if(cur_user_name[0])
     190    if (cur_user_name[0])
    189191        return cur_user_name;
    190     else
    191         return(getlogin() ? getlogin() : "unknown");
     192
     193#if defined __CELLOS_LV2__
     194    /* FIXME: retrieve login name */
     195    return "Player";
     196#else
     197    char const *login = getlogin();
     198    return login ? login : "unknown";
     199#endif
    192200}
    193201
    194202void set_login(char const *name)
    195 { strncpy(cur_user_name,name,20); }
     203{
     204    strncpy(cur_user_name, name, 20);
     205}
    196206
    197207view::view(game_object *Focus, view *Next, int number)
     
    384394    }
    385395
     396#if !defined __CELLOS_LV2__
    386397    if( view_changed() )
    387398    {
     
    432443    base->packet.write_uint16((uint16_t)((int16_t)sug_px));
    433444    base->packet.write_uint16((uint16_t)((int16_t)sug_py));
     445#endif
    434446}
    435447
     
    482494int view::process_input(char cmd, uint8_t *&pk)   // return 0 if something went wrong
    483495{
     496#if !defined __CELLOS_LV2__
    484497  switch (cmd)
    485498  {
     
    553566    case SCMD_EXT_KEYRELEASE : set_key_down(*(pk++)+256,0); break;
    554567  }
     568#endif
    555569  return 1;
    556570}
     
    558572int view::local_player()
    559573{
     574#if defined __CELLOS_LV2__
     575  return 1;
     576#else
    560577  return player_number==client_number();
     578#endif
    561579}
    562580
     
    11601178void process_packet_commands(uint8_t *pk, int size)
    11611179{
     1180#if !defined __CELLOS_LV2__
    11621181  int32_t sync_uint16=-1;
    11631182
     
    12591278    }
    12601279  } while (cmd!=SCMD_END_OF_PACKET);
     1280#endif
    12611281}
    12621282
Note: See TracChangeset for help on using the changeset viewer.