VirtualBox

Ignore:
Timestamp:
Oct 26, 2010 11:12:30 AM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: tabs to spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_lists.c

    r15532 r33457  
    1111static int __gl_CallListsNumBytes( GLenum type )
    1212{
    13         switch( type )
    14         {
    15                 case GL_BYTE:
    16                 case GL_UNSIGNED_BYTE:
    17                 case GL_2_BYTES:
    18                         return 1;
    19                 case GL_SHORT:
    20                 case GL_UNSIGNED_SHORT:
    21                 case GL_3_BYTES:
    22                         return 2;
    23                 case GL_INT:
    24                 case GL_UNSIGNED_INT:
    25                 case GL_FLOAT:
    26                 case GL_4_BYTES:
    27                         return 4;
    28                 default:
    29                         return -1;
    30         }
     13    switch( type )
     14    {
     15        case GL_BYTE:
     16        case GL_UNSIGNED_BYTE:
     17        case GL_2_BYTES:
     18            return 1;
     19        case GL_SHORT:
     20        case GL_UNSIGNED_SHORT:
     21        case GL_3_BYTES:
     22            return 2;
     23        case GL_INT:
     24        case GL_UNSIGNED_INT:
     25        case GL_FLOAT:
     26        case GL_4_BYTES:
     27            return 4;
     28        default:
     29            return -1;
     30    }
    3131}
    3232
    3333void PACK_APIENTRY crPackCallLists(GLint n, GLenum type,
    34                 const GLvoid *lists )
     34        const GLvoid *lists )
    3535{
    36         unsigned char *data_ptr;
    37         int packet_length;
     36    unsigned char *data_ptr;
     37    int packet_length;
    3838
    39         int num_bytes = __gl_CallListsNumBytes( type ) * n;
    40         if (num_bytes < 0)
    41         {
    42                 __PackError( __LINE__, __FILE__, GL_INVALID_ENUM,
    43                                                                 "crPackCallLists(bad type)" );
    44                 return;
    45         }
     39    int num_bytes = __gl_CallListsNumBytes( type ) * n;
     40    if (num_bytes < 0)
     41    {
     42        __PackError( __LINE__, __FILE__, GL_INVALID_ENUM,
     43                                "crPackCallLists(bad type)" );
     44        return;
     45    }
    4646
    47         packet_length =
    48                 sizeof( n ) +
    49                 sizeof( type ) +
    50                 num_bytes;
     47    packet_length =
     48        sizeof( n ) +
     49        sizeof( type ) +
     50        num_bytes;
    5151
    52         data_ptr = (unsigned char *) crPackAlloc( packet_length );
    53         WRITE_DATA( 0, GLint, n );
    54         WRITE_DATA( 4, GLenum, type );
    55         crMemcpy( data_ptr + 8, lists, num_bytes );
     52    data_ptr = (unsigned char *) crPackAlloc( packet_length );
     53    WRITE_DATA( 0, GLint, n );
     54    WRITE_DATA( 4, GLenum, type );
     55    crMemcpy( data_ptr + 8, lists, num_bytes );
    5656
    57         crHugePacket( CR_CALLLISTS_OPCODE, data_ptr );
     57    crHugePacket( CR_CALLLISTS_OPCODE, data_ptr );
    5858    crPackFree( data_ptr );
    5959}
     
    6363void PACK_APIENTRY crPackNewList( GLuint list, GLenum mode )
    6464{
    65         GET_PACKER_CONTEXT(pc);
    66         unsigned char *data_ptr;
    67         (void) pc;
    68         GET_BUFFERED_POINTER( pc, 16 );
    69         WRITE_DATA( 0, GLint, 16 );
    70         WRITE_DATA( 4, GLenum, CR_NEWLIST_EXTEND_OPCODE );
    71         WRITE_DATA( 8, GLuint, list );
    72         WRITE_DATA( 12, GLenum, mode );
    73         WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    74         pc->buffer.in_List = GL_TRUE;
    75         pc->buffer.holds_List = GL_TRUE;
     65    GET_PACKER_CONTEXT(pc);
     66    unsigned char *data_ptr;
     67    (void) pc;
     68    GET_BUFFERED_POINTER( pc, 16 );
     69    WRITE_DATA( 0, GLint, 16 );
     70    WRITE_DATA( 4, GLenum, CR_NEWLIST_EXTEND_OPCODE );
     71    WRITE_DATA( 8, GLuint, list );
     72    WRITE_DATA( 12, GLenum, mode );
     73    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     74    pc->buffer.in_List = GL_TRUE;
     75    pc->buffer.holds_List = GL_TRUE;
    7676}
    7777
    7878void PACK_APIENTRY crPackEndList( void )
    7979{
    80         GET_PACKER_CONTEXT(pc);
    81         unsigned char *data_ptr;
    82         GET_BUFFERED_POINTER( pc, 8 );
    83         WRITE_DATA( 0, GLint, 8 );
    84         WRITE_DATA( 4, GLenum, CR_ENDLIST_EXTEND_OPCODE );
    85         WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    86         pc->buffer.in_List = GL_FALSE;
     80    GET_PACKER_CONTEXT(pc);
     81    unsigned char *data_ptr;
     82    GET_BUFFERED_POINTER( pc, 8 );
     83    WRITE_DATA( 0, GLint, 8 );
     84    WRITE_DATA( 4, GLenum, CR_ENDLIST_EXTEND_OPCODE );
     85    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     86    pc->buffer.in_List = GL_FALSE;
    8787}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette