VirtualBox

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

最後變更 在這個檔案從70084是 69392,由 vboxsync 提交於 7 年 前

GuestHost/OpenGL: scm updates

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id Revision
檔案大小: 1.7 KB
 
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("}")
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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