VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/pack/pack.py@ 48999

Last change on this file since 48999 was 20083, checked in by vboxsync, 16 years ago

crOpenGL: tabs to spaces

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6import sys
7
8import apiutil
9
10
11keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
12
13
14apiutil.CopyrightC()
15
16print """
17/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY pack.py SCRIPT */
18#include <stdio.h>
19#include "cr_string.h"
20#include "cr_spu.h"
21#include "packspu.h"
22#include "cr_packfunctions.h"
23#include "packspu_proto.h"
24"""
25
26num_funcs = len(keys) - len(apiutil.AllSpecials('packspu_unimplemented'))
27print 'SPUNamedFunctionTable _cr_pack_table[%d];' % (num_funcs+1)
28
29print """
30static void __fillin( int offset, char *name, SPUGenericFunction func )
31{
32 _cr_pack_table[offset].name = crStrdup( name );
33 _cr_pack_table[offset].fn = func;
34}"""
35
36pack_specials = []
37
38for func_name in keys:
39 if ("get" in apiutil.Properties(func_name) or
40 apiutil.FindSpecial( "packspu", func_name ) or
41 apiutil.FindSpecial( "packspu_flush", func_name ) or
42 apiutil.FindSpecial( "packspu_vertex", func_name )):
43 pack_specials.append( func_name )
44
45print '\nvoid packspuCreateFunctions( void )'
46print '{'
47for index in range(len(keys)):
48 func_name = keys[index]
49 if apiutil.FindSpecial( "packspu_unimplemented", func_name ):
50 continue
51 if func_name in pack_specials:
52 print '\t__fillin( %3d, "%s", (SPUGenericFunction) packspu_%s );' % (index, func_name, func_name )
53 else:
54 print '\t__fillin( %3d, "%s", (SPUGenericFunction) (pack_spu.swap ? crPack%sSWAP : crPack%s) );' % (index, func_name, func_name, func_name )
55print '\t__fillin( %3d, NULL, NULL );' % num_funcs
56print '}'
Note: See TracBrowser for help on using the repository browser.

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