xoreos  0.0.5
util.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #include "src/common/ustring.h"
26 
27 #include "src/aurora/2dareg.h"
28 #include "src/aurora/gdafile.h"
29 
31 
32 namespace Engines {
33 
34 namespace DragonAge {
35 
37  const Aurora::GDAFile &m2da = TwoDAReg.getMGDA("m2da_");
38 
39  const Common::UString sheetName = m2da.getString(m2da.findRow(id), "Worksheet");
40 
41  return TwoDAReg.getMGDA(sheetName);
42 }
43 
44 } // End of namespace DragonAge
45 
46 } // End of namespace Engines
Handling BioWare&#39;s GDAs (2DAs, two-dimensional array, within V4.0 GFFs).
A class holding an UTF-8 string.
Definition: ustring.h:48
size_t findRow(uint32 id) const
Find a row by its ID value.
Definition: gdafile.cpp:95
const Aurora::GDAFile & getMGDA(uint32 id)
Definition: util.cpp:36
Dragon Age: Origins utility functions.
#define TwoDAReg
Shortcut for accessing the 2da registry.
Definition: 2dareg.h:101
The global 2DA registry.
Unicode string handling.
Common::UString getString(size_t row, uint32 columnHash, const Common::UString &def="") const
Definition: gdafile.cpp:165
uint32_t uint32
Definition: types.h:204
Class to hold the GFF&#39;d two-dimensional array of a GDA file.
Definition: gdafile.h:62