OLD | NEW |
1 | 1 |
2 //---------------------------------------------------------------------------- | 2 //---------------------------------------------------------------------------- |
3 // XYQ: 2006-01-22 Copied from AGG project. | 3 // XYQ: 2006-01-22 Copied from AGG project. |
4 // TODO: This file uses intensive floating point operations, so it's NOT suitabl
e | 4 // TODO: This file uses intensive floating point operations, so it's NOT suitabl
e |
5 // for platforms like Symbian OS. We need to change to FIX format. | 5 // for platforms like Symbian OS. We need to change to FIX format. |
6 //---------------------------------------------------------------------------- | 6 //---------------------------------------------------------------------------- |
7 //---------------------------------------------------------------------------- | 7 //---------------------------------------------------------------------------- |
8 // Anti-Grain Geometry - Version 2.3 | 8 // Anti-Grain Geometry - Version 2.3 |
9 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) | 9 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) |
10 // | 10 // |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 FX_Free(m_coord_blocks); | 64 FX_Free(m_coord_blocks); |
65 } | 65 } |
66 m_coord_blocks = new_coords; | 66 m_coord_blocks = new_coords; |
67 m_cmd_blocks = new_cmds; | 67 m_cmd_blocks = new_cmds; |
68 m_max_blocks += block_pool; | 68 m_max_blocks += block_pool; |
69 } | 69 } |
70 m_coord_blocks[nb] = | 70 m_coord_blocks[nb] = |
71 FX_Alloc( FX_FLOAT, block_size * 2 + | 71 FX_Alloc( FX_FLOAT, block_size * 2 + |
72 block_size / | 72 block_size / |
73 (sizeof(FX_FLOAT) / sizeof(unsigned char))); | 73 (sizeof(FX_FLOAT) / sizeof(unsigned char))); |
| 74 if (!m_coord_blocks[nb]) { |
| 75 return; |
| 76 } |
74 m_cmd_blocks[nb] = | 77 m_cmd_blocks[nb] = |
75 (unsigned char*)(m_coord_blocks[nb] + block_size * 2); | 78 (unsigned char*)(m_coord_blocks[nb] + block_size * 2); |
76 m_total_blocks++; | 79 m_total_blocks++; |
77 } | 80 } |
78 void path_storage::rewind(unsigned path_id) | 81 void path_storage::rewind(unsigned path_id) |
79 { | 82 { |
80 m_iterator = path_id; | 83 m_iterator = path_id; |
81 } | 84 } |
82 void path_storage::curve4(FX_FLOAT x_ctrl1, FX_FLOAT y_ctrl1, | 85 void path_storage::curve4(FX_FLOAT x_ctrl1, FX_FLOAT y_ctrl1, |
83 FX_FLOAT x_ctrl2, FX_FLOAT y_ctrl2, | 86 FX_FLOAT x_ctrl2, FX_FLOAT y_ctrl2, |
84 FX_FLOAT x_to, FX_FLOAT y_to) | 87 FX_FLOAT x_to, FX_FLOAT y_to) |
85 { | 88 { |
86 add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4); | 89 add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4); |
87 add_vertex(x_ctrl2, y_ctrl2, path_cmd_curve4); | 90 add_vertex(x_ctrl2, y_ctrl2, path_cmd_curve4); |
88 add_vertex(x_to, y_to, path_cmd_curve4); | 91 add_vertex(x_to, y_to, path_cmd_curve4); |
89 } | 92 } |
90 void path_storage::end_poly() | 93 void path_storage::end_poly() |
91 { | 94 { |
92 if(m_total_vertices) { | 95 if(m_total_vertices) { |
93 if(is_vertex(command(m_total_vertices - 1))) { | 96 if(is_vertex(command(m_total_vertices - 1))) { |
94 add_vertex(0, 0, path_cmd_end_poly | path_flags_close); | 97 add_vertex(0, 0, path_cmd_end_poly | path_flags_close); |
95 } | 98 } |
96 } | 99 } |
97 } | 100 } |
98 } | 101 } |
OLD | NEW |