Changeset 63939 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker/convert.py
- Timestamp:
- Sep 22, 2016 7:58:05 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 110825
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/convert.py
r15532 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 17 18 apiutil.CopyrightC() 18 19 19 print 20 print(''' 20 21 #include "state/cr_statetypes.h" 21 22 … … 28 29 return d; 29 30 } 30 ''' 31 ''') 31 32 32 for k in gltypes.keys():33 for k in sorted(gltypes.keys()): 33 34 for i in range(1,5): 34 print 'static void __convert_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k]['type'])35 print('static void __convert_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k]['type'])) 35 36 if k == 'd': 36 37 for j in range(i-1): 37 print '\t*dst++ = (GLfloat) __read_double(src++);'38 print '\t*dst = (GLfloat) __read_double(src);'38 print('\t*dst++ = (GLfloat) __read_double(src++);') 39 print('\t*dst = (GLfloat) __read_double(src);') 39 40 else: 40 41 for j in range(i-1): 41 print '\t*dst++ = (GLfloat) *src++;';42 print '\t*dst = (GLfloat) *src;';43 print '}\n';42 print('\t*dst++ = (GLfloat) *src++;') 43 print('\t*dst = (GLfloat) *src;') 44 print('}\n') 44 45 45 46 scale = { … … 54 55 } 55 56 56 for k in gltypes.keys():57 for k in sorted(gltypes.keys()): 57 58 if k != 'f' and k != 'd' and k != 'l': 58 59 if k[0:1] == "N": … … 61 62 k2 = k 62 63 for i in range(1,5): 63 print 'static void __convert_rescale_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k2]['type'])64 print('static void __convert_rescale_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k2]['type'])) 64 65 for j in range(i-1): 65 print '\t*dst++ = ((GLfloat) *src++) / %s;' % scale[k2]66 print '\t*dst = ((GLfloat) *src) / %s;' % scale[k2]67 print '}\n'66 print('\t*dst++ = ((GLfloat) *src++) / %s;' % scale[k2]) 67 print('\t*dst = ((GLfloat) *src) / %s;' % scale[k2]) 68 print('}\n') 68 69 69 print 70 print(''' 70 71 71 72 static void __convert_boolean (GLboolean *dst, const GLboolean *src) { 72 73 *dst = *src; 73 74 } 74 ''' 75 ''')
Note:
See TracChangeset
for help on using the changeset viewer.