VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_current.py@ 71930

Last change on this file since 71930 was 69392, checked in by vboxsync, 7 years ago

GuestHost/OpenGL: scm updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.7 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
6# This script generates the pack_current.c file.
7
8from __future__ import print_function
9import sys
10sys.path.append( "../glapi_parser" )
11import apiutil
12
13from pack_currenttypes import *
14
15apiutil.CopyrightC()
16
17print("""
18/* DO NOT EDIT - THIS FILE GENERATED BY THE pack_current.py SCRIPT */
19
20#include <memory.h>
21#include "packer.h"
22#include "state/cr_currentpointers.h"
23
24#include <stdio.h>
25
26void crPackOffsetCurrentPointers( int offset )
27{
28 CR_GET_PACKER_CONTEXT(pc);
29 GLnormal_p *normal = &(pc->current.c.normal);
30 GLcolor_p *color = &(pc->current.c.color);
31 GLsecondarycolor_p *secondaryColor = &(pc->current.c.secondaryColor);
32 GLtexcoord_p *texCoord = &(pc->current.c.texCoord);
33 GLindex_p *index = &(pc->current.c.index);
34 GLedgeflag_p *edgeFlag = &(pc->current.c.edgeFlag);
35 GLvertexattrib_p *vertexAttrib = &(pc->current.c.vertexAttrib);
36 GLfogcoord_p *fogCoord = &(pc->current.c.fogCoord);
37 int i;
38""")
39
40for k in sorted(current_fns.keys()):
41 name = '%s%s' % (k[:1].lower(),k[1:])
42 if 'array' in current_fns[k]:
43 print('\tfor (i = 0; i < %s; i++)' % current_fns[k]['array'])
44 print('\t{')
45 for type in current_fns[k]['types']:
46 for size in current_fns[k]['sizes']:
47 indent = ""
48 ptr = "%s->%s%d" % (name, type, size )
49 if 'array' in current_fns[k]:
50 ptr += "[i]"
51 indent = "\t"
52 print("%s\tif (%s)" % (indent, ptr))
53 print("%s\t\t%s += offset;" % (indent, ptr ))
54 if 'array' in current_fns[k]:
55 print('\t}')
56print("""
57}
58
59void crPackNullCurrentPointers( void )
60{
61 CR_GET_PACKER_CONTEXT(pc);
62 CRCurrentStateAttr *c = &(pc->current.c);
63""")
64print('\tmemset (c, 0, sizeof(CRCurrentStateAttr));')
65print("}")
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