You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: coresdk/src/coresdk/animations.cpp
+19-20Lines changed: 19 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,6 @@ using std::string;
25
25
using std::vector;
26
26
using std::map;
27
27
using std::ifstream;
28
-
using std::to_string;
29
28
30
29
namespacesplashkit_lib
31
30
{
@@ -93,7 +92,7 @@ namespace splashkit_lib
93
92
94
93
if (rows[my_row.id].id != -1)
95
94
{
96
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". A frame with id " + to_string(my_row.id) + " already exists.";
95
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". A frame with id " + std::to_string(my_row.id) + " already exists.";
97
96
returnfalse;
98
97
}
99
98
else
@@ -113,7 +112,7 @@ namespace splashkit_lib
113
112
{
114
113
if (ids[j].name == my_id.name)
115
114
{
116
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". The id " + my_id.name + " already exists.";
115
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". The id " + my_id.name + " already exists.";
117
116
returnfalse;
118
117
}
119
118
}
@@ -128,7 +127,7 @@ namespace splashkit_lib
128
127
//
129
128
// if (count_delimiter(data, ',') != 3)
130
129
// {
131
-
// LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". A frame must have 4 values separated as id,cell,dur,next");
130
+
// LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". A frame must have 4 values separated as id,cell,dur,next");
132
131
// return false;
133
132
// }
134
133
//
@@ -150,7 +149,7 @@ namespace splashkit_lib
150
149
151
150
if ( count_delimiter_with_ranges(data, ',') != 3 )
152
151
{
153
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". A multi-frame must have 4 values separated as id-range,cell-range,dur,next";
152
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". A multi-frame must have 4 values separated as id-range,cell-range,dur,next";
154
153
returnfalse;
155
154
}
156
155
@@ -159,7 +158,7 @@ namespace splashkit_lib
159
158
160
159
if (id_range.size() != cell_range.size())
161
160
{
162
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". The range of cells and ids is not the same length.";
161
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". The range of cells and ids is not the same length.";
163
162
returnfalse;
164
163
}
165
164
@@ -191,7 +190,7 @@ namespace splashkit_lib
191
190
192
191
if (count_delimiter_with_ranges(data, ',') != 1)
193
192
{
194
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". An id must have 2 values separated as name,start-id";
193
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". An id must have 2 values separated as name,start-id";
195
194
returnfalse;
196
195
}
197
196
@@ -208,7 +207,7 @@ namespace splashkit_lib
208
207
209
208
if (count_delimiter(data, ',') != 2)
210
209
{
211
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". A sound must have three parts frame #,sound name,sound file.";
210
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". A sound must have three parts frame #,sound name,sound file.";
LOG(WARNING) << "At line " + to_string(line_no) + " in animation " + filename + ": No frame with id " + to_string(id) + " for sound file " + snd_file;
230
+
LOG(WARNING) << "At line " + std::to_string(line_no) + " in animation " + filename + ": No frame with id " + std::to_string(id) + " for sound file " + snd_file;
232
231
};
233
232
234
233
auto process_vector = [&]()
@@ -240,7 +239,7 @@ namespace splashkit_lib
240
239
241
240
if (count_delimiter(data, ',') != 2)
242
241
{
243
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". A vector must have three parts frame #s, x value, y value.";
242
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". A vector must have three parts frame #s, x value, y value.";
244
243
return;
245
244
}
246
245
@@ -250,13 +249,13 @@ namespace splashkit_lib
250
249
251
250
if (nottry_str_to_double(x_val, x))
252
251
{
253
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". X value must be a number.";
252
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". X value must be a number.";
254
253
return;
255
254
}
256
255
257
256
if (nottry_str_to_double(y_val, y))
258
257
{
259
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". Y value must be a number.";
258
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". Y value must be a number.";
260
259
return;
261
260
}
262
261
@@ -282,7 +281,7 @@ namespace splashkit_lib
282
281
// Verify that id is a single char
283
282
if (line_id.length() != 1)
284
283
{
285
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". Error with frame #: " + line_id + ". This should be a single character.";
284
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". Error with frame #: " + line_id + ". This should be a single character.";
286
285
return;
287
286
}
288
287
@@ -305,7 +304,7 @@ namespace splashkit_lib
305
304
process_vector();
306
305
break;
307
306
default:
308
-
LOG(WARNING) << "Error at line " + to_string(line_no) + " in animation " + filename + ". Error with id: " + line_id + ". This should be one of f,m,i, s, or v.";
307
+
LOG(WARNING) << "Error at line " + std::to_string(line_no) + " in animation " + filename + ". Error with id: " + line_id + ". This should be one of f,m,i, s, or v.";
309
308
return;
310
309
}
311
310
};
@@ -344,7 +343,7 @@ namespace splashkit_lib
344
343
{
345
344
free_animation_script(result);
346
345
result = nullptr;
347
-
LOG(WARNING) << "Error in animation " + filename + ". Error with frame: " + to_string(j) + ". Next is outside of available frames.";
346
+
LOG(WARNING) << "Error in animation " + filename + ". Error with frame: " + std::to_string(j) + ". Next is outside of available frames.";
348
347
return;
349
348
}
350
349
else
@@ -409,7 +408,7 @@ namespace splashkit_lib
409
408
if (sum_loop(current) == 0)
410
409
{
411
410
free_animation_script(result);
412
-
LOG(WARNING) << "Error in animation " + filename + ". Animation contains a loop with duration 0 starting at cell " + to_string(current->index);
411
+
LOG(WARNING) << "Error in animation " + filename + ". Animation contains a loop with duration 0 starting at cell " + std::to_string(current->index);
413
412
return;
414
413
}
415
414
}
@@ -670,7 +669,7 @@ namespace splashkit_lib
670
669
671
670
if ( idx < 0or idx >= temp->animation_names.size())
672
671
{
673
-
LOG(WARNING) << "Attempting to get an animation that is not within range 0-" + to_string(temp->animations.size()-1) + ".";
672
+
LOG(WARNING) << "Attempting to get an animation that is not within range 0-" + std::to_string(temp->animations.size()-1) + ".";
674
673
return"";
675
674
}
676
675
@@ -699,7 +698,7 @@ namespace splashkit_lib
699
698
700
699
if ((idx < 0) or (idx >= script->animations.size()))
701
700
{
702
-
LOG(WARNING) << "Assigning an animation frame that is not within range 0-" + to_string(script->animations.size()-1) + ".";
701
+
LOG(WARNING) << "Assigning an animation frame that is not within range 0-" + std::to_string(script->animations.size()-1) + ".";
703
702
return;
704
703
}
705
704
@@ -790,7 +789,7 @@ namespace splashkit_lib
790
789
791
790
if ((idx < 0) or (idx >= script->animations.size()))
792
791
{
793
-
LOG(WARNING) << "Unable to create animation number " + to_string(idx) + " from script " + script->name;
792
+
LOG(WARNING) << "Unable to create animation number " + std::to_string(idx) + " from script " + script->name;
0 commit comments