Merge lp:~unity-team/nux/nux.removed-custom-types into lp:nux/2.0
- nux.removed-custom-types
- Merge into 2.0
Proposed by
Jay Taoko
Status: | Merged |
---|---|
Approved by: | Jay Taoko |
Approved revision: | 577 |
Merged at revision: | 577 |
Proposed branch: | lp:~unity-team/nux/nux.removed-custom-types |
Merge into: | lp:nux/2.0 |
Diff against target: |
2652 lines (+422/-570) 38 files modified
Nux/CairoWrapper.cpp (+1/-1) Nux/Canvas.cpp (+2/-2) Nux/CoverflowModel.cpp (+1/-1) Nux/Nux.h (+0/-2) Nux/NuxGlobalInitializer.cpp (+2/-2) Nux/StaticText.cpp (+1/-1) Nux/TextEntry.cpp (+4/-4) NuxCore/Character/NUni.cpp (+71/-71) NuxCore/Character/NUni.h (+21/-21) NuxCore/Character/NUnicode.cpp (+8/-8) NuxCore/Character/NUnicode.h (+28/-28) NuxCore/FileManager/NFileManagerGNU.cpp (+1/-1) NuxCore/FileManager/NFileManagerWindows.cpp (+5/-5) NuxCore/FileManager/NSerializer.cpp (+13/-17) NuxCore/FileManager/NSerializer.h (+9/-16) NuxCore/GlobalInitializer.cpp (+1/-1) NuxCore/Makefile.am (+0/-1) NuxCore/Math/MathInc.h (+0/-2) NuxCore/Math/MathUtility.h (+9/-6) NuxCore/Memory.cpp (+1/-1) NuxCore/NuxCore.h (+1/-4) NuxCore/ObjectPtr.h (+11/-11) NuxCore/ObjectType.h (+1/-1) NuxCore/SystemTypes.h (+0/-117) NuxCore/TextString.cpp (+13/-26) NuxCore/TextString.h (+5/-6) NuxGraphics/FontTexture.h (+1/-1) NuxGraphics/GLResource.h (+0/-1) NuxGraphics/GLTextureResourceManager.cpp (+96/-96) NuxGraphics/GLTextureResourceManager.h (+60/-60) NuxGraphics/GLVertexResourceManager.cpp (+2/-2) NuxGraphics/GlobalGraphicsInitializer.cpp (+1/-1) NuxGraphics/GraphicsDisplayWin.cpp (+22/-22) NuxImage/CairoGraphics.cpp (+2/-2) NuxImage/GdkGraphics.cpp (+1/-1) NuxImage/ImageSurface.cpp (+22/-22) NuxImage/ImageSurface.h (+5/-5) configure.ac (+1/-1) |
To merge this branch: | bzr merge lp:~unity-team/nux/nux.removed-custom-types |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jay Taoko (community) | Approve | ||
Review via email: mp+93712@code.launchpad.net |
Commit message
Description of the change
* Removed file NuxCore/
* Replaced Nux custom types with C++ standard types.
To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Nux/CairoWrapper.cpp' |
2 | --- Nux/CairoWrapper.cpp 2012-02-09 02:42:42 +0000 |
3 | +++ Nux/CairoWrapper.cpp 2012-02-19 00:04:19 +0000 |
4 | @@ -147,7 +147,7 @@ |
5 | geometry_.width, |
6 | geometry_.height, |
7 | 1); |
8 | - t_u8* ptr = cairo_image_surface_get_data (surface_); |
9 | + unsigned char* ptr = cairo_image_surface_get_data (surface_); |
10 | int stride = cairo_image_surface_get_stride (surface_); |
11 | |
12 | if (ptr == 0 || stride == 0) |
13 | |
14 | === modified file 'Nux/Canvas.cpp' |
15 | --- Nux/Canvas.cpp 2011-12-06 22:44:57 +0000 |
16 | +++ Nux/Canvas.cpp 2012-02-19 00:04:19 +0000 |
17 | @@ -84,8 +84,8 @@ |
18 | _last_width, |
19 | _last_height, |
20 | 1); |
21 | - t_u8* ptr = cairo_image_surface_get_data (_surface); |
22 | - int stride = cairo_image_surface_get_stride (_surface); |
23 | + unsigned char* ptr = cairo_image_surface_get_data (_surface); |
24 | + int stride = cairo_image_surface_get_stride (_surface); |
25 | |
26 | if (ptr == NULL || stride == 0) { |
27 | g_debug ("Invalid surface!"); |
28 | |
29 | === modified file 'Nux/CoverflowModel.cpp' |
30 | --- Nux/CoverflowModel.cpp 2012-02-13 09:40:34 +0000 |
31 | +++ Nux/CoverflowModel.cpp 2012-02-19 00:04:19 +0000 |
32 | @@ -111,7 +111,7 @@ |
33 | |
34 | void CoverflowModel::SetSelection(size_t index) |
35 | { |
36 | - index = std::min(index, pimpl->items_.size() - 1); |
37 | + index = std::min<size_t>(index, pimpl->items_.size() - 1); |
38 | if (index != pimpl->selection_index_) |
39 | { |
40 | pimpl->selection_index_ = index; |
41 | |
42 | === modified file 'Nux/Nux.h' |
43 | --- Nux/Nux.h 2011-12-29 18:06:53 +0000 |
44 | +++ Nux/Nux.h 2012-02-19 00:04:19 +0000 |
45 | @@ -24,8 +24,6 @@ |
46 | #define NUX_H |
47 | |
48 | #include "NuxCore/NuxCore.h" |
49 | - |
50 | -#include "NuxCore/SystemTypes.h" |
51 | #include "NuxCore/Error.h" |
52 | #include "NuxCore/FilePath.h" |
53 | #include "NuxCore/Color.h" |
54 | |
55 | === modified file 'Nux/NuxGlobalInitializer.cpp' |
56 | --- Nux/NuxGlobalInitializer.cpp 2011-10-10 01:52:00 +0000 |
57 | +++ Nux/NuxGlobalInitializer.cpp 2012-02-19 00:04:19 +0000 |
58 | @@ -26,11 +26,11 @@ |
59 | namespace nux |
60 | { |
61 | |
62 | - static NuxGlobalSingletonInitializer *GNuxGlobalInitializer = 0; |
63 | + static NuxGlobalSingletonInitializer* GNuxGlobalInitializer = 0; |
64 | |
65 | static void SystemStart() |
66 | { |
67 | - static t_u8 StaticBuffer[sizeof(NuxGlobalSingletonInitializer) ]; |
68 | + static unsigned char StaticBuffer[sizeof(NuxGlobalSingletonInitializer) ]; |
69 | // Placement new in our reserved buffer. |
70 | GNuxGlobalInitializer = new(StaticBuffer) NuxGlobalSingletonInitializer(); |
71 | |
72 | |
73 | === modified file 'Nux/StaticText.cpp' |
74 | --- Nux/StaticText.cpp 2012-02-08 02:00:19 +0000 |
75 | +++ Nux/StaticText.cpp 2012-02-19 00:04:19 +0000 |
76 | @@ -566,7 +566,7 @@ |
77 | &pTextLayout_ // The IDWriteTextLayout interface pointer. |
78 | ); |
79 | |
80 | - IDWriteInlineObject* inlineObject = nullptr; |
81 | + IDWriteInlineObject* inlineObject = NULL; |
82 | if (SUCCEEDED(hr)) |
83 | { |
84 | pDWriteFactory->CreateEllipsisTrimmingSign( |
85 | |
86 | === modified file 'Nux/TextEntry.cpp' |
87 | --- Nux/TextEntry.cpp 2012-02-13 22:33:37 +0000 |
88 | +++ Nux/TextEntry.cpp 2012-02-19 00:04:19 +0000 |
89 | @@ -112,10 +112,10 @@ |
90 | TextEntry::TextEntry(const char* text, NUX_FILE_LINE_DECL) |
91 | : View(NUX_FILE_LINE_PARAM) |
92 | , _size_match_text(true) |
93 | - , _texture2D(nullptr) |
94 | - , canvas_(nullptr) |
95 | - , cached_layout_(nullptr) |
96 | - , preedit_attrs_(nullptr) |
97 | + , _texture2D(NULL) |
98 | + , canvas_(NULL) |
99 | + , cached_layout_(NULL) |
100 | + , preedit_attrs_(NULL) |
101 | , completion_color_(color::Gray) |
102 | , last_dblclick_time_(0) |
103 | , cursor_(0) |
104 | |
105 | === modified file 'NuxCore/Character/NUni.cpp' |
106 | --- NuxCore/Character/NUni.cpp 2011-04-06 21:54:09 +0000 |
107 | +++ NuxCore/Character/NUni.cpp 2012-02-19 00:04:19 +0000 |
108 | @@ -69,24 +69,24 @@ |
109 | |
110 | static const int halfShift = 10; /* used for shifting by 10 bits */ |
111 | |
112 | - static const t_UTF32 halfBase = 0x0010000UL; |
113 | - static const t_UTF32 halfMask = 0x3FFUL; |
114 | - |
115 | -#define UNI_SUR_HIGH_START (t_UTF32)0xD800 |
116 | -#define UNI_SUR_HIGH_END (t_UTF32)0xDBFF |
117 | -#define UNI_SUR_LOW_START (t_UTF32)0xDC00 |
118 | -#define UNI_SUR_LOW_END (t_UTF32)0xDFFF |
119 | - |
120 | - |
121 | - ConversionResult ConvertUTF32toUTF16 (const t_UTF32 **sourceStart, const t_UTF32 *sourceEnd, t_UTF16 **targetStart, t_UTF16 *targetEnd, ConversionFlags flags) |
122 | + static const unsigned int halfBase = 0x0010000UL; |
123 | + static const unsigned int halfMask = 0x3FFUL; |
124 | + |
125 | +#define UNI_SUR_HIGH_START (unsigned int)0xD800 |
126 | +#define UNI_SUR_HIGH_END (unsigned int)0xDBFF |
127 | +#define UNI_SUR_LOW_START (unsigned int)0xDC00 |
128 | +#define UNI_SUR_LOW_END (unsigned int)0xDFFF |
129 | + |
130 | + |
131 | + ConversionResult ConvertUTF32toUTF16 (const unsigned int **sourceStart, const unsigned int *sourceEnd, wchar_t **targetStart, wchar_t *targetEnd, ConversionFlags flags) |
132 | { |
133 | ConversionResult result = conversionOK; |
134 | - const t_UTF32 *source = *sourceStart; |
135 | - t_UTF16 *target = *targetStart; |
136 | + const unsigned int *source = *sourceStart; |
137 | + wchar_t *target = *targetStart; |
138 | |
139 | while (source < sourceEnd) |
140 | { |
141 | - t_UTF32 ch; |
142 | + unsigned int ch; |
143 | |
144 | if (target >= targetEnd) |
145 | { |
146 | @@ -114,7 +114,7 @@ |
147 | } |
148 | else |
149 | { |
150 | - *target++ = (t_UTF16) ch; /* normal case */ |
151 | + *target++ = (wchar_t) ch; /* normal case */ |
152 | } |
153 | } |
154 | else if (ch > UNI_MAX_LEGAL_UTF32) |
155 | @@ -139,8 +139,8 @@ |
156 | } |
157 | |
158 | ch -= halfBase; |
159 | - *target++ = (t_UTF16) ( (ch >> halfShift) + UNI_SUR_HIGH_START); |
160 | - *target++ = (t_UTF16) ( (ch & halfMask) + UNI_SUR_LOW_START); |
161 | + *target++ = (wchar_t) ( (ch >> halfShift) + UNI_SUR_HIGH_START); |
162 | + *target++ = (wchar_t) ( (ch & halfMask) + UNI_SUR_LOW_START); |
163 | } |
164 | } |
165 | |
166 | @@ -151,16 +151,16 @@ |
167 | |
168 | /* --------------------------------------------------------------------- */ |
169 | |
170 | - ConversionResult ConvertUTF16toUTF32 (const t_UTF16 **sourceStart, const t_UTF16 *sourceEnd, t_UTF32 **targetStart, t_UTF32 *targetEnd, ConversionFlags flags) |
171 | + ConversionResult ConvertUTF16toUTF32 (const wchar_t **sourceStart, const wchar_t *sourceEnd, unsigned int **targetStart, unsigned int *targetEnd, ConversionFlags flags) |
172 | { |
173 | ConversionResult result = conversionOK; |
174 | - const t_UTF16 *source = *sourceStart; |
175 | - t_UTF32 *target = *targetStart; |
176 | - t_UTF32 ch, ch2; |
177 | + const wchar_t *source = *sourceStart; |
178 | + unsigned int *target = *targetStart; |
179 | + unsigned int ch, ch2; |
180 | |
181 | while (source < sourceEnd) |
182 | { |
183 | - const t_UTF16 *oldSource = source; /* In case we have to back up because of target overflow. */ |
184 | + const wchar_t *oldSource = source; /* In case we have to back up because of target overflow. */ |
185 | ch = *source++; |
186 | |
187 | /* If we have a surrogate pair, convert to UTF32 first. */ |
188 | @@ -253,7 +253,7 @@ |
189 | * This table contains as many values as there might be trailing bytes |
190 | * in a UTF-8 sequence. |
191 | */ |
192 | - static const t_UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, |
193 | + static const unsigned int offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, |
194 | 0x03C82080UL, 0xFA082080UL, 0x82082080UL |
195 | }; |
196 | |
197 | @@ -264,7 +264,7 @@ |
198 | * (I.e., one byte sequence, two byte... etc.). Remember that sequencs |
199 | * for *legal* UTF-8 will be 4 or fewer bytes total. |
200 | */ |
201 | - static const t_UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; |
202 | + static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; |
203 | |
204 | /* --------------------------------------------------------------------- */ |
205 | |
206 | @@ -278,19 +278,19 @@ |
207 | |
208 | /* --------------------------------------------------------------------- */ |
209 | |
210 | - ConversionResult ConvertUTF16toUTF8 (const t_UTF16 **sourceStart, const t_UTF16 *sourceEnd, t_UTF8 **targetStart, t_UTF8 *targetEnd, ConversionFlags flags) |
211 | + ConversionResult ConvertUTF16toUTF8 (const wchar_t **sourceStart, const wchar_t *sourceEnd, unsigned char **targetStart, unsigned char *targetEnd, ConversionFlags flags) |
212 | { |
213 | ConversionResult result = conversionOK; |
214 | - const t_UTF16 *source = *sourceStart; |
215 | - t_UTF8 *target = *targetStart; |
216 | + const wchar_t *source = *sourceStart; |
217 | + unsigned char *target = *targetStart; |
218 | |
219 | while (source < sourceEnd) |
220 | { |
221 | - t_UTF32 ch; |
222 | + unsigned int ch; |
223 | unsigned short bytesToWrite = 0; |
224 | - const t_UTF32 byteMask = 0xBF; |
225 | - const t_UTF32 byteMark = 0x80; |
226 | - const t_UTF16 *oldSource = source; /* In case we have to back up because of target overflow. */ |
227 | + const unsigned int byteMask = 0xBF; |
228 | + const unsigned int byteMark = 0x80; |
229 | + const wchar_t *oldSource = source; /* In case we have to back up because of target overflow. */ |
230 | ch = *source++; |
231 | |
232 | /* If we have a surrogate pair, convert to UTF32 first. */ |
233 | @@ -299,7 +299,7 @@ |
234 | /* If the 16 bits following the high surrogate are in the source buffer... */ |
235 | if (source < sourceEnd) |
236 | { |
237 | - t_UTF32 ch2 = *source; |
238 | + unsigned int ch2 = *source; |
239 | |
240 | /* If it's a low surrogate, convert to UTF32. */ |
241 | if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) |
242 | @@ -334,19 +334,19 @@ |
243 | } |
244 | |
245 | /* Figure out how many bytes the result will require */ |
246 | - if (ch < (t_UTF32) 0x80) |
247 | + if (ch < (unsigned int) 0x80) |
248 | { |
249 | bytesToWrite = 1; |
250 | } |
251 | - else if (ch < (t_UTF32) 0x800) |
252 | + else if (ch < (unsigned int) 0x800) |
253 | { |
254 | bytesToWrite = 2; |
255 | } |
256 | - else if (ch < (t_UTF32) 0x10000) |
257 | + else if (ch < (unsigned int) 0x10000) |
258 | { |
259 | bytesToWrite = 3; |
260 | } |
261 | - else if (ch < (t_UTF32) 0x110000) |
262 | + else if (ch < (unsigned int) 0x110000) |
263 | { |
264 | bytesToWrite = 4; |
265 | } |
266 | @@ -369,16 +369,16 @@ |
267 | switch (bytesToWrite) /* note: everything falls through. */ |
268 | { |
269 | case 4: |
270 | - *--target = (t_UTF8) ( (ch | byteMark) & byteMask); |
271 | + *--target = (unsigned char) ( (ch | byteMark) & byteMask); |
272 | ch >>= 6; |
273 | case 3: |
274 | - *--target = (t_UTF8) ( (ch | byteMark) & byteMask); |
275 | + *--target = (unsigned char) ( (ch | byteMark) & byteMask); |
276 | ch >>= 6; |
277 | case 2: |
278 | - *--target = (t_UTF8) ( (ch | byteMark) & byteMask); |
279 | + *--target = (unsigned char) ( (ch | byteMark) & byteMask); |
280 | ch >>= 6; |
281 | case 1: |
282 | - *--target = (t_UTF8) (ch | firstByteMark[bytesToWrite]); |
283 | + *--target = (unsigned char) (ch | firstByteMark[bytesToWrite]); |
284 | } |
285 | |
286 | target += bytesToWrite; |
287 | @@ -402,10 +402,10 @@ |
288 | * definition of UTF-8 goes up to 4-byte sequences. |
289 | */ |
290 | |
291 | - static bool isLegalUTF8 (const t_UTF8 *source, int length) |
292 | + static bool isLegalUTF8 (const unsigned char *source, int length) |
293 | { |
294 | - t_UTF8 a; |
295 | - const t_UTF8 *srcptr = source + length; |
296 | + unsigned char a; |
297 | + const unsigned char *srcptr = source + length; |
298 | |
299 | switch (length) |
300 | { |
301 | @@ -469,7 +469,7 @@ |
302 | * This is not used here; it's just exported. |
303 | */ |
304 | |
305 | - bool isLegalUTF8Sequence (const t_UTF8 *source, const t_UTF8 *sourceEnd) |
306 | + bool isLegalUTF8Sequence (const unsigned char *source, const unsigned char *sourceEnd) |
307 | { |
308 | int length; |
309 | |
310 | @@ -508,8 +508,8 @@ |
311 | bool |
312 | tr_utf8_validate ( const char *str, int max_len, const char **end ) |
313 | { |
314 | - const t_UTF8 *source = (const t_UTF8 *) str; |
315 | - const t_UTF8 *sourceEnd; |
316 | + const unsigned char *source = (const unsigned char *) str; |
317 | + const unsigned char *sourceEnd; |
318 | |
319 | if ( max_len == 0 ) |
320 | return true; |
321 | @@ -564,15 +564,15 @@ |
322 | |
323 | /* --------------------------------------------------------------------- */ |
324 | |
325 | - ConversionResult ConvertUTF8toUTF16 (const t_UTF8 **sourceStart, const t_UTF8 *sourceEnd, t_UTF16 **targetStart, t_UTF16 *targetEnd, ConversionFlags flags) |
326 | + ConversionResult ConvertUTF8toUTF16 (const unsigned char **sourceStart, const unsigned char *sourceEnd, wchar_t **targetStart, wchar_t *targetEnd, ConversionFlags flags) |
327 | { |
328 | ConversionResult result = conversionOK; |
329 | - const t_UTF8 *source = *sourceStart; |
330 | - t_UTF16 *target = *targetStart; |
331 | + const unsigned char *source = *sourceStart; |
332 | + wchar_t *target = *targetStart; |
333 | |
334 | while (source < sourceEnd) |
335 | { |
336 | - t_UTF32 ch = 0; |
337 | + unsigned int ch = 0; |
338 | unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; |
339 | |
340 | if (source + extraBytesToRead >= sourceEnd) |
341 | @@ -639,7 +639,7 @@ |
342 | } |
343 | else |
344 | { |
345 | - *target++ = (t_UTF16) ch; /* normal case */ |
346 | + *target++ = (wchar_t) ch; /* normal case */ |
347 | } |
348 | } |
349 | else if (ch > UNI_MAX_UTF16) |
350 | @@ -666,8 +666,8 @@ |
351 | } |
352 | |
353 | ch -= halfBase; |
354 | - *target++ = (t_UTF16) ( (ch >> halfShift) + UNI_SUR_HIGH_START); |
355 | - *target++ = (t_UTF16) ( (ch & halfMask) + UNI_SUR_LOW_START); |
356 | + *target++ = (wchar_t) ( (ch >> halfShift) + UNI_SUR_HIGH_START); |
357 | + *target++ = (wchar_t) ( (ch & halfMask) + UNI_SUR_LOW_START); |
358 | } |
359 | } |
360 | |
361 | @@ -679,19 +679,19 @@ |
362 | /* --------------------------------------------------------------------- */ |
363 | |
364 | ConversionResult ConvertUTF32toUTF8 ( |
365 | - const t_UTF32 **sourceStart, const t_UTF32 *sourceEnd, |
366 | - t_UTF8 **targetStart, t_UTF8 *targetEnd, ConversionFlags flags) |
367 | + const unsigned int **sourceStart, const unsigned int *sourceEnd, |
368 | + unsigned char **targetStart, unsigned char *targetEnd, ConversionFlags flags) |
369 | { |
370 | ConversionResult result = conversionOK; |
371 | - const t_UTF32 *source = *sourceStart; |
372 | - t_UTF8 *target = *targetStart; |
373 | + const unsigned int *source = *sourceStart; |
374 | + unsigned char *target = *targetStart; |
375 | |
376 | while (source < sourceEnd) |
377 | { |
378 | - t_UTF32 ch; |
379 | + unsigned int ch; |
380 | unsigned short bytesToWrite = 0; |
381 | - const t_UTF32 byteMask = 0xBF; |
382 | - const t_UTF32 byteMark = 0x80; |
383 | + const unsigned int byteMask = 0xBF; |
384 | + const unsigned int byteMark = 0x80; |
385 | ch = *source++; |
386 | |
387 | if (flags == strictConversion ) |
388 | @@ -709,15 +709,15 @@ |
389 | * Figure out how many bytes the result will require. Turn any |
390 | * illegally large UTF32 things (> Plane 17) into replacement chars. |
391 | */ |
392 | - if (ch < (t_UTF32) 0x80) |
393 | + if (ch < (unsigned int) 0x80) |
394 | { |
395 | bytesToWrite = 1; |
396 | } |
397 | - else if (ch < (t_UTF32) 0x800) |
398 | + else if (ch < (unsigned int) 0x800) |
399 | { |
400 | bytesToWrite = 2; |
401 | } |
402 | - else if (ch < (t_UTF32) 0x10000) |
403 | + else if (ch < (unsigned int) 0x10000) |
404 | { |
405 | bytesToWrite = 3; |
406 | } |
407 | @@ -745,16 +745,16 @@ |
408 | switch (bytesToWrite) /* note: everything falls through. */ |
409 | { |
410 | case 4: |
411 | - *--target = (t_UTF8) ( (ch | byteMark) & byteMask); |
412 | + *--target = (unsigned char) ( (ch | byteMark) & byteMask); |
413 | ch >>= 6; |
414 | case 3: |
415 | - *--target = (t_UTF8) ( (ch | byteMark) & byteMask); |
416 | + *--target = (unsigned char) ( (ch | byteMark) & byteMask); |
417 | ch >>= 6; |
418 | case 2: |
419 | - *--target = (t_UTF8) ( (ch | byteMark) & byteMask); |
420 | + *--target = (unsigned char) ( (ch | byteMark) & byteMask); |
421 | ch >>= 6; |
422 | case 1: |
423 | - *--target = (t_UTF8) (ch | firstByteMark[bytesToWrite]); |
424 | + *--target = (unsigned char) (ch | firstByteMark[bytesToWrite]); |
425 | } |
426 | |
427 | target += bytesToWrite; |
428 | @@ -768,16 +768,16 @@ |
429 | /* --------------------------------------------------------------------- */ |
430 | |
431 | ConversionResult ConvertUTF8toUTF32 ( |
432 | - const t_UTF8 **sourceStart, const t_UTF8 *sourceEnd, |
433 | - t_UTF32 **targetStart, t_UTF32 *targetEnd, ConversionFlags flags) |
434 | + const unsigned char **sourceStart, const unsigned char *sourceEnd, |
435 | + unsigned int **targetStart, unsigned int *targetEnd, ConversionFlags flags) |
436 | { |
437 | ConversionResult result = conversionOK; |
438 | - const t_UTF8 *source = *sourceStart; |
439 | - t_UTF32 *target = *targetStart; |
440 | + const unsigned char *source = *sourceStart; |
441 | + unsigned int *target = *targetStart; |
442 | |
443 | while (source < sourceEnd) |
444 | { |
445 | - t_UTF32 ch = 0; |
446 | + unsigned int ch = 0; |
447 | unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; |
448 | |
449 | if (source + extraBytesToRead >= sourceEnd) |
450 | |
451 | === modified file 'NuxCore/Character/NUni.h' |
452 | --- NuxCore/Character/NUni.h 2011-04-06 21:54:09 +0000 |
453 | +++ NuxCore/Character/NUni.h 2012-02-19 00:04:19 +0000 |
454 | @@ -112,9 +112,9 @@ |
455 | bit mask & shift operations. |
456 | ------------------------------------------------------------------------ */ |
457 | |
458 | -//typedef unsigned long t_UTF32; /* at least 32 bits */ |
459 | -//typedef unsigned short t_UTF16; /* at least 16 bits */ |
460 | -//typedef unsigned char t_UTF8; /* typically 8 bits */ |
461 | +//typedef unsigned long unsigned int; /* at least 32 bits */ |
462 | +//typedef unsigned short wchar_t; /* at least 16 bits */ |
463 | +//typedef unsigned char unsigned char; /* typically 8 bits */ |
464 | //typedef unsigned char Boolean; /* 0 or 1 */ |
465 | |
466 | |
467 | @@ -122,11 +122,11 @@ |
468 | { |
469 | |
470 | /* Some fundamental constants */ |
471 | -#define UNI_REPLACEMENT_CHAR (t_UTF32)0x0000FFFD |
472 | -#define UNI_MAX_BMP (t_UTF32)0x0000FFFF |
473 | -#define UNI_MAX_UTF16 (t_UTF32)0x0010FFFF |
474 | -#define UNI_MAX_UTF32 (t_UTF32)0x7FFFFFFF |
475 | -#define UNI_MAX_LEGAL_UTF32 (t_UTF32)0x0010FFFF |
476 | +#define UNI_REPLACEMENT_CHAR (unsigned int)0x0000FFFD |
477 | +#define UNI_MAX_BMP (unsigned int)0x0000FFFF |
478 | +#define UNI_MAX_UTF16 (unsigned int)0x0010FFFF |
479 | +#define UNI_MAX_UTF32 (unsigned int)0x7FFFFFFF |
480 | +#define UNI_MAX_LEGAL_UTF32 (unsigned int)0x0010FFFF |
481 | |
482 | typedef enum |
483 | { |
484 | @@ -143,30 +143,30 @@ |
485 | } ConversionFlags; |
486 | |
487 | ConversionResult ConvertUTF8toUTF16 ( |
488 | - const t_UTF8 **sourceStart, const t_UTF8 *sourceEnd, |
489 | - t_UTF16 **targetStart, t_UTF16 *targetEnd, ConversionFlags flags); |
490 | + const unsigned char **sourceStart, const unsigned char *sourceEnd, |
491 | + wchar_t **targetStart, wchar_t *targetEnd, ConversionFlags flags); |
492 | |
493 | ConversionResult ConvertUTF16toUTF8 ( |
494 | - const t_UTF16 **sourceStart, const t_UTF16 *sourceEnd, |
495 | - t_UTF8 **targetStart, t_UTF8 *targetEnd, ConversionFlags flags); |
496 | + const wchar_t **sourceStart, const wchar_t *sourceEnd, |
497 | + unsigned char **targetStart, unsigned char *targetEnd, ConversionFlags flags); |
498 | |
499 | ConversionResult ConvertUTF8toUTF32 ( |
500 | - const t_UTF8 **sourceStart, const t_UTF8 *sourceEnd, |
501 | - t_UTF32 **targetStart, t_UTF32 *targetEnd, ConversionFlags flags); |
502 | + const unsigned char **sourceStart, const unsigned char *sourceEnd, |
503 | + unsigned int **targetStart, unsigned int *targetEnd, ConversionFlags flags); |
504 | |
505 | ConversionResult ConvertUTF32toUTF8 ( |
506 | - const t_UTF32 **sourceStart, const t_UTF32 *sourceEnd, |
507 | - t_UTF8 **targetStart, t_UTF8 *targetEnd, ConversionFlags flags); |
508 | + const unsigned int **sourceStart, const unsigned int *sourceEnd, |
509 | + unsigned char **targetStart, unsigned char *targetEnd, ConversionFlags flags); |
510 | |
511 | ConversionResult ConvertUTF16toUTF32 ( |
512 | - const t_UTF16 **sourceStart, const t_UTF16 *sourceEnd, |
513 | - t_UTF32 **targetStart, t_UTF32 *targetEnd, ConversionFlags flags); |
514 | + const wchar_t **sourceStart, const wchar_t *sourceEnd, |
515 | + unsigned int **targetStart, unsigned int *targetEnd, ConversionFlags flags); |
516 | |
517 | ConversionResult ConvertUTF32toUTF16 ( |
518 | - const t_UTF32 **sourceStart, const t_UTF32 *sourceEnd, |
519 | - t_UTF16 **targetStart, t_UTF16 *targetEnd, ConversionFlags flags); |
520 | + const unsigned int **sourceStart, const unsigned int *sourceEnd, |
521 | + wchar_t **targetStart, wchar_t *targetEnd, ConversionFlags flags); |
522 | |
523 | - bool isLegalUTF8Sequence (const t_UTF8 *source, const t_UTF8 *sourceEnd); |
524 | + bool isLegalUTF8Sequence (const unsigned char *source, const unsigned char *sourceEnd); |
525 | |
526 | |
527 | /* intended to work the same as g_utf8_validate */ |
528 | |
529 | === modified file 'NuxCore/Character/NUnicode.cpp' |
530 | --- NuxCore/Character/NUnicode.cpp 2011-09-20 06:03:43 +0000 |
531 | +++ NuxCore/Character/NUnicode.cpp 2012-02-19 00:04:19 +0000 |
532 | @@ -34,10 +34,10 @@ |
533 | size_t utf8size = 6 * utf16size; |
534 | ANSICHAR *utf8string = new ANSICHAR[utf8size+1]; |
535 | |
536 | - const t_UTF16 *source_start = utf16string.c_str(); |
537 | - const t_UTF16 *source_end = source_start + utf16size; |
538 | - t_UTF8 *target_start = reinterpret_cast<t_UTF8 *> (utf8string); |
539 | - t_UTF8 *target_end = target_start + utf8size; |
540 | + const wchar_t *source_start = utf16string.c_str(); |
541 | + const wchar_t *source_end = source_start + utf16size; |
542 | + unsigned char *target_start = reinterpret_cast<unsigned char *> (utf8string); |
543 | + unsigned char *target_end = target_start + utf8size; |
544 | |
545 | ConversionResult res = ConvertUTF16toUTF8 (&source_start, source_end, &target_start, target_end, lenientConversion); |
546 | |
547 | @@ -59,10 +59,10 @@ |
548 | size_t utf16size = utf8size; |
549 | UNICHAR *utf16string = new UNICHAR[utf16size+1]; |
550 | |
551 | - const t_UTF8 *source_start = reinterpret_cast<const t_UTF8 *> (utf8string.c_str() ); |
552 | - const t_UTF8 *source_end = source_start + utf8size; |
553 | - t_UTF16 *target_start = reinterpret_cast<t_UTF16 *> (utf16string); |
554 | - t_UTF16 *target_end = target_start + utf16size; |
555 | + const unsigned char *source_start = reinterpret_cast<const unsigned char *> (utf8string.c_str() ); |
556 | + const unsigned char *source_end = source_start + utf8size; |
557 | + wchar_t *target_start = reinterpret_cast<wchar_t *> (utf16string); |
558 | + wchar_t *target_end = target_start + utf16size; |
559 | |
560 | ConversionResult res = ConvertUTF8toUTF16 (&source_start, source_end, &target_start, target_end, lenientConversion); |
561 | |
562 | |
563 | === modified file 'NuxCore/Character/NUnicode.h' |
564 | --- NuxCore/Character/NUnicode.h 2011-04-06 21:54:09 +0000 |
565 | +++ NuxCore/Character/NUnicode.h 2012-02-19 00:04:19 +0000 |
566 | @@ -51,10 +51,10 @@ |
567 | inline TCHAR ConvertAnsiCharToTCHAR (ANSICHAR In) |
568 | { |
569 | TCHAR output; |
570 | - const t_UTF8 *source_start = &In; |
571 | - const t_UTF8 *source_end = source_start + 1; |
572 | - t_UTF16 *target_start = reinterpret_cast<t_UTF16 *> (&output); |
573 | - t_UTF16 *target_end = target_start + sizeof (wchar_t); |
574 | + const unsigned char *source_start = &In; |
575 | + const unsigned char *source_end = source_start + 1; |
576 | + wchar_t *target_start = reinterpret_cast<wchar_t *> (&output); |
577 | + wchar_t *target_end = target_start + sizeof (wchar_t); |
578 | |
579 | ConversionResult res = ConvertUTF8toUTF16 (&source_start, source_end, &target_start, target_end, lenientConversion); |
580 | |
581 | @@ -69,10 +69,10 @@ |
582 | inline ANSICHAR ConvertTCHARToAnsiChar (TCHAR In) |
583 | { |
584 | ANSICHAR output; |
585 | - const t_UTF16 *source_start = &In; |
586 | - const t_UTF16 *source_end = source_start + 1; |
587 | - t_UTF8 *target_start = reinterpret_cast<t_UTF8 *> (&output); |
588 | - t_UTF8 *target_end = target_start + sizeof (wchar_t); |
589 | + const wchar_t *source_start = &In; |
590 | + const wchar_t *source_end = source_start + 1; |
591 | + unsigned char *target_start = reinterpret_cast<unsigned char *> (&output); |
592 | + unsigned char *target_end = target_start + sizeof (wchar_t); |
593 | |
594 | ConversionResult res = ConvertUTF16toUTF8 (&source_start, source_end, &target_start, target_end, lenientConversion); |
595 | |
596 | @@ -95,10 +95,10 @@ |
597 | inline TCHAR ConvertUnicodeCharToTCHAR (UNICHAR In) |
598 | { |
599 | TCHAR output; |
600 | - const t_UTF16 *source_start = &In; |
601 | - const t_UTF16 *source_end = source_start + 1; |
602 | - t_UTF8 *target_start = reinterpret_cast<t_UTF8 *> (&output); |
603 | - t_UTF8 *target_end = target_start + sizeof (wchar_t); |
604 | + const wchar_t *source_start = &In; |
605 | + const wchar_t *source_end = source_start + 1; |
606 | + unsigned char *target_start = reinterpret_cast<unsigned char *> (&output); |
607 | + unsigned char *target_end = target_start + sizeof (wchar_t); |
608 | |
609 | ConversionResult res = ConvertUTF16toUTF8 (&source_start, source_end, &target_start, target_end, lenientConversion); |
610 | |
611 | @@ -113,10 +113,10 @@ |
612 | inline UNICHAR ConvertTCHARToUnicodeChar (TCHAR In) |
613 | { |
614 | UNICHAR output; |
615 | - const t_UTF8 *source_start = reinterpret_cast<const t_UTF8 *> (&In); |
616 | - const t_UTF8 *source_end = source_start + 1; |
617 | - t_UTF16 *target_start = reinterpret_cast<t_UTF16 *> (&output); |
618 | - t_UTF16 *target_end = target_start + sizeof (wchar_t); |
619 | + const unsigned char *source_start = reinterpret_cast<const unsigned char *> (&In); |
620 | + const unsigned char *source_end = source_start + 1; |
621 | + wchar_t *target_start = reinterpret_cast<wchar_t *> (&output); |
622 | + wchar_t *target_end = target_start + sizeof (wchar_t); |
623 | |
624 | ConversionResult res = ConvertUTF8toUTF16 (&source_start, source_end, &target_start, target_end, lenientConversion); |
625 | |
626 | @@ -144,10 +144,10 @@ |
627 | inline ANSICHAR ConvertUnicodeCharToAnsiChar (UNICHAR In) |
628 | { |
629 | TCHAR output; |
630 | - const t_UTF16 *source_start = &In; |
631 | - const t_UTF16 *source_end = source_start + 1; |
632 | - t_UTF8 *target_start = reinterpret_cast<t_UTF8 *> (&output); |
633 | - t_UTF8 *target_end = target_start + sizeof (wchar_t); |
634 | + const wchar_t *source_start = &In; |
635 | + const wchar_t *source_end = source_start + 1; |
636 | + unsigned char *target_start = reinterpret_cast<unsigned char *> (&output); |
637 | + unsigned char *target_end = target_start + sizeof (wchar_t); |
638 | |
639 | ConversionResult res = ConvertUTF16toUTF8 (&source_start, source_end, &target_start, target_end, lenientConversion); |
640 | |
641 | @@ -165,10 +165,10 @@ |
642 | inline UNICHAR ConvertAnsiCharToUnicodeChar (ANSICHAR In) |
643 | { |
644 | UNICHAR output; |
645 | - const t_UTF8 *source_start = reinterpret_cast<const t_UTF8 *> (&In); |
646 | - const t_UTF8 *source_end = source_start + 1; |
647 | - t_UTF16 *target_start = reinterpret_cast<t_UTF16 *> (&output); |
648 | - t_UTF16 *target_end = target_start + sizeof (wchar_t); |
649 | + const unsigned char *source_start = reinterpret_cast<const unsigned char *> (&In); |
650 | + const unsigned char *source_end = source_start + 1; |
651 | + wchar_t *target_start = reinterpret_cast<wchar_t *> (&output); |
652 | + wchar_t *target_end = target_start + sizeof (wchar_t); |
653 | |
654 | ConversionResult res = ConvertUTF8toUTF16 (&source_start, source_end, &target_start, target_end, lenientConversion); |
655 | |
656 | @@ -198,10 +198,10 @@ |
657 | size_t utf8size = 6 * utf16size; |
658 | ANSICHAR *utf8string = new ANSICHAR[utf8size+1]; |
659 | |
660 | - const t_UTF16 *source_start = utf16string.c_str(); |
661 | - const t_UTF16 *source_end = source_start + utf16size; |
662 | - t_UTF8* target_start = reinterpret_cast<t_UTF8*>(utf8string); |
663 | - t_UTF8* target_end = target_start + utf8size; |
664 | + const wchar_t *source_start = utf16string.c_str(); |
665 | + const wchar_t *source_end = source_start + utf16size; |
666 | + unsigned char* target_start = reinterpret_cast<unsigned char*>(utf8string); |
667 | + unsigned char* target_end = target_start + utf8size; |
668 | |
669 | ConversionResult res = ConvertUTF16toUTF8(&source_start, source_end, &target_start, target_end, lenientConversion); |
670 | if (res != conversionOK) |
671 | |
672 | === modified file 'NuxCore/FileManager/NFileManagerGNU.cpp' |
673 | --- NuxCore/FileManager/NFileManagerGNU.cpp 2011-10-21 23:49:15 +0000 |
674 | +++ NuxCore/FileManager/NFileManagerGNU.cpp 2012-02-19 00:04:19 +0000 |
675 | @@ -181,7 +181,7 @@ |
676 | return; |
677 | } |
678 | |
679 | - Precache (m_FilePos, t_s32_max); |
680 | + Precache (m_FilePos, 0x7FFFFFFF); |
681 | DataSize = Min<long long> (Length, m_BufferBase + m_BufferCount - m_FilePos); |
682 | |
683 | if (DataSize <= 0) |
684 | |
685 | === modified file 'NuxCore/FileManager/NFileManagerWindows.cpp' |
686 | --- NuxCore/FileManager/NFileManagerWindows.cpp 2011-10-21 22:06:35 +0000 |
687 | +++ NuxCore/FileManager/NFileManagerWindows.cpp 2012-02-19 00:04:19 +0000 |
688 | @@ -150,7 +150,7 @@ |
689 | return !m_ErrorCode; |
690 | } |
691 | |
692 | - void NWindowsSerialFileReader::SerializeFinal (void *Dest, long long Length) |
693 | + void NWindowsSerialFileReader::SerializeFinal (void* Dest, long long Length) |
694 | { |
695 | nuxAssert (Dest); |
696 | |
697 | @@ -164,7 +164,7 @@ |
698 | { |
699 | int Count = 0; |
700 | //GTotalBytesReadViaFileManager += Length; |
701 | - ReadFile (m_FileHandle, Dest, Length, (DWORD *) &Count, NULL); |
702 | + ReadFile (m_FileHandle, Dest, Length, (DWORD*) &Count, NULL); |
703 | |
704 | if (Count != Length) |
705 | { |
706 | @@ -177,7 +177,7 @@ |
707 | return; |
708 | } |
709 | |
710 | - Precache (m_FilePos, t_s32_max); |
711 | + Precache (m_FilePos, 0x7FFFFFFF); |
712 | DataSize = Min<long long> (Length, m_BufferBase + m_BufferCount - m_FilePos); |
713 | |
714 | if (DataSize <= 0) |
715 | @@ -753,7 +753,7 @@ |
716 | |
717 | if (_tstat (Filename, &FileInfo) == 0) |
718 | { |
719 | - time_t CurrentTime, |
720 | + time_t CurrentTime, |
721 | FileTime; |
722 | FileTime = FileInfo.st_mtime; |
723 | time (&CurrentTime); |
724 | @@ -847,7 +847,7 @@ |
725 | Timestamp.Second = pTime.tm_sec; |
726 | Timestamp.Year = pTime.tm_year + 1900; |
727 | #else |
728 | - time_t FileTime; |
729 | + time_t FileTime; |
730 | // FileTime represents seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time (UTC). |
731 | FileTime = FileInfo.st_mtime; |
732 | // gmtime can express time up to 03:14:07 January 19, 2038, UTC |
733 | |
734 | === modified file 'NuxCore/FileManager/NSerializer.cpp' |
735 | --- NuxCore/FileManager/NSerializer.cpp 2011-10-21 22:06:35 +0000 |
736 | +++ NuxCore/FileManager/NSerializer.cpp 2012-02-19 00:04:19 +0000 |
737 | @@ -30,7 +30,7 @@ |
738 | // { |
739 | // for(unsigned long long i = 0; i < Length; i++) |
740 | // { |
741 | -// t_u8* bytebuffer = (t_u8*)(&buffer[i]); |
742 | +// unsigned char* bytebuffer = (unsigned char*)(&buffer[i]); |
743 | // Serialize(bytebuffer, ElementSize); |
744 | // } |
745 | // } |
746 | @@ -47,26 +47,26 @@ |
747 | // return Sr; |
748 | // } |
749 | |
750 | - void NSerializer::Serialize (t_char &data) |
751 | + void NSerializer::Serialize (char &data) |
752 | { |
753 | - SerializeFinal (&data, sizeof (t_char) ); |
754 | + SerializeFinal (&data, sizeof (char) ); |
755 | } |
756 | + |
757 | void NSerializer::Serialize (wchar_t &data) |
758 | { |
759 | SerializeFinal (&data, sizeof (wchar_t) ); |
760 | } |
761 | + |
762 | void NSerializer::Serialize (bool &data) |
763 | { |
764 | SerializeFinal (&data, sizeof (bool) ); |
765 | } |
766 | - void NSerializer::Serialize (t_s8 &data) |
767 | - { |
768 | - SerializeFinal (&data, sizeof (t_s8) ); |
769 | - } |
770 | - void NSerializer::Serialize (t_u8 &data) |
771 | - { |
772 | - SerializeFinal (&data, sizeof (t_u8) ); |
773 | - } |
774 | + |
775 | + void NSerializer::Serialize (unsigned char &data) |
776 | + { |
777 | + SerializeFinal (&data, sizeof (unsigned char) ); |
778 | + } |
779 | + |
780 | void NSerializer::Serialize (unsigned short &data) |
781 | { |
782 | SerializeFinal (&data, sizeof (unsigned short) ); |
783 | @@ -108,10 +108,6 @@ |
784 | SerializeFinal (&data, sizeof (long long) ); |
785 | } |
786 | |
787 | - void NSerializer::Serialize (t_char *buffer, unsigned int len, unsigned int stride) |
788 | - { |
789 | - SerializeFinal (buffer, len * stride); |
790 | - } |
791 | void NSerializer::Serialize (wchar_t *buffer, unsigned int len, unsigned int stride) |
792 | { |
793 | SerializeFinal (buffer, len * stride); |
794 | @@ -120,11 +116,11 @@ |
795 | { |
796 | SerializeFinal (buffer, len * stride); |
797 | } |
798 | - void NSerializer::Serialize (t_s8 *buffer, unsigned int len, unsigned int stride) |
799 | + void NSerializer::Serialize (char *buffer, unsigned int len, unsigned int stride) |
800 | { |
801 | SerializeFinal (buffer, len * stride); |
802 | } |
803 | - void NSerializer::Serialize (t_u8 *buffer, unsigned int len, unsigned int stride) |
804 | + void NSerializer::Serialize (unsigned char *buffer, unsigned int len, unsigned int stride) |
805 | { |
806 | SerializeFinal (buffer, len * stride); |
807 | } |
808 | |
809 | === modified file 'NuxCore/FileManager/NSerializer.h' |
810 | --- NuxCore/FileManager/NSerializer.h 2011-10-21 22:06:35 +0000 |
811 | +++ NuxCore/FileManager/NSerializer.h 2012-02-19 00:04:19 +0000 |
812 | @@ -55,7 +55,7 @@ |
813 | // { |
814 | // for(unsigned long long i = 0; i < NumberOfElements; i++) |
815 | // { |
816 | -// t_u8* bytebuffer = (t_u8*)(&buffer[i]); |
817 | +// unsigned char* bytebuffer = (unsigned char*)(&buffer[i]); |
818 | // Serialize(bytebuffer, ElementSize); |
819 | // } |
820 | // } |
821 | @@ -86,12 +86,12 @@ |
822 | { |
823 | // Transferring between memory and file, so flip the byte order. |
824 | for ( INT i = Length - 1; i >= 0; i-- ) |
825 | - Serialize ( (t_u8 *) V + i, 1 ); |
826 | + Serialize ( (unsigned char *) V + i, 1 ); |
827 | } |
828 | else |
829 | { |
830 | // Transferring around within memory, so keep the byte order. |
831 | - Serialize ( (t_u8 *) V, Length); |
832 | + Serialize ( (unsigned char *) V, Length); |
833 | } |
834 | |
835 | return *this; |
836 | @@ -108,11 +108,10 @@ |
837 | return m_ErrorCode; |
838 | } |
839 | |
840 | - virtual void Serialize (t_char &data); |
841 | + virtual void Serialize (char &data); |
842 | virtual void Serialize (wchar_t &data); |
843 | virtual void Serialize (bool &data); |
844 | - virtual void Serialize (t_s8 &data); |
845 | - virtual void Serialize (t_u8 &data); |
846 | + virtual void Serialize (unsigned char &data); |
847 | virtual void Serialize (unsigned short &data); |
848 | virtual void Serialize (short &data); |
849 | virtual void Serialize (unsigned int &data); |
850 | @@ -124,11 +123,10 @@ |
851 | virtual void Serialize (unsigned long long &data); |
852 | virtual void Serialize (long long &data); |
853 | |
854 | - virtual void Serialize (t_char *buffer, unsigned int len, unsigned int stride = sizeof (t_char) ); |
855 | virtual void Serialize (wchar_t *buffer, unsigned int len, unsigned int stride = sizeof (wchar_t) ); |
856 | virtual void Serialize (bool *buffer, unsigned int len, unsigned int stride = sizeof (bool) ); |
857 | - virtual void Serialize (t_s8 *buffer, unsigned int len, unsigned int stride = sizeof (t_s8) ); |
858 | - virtual void Serialize (t_u8 *buffer, unsigned int len, unsigned int stride = sizeof (t_u8) ); |
859 | + virtual void Serialize (char *buffer, unsigned int len, unsigned int stride = sizeof (char) ); |
860 | + virtual void Serialize (unsigned char *buffer, unsigned int len, unsigned int stride = sizeof (unsigned char) ); |
861 | virtual void Serialize (unsigned short *buffer, unsigned int len, unsigned int stride = sizeof (unsigned short) ); |
862 | virtual void Serialize (short *buffer, unsigned int len, unsigned int stride = sizeof (short) ); |
863 | virtual void Serialize (unsigned int *buffer, unsigned int len, unsigned int stride = sizeof (unsigned int) ); |
864 | @@ -152,22 +150,17 @@ |
865 | bool m_ErrorCode; |
866 | }; |
867 | |
868 | - NUX_INLINE NSerializer &operator << (NSerializer &Sr, t_char &v) |
869 | - { |
870 | - Sr.Serialize (v); |
871 | - return Sr; |
872 | - } |
873 | NUX_INLINE NSerializer &operator << (NSerializer &Sr, bool &v) |
874 | { |
875 | Sr.Serialize (v); |
876 | return Sr; |
877 | } |
878 | - NUX_INLINE NSerializer &operator << (NSerializer &Sr, t_s8 &v) |
879 | + NUX_INLINE NSerializer &operator << (NSerializer &Sr, char &v) |
880 | { |
881 | Sr.Serialize (v); |
882 | return Sr; |
883 | } |
884 | - NUX_INLINE NSerializer &operator << (NSerializer &Sr, t_u8 &v) |
885 | + NUX_INLINE NSerializer &operator << (NSerializer &Sr, unsigned char &v) |
886 | { |
887 | Sr.Serialize (v); |
888 | return Sr; |
889 | |
890 | === modified file 'NuxCore/GlobalInitializer.cpp' |
891 | --- NuxCore/GlobalInitializer.cpp 2011-09-20 06:03:43 +0000 |
892 | +++ NuxCore/GlobalInitializer.cpp 2012-02-19 00:04:19 +0000 |
893 | @@ -29,7 +29,7 @@ |
894 | |
895 | static void SystemStart() |
896 | { |
897 | - static t_u8 StaticBuffer [sizeof (GlobalSingletonInitializer)]; |
898 | + static unsigned char StaticBuffer [sizeof (GlobalSingletonInitializer)]; |
899 | // Placement new in our reserved buffer. |
900 | GGlobalInitializer = new (StaticBuffer) GlobalSingletonInitializer (); |
901 | |
902 | |
903 | === modified file 'NuxCore/Makefile.am' |
904 | --- NuxCore/Makefile.am 2012-02-12 00:39:05 +0000 |
905 | +++ NuxCore/Makefile.am 2012-02-19 00:04:19 +0000 |
906 | @@ -120,7 +120,6 @@ |
907 | |
908 | source_h = \ |
909 | $(srcdir)/AsyncFileWriter.h \ |
910 | - $(srcdir)/SystemTypes.h \ |
911 | $(srcdir)/Point.h \ |
912 | $(srcdir)/FilePath.h \ |
913 | $(srcdir)/System.h \ |
914 | |
915 | === modified file 'NuxCore/Math/MathInc.h' |
916 | --- NuxCore/Math/MathInc.h 2011-05-16 23:55:32 +0000 |
917 | +++ NuxCore/Math/MathInc.h 2012-02-19 00:04:19 +0000 |
918 | @@ -23,8 +23,6 @@ |
919 | #ifndef MATHINC_H |
920 | #define MATHINC_H |
921 | |
922 | -#include "../SystemTypes.h" |
923 | - |
924 | #include "Constants.h" |
925 | #include "MathUtility.h" |
926 | #include "Complex.h" |
927 | |
928 | === modified file 'NuxCore/Math/MathUtility.h' |
929 | --- NuxCore/Math/MathUtility.h 2011-10-21 22:06:35 +0000 |
930 | +++ NuxCore/Math/MathUtility.h 2012-02-19 00:04:19 +0000 |
931 | @@ -32,6 +32,9 @@ |
932 | |
933 | #include "Constants.h" |
934 | |
935 | +#define DEGTORAD(d) (d) * nux::Const::pi / 180.0f |
936 | +#define RADTODEG(d) (d) * 180.0f / nux::Const::pi |
937 | + |
938 | namespace nux |
939 | { |
940 | template<typename T> inline T Square (const T A) |
941 | @@ -224,8 +227,8 @@ |
942 | inline unsigned short ReverseByteOrdering (unsigned short value) |
943 | { |
944 | unsigned short temp; |
945 | - t_u8 *src = (t_u8 *) &value; |
946 | - t_u8 *dest = (t_u8 *) &temp; |
947 | + unsigned char *src = (unsigned char *) &value; |
948 | + unsigned char *dest = (unsigned char *) &temp; |
949 | |
950 | dest[0] = src[1]; |
951 | dest[1] = src[0]; |
952 | @@ -240,8 +243,8 @@ |
953 | inline unsigned int ReverseByteOrdering (unsigned int value) |
954 | { |
955 | unsigned int temp; |
956 | - t_u8 *src = (t_u8 *) &value; |
957 | - t_u8 *dest = (t_u8 *) &temp; |
958 | + unsigned char *src = (unsigned char *) &value; |
959 | + unsigned char *dest = (unsigned char *) &temp; |
960 | |
961 | dest[0] = src[3]; |
962 | dest[1] = src[2]; |
963 | @@ -258,8 +261,8 @@ |
964 | inline unsigned long long ReverseByteOrdering (unsigned long long value) |
965 | { |
966 | unsigned long long temp; |
967 | - t_u8 *src = (t_u8 *) &value; |
968 | - t_u8 *dest = (t_u8 *) &temp; |
969 | + unsigned char *src = (unsigned char *) &value; |
970 | + unsigned char *dest = (unsigned char *) &temp; |
971 | |
972 | dest[0] = src[7]; |
973 | dest[1] = src[6]; |
974 | |
975 | === modified file 'NuxCore/Memory.cpp' |
976 | --- NuxCore/Memory.cpp 2011-10-21 22:06:35 +0000 |
977 | +++ NuxCore/Memory.cpp 2012-02-19 00:04:19 +0000 |
978 | @@ -32,7 +32,7 @@ |
979 | |
980 | bool MemIsZero ( const void *V, size_t Count ) |
981 | { |
982 | - t_u8 *B = (t_u8 *) V; |
983 | + unsigned char *B = (unsigned char *) V; |
984 | |
985 | while ( Count-- > 0 ) |
986 | if ( *B++ != 0 ) |
987 | |
988 | === modified file 'NuxCore/NuxCore.h' |
989 | --- NuxCore/NuxCore.h 2012-01-17 00:32:06 +0000 |
990 | +++ NuxCore/NuxCore.h 2012-02-19 00:04:19 +0000 |
991 | @@ -62,9 +62,6 @@ |
992 | #include <new> |
993 | #include <set> |
994 | |
995 | -#include "SystemTypes.h" |
996 | - |
997 | - |
998 | // WIN32_SECURE if define for the latest version of Visual Studio starting at VS 2005. We use it for security improvement. |
999 | #if (defined NUX_VISUAL_STUDIO_2005) || (defined NUX_VISUAL_STUDIO_2008) || (defined NUX_VISUAL_STUDIO_2010) |
1000 | #define WIN32_SECURE |
1001 | @@ -505,7 +502,7 @@ |
1002 | { |
1003 | return dw; |
1004 | } |
1005 | - static inline t_byte VAType (t_byte b) |
1006 | + static inline unsigned char VAType (unsigned char b) |
1007 | { |
1008 | return b; |
1009 | } |
1010 | |
1011 | === modified file 'NuxCore/ObjectPtr.h' |
1012 | --- NuxCore/ObjectPtr.h 2011-11-11 02:42:04 +0000 |
1013 | +++ NuxCore/ObjectPtr.h 2012-02-19 00:04:19 +0000 |
1014 | @@ -42,7 +42,7 @@ |
1015 | public: |
1016 | //! Constructor |
1017 | ObjectPtr() |
1018 | - : ptr_(nullptr) |
1019 | + : ptr_(NULL) |
1020 | { |
1021 | } |
1022 | |
1023 | @@ -66,7 +66,7 @@ |
1024 | */ |
1025 | template <typename O> |
1026 | ObjectPtr(ObjectPtr<O> const& other) |
1027 | - : ptr_(nullptr) |
1028 | + : ptr_(NULL) |
1029 | { |
1030 | if (other.ptr_ && |
1031 | other.ptr_->Type().IsDerivedFromType(T::StaticObjectType)) |
1032 | @@ -87,7 +87,7 @@ |
1033 | longer have a reference on ptr. |
1034 | */ |
1035 | explicit ObjectPtr(T *ptr, bool WarnMissuse = false) |
1036 | - : ptr_(nullptr) |
1037 | + : ptr_(NULL) |
1038 | { |
1039 | if (ptr) |
1040 | { |
1041 | @@ -113,7 +113,7 @@ |
1042 | */ |
1043 | template <typename O> |
1044 | explicit ObjectPtr(O *ptr, bool WarnMissuse = false) |
1045 | - : ptr_(nullptr) |
1046 | + : ptr_(NULL) |
1047 | { |
1048 | if (ptr && |
1049 | ptr->Type().IsDerivedFromType(T::StaticObjectType)) |
1050 | @@ -328,7 +328,7 @@ |
1051 | // Decrease the number of strong reference on the hosted pointer. |
1052 | ptr_->objectptr_count_->Decrement(); |
1053 | bool destroyed = ptr_->UnReference(); |
1054 | - ptr_ = nullptr; |
1055 | + ptr_ = NULL; |
1056 | return destroyed; |
1057 | } |
1058 | |
1059 | @@ -356,7 +356,7 @@ |
1060 | public: |
1061 | //! Constructor |
1062 | ObjectWeakPtr() |
1063 | - : ptr_(nullptr) |
1064 | + : ptr_(NULL) |
1065 | { |
1066 | } |
1067 | |
1068 | @@ -386,7 +386,7 @@ |
1069 | */ |
1070 | template <typename O> |
1071 | explicit ObjectWeakPtr(O* ptr, bool WarnMissuse = false) |
1072 | - : ptr_(nullptr) |
1073 | + : ptr_(NULL) |
1074 | { |
1075 | if (ptr && |
1076 | (ptr->Type().IsDerivedFromType(T::StaticObjectType))) |
1077 | @@ -412,7 +412,7 @@ |
1078 | */ |
1079 | template <typename O> |
1080 | ObjectWeakPtr(const ObjectWeakPtr<O>& other) |
1081 | - : ptr_(nullptr) |
1082 | + : ptr_(NULL) |
1083 | { |
1084 | if (other.ptr_ && |
1085 | (other.ptr_->Type().IsDerivedFromType(T::StaticObjectType))) |
1086 | @@ -428,7 +428,7 @@ |
1087 | */ |
1088 | template <typename O> |
1089 | ObjectWeakPtr(const ObjectPtr<O> &other) |
1090 | - : ptr_(nullptr) |
1091 | + : ptr_(NULL) |
1092 | { |
1093 | if (other.ptr_ && |
1094 | (other.ptr_->Type().IsDerivedFromType(T::StaticObjectType))) |
1095 | @@ -636,7 +636,7 @@ |
1096 | bool Release() |
1097 | { |
1098 | Disconnect(); |
1099 | - ptr_ = nullptr; |
1100 | + ptr_ = NULL; |
1101 | return false; |
1102 | } |
1103 | |
1104 | @@ -668,7 +668,7 @@ |
1105 | |
1106 | void TargetDestroyed(Object* ptr) |
1107 | { |
1108 | - ptr_ = nullptr; |
1109 | + ptr_ = NULL; |
1110 | // rese the connetion too |
1111 | destroy_listener_ = sigc::connection(); |
1112 | } |
1113 | |
1114 | === modified file 'NuxCore/ObjectType.h' |
1115 | --- NuxCore/ObjectType.h 2011-09-20 06:03:43 +0000 |
1116 | +++ NuxCore/ObjectType.h 2012-02-19 00:04:19 +0000 |
1117 | @@ -41,7 +41,7 @@ |
1118 | |
1119 | NObjectType() |
1120 | : name("Null_Type") |
1121 | - , super(nullptr) |
1122 | + , super(NULL) |
1123 | { |
1124 | } |
1125 | |
1126 | |
1127 | === removed file 'NuxCore/SystemTypes.h' |
1128 | --- NuxCore/SystemTypes.h 2011-10-21 23:49:15 +0000 |
1129 | +++ NuxCore/SystemTypes.h 1970-01-01 00:00:00 +0000 |
1130 | @@ -1,117 +0,0 @@ |
1131 | -/* |
1132 | - * Copyright 2010 Inalogic® Inc. |
1133 | - * |
1134 | - * This program is free software: you can redistribute it and/or modify it |
1135 | - * under the terms of the GNU Lesser General Public License, as |
1136 | - * published by the Free Software Foundation; either version 2.1 or 3.0 |
1137 | - * of the License. |
1138 | - * |
1139 | - * This program is distributed in the hope that it will be useful, but |
1140 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1141 | - * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
1142 | - * PURPOSE. See the applicable version of the GNU Lesser General Public |
1143 | - * License for more details. |
1144 | - * |
1145 | - * You should have received a copy of both the GNU Lesser General Public |
1146 | - * License along with this program. If not, see <http://www.gnu.org/licenses/> |
1147 | - * |
1148 | - * Authored by: Jay Taoko <jaytaoko@inalogic.com> |
1149 | - * |
1150 | - */ |
1151 | - |
1152 | - |
1153 | -#ifndef SYSTEMTYPES_H |
1154 | -#define SYSTEMTYPES_H |
1155 | - |
1156 | -#include <cstddef> |
1157 | - |
1158 | -namespace nux |
1159 | -{ |
1160 | -// Note: do not use long: long is 64 bits in LP64 while it remains 32 bits on LLP64 |
1161 | - |
1162 | - typedef unsigned char t_u8, t_byte, t_uchar; // 0 to 255 |
1163 | - typedef char t_char; // –128 to 127 |
1164 | -// signed char is a distinct type. See ANSI C Draft Standard and the keyword "signed" |
1165 | - typedef signed char t_s8, t_schar; // –128 to 127 |
1166 | - |
1167 | - typedef void t_void, *t_pvoid; |
1168 | - |
1169 | - typedef unsigned char t_UTF8; |
1170 | - typedef unsigned int t_UTF32; |
1171 | - |
1172 | - typedef unsigned int t_u32; // TODO: to be removed soon. |
1173 | - |
1174 | -#ifdef _WIN32 |
1175 | - typedef wchar_t t_UTF16; |
1176 | -#elif defined(__linux__) |
1177 | - typedef wchar_t t_UTF16; |
1178 | -#elif defined (__APPLE__) |
1179 | - typedef wchar_t t_UTF16; |
1180 | -#else |
1181 | -#error t_UTF16 is undefined for this platform. |
1182 | -#endif |
1183 | - |
1184 | - const t_s8 t_s8_min = -128; |
1185 | - const t_s8 t_s8_max = 127; |
1186 | - const t_u8 t_u8_min = 0; |
1187 | - const t_u8 t_u8_max = 255; |
1188 | - const short t_s16_min = -32768; |
1189 | - const short t_s16_max = 32767; |
1190 | - const unsigned short t_u16_min = 0; |
1191 | - const unsigned short t_u16_max = 65535; |
1192 | - const int t_s32_min = 0x80000000; |
1193 | - const int t_s32_max = 0x7FFFFFFF; |
1194 | - const unsigned int t_u32_min = 0x00000000; |
1195 | - const unsigned int t_u32_max = 0xFFFFFFFF; |
1196 | - const long long t_s64_min = 0x8000000000000000LL; |
1197 | - const long long t_s64_max = 0x7FFFFFFFFFFFFFFFLL; |
1198 | - const unsigned long long t_u64_min = 0x0000000000000000ULL; |
1199 | - const unsigned long long t_u64_max = 0xFFFFFFFFFFFFFFFFULL; |
1200 | - |
1201 | - const float t_f32_min = 1.175494351E-38F; |
1202 | - const float t_f32_max = 3.402823466E+38F; |
1203 | - const double t_f64_min = 2.2250738585072014E-308; |
1204 | - const double t_f64_max = 1.7976931348623158E+308; |
1205 | - |
1206 | - const float MinFloat = 1.175494351E-38F; |
1207 | - const float MaxFloat = 3.402823466E+38F; |
1208 | - const double MinDouble = 2.2250738585072014E-308; |
1209 | - const double MaxDouble = 1.7976931348623158E+308; |
1210 | - |
1211 | -// ILP32 LP64 LLP64 ILP64 |
1212 | -// char 8 8 8 8 |
1213 | -// short 16 16 16 16 |
1214 | -// int 32 32 32 64 |
1215 | -// long 32 64 32 64 |
1216 | -// long long 64 64 64 64 |
1217 | -// pointer 32 64 64 64 |
1218 | - |
1219 | -// Window 64-bit supports LLP64 |
1220 | -// Linux 64 bit supports LP64 |
1221 | -// Mac OS 64 bit supports LP64 |
1222 | - |
1223 | -// The size of a long integer in particular depends on the operating system and the targeted architecture as follows: |
1224 | -// |
1225 | -// OS arch size |
1226 | -// Windows IA-32 4 bytes |
1227 | -// Windows Intel 64 4 bytes |
1228 | -// Windows IA-64 4 bytes |
1229 | -// Linux IA-32 4 bytes |
1230 | -// Linux Intel 64 8 bytes |
1231 | -// Linux IA-64 8 bytes |
1232 | -// Mac OS X IA-32 4 bytes |
1233 | -// Mac OS X Intel 64 8 bytes |
1234 | - |
1235 | -#define NUX_BYTE_SIZE 1 |
1236 | -#define NUX_WORD_SIZE 2 |
1237 | -#define NUX_FLOAT_SIZE 4 |
1238 | -#define NUX_INT_SIZE 4 |
1239 | -#define NUX_DOUBLE_SIZE 8 |
1240 | - |
1241 | -#define DEGTORAD(d) (d) * 3.1415927f / 180.0f |
1242 | -#define RADTODEG(d) (d) * 180.0f / 3.1415927f |
1243 | - |
1244 | - |
1245 | -} |
1246 | - |
1247 | -#endif // SYSTEMTYPES_H |
1248 | |
1249 | === modified file 'NuxCore/TextString.cpp' |
1250 | --- NuxCore/TextString.cpp 2011-10-21 22:06:35 +0000 |
1251 | +++ NuxCore/TextString.cpp 2012-02-19 00:04:19 +0000 |
1252 | @@ -249,15 +249,11 @@ |
1253 | { |
1254 | return ToCharString (buffer, len, "%.20lg", value); |
1255 | } |
1256 | - size_t ValueToLiteralString (char *buffer, unsigned int len, t_u8 value) |
1257 | + size_t ValueToLiteralString (char *buffer, unsigned int len, unsigned char value) |
1258 | { |
1259 | return ValueToLiteralString (buffer, len, (unsigned int) value); |
1260 | } |
1261 | - size_t ValueToLiteralString (char *buffer, unsigned int len, t_char value) |
1262 | - { |
1263 | - return ValueToLiteralString (buffer, len, (int) value); |
1264 | - } |
1265 | - size_t ValueToLiteralString (char *buffer, unsigned int len, t_s8 value) |
1266 | + size_t ValueToLiteralString (char *buffer, unsigned int len, char value) |
1267 | { |
1268 | return ValueToLiteralString (buffer, len, (int) value); |
1269 | } |
1270 | @@ -302,30 +298,21 @@ |
1271 | { |
1272 | return FromCharString (buffer, len, "%lg", value ); |
1273 | } |
1274 | - bool ValueFromLiteralString (const char *buffer, unsigned int len, t_u8 &value) |
1275 | + bool ValueFromLiteralString (const char *buffer, unsigned int len, unsigned char &value) |
1276 | { |
1277 | unsigned int tmp = 0; |
1278 | bool result; |
1279 | result = ValueFromLiteralString (buffer, len, tmp); |
1280 | - value = (t_u8) tmp; |
1281 | - return result; |
1282 | - } |
1283 | - |
1284 | - bool ValueFromLiteralString (const char *buffer, unsigned int len, t_char &value) |
1285 | - { |
1286 | - int tmp = 0; |
1287 | - bool result; |
1288 | - result = ValueFromLiteralString (buffer, len, tmp); |
1289 | - value = (t_char) tmp; |
1290 | - return result; |
1291 | - } |
1292 | - |
1293 | - bool ValueFromLiteralString (const char *buffer, unsigned int len, t_s8 &value) |
1294 | - { |
1295 | - int tmp = 0; |
1296 | - bool result; |
1297 | - result = ValueFromLiteralString (buffer, len, tmp); |
1298 | - value = (t_s8) tmp; |
1299 | + value = (unsigned char) tmp; |
1300 | + return result; |
1301 | + } |
1302 | + |
1303 | + bool ValueFromLiteralString (const char *buffer, unsigned int len, char &value) |
1304 | + { |
1305 | + int tmp = 0; |
1306 | + bool result; |
1307 | + result = ValueFromLiteralString (buffer, len, tmp); |
1308 | + value = (char) tmp; |
1309 | return result; |
1310 | } |
1311 | |
1312 | |
1313 | === modified file 'NuxCore/TextString.h' |
1314 | --- NuxCore/TextString.h 2011-10-21 22:06:35 +0000 |
1315 | +++ NuxCore/TextString.h 2012-02-19 00:04:19 +0000 |
1316 | @@ -464,9 +464,9 @@ |
1317 | size_t ValueToLiteralString (char *buffer, size_t len, long long value); |
1318 | size_t ValueToLiteralString (char *buffer, size_t len, float value); |
1319 | size_t ValueToLiteralString (char *buffer, size_t len, double value); |
1320 | - size_t ValueToLiteralString (char *buffer, size_t len, t_u8 value); |
1321 | - size_t ValueToLiteralString (char *buffer, size_t len, t_s8 value); |
1322 | - size_t ValueToLiteralString (char *buffer, size_t len, t_schar value); |
1323 | + size_t ValueToLiteralString (char *buffer, size_t len, unsigned char value); |
1324 | + size_t ValueToLiteralString (char *buffer, size_t len, char value); |
1325 | + size_t ValueToLiteralString (char *buffer, size_t len, char value); |
1326 | |
1327 | template<class T> |
1328 | bool FromCharString (const char *buffer, size_t bufferlen, const char *format, T &value) |
1329 | @@ -510,9 +510,8 @@ |
1330 | bool ValueFromLiteralString (const char *buffer, size_t len, long long &value); |
1331 | bool ValueFromLiteralString (const char *buffer, size_t len, float &value); |
1332 | bool ValueFromLiteralString (const char *buffer, size_t len, double &value); |
1333 | - bool ValueFromLiteralString (const char *buffer, size_t len, t_u8 &value); |
1334 | - bool ValueFromLiteralString (const char *buffer, size_t len, t_s8 &value); |
1335 | - bool ValueFromLiteralString (const char *buffer, size_t len, t_schar &value); |
1336 | + bool ValueFromLiteralString (const char *buffer, size_t len, unsigned char &value); |
1337 | + bool ValueFromLiteralString (const char *buffer, size_t len, char &value); |
1338 | |
1339 | |
1340 | /*----------------------------------------------------------------------------- |
1341 | |
1342 | === modified file 'NuxGraphics/FontTexture.h' |
1343 | --- NuxGraphics/FontTexture.h 2011-10-21 22:06:35 +0000 |
1344 | +++ NuxGraphics/FontTexture.h 2012-02-19 00:04:19 +0000 |
1345 | @@ -147,7 +147,7 @@ |
1346 | : italic(false), bold(false), LineHeight(0), Base(0), Width(0), Height(0) |
1347 | , Pages(0), FontHeight(0), Ascent(0), Descent(0), AvgCharWidth(0) |
1348 | , MaxCharWidth(0), InternalLeading(0), ExternalLeading(0) |
1349 | - , NumChar(0), NumKerningPairs(0), Kerning(nullptr) |
1350 | + , NumChar(0), NumKerningPairs(0), Kerning(NULL) |
1351 | {} |
1352 | |
1353 | ~Charset() |
1354 | |
1355 | === modified file 'NuxGraphics/GLResource.h' |
1356 | --- NuxGraphics/GLResource.h 2011-10-19 20:32:38 +0000 |
1357 | +++ NuxGraphics/GLResource.h 2012-02-19 00:04:19 +0000 |
1358 | @@ -24,7 +24,6 @@ |
1359 | #define GLRESOURCE_H |
1360 | |
1361 | #include "NuxCore/NuxCore.h" |
1362 | -#include "NuxCore/SystemTypes.h" |
1363 | #include "NuxCore/Error.h" |
1364 | #include "NuxCore/FilePath.h" |
1365 | #include "NuxCore/Color.h" |
1366 | |
1367 | === modified file 'NuxGraphics/GLTextureResourceManager.cpp' |
1368 | --- NuxGraphics/GLTextureResourceManager.cpp 2011-11-10 17:28:44 +0000 |
1369 | +++ NuxGraphics/GLTextureResourceManager.cpp 2012-02-19 00:04:19 +0000 |
1370 | @@ -45,20 +45,20 @@ |
1371 | |
1372 | /*! Up cast a Resource. |
1373 | The source must be derived from the destination type |
1374 | - @param T Destination type. |
1375 | - @param U Source type. |
1376 | - @return The casted to the destination type |
1377 | + @param T Destination type. |
1378 | + @param U Source type. |
1379 | + @return The casted to the destination type |
1380 | */ |
1381 | template < class T, class U > |
1382 | - static T *UpCastResource(U *Src) |
1383 | + static T* UpCastResource(U* Src) |
1384 | { |
1385 | if (!Src || !Src->Type().IsDerivedFromType(T::StaticObjectType)) |
1386 | nuxError("[UpCastResource] Cast of %s to %s failed", U::StaticObjectType.name, T::StaticObjectType.name); |
1387 | |
1388 | - return(T *) Src; |
1389 | + return(T*) Src; |
1390 | } |
1391 | |
1392 | - BaseTexture *CreateTexture2DFromPixbuf(GdkPixbuf *pixbuf, bool premultiply) |
1393 | + BaseTexture* CreateTexture2DFromPixbuf(GdkPixbuf* pixbuf, bool premultiply) |
1394 | { |
1395 | const unsigned int rowstride = gdk_pixbuf_get_rowstride(pixbuf); |
1396 | const unsigned int width = gdk_pixbuf_get_width(pixbuf); |
1397 | @@ -76,12 +76,12 @@ |
1398 | // as four 8-bit values(using bit-shifts) that are then stored |
1399 | // separately, that's slow considering it's meant to be used a lot in |
1400 | // deep loops. |
1401 | - NTextureData *data = new NTextureData(BITFMT_R8G8B8A8, width, height, 1); |
1402 | - ImageSurface &surface = data->GetSurface(0); |
1403 | + NTextureData* data = new NTextureData(BITFMT_R8G8B8A8, width, height, 1); |
1404 | + ImageSurface& surface = data->GetSurface(0); |
1405 | if (gdk_pixbuf_get_has_alpha(pixbuf) == TRUE) |
1406 | { |
1407 | - unsigned char *pixels_u8 = gdk_pixbuf_get_pixels(pixbuf); |
1408 | - unsigned int *pixels_u32 = reinterpret_cast<unsigned int *> (pixels_u8); |
1409 | + unsigned char* pixels_u8 = gdk_pixbuf_get_pixels(pixbuf); |
1410 | + unsigned int* pixels_u32 = reinterpret_cast<unsigned int*> (pixels_u8); |
1411 | |
1412 | if (premultiply == true) |
1413 | { |
1414 | @@ -104,7 +104,7 @@ |
1415 | } |
1416 | } |
1417 | pixels_u8 += rowstride; |
1418 | - pixels_u32 = reinterpret_cast<unsigned int *> (pixels_u8); |
1419 | + pixels_u32 = reinterpret_cast<unsigned int*> (pixels_u8); |
1420 | } |
1421 | } |
1422 | else |
1423 | @@ -115,14 +115,14 @@ |
1424 | for (unsigned int j = 0; j < width; j++) |
1425 | surface.Write32b(j, i, pixels_u32[j]); |
1426 | pixels_u8 += rowstride; |
1427 | - pixels_u32 = reinterpret_cast<unsigned int *> (pixels_u8); |
1428 | + pixels_u32 = reinterpret_cast<unsigned int*> (pixels_u8); |
1429 | } |
1430 | } |
1431 | } |
1432 | else |
1433 | { |
1434 | // Copy from pixbuf(RGB) to surface(RGBA). |
1435 | - unsigned char *pixels = gdk_pixbuf_get_pixels(pixbuf); |
1436 | + unsigned char* pixels = gdk_pixbuf_get_pixels(pixbuf); |
1437 | for (unsigned int i = 0; i < height; i++) |
1438 | { |
1439 | for (unsigned int j = 0; j < width; j++) |
1440 | @@ -137,22 +137,22 @@ |
1441 | } |
1442 | |
1443 | // Create a 2D texture and upload the pixels. |
1444 | - BaseTexture *texture = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); |
1445 | + BaseTexture* texture = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); |
1446 | texture->Update(data); |
1447 | |
1448 | delete data; // data is deleted as texture->Update() copies it. |
1449 | return texture; |
1450 | } |
1451 | |
1452 | - BaseTexture* CreateTexture2DFromFile(const char *filename, int max_size, |
1453 | + BaseTexture* CreateTexture2DFromFile(const char* filename, int max_size, |
1454 | bool premultiply) |
1455 | { |
1456 | - GError *error = NULL; |
1457 | - GdkPixbuf *pixbuf = |
1458 | + GError* error = NULL; |
1459 | + GdkPixbuf* pixbuf = |
1460 | gdk_pixbuf_new_from_file_at_size(filename, max_size, max_size, &error); |
1461 | if (error == NULL) |
1462 | { |
1463 | - BaseTexture *texture = CreateTexture2DFromPixbuf(pixbuf, premultiply); |
1464 | + BaseTexture* texture = CreateTexture2DFromPixbuf(pixbuf, premultiply); |
1465 | g_object_unref(pixbuf); |
1466 | return texture; |
1467 | } |
1468 | @@ -163,14 +163,14 @@ |
1469 | } |
1470 | } |
1471 | |
1472 | - BaseTexture *CreateTextureFromPixbuf(GdkPixbuf *pixbuf) |
1473 | + BaseTexture* CreateTextureFromPixbuf(GdkPixbuf* pixbuf) |
1474 | { |
1475 | - NBitmapData *BitmapData = LoadGdkPixbuf(pixbuf); |
1476 | + NBitmapData* BitmapData = LoadGdkPixbuf(pixbuf); |
1477 | NUX_RETURN_VALUE_IF_NULL(BitmapData, 0); |
1478 | |
1479 | if (BitmapData->IsTextureData()) |
1480 | { |
1481 | - BaseTexture *texture = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); |
1482 | + BaseTexture* texture = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); |
1483 | texture->Update(BitmapData); |
1484 | return texture; |
1485 | } |
1486 | @@ -178,9 +178,9 @@ |
1487 | return 0; |
1488 | } |
1489 | |
1490 | - BaseTexture *CreateTextureFromFile(const char *TextureFilename) |
1491 | + BaseTexture* CreateTextureFromFile(const char* TextureFilename) |
1492 | { |
1493 | - BaseTexture* texture = nullptr; |
1494 | + BaseTexture* texture = NULL; |
1495 | |
1496 | NBitmapData* BitmapData = LoadImageFile(TextureFilename); |
1497 | NUX_RETURN_VALUE_IF_NULL(BitmapData, 0); |
1498 | @@ -215,46 +215,46 @@ |
1499 | return texture; |
1500 | } |
1501 | |
1502 | - BaseTexture *CreateTextureFromBitmapData(const NBitmapData *BitmapData) |
1503 | + BaseTexture* CreateTextureFromBitmapData(const NBitmapData* BitmapData) |
1504 | { |
1505 | if (BitmapData == 0) |
1506 | return 0; |
1507 | |
1508 | if (BitmapData->IsTextureData()) |
1509 | { |
1510 | - BaseTexture *texture = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); |
1511 | + BaseTexture* texture = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); |
1512 | texture->Update(BitmapData); |
1513 | return texture; |
1514 | } |
1515 | else if (BitmapData->IsCubemapTextureData()) |
1516 | { |
1517 | - TextureCube *texture = new TextureCube(); |
1518 | + TextureCube* texture = new TextureCube(); |
1519 | texture->Update(BitmapData); |
1520 | return texture; |
1521 | } |
1522 | else if (BitmapData->IsVolumeTextureData()) |
1523 | { |
1524 | - TextureVolume *texture = new TextureVolume(); |
1525 | + TextureVolume* texture = new TextureVolume(); |
1526 | texture->Update(BitmapData); |
1527 | return texture; |
1528 | } |
1529 | else if (BitmapData->IsAnimatedTextureData()) |
1530 | { |
1531 | - TextureFrameAnimation *texture = new TextureFrameAnimation(); |
1532 | + TextureFrameAnimation* texture = new TextureFrameAnimation(); |
1533 | texture->Update(BitmapData); |
1534 | return texture; |
1535 | } |
1536 | return 0; |
1537 | } |
1538 | |
1539 | - BaseTexture* LoadTextureFromFile(const std::string &filename) |
1540 | + BaseTexture* LoadTextureFromFile(const std::string& filename) |
1541 | { |
1542 | NBitmapData* bitmap = LoadImageFile(filename.c_str()); |
1543 | |
1544 | if (bitmap == NULL) |
1545 | return NULL; |
1546 | |
1547 | - BaseTexture *texture = CreateTextureFromBitmapData(bitmap); |
1548 | + BaseTexture* texture = CreateTextureFromBitmapData(bitmap); |
1549 | return texture; |
1550 | } |
1551 | |
1552 | @@ -285,19 +285,19 @@ |
1553 | { |
1554 | } |
1555 | |
1556 | - Texture2D::Texture2D(const Texture2D &texture, NUX_FILE_LINE_DECL) |
1557 | + Texture2D::Texture2D(const Texture2D& texture, NUX_FILE_LINE_DECL) |
1558 | : BaseTexture(NUX_FILE_LINE_PARAM) |
1559 | { |
1560 | _image = texture._image; |
1561 | } |
1562 | |
1563 | - Texture2D::Texture2D(const NTextureData &texture_data, NUX_FILE_LINE_DECL) |
1564 | + Texture2D::Texture2D(const NTextureData& texture_data, NUX_FILE_LINE_DECL) |
1565 | : BaseTexture(NUX_FILE_LINE_PARAM) |
1566 | { |
1567 | _image = texture_data; |
1568 | } |
1569 | |
1570 | - Texture2D &Texture2D::operator = (const Texture2D &texture) |
1571 | + Texture2D& Texture2D::operator = (const Texture2D& texture) |
1572 | { |
1573 | if (this == &texture) |
1574 | return *this; // Handle self assignment |
1575 | @@ -310,7 +310,7 @@ |
1576 | { |
1577 | } |
1578 | |
1579 | - bool Texture2D::Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource) |
1580 | + bool Texture2D::Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource) |
1581 | { |
1582 | nuxAssertMsg(BitmapData, "[Texture2D::Update] Argument BitmapData is NULL."); |
1583 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1584 | @@ -321,7 +321,7 @@ |
1585 | return false; |
1586 | } |
1587 | |
1588 | - _image = *static_cast<const NTextureData *> (BitmapData); |
1589 | + _image = *static_cast<const NTextureData*> (BitmapData); |
1590 | |
1591 | if (UpdateAndCacheResource) |
1592 | { |
1593 | @@ -332,9 +332,9 @@ |
1594 | return true; |
1595 | } |
1596 | |
1597 | - bool Texture2D::Update(const char *filename, bool UpdateAndCacheResource) |
1598 | + bool Texture2D::Update(const char* filename, bool UpdateAndCacheResource) |
1599 | { |
1600 | - NBitmapData *BitmapData = LoadImageFile(filename); |
1601 | + NBitmapData* BitmapData = LoadImageFile(filename); |
1602 | nuxAssertMsg(BitmapData, "[Texture2D::Update] Bitmap for file(%s) is NULL.", filename); |
1603 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1604 | bool ret = Update(BitmapData, UpdateAndCacheResource); |
1605 | @@ -342,12 +342,12 @@ |
1606 | return ret; |
1607 | } |
1608 | |
1609 | - void Texture2D::GetData(void *Buffer, int MipIndex, int StrideY, int face) |
1610 | + void Texture2D::GetData(void* Buffer, int MipIndex, int StrideY, int face) |
1611 | { |
1612 | - BYTE *Dest = (BYTE *) Buffer; |
1613 | - const BYTE *Src = _image.GetSurface(MipIndex).GetPtrRawData(); |
1614 | - int RowByteSize = _image.GetSurface(MipIndex).GetPitch(); |
1615 | - int NumRows = _image.GetSurface(MipIndex).GetBlockHeight(); |
1616 | + BYTE *Dest = (BYTE*) Buffer; |
1617 | + const BYTE *Src = _image.GetSurface(MipIndex).GetPtrRawData(); |
1618 | + int RowByteSize = _image.GetSurface(MipIndex).GetPitch(); |
1619 | + int NumRows = _image.GetSurface(MipIndex).GetBlockHeight(); |
1620 | |
1621 | for ( int Y = 0; Y < NumRows; Y++ ) |
1622 | { |
1623 | @@ -363,7 +363,7 @@ |
1624 | return texture; |
1625 | } |
1626 | |
1627 | - CachedBaseTexture::CachedBaseTexture(NResourceSet *ResourceManager) |
1628 | + CachedBaseTexture::CachedBaseTexture(NResourceSet* ResourceManager) |
1629 | : CachedResourceData(ResourceManager), |
1630 | SourceWidth(0), |
1631 | SourceHeight(0), |
1632 | @@ -378,13 +378,13 @@ |
1633 | m_Texture.Release(); |
1634 | } |
1635 | |
1636 | - bool CachedBaseTexture::UpdateResource(ResourceData *Resource) |
1637 | + bool CachedBaseTexture::UpdateResource(ResourceData* Resource) |
1638 | { |
1639 | - UpdateTexture((BaseTexture *) Resource); |
1640 | + UpdateTexture((BaseTexture*) Resource); |
1641 | return TRUE; |
1642 | } |
1643 | |
1644 | - bool CachedBaseTexture::RecreateTexture(BaseTexture *Source) |
1645 | + bool CachedBaseTexture::RecreateTexture(BaseTexture* Source) |
1646 | { |
1647 | int CurrentWidth = m_Texture->GetWidth(); |
1648 | int CurrentHeight = m_Texture->GetHeight(); |
1649 | @@ -402,7 +402,7 @@ |
1650 | return Recreate; |
1651 | } |
1652 | |
1653 | - CachedTexture2D::CachedTexture2D(NResourceSet *ResourceManager, Texture2D *SourceTexture) |
1654 | + CachedTexture2D::CachedTexture2D(NResourceSet* ResourceManager, Texture2D* SourceTexture) |
1655 | : CachedBaseTexture(ResourceManager) |
1656 | { |
1657 | if (SourceTexture->IsNull()) |
1658 | @@ -427,7 +427,7 @@ |
1659 | |
1660 | } |
1661 | |
1662 | - void CachedTexture2D::UpdateTexture( BaseTexture *SourceTexture ) |
1663 | + void CachedTexture2D::UpdateTexture( BaseTexture* SourceTexture ) |
1664 | { |
1665 | if ((SourceTexture == 0) || SourceTexture->IsNull()) |
1666 | { |
1667 | @@ -462,7 +462,7 @@ |
1668 | } |
1669 | } |
1670 | |
1671 | - void CachedTexture2D::LoadMipLevel(BaseTexture *SourceTexture, int MipLevel) |
1672 | + void CachedTexture2D::LoadMipLevel(BaseTexture* SourceTexture, int MipLevel) |
1673 | { |
1674 | SURFACE_LOCKED_RECT LockedRect; |
1675 | ObjectPtr < IOpenGLTexture2D > Texture2D = m_Texture; //m_Texture.CastRef<IOpenGLTexture2D>(); |
1676 | @@ -477,17 +477,17 @@ |
1677 | { |
1678 | } |
1679 | |
1680 | - TextureRectangle::TextureRectangle(const TextureRectangle &texture) |
1681 | + TextureRectangle::TextureRectangle(const TextureRectangle& texture) |
1682 | { |
1683 | _image = texture._image; |
1684 | } |
1685 | |
1686 | - TextureRectangle::TextureRectangle(const NTextureData &BaseTexture) |
1687 | + TextureRectangle::TextureRectangle(const NTextureData& BaseTexture) |
1688 | { |
1689 | _image = BaseTexture; |
1690 | } |
1691 | |
1692 | - TextureRectangle &TextureRectangle::operator = (const TextureRectangle &texture) |
1693 | + TextureRectangle& TextureRectangle::operator = (const TextureRectangle& texture) |
1694 | { |
1695 | if (this == &texture) |
1696 | return *this; // Handle self assignment |
1697 | @@ -501,7 +501,7 @@ |
1698 | |
1699 | } |
1700 | |
1701 | - bool TextureRectangle::Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource) |
1702 | + bool TextureRectangle::Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource) |
1703 | { |
1704 | nuxAssertMsg(BitmapData, "[TextureRectangle::Update] Argument BitmapData is NULL."); |
1705 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1706 | @@ -512,7 +512,7 @@ |
1707 | return false; |
1708 | } |
1709 | |
1710 | - _image = *static_cast<const NTextureData *> (BitmapData); |
1711 | + _image = *static_cast<const NTextureData*> (BitmapData); |
1712 | |
1713 | if (UpdateAndCacheResource) |
1714 | { |
1715 | @@ -522,10 +522,10 @@ |
1716 | return true; |
1717 | } |
1718 | |
1719 | - bool TextureRectangle::Update(const char *filename, bool UpdateAndCacheResource) |
1720 | + bool TextureRectangle::Update(const char* filename, bool UpdateAndCacheResource) |
1721 | { |
1722 | bool b = false; |
1723 | - NBitmapData *BitmapData = LoadImageFile(filename); |
1724 | + NBitmapData* BitmapData = LoadImageFile(filename); |
1725 | nuxAssertMsg(BitmapData, "[TextureRectangle::Update] Bitmap for file(%s) is NULL.", filename); |
1726 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1727 | b = Update(BitmapData); |
1728 | @@ -533,9 +533,9 @@ |
1729 | return b; |
1730 | } |
1731 | |
1732 | - void TextureRectangle::GetData(void *Buffer, int MipIndex, int StrideY, int face) |
1733 | + void TextureRectangle::GetData(void* Buffer, int MipIndex, int StrideY, int face) |
1734 | { |
1735 | - BYTE *Dest = (BYTE *) Buffer; |
1736 | + BYTE *Dest = (BYTE *) Buffer; |
1737 | const BYTE *Src = _image.GetSurface(MipIndex).GetPtrRawData(); |
1738 | int RowByteSize = _image.GetSurface(MipIndex).GetPitch(); |
1739 | int NumRows = _image.GetSurface(MipIndex).GetBlockHeight(); |
1740 | @@ -554,7 +554,7 @@ |
1741 | return texture; |
1742 | } |
1743 | |
1744 | - CachedTextureRectangle::CachedTextureRectangle(NResourceSet *ResourceManager, TextureRectangle *SourceTexture) |
1745 | + CachedTextureRectangle::CachedTextureRectangle(NResourceSet* ResourceManager, TextureRectangle* SourceTexture) |
1746 | : CachedBaseTexture(ResourceManager) |
1747 | { |
1748 | if (SourceTexture->IsNull()) |
1749 | @@ -579,7 +579,7 @@ |
1750 | |
1751 | } |
1752 | |
1753 | - void CachedTextureRectangle::UpdateTexture( BaseTexture *SourceTexture ) |
1754 | + void CachedTextureRectangle::UpdateTexture( BaseTexture* SourceTexture ) |
1755 | { |
1756 | if ((SourceTexture == 0) || SourceTexture->IsNull()) |
1757 | { |
1758 | @@ -614,10 +614,10 @@ |
1759 | } |
1760 | } |
1761 | |
1762 | - void CachedTextureRectangle::LoadMipLevel(BaseTexture *SourceTexture, int MipLevel) |
1763 | + void CachedTextureRectangle::LoadMipLevel(BaseTexture* SourceTexture, int MipLevel) |
1764 | { |
1765 | - SURFACE_LOCKED_RECT LockedRect; |
1766 | - ObjectPtr <IOpenGLRectangleTexture> TextureRectangle = m_Texture; //m_Texture.CastRef<IOpenGLRectangleTexture>(); |
1767 | + SURFACE_LOCKED_RECT LockedRect; |
1768 | + ObjectPtr <IOpenGLRectangleTexture> TextureRectangle = m_Texture; //m_Texture.CastRef<IOpenGLRectangleTexture>(); |
1769 | |
1770 | OGL_CALL(TextureRectangle->LockRect( MipLevel, &LockedRect, NULL)); |
1771 | SourceTexture->GetData( LockedRect.pBits, MipLevel, LockedRect.Pitch ); |
1772 | @@ -629,12 +629,12 @@ |
1773 | { |
1774 | } |
1775 | |
1776 | - TextureCube::TextureCube(const TextureCube &texture) |
1777 | + TextureCube::TextureCube(const TextureCube& texture) |
1778 | { |
1779 | _image = texture._image; |
1780 | } |
1781 | |
1782 | - TextureCube &TextureCube::operator = (const TextureCube &texture) |
1783 | + TextureCube& TextureCube::operator = (const TextureCube& texture) |
1784 | { |
1785 | if (this == &texture) |
1786 | return *this; // Handle self assignment |
1787 | @@ -648,7 +648,7 @@ |
1788 | |
1789 | } |
1790 | |
1791 | - bool TextureCube::Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource) |
1792 | + bool TextureCube::Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource) |
1793 | { |
1794 | nuxAssertMsg(BitmapData, "[TextureCube::Update] Argument BitmapData is NULL."); |
1795 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1796 | @@ -659,7 +659,7 @@ |
1797 | return false; |
1798 | } |
1799 | |
1800 | - _image = *static_cast<const NCubemapData *> (BitmapData); |
1801 | + _image = *static_cast<const NCubemapData*> (BitmapData); |
1802 | |
1803 | if (UpdateAndCacheResource) |
1804 | { |
1805 | @@ -670,9 +670,9 @@ |
1806 | return true; |
1807 | } |
1808 | |
1809 | - bool TextureCube::Update(const char *filename, bool UpdateAndCacheResource) |
1810 | + bool TextureCube::Update(const char* filename, bool UpdateAndCacheResource) |
1811 | { |
1812 | - NBitmapData *BitmapData = LoadImageFile(filename); |
1813 | + NBitmapData* BitmapData = LoadImageFile(filename); |
1814 | nuxAssertMsg(BitmapData, "[TextureCube::Update] Bitmap for file(%s) is NULL.", filename); |
1815 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1816 | bool ret = Update(BitmapData); |
1817 | @@ -680,9 +680,9 @@ |
1818 | return ret; |
1819 | } |
1820 | |
1821 | - void TextureCube::GetData(void *Buffer, int MipIndex, int StrideY, int face) |
1822 | + void TextureCube::GetData(void* Buffer, int MipIndex, int StrideY, int face) |
1823 | { |
1824 | - BYTE *Dest = (BYTE *) Buffer; |
1825 | + BYTE *Dest = (BYTE *) Buffer; |
1826 | const BYTE *Src = _image.GetSurface(face, MipIndex).GetPtrRawData(); |
1827 | int RowByteSize = _image.GetSurface(face, MipIndex).GetPitch(); |
1828 | int NumRows = _image.GetSurface(face, MipIndex).GetBlockHeight(); |
1829 | @@ -701,7 +701,7 @@ |
1830 | return texture; |
1831 | } |
1832 | |
1833 | - CachedTextureCube::CachedTextureCube(NResourceSet *ResourceManager, TextureCube *SourceTexture) |
1834 | + CachedTextureCube::CachedTextureCube(NResourceSet* ResourceManager, TextureCube* SourceTexture) |
1835 | : CachedBaseTexture(ResourceManager) |
1836 | { |
1837 | if (SourceTexture->IsNull()) |
1838 | @@ -725,7 +725,7 @@ |
1839 | |
1840 | } |
1841 | |
1842 | - void CachedTextureCube::UpdateTexture( BaseTexture *SourceTexture ) |
1843 | + void CachedTextureCube::UpdateTexture( BaseTexture* SourceTexture ) |
1844 | { |
1845 | if ((SourceTexture == 0) || SourceTexture->IsNull()) |
1846 | { |
1847 | @@ -759,9 +759,9 @@ |
1848 | } |
1849 | } |
1850 | |
1851 | - void CachedTextureCube::LoadMipLevel(BaseTexture *SourceTexture, int MipLevel) |
1852 | + void CachedTextureCube::LoadMipLevel(BaseTexture* SourceTexture, int MipLevel) |
1853 | { |
1854 | - SURFACE_LOCKED_RECT LockedRect; |
1855 | + SURFACE_LOCKED_RECT LockedRect; |
1856 | ObjectPtr <IOpenGLCubeTexture> CubemapTexture = m_Texture; //m_Texture.CastRef<IOpenGLCubeTexture>(); |
1857 | |
1858 | for (int face = CUBEMAP_FACE_POSITIVE_X; face < GL_TEXTURE_CUBE_MAP_NEGATIVE_Z + 1; face++) |
1859 | @@ -777,12 +777,12 @@ |
1860 | { |
1861 | } |
1862 | |
1863 | - TextureVolume::TextureVolume(const TextureVolume &texture) |
1864 | + TextureVolume::TextureVolume(const TextureVolume& texture) |
1865 | { |
1866 | _image = texture._image; |
1867 | } |
1868 | |
1869 | - TextureVolume &TextureVolume::operator = (const TextureVolume &texture) |
1870 | + TextureVolume& TextureVolume::operator = (const TextureVolume& texture) |
1871 | { |
1872 | if (this == &texture) |
1873 | return *this; // Handle self assignment |
1874 | @@ -796,7 +796,7 @@ |
1875 | |
1876 | } |
1877 | |
1878 | - bool TextureVolume::Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource) |
1879 | + bool TextureVolume::Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource) |
1880 | { |
1881 | nuxAssertMsg(BitmapData, "[TextureVolume::Update] Argument BitmapData is NULL."); |
1882 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1883 | @@ -807,7 +807,7 @@ |
1884 | return false; |
1885 | } |
1886 | |
1887 | - _image = *static_cast<const NVolumeData *> (BitmapData); |
1888 | + _image = *static_cast<const NVolumeData*> (BitmapData); |
1889 | |
1890 | if (UpdateAndCacheResource) |
1891 | { |
1892 | @@ -818,9 +818,9 @@ |
1893 | return true; |
1894 | } |
1895 | |
1896 | - bool TextureVolume::Update(const char *filename, bool UpdateAndCacheResource) |
1897 | + bool TextureVolume::Update(const char* filename, bool UpdateAndCacheResource) |
1898 | { |
1899 | - NBitmapData *BitmapData = LoadImageFile(filename); |
1900 | + NBitmapData* BitmapData = LoadImageFile(filename); |
1901 | nuxAssertMsg(BitmapData, "[TextureVolume::Update] Bitmap for file(%s) is NULL.", filename); |
1902 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1903 | bool ret = Update(filename); |
1904 | @@ -828,7 +828,7 @@ |
1905 | return ret; |
1906 | } |
1907 | |
1908 | - void TextureVolume::GetData(void *Buffer, int MipIndex, int StrideY, int slice) |
1909 | + void TextureVolume::GetData(void* Buffer, int MipIndex, int StrideY, int slice) |
1910 | { |
1911 | BYTE *Dest = (BYTE *) Buffer; |
1912 | // const BYTE* Src = _image.GetSurface(MipIndex, slice).GetPtrRawData(); |
1913 | @@ -851,7 +851,7 @@ |
1914 | Dest += NumRows * StrideY; |
1915 | } |
1916 | |
1917 | -// BYTE* Dest = (BYTE*)Buffer; |
1918 | +// BYTE* Dest = (BYTE*)Buffer; |
1919 | // const BYTE* Src = _image.GetSurface(MipIndex, slice).GetPtrRawData(); |
1920 | // int RowByteSize = _image.GetSurface(MipIndex, slice).GetPitch(); |
1921 | // int NumRows = _image.GetSurface(MipIndex, slice).GetBlockHeight(); |
1922 | @@ -870,7 +870,7 @@ |
1923 | return texture; |
1924 | } |
1925 | |
1926 | - CachedTextureVolume::CachedTextureVolume(NResourceSet *ResourceManager, TextureVolume *SourceTexture) |
1927 | + CachedTextureVolume::CachedTextureVolume(NResourceSet* ResourceManager, TextureVolume* SourceTexture) |
1928 | : CachedBaseTexture(ResourceManager) |
1929 | { |
1930 | if (SourceTexture->IsNull()) |
1931 | @@ -896,7 +896,7 @@ |
1932 | |
1933 | } |
1934 | |
1935 | - void CachedTextureVolume::UpdateTexture( BaseTexture *SourceTexture ) |
1936 | + void CachedTextureVolume::UpdateTexture( BaseTexture* SourceTexture ) |
1937 | { |
1938 | if ((SourceTexture == 0) || SourceTexture->IsNull()) |
1939 | { |
1940 | @@ -932,7 +932,7 @@ |
1941 | } |
1942 | } |
1943 | |
1944 | - void CachedTextureVolume::LoadMipLevel(BaseTexture *SourceTexture, int MipLevel) |
1945 | + void CachedTextureVolume::LoadMipLevel(BaseTexture* SourceTexture, int MipLevel) |
1946 | { |
1947 | VOLUME_LOCKED_BOX LockedBox; |
1948 | ObjectPtr <IOpenGLVolumeTexture> VolumeTexture = m_Texture; //m_Texture.CastRef<IOpenGLVolumeTexture>(); |
1949 | @@ -958,12 +958,12 @@ |
1950 | { |
1951 | } |
1952 | |
1953 | - TextureFrameAnimation::TextureFrameAnimation(const TextureFrameAnimation &texture) |
1954 | + TextureFrameAnimation::TextureFrameAnimation(const TextureFrameAnimation& texture) |
1955 | { |
1956 | _image = texture._image; |
1957 | } |
1958 | |
1959 | - TextureFrameAnimation &TextureFrameAnimation::operator = (const TextureFrameAnimation &texture) |
1960 | + TextureFrameAnimation& TextureFrameAnimation::operator = (const TextureFrameAnimation& texture) |
1961 | { |
1962 | if (this == &texture) |
1963 | return *this; // Handle self assignment |
1964 | @@ -977,7 +977,7 @@ |
1965 | |
1966 | } |
1967 | |
1968 | - bool TextureFrameAnimation::Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource) |
1969 | + bool TextureFrameAnimation::Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource) |
1970 | { |
1971 | nuxAssertMsg(BitmapData, "[TextureFrameAnimation::Update] Argument BitmapData is NULL."); |
1972 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1973 | @@ -999,9 +999,9 @@ |
1974 | return true; |
1975 | } |
1976 | |
1977 | - bool TextureFrameAnimation::Update(const char *filename, bool UpdateAndCacheResource) |
1978 | + bool TextureFrameAnimation::Update(const char* filename, bool UpdateAndCacheResource) |
1979 | { |
1980 | - NBitmapData *BitmapData = LoadImageFile(filename); |
1981 | + NBitmapData* BitmapData = LoadImageFile(filename); |
1982 | nuxAssertMsg(BitmapData, "[TextureFrameAnimation::Update] Bitmap for file(%s) is NULL.", filename); |
1983 | NUX_RETURN_VALUE_IF_NULL(BitmapData, false); |
1984 | bool ret = Update(BitmapData); |
1985 | @@ -1009,7 +1009,7 @@ |
1986 | return ret; |
1987 | } |
1988 | |
1989 | - void TextureFrameAnimation::GetData(void *Buffer, int MipIndex, int StrideY, int slice) |
1990 | + void TextureFrameAnimation::GetData(void* Buffer, int MipIndex, int StrideY, int slice) |
1991 | { |
1992 | BYTE *Dest = (BYTE *) Buffer; |
1993 | //for(int slice = 0; slice < ImageSurface::GetLevelDim(_image.GetFormat(), _image.GetDepth(), MipIndex); slice++) |
1994 | @@ -1040,7 +1040,7 @@ |
1995 | return texture; |
1996 | } |
1997 | |
1998 | - CachedTextureFrameAnimation::CachedTextureFrameAnimation(NResourceSet *ResourceManager, TextureFrameAnimation *SourceTexture) |
1999 | + CachedTextureFrameAnimation::CachedTextureFrameAnimation(NResourceSet* ResourceManager, TextureFrameAnimation* SourceTexture) |
2000 | : CachedBaseTexture(ResourceManager) |
2001 | { |
2002 | if (SourceTexture->IsNull()) |
2003 | @@ -1065,7 +1065,7 @@ |
2004 | |
2005 | } |
2006 | |
2007 | - void CachedTextureFrameAnimation::UpdateTexture( BaseTexture *SourceTexture ) |
2008 | + void CachedTextureFrameAnimation::UpdateTexture( BaseTexture* SourceTexture ) |
2009 | { |
2010 | if ((SourceTexture == 0) || SourceTexture->IsNull()) |
2011 | { |
2012 | @@ -1100,11 +1100,11 @@ |
2013 | } |
2014 | } |
2015 | |
2016 | - void CachedTextureFrameAnimation::LoadMipLevel(BaseTexture *SourceTexture, int MipLevel) |
2017 | + void CachedTextureFrameAnimation::LoadMipLevel(BaseTexture* SourceTexture, int MipLevel) |
2018 | { |
2019 | SURFACE_LOCKED_RECT LockedRect; |
2020 | ObjectPtr <IOpenGLAnimatedTexture> AnimatedTexture = m_Texture; //m_Texture.CastRef<IOpenGLAnimatedTexture>(); |
2021 | - TextureFrameAnimation *Source = UpCastResource<TextureFrameAnimation, BaseTexture> (SourceTexture); |
2022 | + TextureFrameAnimation* Source = UpCastResource<TextureFrameAnimation, BaseTexture> (SourceTexture); |
2023 | |
2024 | for (int frame = 0; frame < Source->GetDepth(); frame++) |
2025 | { |
2026 | |
2027 | === modified file 'NuxGraphics/GLTextureResourceManager.h' |
2028 | --- NuxGraphics/GLTextureResourceManager.h 2011-10-19 20:32:38 +0000 |
2029 | +++ NuxGraphics/GLTextureResourceManager.h 2012-02-19 00:04:19 +0000 |
2030 | @@ -50,7 +50,7 @@ |
2031 | * Note that if there's no alpha channel, the argument is ignored. |
2032 | * @return The resulting texture. |
2033 | */ |
2034 | - BaseTexture *CreateTexture2DFromFile(const char *filename, int max_size, |
2035 | + BaseTexture* CreateTexture2DFromFile(const char* filename, int max_size, |
2036 | bool premultiply); |
2037 | |
2038 | /*! |
2039 | @@ -62,15 +62,15 @@ |
2040 | * Note that if there's no alpha channel, the argument is ignored. |
2041 | * @return The resulting texture. |
2042 | */ |
2043 | - BaseTexture *CreateTexture2DFromPixbuf(GdkPixbuf *pixbuf, bool premultiply); |
2044 | + BaseTexture* CreateTexture2DFromPixbuf(GdkPixbuf* pixbuf, bool premultiply); |
2045 | |
2046 | // FIXME(loicm) Should be deprecated. |
2047 | - BaseTexture *CreateTextureFromPixbuf(GdkPixbuf *pixbuf); |
2048 | - |
2049 | - BaseTexture *CreateTextureFromFile(const char *TextureFilename); |
2050 | - BaseTexture *CreateTextureFromBitmapData(const NBitmapData *BitmapData); |
2051 | - |
2052 | - BaseTexture* LoadTextureFromFile(const std::string &filename); |
2053 | + BaseTexture* CreateTextureFromPixbuf(GdkPixbuf* pixbuf); |
2054 | + |
2055 | + BaseTexture* CreateTextureFromFile(const char* TextureFilename); |
2056 | + BaseTexture* CreateTextureFromBitmapData(const NBitmapData* BitmapData); |
2057 | + |
2058 | + BaseTexture* LoadTextureFromFile(const std::string& filename); |
2059 | |
2060 | //! Abstract base class for textures. |
2061 | class BaseTexture: public ResourceData |
2062 | @@ -90,7 +90,7 @@ |
2063 | GetDeviceTexture() or GetCachedTexture() is called. |
2064 | @return True if there was no error during the update. |
2065 | */ |
2066 | - virtual bool Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource = true) = 0; |
2067 | + virtual bool Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource = true) = 0; |
2068 | |
2069 | /*! |
2070 | Update the texture with the provided filename. In doing so, if the texture as been cached in the resource manager, then |
2071 | @@ -102,9 +102,9 @@ |
2072 | GetDeviceTexture() or GetCachedTexture() is called. |
2073 | @return True if there was no error during the update. |
2074 | */ |
2075 | - virtual bool Update(const char *filename, bool UpdateAndCacheResource = true) = 0; |
2076 | + virtual bool Update(const char* filename, bool UpdateAndCacheResource = true) = 0; |
2077 | |
2078 | - virtual void GetData(void *Buffer, int MipIndex, int StrideY, int face = 0) = 0; |
2079 | + virtual void GetData(void* Buffer, int MipIndex, int StrideY, int face = 0) = 0; |
2080 | |
2081 | /*! |
2082 | @return The texture width. |
2083 | @@ -178,9 +178,9 @@ |
2084 | |
2085 | public: |
2086 | Texture2D(NUX_FILE_LINE_PROTO); |
2087 | - Texture2D(const Texture2D &texture, NUX_FILE_LINE_PROTO); |
2088 | - Texture2D(const NTextureData &BaseTexture, NUX_FILE_LINE_PROTO); |
2089 | - Texture2D &operator = (const Texture2D &texture); |
2090 | + Texture2D(const Texture2D& texture, NUX_FILE_LINE_PROTO); |
2091 | + Texture2D(const NTextureData& BaseTexture, NUX_FILE_LINE_PROTO); |
2092 | + Texture2D& operator = (const Texture2D& texture); |
2093 | ~Texture2D(); |
2094 | |
2095 | /*! |
2096 | @@ -191,7 +191,7 @@ |
2097 | GetGraphicsDisplay()->GetGraphicsEngine()->CacheResource(this); |
2098 | @return True is there was not error. |
2099 | */ |
2100 | - virtual bool Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource = true); |
2101 | + virtual bool Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource = true); |
2102 | |
2103 | /*! |
2104 | Update the hardware resources associated to this object with the data associated to the file name. |
2105 | @@ -201,7 +201,7 @@ |
2106 | GetGraphicsDisplay()->GetGraphicsEngine()->CacheResource(this); |
2107 | @return True is there was not error. |
2108 | */ |
2109 | - virtual bool Update(const char *Filename, bool UpdateAndCacheResource = true); |
2110 | + virtual bool Update(const char* Filename, bool UpdateAndCacheResource = true); |
2111 | |
2112 | /*! |
2113 | @return True if the texture storage contains valid bitmap data. |
2114 | @@ -211,7 +211,7 @@ |
2115 | return _image.IsNull(); |
2116 | } |
2117 | |
2118 | - void GetData(void *Buffer, int MipIndex, int StrideY, int face = 0); |
2119 | + void GetData(void* Buffer, int MipIndex, int StrideY, int face = 0); |
2120 | |
2121 | /*! |
2122 | @return The number of mip maps in the texture. |
2123 | @@ -268,13 +268,13 @@ |
2124 | |
2125 | public: |
2126 | TextureRectangle(NUX_FILE_LINE_PROTO); |
2127 | - TextureRectangle(const TextureRectangle &texture); |
2128 | + TextureRectangle(const TextureRectangle& texture); |
2129 | TextureRectangle(const NTextureData& Image); |
2130 | - TextureRectangle &operator = (const TextureRectangle &texture); |
2131 | + TextureRectangle& operator = (const TextureRectangle& texture); |
2132 | ~TextureRectangle(); |
2133 | |
2134 | - virtual bool Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource = true); |
2135 | - virtual bool Update(const char *filename, bool UpdateAndCacheResource = true); |
2136 | + virtual bool Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource = true); |
2137 | + virtual bool Update(const char* filename, bool UpdateAndCacheResource = true); |
2138 | |
2139 | /*! |
2140 | @return True if the texture storage contains valid bitmap data. |
2141 | @@ -284,7 +284,7 @@ |
2142 | return _image.IsNull(); |
2143 | } |
2144 | |
2145 | - void GetData(void *Buffer, int MipIndex, int StrideY, int face = 0); |
2146 | + void GetData(void* Buffer, int MipIndex, int StrideY, int face = 0); |
2147 | |
2148 | /*! |
2149 | @return The number of mip maps in the texture. |
2150 | @@ -343,12 +343,12 @@ |
2151 | public: |
2152 | TextureCube(NUX_FILE_LINE_PROTO); |
2153 | //Texture2D(const NTextureData& Image); |
2154 | - TextureCube(const TextureCube &texture); |
2155 | - TextureCube &operator = (const TextureCube &texture); |
2156 | + TextureCube(const TextureCube& texture); |
2157 | + TextureCube& operator = (const TextureCube& texture); |
2158 | ~TextureCube(); |
2159 | |
2160 | - virtual bool Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource = true); |
2161 | - virtual bool Update(const char *filename, bool UpdateAndCacheResource = true); |
2162 | + virtual bool Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource = true); |
2163 | + virtual bool Update(const char* filename, bool UpdateAndCacheResource = true); |
2164 | |
2165 | /*! |
2166 | @return True if the texture storage contains valid bitmap data. |
2167 | @@ -357,7 +357,7 @@ |
2168 | { |
2169 | return _image.IsNull(); |
2170 | } |
2171 | - void GetData(void *Buffer, int MipIndex, int StrideY, int face = 0); |
2172 | + void GetData(void* Buffer, int MipIndex, int StrideY, int face = 0); |
2173 | |
2174 | /*! |
2175 | @return The number of mip maps in the texture. |
2176 | @@ -416,12 +416,12 @@ |
2177 | public: |
2178 | TextureVolume(NUX_FILE_LINE_PROTO); |
2179 | //Texture2D(const NTextureData& Image); |
2180 | - TextureVolume(const TextureVolume &texture); |
2181 | - TextureVolume &operator = (const TextureVolume &texture); |
2182 | + TextureVolume(const TextureVolume& texture); |
2183 | + TextureVolume& operator = (const TextureVolume& texture); |
2184 | ~TextureVolume(); |
2185 | |
2186 | - virtual bool Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource = true); |
2187 | - virtual bool Update(const char *filename, bool UpdateAndCacheResource = true); |
2188 | + virtual bool Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource = true); |
2189 | + virtual bool Update(const char* filename, bool UpdateAndCacheResource = true); |
2190 | |
2191 | /*! |
2192 | @return True if the texture storage contains valid bitmap data. |
2193 | @@ -430,7 +430,7 @@ |
2194 | { |
2195 | return _image.IsNull(); |
2196 | } |
2197 | - void GetData(void *Buffer, int MipIndex, int StrideY, int slice = 0); |
2198 | + void GetData(void* Buffer, int MipIndex, int StrideY, int slice = 0); |
2199 | |
2200 | /*! |
2201 | @return The number of mip maps in the texture. |
2202 | @@ -497,12 +497,12 @@ |
2203 | |
2204 | public: |
2205 | TextureFrameAnimation(NUX_FILE_LINE_PROTO); |
2206 | - TextureFrameAnimation(const TextureFrameAnimation &texture); |
2207 | - TextureFrameAnimation &operator = (const TextureFrameAnimation &texture); |
2208 | + TextureFrameAnimation(const TextureFrameAnimation& texture); |
2209 | + TextureFrameAnimation& operator = (const TextureFrameAnimation& texture); |
2210 | ~TextureFrameAnimation(); |
2211 | |
2212 | - virtual bool Update(const NBitmapData *BitmapData, bool UpdateAndCacheResource = true); |
2213 | - virtual bool Update(const char *filename, bool UpdateAndCacheResource = true); |
2214 | + virtual bool Update(const NBitmapData* BitmapData, bool UpdateAndCacheResource = true); |
2215 | + virtual bool Update(const char* filename, bool UpdateAndCacheResource = true); |
2216 | |
2217 | /*! |
2218 | @return True if the texture storage contains valid bitmap data. |
2219 | @@ -511,7 +511,7 @@ |
2220 | { |
2221 | return _image.IsNull(); |
2222 | } |
2223 | - void GetData(void *Buffer, int MipIndex, int StrideY, int slice = 0); |
2224 | + void GetData(void* Buffer, int MipIndex, int StrideY, int slice = 0); |
2225 | int GetFrameTime(int Frame); |
2226 | |
2227 | /*! |
2228 | @@ -578,16 +578,16 @@ |
2229 | public: |
2230 | ObjectPtr < IOpenGLBaseTexture > m_Texture; |
2231 | |
2232 | - CachedBaseTexture(NResourceSet *ResourceManager); |
2233 | + CachedBaseTexture(NResourceSet* ResourceManager); |
2234 | ~CachedBaseTexture(); |
2235 | |
2236 | - virtual void LoadMipLevel(BaseTexture *SourceTexture, int MipLevel) = 0; |
2237 | - |
2238 | - virtual bool UpdateResource(ResourceData *Resource); |
2239 | - |
2240 | - bool RecreateTexture(BaseTexture *Source); |
2241 | - |
2242 | - virtual void UpdateTexture(BaseTexture *Source) = 0; |
2243 | + virtual void LoadMipLevel(BaseTexture* SourceTexture, int MipLevel) = 0; |
2244 | + |
2245 | + virtual bool UpdateResource(ResourceData* Resource); |
2246 | + |
2247 | + bool RecreateTexture(BaseTexture* Source); |
2248 | + |
2249 | + virtual void UpdateTexture(BaseTexture* Source) = 0; |
2250 | |
2251 | unsigned int SourceWidth; |
2252 | unsigned int SourceHeight; |
2253 | @@ -599,55 +599,55 @@ |
2254 | { |
2255 | NUX_DECLARE_OBJECT_TYPE(CachedTexture2D, CachedBaseTexture); |
2256 | public: |
2257 | - CachedTexture2D(NResourceSet *ResourceManager, Texture2D *SourceTexture); |
2258 | + CachedTexture2D(NResourceSet* ResourceManager, Texture2D* SourceTexture); |
2259 | ~CachedTexture2D(); |
2260 | |
2261 | - virtual void UpdateTexture(BaseTexture *Source); |
2262 | - virtual void LoadMipLevel(BaseTexture *SourceTexture, int MipLevel); |
2263 | + virtual void UpdateTexture(BaseTexture* Source); |
2264 | + virtual void LoadMipLevel(BaseTexture* SourceTexture, int MipLevel); |
2265 | }; |
2266 | |
2267 | class CachedTextureRectangle: public CachedBaseTexture |
2268 | { |
2269 | NUX_DECLARE_OBJECT_TYPE(CachedTextureRectangle, CachedBaseTexture); |
2270 | public: |
2271 | - CachedTextureRectangle(NResourceSet *ResourceManager, TextureRectangle *SourceTexture); |
2272 | + CachedTextureRectangle(NResourceSet* ResourceManager, TextureRectangle* SourceTexture); |
2273 | ~CachedTextureRectangle(); |
2274 | |
2275 | - virtual void UpdateTexture(BaseTexture *Source); |
2276 | - virtual void LoadMipLevel(BaseTexture *SourceTexture, int MipLevel); |
2277 | + virtual void UpdateTexture(BaseTexture* Source); |
2278 | + virtual void LoadMipLevel(BaseTexture* SourceTexture, int MipLevel); |
2279 | }; |
2280 | |
2281 | class CachedTextureCube: public CachedBaseTexture |
2282 | { |
2283 | NUX_DECLARE_OBJECT_TYPE(CachedTextureCube, CachedBaseTexture); |
2284 | public: |
2285 | - CachedTextureCube(NResourceSet *ResourceManager, TextureCube *SourceTexture); |
2286 | + CachedTextureCube(NResourceSet* ResourceManager, TextureCube* SourceTexture); |
2287 | ~CachedTextureCube(); |
2288 | |
2289 | - virtual void UpdateTexture(BaseTexture *Source); |
2290 | - virtual void LoadMipLevel(BaseTexture *SourceTexture, int MipLevel); |
2291 | + virtual void UpdateTexture(BaseTexture* Source); |
2292 | + virtual void LoadMipLevel(BaseTexture* SourceTexture, int MipLevel); |
2293 | }; |
2294 | |
2295 | class CachedTextureVolume: public CachedBaseTexture |
2296 | { |
2297 | NUX_DECLARE_OBJECT_TYPE(CachedTextureVolume, CachedBaseTexture); |
2298 | public: |
2299 | - CachedTextureVolume(NResourceSet *ResourceManager, TextureVolume *SourceTexture); |
2300 | + CachedTextureVolume(NResourceSet* ResourceManager, TextureVolume* SourceTexture); |
2301 | ~CachedTextureVolume(); |
2302 | |
2303 | - virtual void UpdateTexture(BaseTexture *Source); |
2304 | - virtual void LoadMipLevel(BaseTexture *SourceTexture, int MipLevel); |
2305 | + virtual void UpdateTexture(BaseTexture* Source); |
2306 | + virtual void LoadMipLevel(BaseTexture* SourceTexture, int MipLevel); |
2307 | }; |
2308 | |
2309 | class CachedTextureFrameAnimation: public CachedBaseTexture |
2310 | { |
2311 | NUX_DECLARE_OBJECT_TYPE(CachedTextureFrameAnimation, CachedBaseTexture); |
2312 | public: |
2313 | - CachedTextureFrameAnimation(NResourceSet *ResourceManager, TextureFrameAnimation *SourceTexture); |
2314 | + CachedTextureFrameAnimation(NResourceSet* ResourceManager, TextureFrameAnimation* SourceTexture); |
2315 | ~CachedTextureFrameAnimation(); |
2316 | |
2317 | - virtual void UpdateTexture(BaseTexture *Source); |
2318 | - virtual void LoadMipLevel(BaseTexture *SourceTexture, int MipLevel); |
2319 | + virtual void UpdateTexture(BaseTexture* Source); |
2320 | + virtual void LoadMipLevel(BaseTexture* SourceTexture, int MipLevel); |
2321 | }; |
2322 | |
2323 | } |
2324 | |
2325 | === modified file 'NuxGraphics/GLVertexResourceManager.cpp' |
2326 | --- NuxGraphics/GLVertexResourceManager.cpp 2012-01-22 04:31:33 +0000 |
2327 | +++ NuxGraphics/GLVertexResourceManager.cpp 2012-02-19 00:04:19 +0000 |
2328 | @@ -283,7 +283,7 @@ |
2329 | return; |
2330 | } |
2331 | |
2332 | - t_byte* pData; |
2333 | + unsigned char* pData; |
2334 | |
2335 | _vertex_buffer->Lock(0, 0, (void**) &pData); |
2336 | Memcpy(pData, SourceVtxBuffer->GetPtrRawData(), SourceVtxBuffer->GetSize()); |
2337 | @@ -373,7 +373,7 @@ |
2338 | return; |
2339 | } |
2340 | |
2341 | - t_byte* pData; |
2342 | + unsigned char* pData; |
2343 | _index_buffer->Lock(0, 0, (void**) &pData); |
2344 | Memcpy(pData, SourceIdxBuffer->GetPtrRawData(), SourceIdxBuffer->GetSize()); |
2345 | _index_buffer->Unlock(); |
2346 | |
2347 | === modified file 'NuxGraphics/GlobalGraphicsInitializer.cpp' |
2348 | --- NuxGraphics/GlobalGraphicsInitializer.cpp 2011-10-19 20:32:38 +0000 |
2349 | +++ NuxGraphics/GlobalGraphicsInitializer.cpp 2012-02-19 00:04:19 +0000 |
2350 | @@ -33,7 +33,7 @@ |
2351 | |
2352 | static void SystemStart() |
2353 | { |
2354 | - static t_u8 StaticBuffer[sizeof(NuxGraphicsGlobalSingletonInitializer) ]; |
2355 | + static unsigned char StaticBuffer[sizeof(NuxGraphicsGlobalSingletonInitializer) ]; |
2356 | // Placement new in our reserved buffer. |
2357 | GNuxGraphicsGlobalInitializer = new(StaticBuffer) NuxGraphicsGlobalSingletonInitializer(); |
2358 | |
2359 | |
2360 | === modified file 'NuxGraphics/GraphicsDisplayWin.cpp' |
2361 | --- NuxGraphics/GraphicsDisplayWin.cpp 2012-01-22 04:31:33 +0000 |
2362 | +++ NuxGraphics/GraphicsDisplayWin.cpp 2012-02-19 00:04:19 +0000 |
2363 | @@ -1527,18 +1527,18 @@ |
2364 | return 0; |
2365 | } |
2366 | |
2367 | - t_UTF16 *utf16_str = new t_UTF16 [4]; |
2368 | - Memset(utf16_str, 0, sizeof(t_UTF16) * 4); |
2369 | + wchar_t *utf16_str = new wchar_t [4]; |
2370 | + Memset(utf16_str, 0, sizeof(wchar_t) * 4); |
2371 | Memcpy(utf16_str, (int*) &wParam, sizeof(wParam)); |
2372 | - t_UTF16 *temp0 = utf16_str; |
2373 | - |
2374 | - t_UTF8 *utf8_str = new t_UTF8 [NUX_EVENT_TEXT_BUFFER_SIZE]; |
2375 | - Memset(utf8_str, 0, sizeof(t_UTF8) * NUX_EVENT_TEXT_BUFFER_SIZE); |
2376 | - t_UTF8 *temp1 = utf8_str; |
2377 | - |
2378 | - |
2379 | - ConversionResult res = ConvertUTF16toUTF8((const nux::t_UTF16 **) &temp0, |
2380 | - utf16_str + sizeof(t_UTF16) * 4, |
2381 | + wchar_t *temp0 = utf16_str; |
2382 | + |
2383 | + unsigned char *utf8_str = new unsigned char [NUX_EVENT_TEXT_BUFFER_SIZE]; |
2384 | + Memset(utf8_str, 0, sizeof(unsigned char) * NUX_EVENT_TEXT_BUFFER_SIZE); |
2385 | + unsigned char *temp1 = utf8_str; |
2386 | + |
2387 | + |
2388 | + ConversionResult res = ConvertUTF16toUTF8((const wchar_t **) &temp0, |
2389 | + utf16_str + sizeof(wchar_t) * 4, |
2390 | &temp1, |
2391 | utf8_str + NUX_EVENT_TEXT_BUFFER_SIZE, |
2392 | lenientConversion); |
2393 | @@ -1576,18 +1576,18 @@ |
2394 | event_->key_repeat_count = (int) (lParam & 0xff); |
2395 | } |
2396 | |
2397 | - t_UTF32 *utf32_str = new t_UTF32 [4]; |
2398 | - Memset(utf32_str, 0, sizeof(t_UTF32) * 4); |
2399 | + unsigned int *utf32_str = new unsigned int [4]; |
2400 | + Memset(utf32_str, 0, sizeof(unsigned int) * 4); |
2401 | Memcpy(utf32_str, (int*) &wParam, sizeof(wParam)); |
2402 | - t_UTF32 *temp0 = utf32_str; |
2403 | - |
2404 | - t_UTF8 *utf8_str = new t_UTF8 [NUX_EVENT_TEXT_BUFFER_SIZE]; |
2405 | - Memset(utf8_str, 0, sizeof(t_UTF8) * NUX_EVENT_TEXT_BUFFER_SIZE); |
2406 | - t_UTF8 *temp1 = utf8_str; |
2407 | - |
2408 | - |
2409 | - ConversionResult res = ConvertUTF32toUTF8((const nux::t_UTF32 **) &temp0, |
2410 | - utf32_str + sizeof(t_UTF32) * 4, |
2411 | + unsigned int *temp0 = utf32_str; |
2412 | + |
2413 | + unsigned char *utf8_str = new unsigned char [NUX_EVENT_TEXT_BUFFER_SIZE]; |
2414 | + Memset(utf8_str, 0, sizeof(unsigned char) * NUX_EVENT_TEXT_BUFFER_SIZE); |
2415 | + unsigned char *temp1 = utf8_str; |
2416 | + |
2417 | + |
2418 | + ConversionResult res = ConvertUTF32toUTF8((const unsigned int**) &temp0, |
2419 | + utf32_str + sizeof(unsigned int) * 4, |
2420 | &temp1, |
2421 | utf8_str + NUX_EVENT_TEXT_BUFFER_SIZE, |
2422 | lenientConversion); |
2423 | |
2424 | === modified file 'NuxImage/CairoGraphics.cpp' |
2425 | --- NuxImage/CairoGraphics.cpp 2011-11-14 06:21:25 +0000 |
2426 | +++ NuxImage/CairoGraphics.cpp 2012-02-19 00:04:19 +0000 |
2427 | @@ -129,7 +129,7 @@ |
2428 | bitmap_format = BITFMT_A8; |
2429 | |
2430 | NTextureData *bitmap_data = new NTextureData(bitmap_format, _width, _height, 1); |
2431 | - t_u8 *ptr = cairo_image_surface_get_data(_cairo_surface); |
2432 | + unsigned char *ptr = cairo_image_surface_get_data(_cairo_surface); |
2433 | int stride = cairo_image_surface_get_stride(_cairo_surface); |
2434 | |
2435 | if (ptr == NULL || stride == 0) |
2436 | @@ -141,7 +141,7 @@ |
2437 | |
2438 | if (m_surface_format == CAIRO_FORMAT_A1) |
2439 | { |
2440 | - t_u8 *temp = new t_u8[bitmap_data->GetSurface(0).GetPitch() ]; |
2441 | + unsigned char *temp = new unsigned char[bitmap_data->GetSurface(0).GetPitch() ]; |
2442 | |
2443 | for (int j = 0; j < _height; j++) |
2444 | { |
2445 | |
2446 | === modified file 'NuxImage/GdkGraphics.cpp' |
2447 | --- NuxImage/GdkGraphics.cpp 2011-10-19 20:32:38 +0000 |
2448 | +++ NuxImage/GdkGraphics.cpp 2012-02-19 00:04:19 +0000 |
2449 | @@ -107,7 +107,7 @@ |
2450 | } |
2451 | |
2452 | ImageSurface& image_surface = texture->GetSurface(0); |
2453 | - t_u8* dest = image_surface.GetPtrRawData(); |
2454 | + unsigned char* dest = image_surface.GetPtrRawData(); |
2455 | int dest_pitch = image_surface.GetPitch(); |
2456 | |
2457 | guchar* src = gdk_pixbuf_get_pixels(pixbuf_); |
2458 | |
2459 | === modified file 'NuxImage/ImageSurface.cpp' |
2460 | --- NuxImage/ImageSurface.cpp 2011-10-21 22:06:35 +0000 |
2461 | +++ NuxImage/ImageSurface.cpp 2012-02-19 00:04:19 +0000 |
2462 | @@ -195,7 +195,7 @@ |
2463 | m_Pitch = surface.m_Pitch; |
2464 | Alignment_ = surface.Alignment_; |
2465 | |
2466 | - RawData_ = new t_u8[surface.GetSize()]; |
2467 | + RawData_ = new unsigned char[surface.GetSize()]; |
2468 | Memcpy(RawData_, surface.RawData_, surface.GetSize()); |
2469 | } |
2470 | |
2471 | @@ -213,7 +213,7 @@ |
2472 | |
2473 | delete [] RawData_; |
2474 | |
2475 | - RawData_ = new t_u8[surface.GetSize() ]; |
2476 | + RawData_ = new unsigned char[surface.GetSize() ]; |
2477 | Memcpy(RawData_, surface.RawData_, surface.GetSize()); |
2478 | return *this; |
2479 | } |
2480 | @@ -298,7 +298,7 @@ |
2481 | |
2482 | block = GPixelFormats[format].BlockSizeY; |
2483 | shift = Log2(GPixelFormats[format].BlockSizeY); |
2484 | - RawData_ = new t_u8[m_Pitch * Align((height + (block-1)) >> shift, block) ]; |
2485 | + RawData_ = new unsigned char[m_Pitch * Align((height + (block-1)) >> shift, block) ]; |
2486 | } |
2487 | else |
2488 | { |
2489 | @@ -308,7 +308,7 @@ |
2490 | |
2491 | block = GPixelFormats[format].BlockSizeY; |
2492 | shift = Log2(GPixelFormats[format].BlockSizeY); |
2493 | - RawData_ = new t_u8[m_Pitch * Align((height + (block-1)) >> shift, block) ]; |
2494 | + RawData_ = new unsigned char[m_Pitch * Align((height + (block-1)) >> shift, block) ]; |
2495 | } |
2496 | |
2497 | Clear(); |
2498 | @@ -430,10 +430,10 @@ |
2499 | if ((format_ == BITFMT_DXT1) || (format_ == BITFMT_DXT2) || (format_ == BITFMT_DXT3) || (format_ == BITFMT_DXT4) || (format_ == BITFMT_DXT5)) |
2500 | return; |
2501 | |
2502 | - RawData_[j *m_Pitch + i *bpe_ + 0] = (t_u8) (value & 0xff); |
2503 | - RawData_[j *m_Pitch + i *bpe_ + 1] = (t_u8) ((value & 0xff00) >> 8); |
2504 | - RawData_[j *m_Pitch + i *bpe_ + 2] = (t_u8) ((value & 0xff0000) >> 16); |
2505 | - RawData_[j *m_Pitch + i *bpe_ + 3] = (t_u8) ((value & 0xff000000) >> 24); |
2506 | + RawData_[j *m_Pitch + i *bpe_ + 0] = (unsigned char) (value & 0xff); |
2507 | + RawData_[j *m_Pitch + i *bpe_ + 1] = (unsigned char) ((value & 0xff00) >> 8); |
2508 | + RawData_[j *m_Pitch + i *bpe_ + 2] = (unsigned char) ((value & 0xff0000) >> 16); |
2509 | + RawData_[j *m_Pitch + i *bpe_ + 3] = (unsigned char) ((value & 0xff000000) >> 24); |
2510 | } |
2511 | |
2512 | void ImageSurface::Write24b(int i, int j, unsigned int value) |
2513 | @@ -445,9 +445,9 @@ |
2514 | if ((format_ == BITFMT_DXT1) || (format_ == BITFMT_DXT2) || (format_ == BITFMT_DXT3) || (format_ == BITFMT_DXT4) || (format_ == BITFMT_DXT5)) |
2515 | return; |
2516 | |
2517 | - RawData_[j *m_Pitch + i *bpe_ + 0] = (t_u8) (value & 0xff); |
2518 | - RawData_[j *m_Pitch + i *bpe_ + 1] = (t_u8) ((value & 0xff00) >> 8); |
2519 | - RawData_[j *m_Pitch + i *bpe_ + 2] = (t_u8) ((value & 0xff0000) >> 16); |
2520 | + RawData_[j *m_Pitch + i *bpe_ + 0] = (unsigned char) (value & 0xff); |
2521 | + RawData_[j *m_Pitch + i *bpe_ + 1] = (unsigned char) ((value & 0xff00) >> 8); |
2522 | + RawData_[j *m_Pitch + i *bpe_ + 2] = (unsigned char) ((value & 0xff0000) >> 16); |
2523 | } |
2524 | |
2525 | void ImageSurface::Write16b(int i, int j, unsigned short value) |
2526 | @@ -459,11 +459,11 @@ |
2527 | if ((format_ == BITFMT_DXT1) || (format_ == BITFMT_DXT2) || (format_ == BITFMT_DXT3) || (format_ == BITFMT_DXT4) || (format_ == BITFMT_DXT5)) |
2528 | return; |
2529 | |
2530 | - RawData_[j *m_Pitch + i *bpe_ + 0] = (t_u8) (value & 0xff); |
2531 | - RawData_[j *m_Pitch + i *bpe_ + 1] = (t_u8) ((value & 0xff00) >> 8); |
2532 | + RawData_[j *m_Pitch + i *bpe_ + 0] = (unsigned char) (value & 0xff); |
2533 | + RawData_[j *m_Pitch + i *bpe_ + 1] = (unsigned char) ((value & 0xff00) >> 8); |
2534 | } |
2535 | |
2536 | - void ImageSurface::Write8b(int i, int j, t_u8 value) |
2537 | + void ImageSurface::Write8b(int i, int j, unsigned char value) |
2538 | { |
2539 | nuxAssert(i < width_); |
2540 | nuxAssert(j < height_); |
2541 | @@ -472,10 +472,10 @@ |
2542 | if ((format_ == BITFMT_DXT1) || (format_ == BITFMT_DXT2) || (format_ == BITFMT_DXT3) || (format_ == BITFMT_DXT4) || (format_ == BITFMT_DXT5)) |
2543 | return; |
2544 | |
2545 | - RawData_[j *m_Pitch + i *bpe_ + 0] = (t_u8) (value & 0xff); |
2546 | + RawData_[j *m_Pitch + i *bpe_ + 0] = (unsigned char) (value & 0xff); |
2547 | } |
2548 | |
2549 | - void ImageSurface::Write(int i, int j, t_u8 r, t_u8 g, t_u8 b, t_u8 a) |
2550 | + void ImageSurface::Write(int i, int j, unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
2551 | { |
2552 | nuxAssert(i < width_); |
2553 | nuxAssert(j < height_); |
2554 | @@ -555,7 +555,7 @@ |
2555 | return; |
2556 | |
2557 | int i, j, k; |
2558 | - t_u8 *flip_data; |
2559 | + unsigned char *flip_data; |
2560 | |
2561 | if (RawData_ == 0) |
2562 | return; |
2563 | @@ -563,7 +563,7 @@ |
2564 | if (width_ == 0 || height_ == 0) |
2565 | return; |
2566 | |
2567 | - flip_data = new t_u8[m_Pitch*height_]; |
2568 | + flip_data = new unsigned char[m_Pitch*height_]; |
2569 | |
2570 | for (j = 0; j < height_; j++) |
2571 | { |
2572 | @@ -584,7 +584,7 @@ |
2573 | { |
2574 | |
2575 | int i, j, k; |
2576 | - t_u8 *flip_data; |
2577 | + unsigned char *flip_data; |
2578 | |
2579 | if (RawData_ == 0) |
2580 | return; |
2581 | @@ -598,7 +598,7 @@ |
2582 | } |
2583 | else |
2584 | { |
2585 | - flip_data = new t_u8[m_Pitch*height_]; |
2586 | + flip_data = new unsigned char[m_Pitch*height_]; |
2587 | |
2588 | for (j = 0; j < height_; j++) |
2589 | { |
2590 | @@ -831,12 +831,12 @@ |
2591 | *pBits = *pBits | (gBits[0][3] << 21); |
2592 | } |
2593 | |
2594 | - const t_u8 *ImageSurface::GetPtrRawData() const |
2595 | + const unsigned char *ImageSurface::GetPtrRawData() const |
2596 | { |
2597 | return RawData_; |
2598 | } |
2599 | |
2600 | - t_u8 *ImageSurface::GetPtrRawData() |
2601 | + unsigned char *ImageSurface::GetPtrRawData() |
2602 | { |
2603 | return RawData_; |
2604 | } |
2605 | |
2606 | === modified file 'NuxImage/ImageSurface.h' |
2607 | --- NuxImage/ImageSurface.h 2012-02-06 01:06:09 +0000 |
2608 | +++ NuxImage/ImageSurface.h 2012-02-19 00:04:19 +0000 |
2609 | @@ -106,8 +106,8 @@ |
2610 | void Write32b(int i, int j, unsigned int value); |
2611 | void Write24b(int i, int j, unsigned int value); |
2612 | void Write16b(int i, int j, unsigned short value); |
2613 | - void Write8b(int i, int j, t_u8 value); |
2614 | - void Write(int i, int j, t_u8 r, t_u8 g, t_u8 b, t_u8 a); |
2615 | + void Write8b(int i, int j, unsigned char value); |
2616 | + void Write(int i, int j, unsigned char r, unsigned char g, unsigned char b, unsigned char a); |
2617 | //! Read an element of the surface. |
2618 | /*! |
2619 | Return a 32 bits value representing the image element at coordinates(i, j). |
2620 | @@ -128,8 +128,8 @@ |
2621 | int GetAlignment() const; |
2622 | int GetSize() const; |
2623 | BitmapFormat GetFormat() const; |
2624 | - const t_u8 *GetPtrRawData() const; |
2625 | - t_u8 *GetPtrRawData(); |
2626 | + const unsigned char *GetPtrRawData() const; |
2627 | + unsigned char *GetPtrRawData(); |
2628 | |
2629 | static int GetLevelPitch(BitmapFormat format, int width, int height, int miplevel); |
2630 | static int GetLevelPitchNoMemAlignment(BitmapFormat format, int width, int height, int miplevel); |
2631 | @@ -166,7 +166,7 @@ |
2632 | int m_Pitch; //!< Image pitch. |
2633 | int bpe_; //!< Number of byte per element. |
2634 | int Alignment_; //!< Data alignment. |
2635 | - t_u8 *RawData_; |
2636 | + unsigned char *RawData_; |
2637 | }; |
2638 | |
2639 | |
2640 | |
2641 | === modified file 'configure.ac' |
2642 | --- configure.ac 2012-02-17 20:04:24 +0000 |
2643 | +++ configure.ac 2012-02-19 00:04:19 +0000 |
2644 | @@ -22,7 +22,7 @@ |
2645 | # The number format is : year/month/day |
2646 | # e.g.: december 5th, 2011 is: 20111205 |
2647 | # To make more than one API change in a day, add a number to the date. Like 20111205.xx |
2648 | -m4_define([nux_abi_version], [20120217.01]) |
2649 | +m4_define([nux_abi_version], [20120218.01]) |
2650 | |
2651 | m4_define([nux_version], |
2652 | [nux_major_version.nux_minor_version.nux_micro_version]) |