Mercurial > hg > Members > kono > Cerium
comparison TaskManager/Test/test_render/task/DrawSpanRenew.cpp @ 188:06f39635a9b0
メモりリーク箇所発見:TaskManager/Test/test_render/ChangeLog参照
author | gongo@localhost.localdomain |
---|---|
date | Thu, 08 Jan 2009 15:34:19 +0900 |
parents | f7ad032575ed |
children | 102dad2949a0 |
comparison
equal
deleted
inserted
replaced
187:ac52c139ad45 | 188:06f39635a9b0 |
---|---|
40 linebuf_init(linebuf[i], rangex, 0xffffffff); | 40 linebuf_init(linebuf[i], rangex, 0xffffffff); |
41 } | 41 } |
42 | 42 |
43 SpanPackPtr spack = (SpanPackPtr)smanager->get_param(3); | 43 SpanPackPtr spack = (SpanPackPtr)smanager->get_param(3); |
44 SpanPackPtr next_spack = (SpanPackPtr)smanager->allocate(sizeof(SpanPack)); | 44 SpanPackPtr next_spack = (SpanPackPtr)smanager->allocate(sizeof(SpanPack)); |
45 SpanPackPtr free_spack1 = spack; | |
46 SpanPackPtr free_spack2 = next_spack; | |
45 Span *span; | 47 Span *span; |
46 | 48 |
47 // span->length_x νǤκƵư | 49 // span->length_x νǤκƵư |
48 int js_cont = smanager->get_param(4); | 50 int js_cont = smanager->get_param(4); |
51 | |
52 smanager->dma_wait(TEX_LOAD); | |
49 | 53 |
50 do { | 54 do { |
51 /** | 55 /** |
52 * SpanPack->next ¸ߤ硢 | 56 * SpanPack->next ¸ߤ硢 |
53 * ߤ SpanPack Ƥ֤ | 57 * ߤ SpanPack Ƥ֤ |
61 } | 65 } |
62 | 66 |
63 for (int t = spack->info.start; t < spack->info.size; t++) { | 67 for (int t = spack->info.start; t < spack->info.size; t++) { |
64 span = &spack->span[t]; | 68 span = &spack->span[t]; |
65 | 69 |
66 Uint32 rgb = 0x00ff00; | 70 Uint32 rgb = 0x00ff0000; |
67 float tex1 = span->tex_x1; | 71 float tex1 = span->tex_x1; |
68 float tex2 = span->tex_x2; | 72 float tex2 = span->tex_x2; |
69 float tey1 = span->tex_y1; | 73 float tey1 = span->tex_y1; |
70 float tey2 = span->tex_y2; | 74 float tey2 = span->tex_y2; |
71 | 75 |
112 * Tile ̵硢öϤǤ | 116 * Tile ̵硢öϤǤ |
113 * Tile ɤ륿餻˺Ƶư | 117 * Tile ɤ륿餻˺Ƶư |
114 */ | 118 */ |
115 if (!isAvailableTile(tex_addr)) { | 119 if (!isAvailableTile(tex_addr)) { |
116 spack->info.start = t; | 120 spack->info.start = t; |
117 set_rgb(tex_addr); | 121 //set_rgb(tex_addr); |
118 //set_rgbs(tex_addr, | 122 set_rgbs(tex_addr, |
119 //getTile(span->tex_width-1, tex_ypos, | 123 getTile(span->tex_width-1, tex_ypos, |
120 //span->tex_width, span->tex_addr)); | 124 span->tex_width, span->tex_addr)); |
121 //reboot(spack, 0); | 125 //reboot(spack, 0); |
122 //goto FINISH; | 126 //goto FINISH; |
123 } | 127 } |
124 | 128 |
125 rgb = get_rgb(tex_localx, tex_localy, tex_addr); | 129 rgb = get_rgb(tex_localx, tex_localy, tex_addr); |
157 if (tex_z < zRow[localx + (rangex*localy)]) { | 161 if (tex_z < zRow[localx + (rangex*localy)]) { |
158 tex_addr = getTile(tex_xpos, tex_ypos, | 162 tex_addr = getTile(tex_xpos, tex_ypos, |
159 span->tex_width, span->tex_addr); | 163 span->tex_width, span->tex_addr); |
160 tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL; | 164 tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL; |
161 tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL; | 165 tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL; |
162 | |
163 if (!isAvailableTile(tex_addr)) { | 166 if (!isAvailableTile(tex_addr)) { |
164 spack->info.start = t; | 167 spack->info.start = t; |
165 set_rgb(tex_addr); | 168 //set_rgb(tex_addr); |
166 //set_rgbs(tex_addr, | 169 set_rgbs(tex_addr, |
167 //getTile(span->tex_width-1, tex_ypos, | 170 getTile(span->tex_width-1, tex_ypos, |
168 //span->tex_width, span->tex_addr)); | 171 span->tex_width, span->tex_addr)); |
169 //reboot(spack, j); | 172 //reboot(spack, j); |
170 //goto FINISH; | 173 //goto FINISH; |
171 } | 174 } |
172 | 175 |
173 rgb = get_rgb(tex_localx, tex_localy, tex_addr); | 176 rgb = get_rgb(tex_localx, tex_localy, tex_addr); |
186 next_spack = tmp_spack; | 189 next_spack = tmp_spack; |
187 } while (spack); | 190 } while (spack); |
188 | 191 |
189 | 192 |
190 FINISH: | 193 FINISH: |
191 free(next_spack); | 194 smanager->dma_wait(SPAN_PACK_LOAD); |
195 //free(next_spack); | |
192 free(linebuf); | 196 free(linebuf); |
193 free(zRow); | 197 free(zRow); |
194 | 198 |
195 // Renew allocate 줿ΤʤΤǡ free | 199 // Renew allocate 줿ΤʤΤǡ free |
196 free(spack); | 200 //free(spack); |
201 | |
202 free(free_spack1); | |
203 free(free_spack2); | |
204 | |
197 | 205 |
198 return 0; | 206 return 0; |
199 } | 207 } |