~wii.sceners.linux/wiithon/1.1

« back to all changes in this revision

Viewing changes to libwbfs_binding/wiithon_wrapper.c

  • Committer: Ricardo Marmolejo García
  • Date: 2009-09-25 03:12:03 UTC
  • Revision ID: makiolo@gmail.com-20090925031203-ir1wiflmzbfjlhso
- Update Translate IT
- Listar juegos mezclando particiones
- Corrigiendo un bug en el sinner, al clonar

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
void spinner(u64 x, u64 max)
20
20
{
 
21
    
21
22
    // casos de excepcion
22
23
    if(max <= 0 || x > max || x < 0)
23
24
    {
43
44
        }
44
45
 
45
46
    d = time(NULL) - start_time;
 
47
    
 
48
    
46
49
    percent = (100 * x) / max;
47
50
 
48
51
    if(percent > 0)
58
61
            diferencia = percent - porcentaje_ponderado;
59
62
            porcentaje_ponderado+=(diferencia/2);
60
63
        }
61
 
        restante = (d * (100-porcentaje_ponderado)) / porcentaje_ponderado;
 
64
 
 
65
        if (porcentaje_ponderado != 0)
 
66
        {
 
67
            restante = (d * (100-porcentaje_ponderado)) / porcentaje_ponderado;
 
68
        }
 
69
        else
 
70
        {
 
71
            restante = 300;    
 
72
        }
62
73
    }
63
74
    else
64
75
    {
69
80
    h = (restante / 3600);
70
81
    m = (restante / 60) % 60;
71
82
    s = (restante % 60);
72
 
 
 
83
    
73
84
    if(x != max)
74
85
    {        
75
86
        fprintf(stdout , "%d;@;%d;@;%d;@;%d\n", porcentaje_ponderado, h, m, s);
78
89
    {
79
90
        fprintf(stdout, "FIN;@;%d;@;%d;@;%d\n", h, m, s);
80
91
    }
 
92
    
81
93
    fflush(stdout);
82
94
}
83
95