/src/ogre/OgreMain/src/OgreCommon.cpp
Line | Count | Source |
1 | | /* |
2 | | ----------------------------------------------------------------------------- |
3 | | This source file is part of OGRE |
4 | | (Object-oriented Graphics Rendering Engine) |
5 | | For the latest info, see http://www.ogre3d.org/ |
6 | | |
7 | | Copyright (c) 2000-2014 Torus Knot Software Ltd |
8 | | |
9 | | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | | of this software and associated documentation files (the "Software"), to deal |
11 | | in the Software without restriction, including without limitation the rights |
12 | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
13 | | copies of the Software, and to permit persons to whom the Software is |
14 | | furnished to do so, subject to the following conditions: |
15 | | |
16 | | The above copyright notice and this permission notice shall be included in |
17 | | all copies or substantial portions of the Software. |
18 | | |
19 | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | THE SOFTWARE. |
26 | | ----------------------------------------------------------------------------- |
27 | | */ |
28 | | #include "OgreStableHeaders.h" |
29 | | |
30 | | namespace Ogre |
31 | | { |
32 | | int findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList, |
33 | | BinaryOptionList& binOptList) |
34 | 0 | { |
35 | 0 | int startIndex = 1; |
36 | 0 | for (int i = 1; i < numargs; ++i) |
37 | 0 | { |
38 | 0 | String tmp(argv[i]); |
39 | 0 | if (StringUtil::startsWith(tmp, "-")) |
40 | 0 | { |
41 | 0 | UnaryOptionList::iterator ui = unaryOptList.find(argv[i]); |
42 | 0 | if(ui != unaryOptList.end()) |
43 | 0 | { |
44 | 0 | ui->second = true; |
45 | 0 | ++startIndex; |
46 | 0 | continue; |
47 | 0 | } |
48 | 0 | BinaryOptionList::iterator bi = binOptList.find(argv[i]); |
49 | 0 | if(bi != binOptList.end()) |
50 | 0 | { |
51 | 0 | bi->second = argv[i+1]; |
52 | 0 | startIndex += 2; |
53 | 0 | ++i; |
54 | 0 | continue; |
55 | 0 | } |
56 | | |
57 | | // Invalid option |
58 | 0 | LogManager::getSingleton().logMessage("Invalid option " + tmp, LML_CRITICAL); |
59 | |
|
60 | 0 | } |
61 | 0 | } |
62 | 0 | return startIndex; |
63 | 0 | } |
64 | | |
65 | | void logMaterialNotFound(const String& name, const String& groupName, const String& destType, |
66 | | const String& destName, LogMessageLevel lml) |
67 | 0 | { |
68 | 0 | LogManager::getSingleton().logMessage( |
69 | 0 | StringUtil::format("Can't assign material to %s '%s'. Material '%s' not found in group '%s'. Have you " |
70 | 0 | "forgotten to define it in a .material script?", |
71 | 0 | destType.c_str(), destName.c_str(), name.c_str(), groupName.c_str()), |
72 | 0 | lml); |
73 | 0 | } |
74 | | } |