Merge lp:~thumper/nux/replace-nfilename into lp:nux
- replace-nfilename
- Merge into trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~thumper/nux/replace-nfilename |
Merge into: | lp:nux |
Prerequisite: | lp:~thumper/nux/rolling-file-appender |
Diff against target: |
636 lines (+58/-383) 9 files modified
Nux/FolderTreeItem.cpp (+8/-6) Nux/FolderTreeItem.h (+18/-12) NuxCore/FileName.cpp (+0/-237) NuxCore/FileName.h (+0/-97) NuxCore/Makefile.am (+0/-2) NuxCore/NuxCore.h (+0/-1) NuxImage/NITX.cpp (+1/-0) NuxMesh/NMeshArchiver_ver_0_0_1.h (+21/-16) NuxMesh/NTextureArchiveManager.cpp (+10/-12) |
To merge this branch: | bzr merge lp:~thumper/nux/replace-nfilename |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil J. Patel (community) | Needs Information | ||
Jay Taoko (community) | Approve | ||
Review via email: mp+65609@code.launchpad.net |
Commit message
Description of the change
Now that we are looking to use boost::filesystem, we can remove the special NFileName class. This is also desirable as we want to remove NString and replace it with std::string.
There were some changes that were made that didn't cause any recompilation. It appears that there are several files in the tree that aren't being compiled into the libraries at the moment.
Neil J. Patel (njpatel) wrote : | # |
Are we still wanting a dep on boost-filesystem now that it's a lib and not just a magic header?
Tim Penhey (thumper) wrote : | # |
On Thu, 21 Jul 2011 23:03:30 you wrote:
> Review: Needs Information
> Are we still wanting a dep on boost-filesystem now that it's a lib and not
> just a magic header?
Yes. This branch won't merge until we get boost-filesystem.
Unmerged revisions
- 402. By Tim Penhey
-
Remove the now unneeded files.
- 401. By Tim Penhey
-
Added note about broken code, but it isn't being compiled either.
- 400. By Tim Penhey
-
fixed other reference in that file too.
- 399. By Tim Penhey
-
Updated, but this file isn't currently compiled.
- 398. By Tim Penhey
-
Replace NFileName with boost::
filesystem: :path.
Preview Diff
1 | === modified file 'Nux/FolderTreeItem.cpp' |
2 | --- Nux/FolderTreeItem.cpp 2011-05-26 21:08:18 +0000 |
3 | +++ Nux/FolderTreeItem.cpp 2011-06-23 02:52:27 +0000 |
4 | @@ -27,13 +27,15 @@ |
5 | namespace nux |
6 | { |
7 | |
8 | - FolderTreeItem::FolderTreeItem (const TCHAR *name, const TCHAR *Path, bool Searchable, NodeParameterType type) |
9 | - : TreeItem (name, type) |
10 | + FolderTreeItem::FolderTreeItem(const TCHAR *name, |
11 | + const TCHAR *Path, |
12 | + bool Searchable, |
13 | + NodeParameterType type) |
14 | + : TreeItem(name, type) |
15 | + , m_Path(Path) |
16 | + , m_Synchronize(false) |
17 | + , m_Searchable(Searchable) |
18 | { |
19 | - m_Synchronize = false; |
20 | - m_Path = Path; |
21 | - m_Searchable = Searchable; |
22 | - |
23 | TableItem::SetAlwaysShowOpeningButton (true); |
24 | |
25 | NString IconPath = NUX_FINDRESOURCELOCATION (TEXT ("Icons/FolderOpen-16x16.png") ); |
26 | |
27 | === modified file 'Nux/FolderTreeItem.h' |
28 | --- Nux/FolderTreeItem.h 2011-04-06 21:54:09 +0000 |
29 | +++ Nux/FolderTreeItem.h 2011-06-23 02:52:27 +0000 |
30 | @@ -23,6 +23,9 @@ |
31 | #ifndef FOLDERTREEITEM_H |
32 | #define FOLDERTREEITEM_H |
33 | |
34 | +#include <string> |
35 | +#include <boost/filesystem.hpp> |
36 | + |
37 | #include "TreeControl.h" |
38 | |
39 | namespace nux |
40 | @@ -35,15 +38,22 @@ |
41 | FolderTreeItem (const TCHAR *name, const TCHAR *Path, bool Searchable = true, NodeParameterType type = NODE_TYPE_STATICTEXT); |
42 | virtual ~FolderTreeItem(); |
43 | |
44 | - virtual void DrawProperty (GraphicsEngine &GfxContext, TableCtrl *table, bool force_draw, Geometry geo, const BasePainter &Painter, RowHeader *row, const std::vector<ColumnHeader>& column_vector, Color ItemBackgroundColor = Color (0x0) ); |
45 | + virtual void DrawProperty(GraphicsEngine& GfxContext, |
46 | + TableCtrl *table, |
47 | + bool force_draw, |
48 | + Geometry geo, |
49 | + const BasePainter &Painter, |
50 | + RowHeader *row, |
51 | + const std::vector<ColumnHeader>& column_vector, |
52 | + Color ItemBackgroundColor = Color (0x0) ); |
53 | |
54 | - const TCHAR *GetPathName() |
55 | + std::string GetPathName() |
56 | { |
57 | - return m_Path.GetTCharPtr(); |
58 | + return m_Path.string(); |
59 | } |
60 | - const TCHAR *GetCleanFilename() |
61 | + std::string GetFilename() |
62 | { |
63 | - return m_Path.GetCleanFilename().GetTCharPtr(); |
64 | + return m_Path.filename(); |
65 | } |
66 | |
67 | void SetSynchronize (bool b) |
68 | @@ -72,17 +82,13 @@ |
69 | BaseTexture* FolderOpenIcon; |
70 | BaseTexture* FolderClosedIcon; |
71 | |
72 | - NFileName m_Path; |
73 | + boost::filesystem::path m_Path; |
74 | NString m_FolderName; |
75 | bool m_Synchronize; // synchronize with windows explorer |
76 | - // True if this is a real directory that can be explorer. False if this is just a decoration item. |
77 | + // True if this is a real directory that can be explorer. |
78 | + // False if this is just a decoration item. |
79 | // Non searchable folders must always be at the top of the tree; |
80 | bool m_Searchable; |
81 | - |
82 | - //virtual long ProcessPropertyEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo); |
83 | - //virtual void DrawProperty(GraphicsEngine& GfxContext, TableCtrl* table, bool force_draw, Geometry geo, const BasePainter& Painter, RowHeader* row, const std::vector<ColumnHeader>& column_vector, Color ItemBackgroundColor = 0x0); |
84 | - //virtual void ComputePropertyLayout(int x, int y, RowHeader* row, const std::vector<ColumnHeader>& column_vector); |
85 | - //virtual int GetItemBestHeight(); |
86 | }; |
87 | |
88 | } |
89 | |
90 | === removed file 'NuxCore/FileName.cpp' |
91 | --- NuxCore/FileName.cpp 2011-04-06 21:54:09 +0000 |
92 | +++ NuxCore/FileName.cpp 1970-01-01 00:00:00 +0000 |
93 | @@ -1,237 +0,0 @@ |
94 | -/* |
95 | - * Copyright 2010 Inalogic® Inc. |
96 | - * |
97 | - * This program is free software: you can redistribute it and/or modify it |
98 | - * under the terms of the GNU Lesser General Public License, as |
99 | - * published by the Free Software Foundation; either version 2.1 or 3.0 |
100 | - * of the License. |
101 | - * |
102 | - * This program is distributed in the hope that it will be useful, but |
103 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
104 | - * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
105 | - * PURPOSE. See the applicable version of the GNU Lesser General Public |
106 | - * License for more details. |
107 | - * |
108 | - * You should have received a copy of both the GNU Lesser General Public |
109 | - * License along with this program. If not, see <http://www.gnu.org/licenses/> |
110 | - * |
111 | - * Authored by: Jay Taoko <jaytaoko@inalogic.com> |
112 | - * |
113 | - */ |
114 | - |
115 | - |
116 | -#include "NuxCore.h" |
117 | -#include "FileName.h" |
118 | -#include "Math/MathUtility.h" |
119 | - |
120 | -namespace nux |
121 | -{ |
122 | - |
123 | - NString NFileName::GetDrive() const |
124 | - { |
125 | - t_size Pos = FindFirstOccurence (NUX_BACKSLASH_CHAR); |
126 | - |
127 | - if (Pos == tstring::npos) |
128 | - { |
129 | - Pos = FindFirstOccurence ("\\"); |
130 | - |
131 | - if (Pos != tstring::npos) |
132 | - { |
133 | - return GetSubString (Pos); |
134 | - } |
135 | - } |
136 | - |
137 | - return TEXT (""); |
138 | - } |
139 | - |
140 | - NString NFileName::GetExtension() const |
141 | - { |
142 | - t_size Pos = FindLastOccurence (TEXT (".") ); |
143 | - |
144 | - if (Pos != tstring::npos) |
145 | - { |
146 | - return GetSubString (Pos + 1, Length() - Pos - 1); |
147 | - } |
148 | - |
149 | - return TEXT (""); |
150 | - } |
151 | - |
152 | -// Returns the base filename without the path |
153 | - NString NFileName::GetCleanFilename() const |
154 | - { |
155 | - t_size Pos = FindLastOccurence (NUX_BACKSLASH_CHAR); |
156 | - Pos = Max<t_size> (Pos, FindLastOccurence (TEXT ("/") ) ); // in case we are using slash and the NUX_BACKSLASH_CHAR is different. |
157 | - Pos = Max<t_size> (Pos, FindLastOccurence (TEXT ("\\") ) ); // in case we are using backslash and the NUX_BACKSLASH_CHAR is different. |
158 | - |
159 | - if (Pos != tstring::npos) |
160 | - { |
161 | - return GetSubString (Pos + 1, Length() - Pos - 1); |
162 | - } |
163 | - |
164 | - return *this; |
165 | - } |
166 | - |
167 | - NString NFileName::GetFilenameNoExtension() const |
168 | - { |
169 | - t_size Pos = FindLastOccurence (TEXT (".") ); |
170 | - |
171 | - if (Pos != tstring::npos) |
172 | - { |
173 | - return GetSubString (Pos); |
174 | - } |
175 | - |
176 | - return *this; |
177 | - } |
178 | - |
179 | -// Returns the base filename without the path and without the extension |
180 | - NString NFileName::GetBaseFilename() const |
181 | - { |
182 | - NString Wk = GetCleanFilename(); |
183 | - |
184 | - t_size Pos = Wk.FindLastOccurence (TEXT (".") ); |
185 | - |
186 | - if (Pos != tstring::npos) |
187 | - { |
188 | - return Wk.GetSubString (Pos); |
189 | - } |
190 | - |
191 | - return Wk; |
192 | - } |
193 | - |
194 | -// Returns the path in front of the filename |
195 | - |
196 | - NString NFileName::GetDirectoryPath() const |
197 | - { |
198 | - t_size Pos = FindLastOccurence (NUX_BACKSLASH_CHAR); |
199 | - Pos = Max<t_size> (Pos, FindLastOccurence (TEXT ("/") ) ); // in case we are using slash and the NUX_BACKSLASH_CHAR is different. |
200 | - Pos = Max<t_size> (Pos, FindLastOccurence (TEXT ("\\") ) ); // in case we are using backslash and the NUX_BACKSLASH_CHAR is different. |
201 | - |
202 | - if (Pos != tstring::npos) |
203 | - { |
204 | - return GetSubString (Pos); |
205 | - } |
206 | - |
207 | - return *this; |
208 | - } |
209 | - |
210 | - void NFileName::ChangeFileExtension (const TCHAR *ext) |
211 | - { |
212 | - t_size Pos = FindLastOccurence (TEXT (".") ); |
213 | - |
214 | - if (Pos != tstring::npos) |
215 | - { |
216 | - (*this) = GetSubString (Pos) + NString (TEXT (".") ) + NString (ext); |
217 | - } |
218 | - else |
219 | - { |
220 | - (*this) = (*this) + NString (TEXT (".") ) + NString (ext); |
221 | - } |
222 | - } |
223 | - |
224 | - void NFileName::ConvertSlashToBackslash() |
225 | - { |
226 | - t_size Pos = tstring::npos; |
227 | - Pos = FindFirstOccurence (TEXT ('/') ); |
228 | - |
229 | - while (Pos != tstring::npos) |
230 | - { |
231 | - Replace (Pos, 1, 1, TEXT ('\\') ); |
232 | - } |
233 | - } |
234 | - |
235 | - |
236 | - void NFileName::ConvertBackslashToSlash() |
237 | - { |
238 | - t_size Pos = tstring::npos; |
239 | - Pos = FindFirstOccurence (TEXT ('\\') ); |
240 | - |
241 | - while (Pos != tstring::npos) |
242 | - { |
243 | - Replace (Pos, 1, 1, TEXT ('/') ); |
244 | - } |
245 | - } |
246 | - |
247 | - void NFileName::AddSlashAtEnd() |
248 | - { |
249 | - if (GetLastChar() != TEXT ('/') ) |
250 | - *this += TEXT ('/'); |
251 | - } |
252 | - |
253 | - void NFileName::AddBackSlashAtEnd() |
254 | - { |
255 | - if (GetLastChar() != TEXT ('\\') ) |
256 | - *this += TEXT ('\\'); |
257 | - } |
258 | - |
259 | - void NFileName::AddSlashAtStart() |
260 | - { |
261 | - if (GetFirstChar() != TEXT ('/') ) |
262 | - Insert (0, 1, TEXT ('/') ); |
263 | - } |
264 | - |
265 | - void NFileName::AddBackSlashAtStart() |
266 | - { |
267 | - if (GetFirstChar() != TEXT ('\\') ) |
268 | - Insert (0, 1, TEXT ('\\') ); |
269 | - } |
270 | - |
271 | - void NFileName::RemoveSlashAtEnd() |
272 | - { |
273 | - RemoveSuffix (TEXT ('/') ); |
274 | - } |
275 | - |
276 | - void NFileName::RemoveBackSlashAtEnd() |
277 | - { |
278 | - RemoveSuffix (TEXT ('\\') ); |
279 | - } |
280 | - |
281 | - void NFileName::RemoveSlashAtStart() |
282 | - { |
283 | - RemovePrefix (TEXT ('/') ); |
284 | - } |
285 | - |
286 | - void NFileName::RemoveBackSlashAtStart() |
287 | - { |
288 | - RemovePrefix (TEXT ('\\') ); |
289 | - } |
290 | - |
291 | - void NFileName::ConvertToCleanSlash() |
292 | - { |
293 | - ConvertBackslashToSlash(); |
294 | - |
295 | - t_size size = Size(); |
296 | - |
297 | - for (t_size i = 0; i < size; ) |
298 | - { |
299 | - if ( (i < size - 1) && (operator[] (i) == TEXT ('/') ) && (operator[] (i + 1) == TEXT ('/') ) ) |
300 | - { |
301 | - Erase (i + 1, 1); |
302 | - --size; |
303 | - } |
304 | - else |
305 | - { |
306 | - i++; |
307 | - } |
308 | - } |
309 | - } |
310 | - |
311 | - void NFileName::ConvertToCleanBackslash() |
312 | - { |
313 | - ConvertSlashToBackslash(); |
314 | - |
315 | - t_size size = Size(); |
316 | - |
317 | - for (t_size i = 0; i < size; ) |
318 | - { |
319 | - if ( (i < size - 1) && (operator[] (i) == TEXT ('\\') ) && (operator[] (i + 1) == TEXT ('\\') ) ) |
320 | - { |
321 | - Erase (i + 1, 1); |
322 | - } |
323 | - else |
324 | - { |
325 | - i++; |
326 | - } |
327 | - } |
328 | - } |
329 | - |
330 | -} |
331 | |
332 | === removed file 'NuxCore/FileName.h' |
333 | --- NuxCore/FileName.h 2011-04-06 21:54:09 +0000 |
334 | +++ NuxCore/FileName.h 1970-01-01 00:00:00 +0000 |
335 | @@ -1,97 +0,0 @@ |
336 | -/* |
337 | - * Copyright 2010 Inalogic® Inc. |
338 | - * |
339 | - * This program is free software: you can redistribute it and/or modify it |
340 | - * under the terms of the GNU Lesser General Public License, as |
341 | - * published by the Free Software Foundation; either version 2.1 or 3.0 |
342 | - * of the License. |
343 | - * |
344 | - * This program is distributed in the hope that it will be useful, but |
345 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
346 | - * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
347 | - * PURPOSE. See the applicable version of the GNU Lesser General Public |
348 | - * License for more details. |
349 | - * |
350 | - * You should have received a copy of both the GNU Lesser General Public |
351 | - * License along with this program. If not, see <http://www.gnu.org/licenses/> |
352 | - * |
353 | - * Authored by: Jay Taoko <jaytaoko@inalogic.com> |
354 | - * |
355 | - */ |
356 | - |
357 | - |
358 | -#ifndef NFILENAME_H |
359 | -#define NFILENAME_H |
360 | - |
361 | -#include "TextString.h" |
362 | - |
363 | -namespace nux |
364 | -{ |
365 | - |
366 | - class NFileName : public NString |
367 | - { |
368 | - public: |
369 | - NFileName() |
370 | - : NString() |
371 | - {} |
372 | - NFileName ( const NFileName &Filename ) |
373 | - : NString ( Filename.GetTCharPtr() ) |
374 | - {} |
375 | - |
376 | - NFileName ( const NString &str ) |
377 | - : NString ( str ) |
378 | - {} |
379 | - |
380 | - NFileName ( const ANSICHAR *str ) |
381 | - : NString ( str ) |
382 | - {} |
383 | - NFileName ( const UNICHAR *str ) |
384 | - : NString ( str ) |
385 | - {} |
386 | - |
387 | - //! Replace all slash with backslash. |
388 | - void ConvertSlashToBackslash(); |
389 | - //! Replace all backslash with slash. |
390 | - void ConvertBackslashToSlash(); |
391 | - //! Add slash at the end if there isn't one already. |
392 | - void AddSlashAtEnd(); |
393 | - //! Add backslash at the end if there isn't one already. |
394 | - void AddBackSlashAtEnd(); |
395 | - //! Add slash at the start if there isn't one already. |
396 | - void AddSlashAtStart(); |
397 | - //! Add backslash at the start if there isn't one already. |
398 | - void AddBackSlashAtStart(); |
399 | - //! Remove slash at the end if there is one. |
400 | - void RemoveSlashAtEnd(); |
401 | - //! Remove backslash at the end if there is one. |
402 | - void RemoveBackSlashAtEnd(); |
403 | - //! Remove slash at the start if there is one. |
404 | - void RemoveSlashAtStart(); |
405 | - //! Remove backslash at the start if there is one. |
406 | - void RemoveBackSlashAtStart(); |
407 | - |
408 | - //! Replace all backslash with slash. Replace multiple consecutive slash with one slash. |
409 | - void ConvertToCleanSlash(); |
410 | - //! Replace all slash with backslash. Replace multiple consecutive backslash with one backslash. |
411 | - void ConvertToCleanBackslash(); |
412 | - |
413 | - NString GetDrive() const; |
414 | - //! Returns the text following the last period. |
415 | - NString GetExtension() const; |
416 | - //! Returns the base filename, minus any path information. |
417 | - NString GetCleanFilename() const; |
418 | - //! Returns the base filename, without the extension (keep the path) |
419 | - NString GetFilenameNoExtension() const; |
420 | - |
421 | - //! Returns the same thing as GetCleanFilename, but without the extension |
422 | - NString GetBaseFilename() const; |
423 | - //! Returns the path in front of the filename |
424 | - NString GetDirectoryPath() const; |
425 | - //! Change the file extension. Do not start ext with a dot character '.'. |
426 | - //! ie ext = "com" |
427 | - void ChangeFileExtension (const TCHAR *ext); |
428 | - }; |
429 | - |
430 | -} |
431 | - |
432 | -#endif // NFILENAME_H |
433 | |
434 | === modified file 'NuxCore/Makefile.am' |
435 | --- NuxCore/Makefile.am 2011-06-23 02:52:27 +0000 |
436 | +++ NuxCore/Makefile.am 2011-06-23 02:52:27 +0000 |
437 | @@ -45,7 +45,6 @@ |
438 | $(srcdir)/Character/NUnicode.cpp \ |
439 | $(srcdir)/Color.cpp \ |
440 | $(srcdir)/Colors.cpp \ |
441 | - $(srcdir)/FileName.cpp \ |
442 | $(srcdir)/ThreadGNU.cpp \ |
443 | $(srcdir)/Parsing.cpp \ |
444 | $(srcdir)/CPU.cpp \ |
445 | @@ -147,7 +146,6 @@ |
446 | $(srcdir)/Error.h \ |
447 | $(srcdir)/SystemGNU.h \ |
448 | $(srcdir)/NuxCore.h \ |
449 | - $(srcdir)/FileName.h \ |
450 | $(srcdir)/OutputDevice.h \ |
451 | $(srcdir)/Process.h \ |
452 | $(srcdir)/ObjectType.h \ |
453 | |
454 | === modified file 'NuxCore/NuxCore.h' |
455 | --- NuxCore/NuxCore.h 2011-05-27 04:08:01 +0000 |
456 | +++ NuxCore/NuxCore.h 2011-06-23 02:52:27 +0000 |
457 | @@ -755,7 +755,6 @@ |
458 | |
459 | #include "FileIO.h" |
460 | #include "ObjectType.h" |
461 | -#include "FileName.h" |
462 | #include "Color.h" |
463 | #include "Colors.h" |
464 | #include "Object.h" |
465 | |
466 | === modified file 'NuxImage/NITX.cpp' |
467 | --- NuxImage/NITX.cpp 2011-04-06 21:54:09 +0000 |
468 | +++ NuxImage/NITX.cpp 2011-06-23 02:52:27 +0000 |
469 | @@ -428,6 +428,7 @@ |
470 | |
471 | void TextureArchiveGetInfo_ver_0_0_1 (NSerializer *FileStream, TextureArchiveInfo_ver_0_0_1 &TextureArchiveInfo) |
472 | { |
473 | + // NOTE: This is severely broken as the struct contains an object. |
474 | Memset (&TextureArchiveInfo, 0, sizeof (TextureArchiveInfo_ver_0_0_1) ); |
475 | |
476 | t_u32 texturenamesize = 0; |
477 | |
478 | === modified file 'NuxMesh/NMeshArchiver_ver_0_0_1.h' |
479 | --- NuxMesh/NMeshArchiver_ver_0_0_1.h 2011-04-06 21:54:09 +0000 |
480 | +++ NuxMesh/NMeshArchiver_ver_0_0_1.h 2011-06-23 02:52:27 +0000 |
481 | @@ -23,27 +23,29 @@ |
482 | #ifndef NMESHARCHIVER_VER_0_0_1_H |
483 | #define NMESHARCHIVER_VER_0_0_1_H |
484 | |
485 | +#include <boost/filesystem.hpp> |
486 | + |
487 | namespace nux |
488 | { |
489 | class NMeshObject; |
490 | |
491 | - typedef enum |
492 | + enum MeshIndexType |
493 | { |
494 | MESHINDEX_UNKNOWN = 0, |
495 | MESHINDEX_SHORT, |
496 | MESHINDEX_INT, |
497 | FORCE_MESHINDEXTYPE = 0x7fffffff |
498 | - } MeshIndexType; |
499 | + }; |
500 | |
501 | - typedef enum |
502 | + enum MeshBufferType |
503 | { |
504 | MESHBUFFER_UNKNOWN = 0, |
505 | MESHBUFFER_INDEXBUFFER, |
506 | MESHBUFFER_VERTEXBUFFER, |
507 | FORCE_MESHBUFFER = 0x7fffffff |
508 | - } MeshBufferType; |
509 | + }; |
510 | |
511 | - typedef enum |
512 | + enum MeshPolygonType |
513 | { |
514 | POLYGONTYPE_UNKNOWN = 0, |
515 | POLYGONTYPE_TRIANGLE, |
516 | @@ -56,9 +58,9 @@ |
517 | POLYGONTYPE_LINESTRIP, |
518 | POLYGONTYPE_POINT, |
519 | FORCE_POLYGONTYPE = 0x7fffffff |
520 | - } MeshPolygonType; |
521 | + }; |
522 | |
523 | - typedef enum |
524 | + enum VertexAttribType |
525 | { |
526 | VERTEXATTRIB_UNKNOWN = 0, |
527 | VERTEXATTRIB_FLOAT, |
528 | @@ -72,9 +74,9 @@ |
529 | VERTEXATTRIB_SHORT_N, // the short component should be divided by 32767.0 to get the normalized value in the range [-1.0, 1.0]. |
530 | VERTEXATTRIB_USHORT_N, // the short component should be divided by 65535.0 to get the normalized value in the range [0.0, 1.0]. |
531 | FORCE_VERTEXATTRIB = 0x7fffffff |
532 | - } VertexAttribType; |
533 | + }; |
534 | |
535 | - typedef enum |
536 | + enum VertexBufferSemantic |
537 | { |
538 | VBSEMANTIC_UNKNOWN = 0, |
539 | VBSEMANTIC_POSITION, |
540 | @@ -92,12 +94,12 @@ |
541 | VBSEMANTIC_TEXCOORD6, |
542 | VBSEMANTIC_TEXCOORD7, |
543 | FORCE_VBSEMANTIC = 0x7fffffff |
544 | - } VertexBufferSemantic; |
545 | + }; |
546 | |
547 | - typedef struct |
548 | + struct MeshDataInfo_ver_0_0_1 |
549 | { |
550 | nux::t_s64 FilePointer; |
551 | - NFileName Name; |
552 | + boost::filesystem::path Name; |
553 | unsigned int Type; |
554 | unsigned int Format; |
555 | unsigned int Width; |
556 | @@ -106,11 +108,14 @@ |
557 | unsigned int NumMipmap; |
558 | unsigned int Size; |
559 | |
560 | - } MeshDataInfo_ver_0_0_1; |
561 | + }; |
562 | |
563 | - bool SaveMeshObject_ver_0_0_1 (nux::NSerializer *FileStream, NMeshObject *); |
564 | - NMeshObject *LoadMeshObject_ver_0_0_1 (nux::NSerializer *FileStream, unsigned int Offset); |
565 | - void MeshDataGetInfo_ver_0_0_1 (nux::NSerializer *FileStream, MeshDataInfo_ver_0_0_1 &TextureArchiveInfo); |
566 | + bool SaveMeshObject_ver_0_0_1(nux::NSerializer* FileStream, |
567 | + NMeshObject*); |
568 | + NMeshObject* LoadMeshObject_ver_0_0_1(nux::NSerializer* FileStream, |
569 | + unsigned int Offset); |
570 | + void MeshDataGetInfo_ver_0_0_1(nux::NSerializer* FileStream, |
571 | + MeshDataInfo_ver_0_0_1& TextureArchiveInfo); |
572 | |
573 | } |
574 | |
575 | |
576 | === modified file 'NuxMesh/NTextureArchiveManager.cpp' |
577 | --- NuxMesh/NTextureArchiveManager.cpp 2011-04-06 21:54:09 +0000 |
578 | +++ NuxMesh/NTextureArchiveManager.cpp 2011-06-23 02:52:27 +0000 |
579 | @@ -18,7 +18,7 @@ |
580 | * Authored by: Jay Taoko <jaytaoko@inalogic.com> |
581 | * |
582 | */ |
583 | - |
584 | +#include <boost/filesystem.hpp> |
585 | |
586 | #include "NuxCore/NuxCore.h" |
587 | |
588 | @@ -107,7 +107,8 @@ |
589 | // <Image Name="Stroke_4pxrad_2px.tga" type="Stroke" style="eSTROKE_CORNER_ROUND4" border_left="4" border_right="4" border_top="4" border_bottom="4" border_only="true" /> |
590 | // </PaintData> |
591 | |
592 | - bool LoadXMLUITextures (const char *XMLUIFile, std::vector<ArchiveTextureData *>& ArchTexArray) |
593 | + bool LoadXMLUITextures(const char *XMLUIFile, |
594 | + std::vector<ArchiveTextureData *>& ArchTexArray) |
595 | { |
596 | FilePath m_FilePath; |
597 | m_FilePath.AddSearchPath (TEXT ("") ); // for case where fully qualified path is given |
598 | @@ -246,12 +247,12 @@ |
599 | for (int i = 0; i < numtexture; i++) |
600 | { |
601 | #ifdef NUX_OS_LINUX |
602 | - NFileName Filename (TEXT (PKGDATADIR"/UITextures") ); |
603 | + boost::filesystem::path Filename(PKGDATADIR"/UITextures"); |
604 | #else |
605 | - NFileName Filename (TEXT ("../../Data/UITextures/") ); |
606 | + boost::filesystem::path Filename("../../Data/UITextures"); |
607 | #endif |
608 | - Filename += ArchTexArray[i]->SourceFile.GetTCharPtr(); |
609 | - NBitmapData *BaseTexture = LoadImageFile (Filename.GetTCharPtr() ); |
610 | + Filename /= ArchTexArray[i]->SourceFile.GetTCharPtr(); |
611 | + NBitmapData *BaseTexture = LoadImageFile(Filename.string().c_str() ); |
612 | |
613 | if (BaseTexture) |
614 | { |
615 | @@ -478,18 +479,15 @@ |
616 | return false; |
617 | } |
618 | |
619 | - NFileName Filename; |
620 | + boost::filesystem::path Filename; |
621 | |
622 | if ( (SourceFolder != 0) && (NString (SourceFolder) != NString (TEXT ("") ) ) ) |
623 | { |
624 | Filename = SourceFolder; |
625 | - Filename.RemoveBackSlashAtEnd(); |
626 | - Filename.RemoveSlashAtEnd(); |
627 | - Filename.AddSlashAtEnd(); |
628 | } |
629 | |
630 | - Filename += TextureFilename; |
631 | - NBitmapData *BaseTexture = LoadImageFile (Filename.GetTCharPtr() ); |
632 | + Filename /= TextureFilename; |
633 | + NBitmapData *BaseTexture = LoadImageFile(Filename.string().c_str()); |
634 | |
635 | if (BaseTexture == 0) |
636 | return false; |
The files in NuxMesh are no longer compiled with Nux.