~ubuntu-branches/ubuntu/raring/simutrans/raring-proposed

« back to all changes in this revision

Viewing changes to besch/writer/vehicle_writer.cc

  • Committer: Package Import Robot
  • Author(s): Ansgar Burchardt
  • Date: 2011-11-03 19:59:02 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20111103195902-uopgwf488mfctb75
Tags: 111.0-1
* New upstream release.
* debian/rules: Update get-orig-source target for new upstream release.
* Use xz compression for source and binary packages.
* Use override_* targets to simplify debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        // prissi: must be done here, since it may affect the len of the header!
62
62
        string sound_str = ltrim( obj.get("sound") );
63
63
        sint8 sound_id=NO_SOUND;
64
 
        if (sound_str.size() > 0) {
 
64
        if (!sound_str.empty()) {
65
65
                // ok, there is some sound
66
66
                sound_id = atoi(sound_str.c_str());
67
67
                if (sound_id == 0 && sound_str[0] == '0') {
71
71
                        // old style id
72
72
                        sound_str = "";
73
73
                }
74
 
                if (sound_str.size() > 0) {
 
74
                if (!sound_str.empty()) {
75
75
                        sound_id = LOAD_SOUND;
76
76
                        total_len += sound_str.size() + 1;
77
77
                }
176
176
                char buf[40];
177
177
                sprintf(buf, "freightimage[%d][%s]", i, dir_codes[0]);
178
178
                str = obj.get(buf);
179
 
                if (str.size() == 0) {
 
179
                if (str.empty()) {
180
180
                        freight_max = i;
181
181
                        break;
182
182
                }
189
189
                // Hajodoc: Empty vehicle image for direction, direction in "s", "w", "sw", "se", unsymmetric vehicles need also "n", "e", "ne", "nw"
190
190
                sprintf(buf, "emptyimage[%s]", dir_codes[i]);
191
191
                str = obj.get(buf);
192
 
                if (str.size() > 0) {
 
192
                if (!str.empty()) {
193
193
                        emptykeys.append(str);
194
194
                        if (i >= 4) {
195
195
                                has_8_images = true;
204
204
                        // old style definition - just [direction]
205
205
                        sprintf(buf, "freightimage[%s]", dir_codes[i]);
206
206
                        str = obj.get(buf);
207
 
                        if (str.size() > 0) {
 
207
                        if (!str.empty()) {
208
208
                                freightkeys_old.append(str);
209
209
                        }
210
210
                } else {
212
212
                        for(int freight = 0; freight < freight_max; freight++) {
213
213
                                sprintf(buf, "freightimage[%d][%s]", freight, dir_codes[i]);
214
214
                                str = obj.get(buf);
215
 
                                if (str.size() == 0) {
 
215
                                if (str.empty()) {
216
216
                                        printf("*** FATAL ***:\nMissing freightimage[%d][%s]!\n", freight, dir_codes[i]);
217
217
                                        fflush(NULL);
218
218
                                        exit(0);
257
257
                sprintf(buf, "constraint[prev][%d]", besch_vorgaenger);
258
258
 
259
259
                str = obj.get(buf);
260
 
                found = str.size() > 0;
 
260
                found = !str.empty();
261
261
                if (found) {
262
262
                        if (!STRICMP(str.c_str(), "none")) {
263
263
                                str = "";
276
276
                sprintf(buf, "constraint[next][%d]", besch_nachfolger);
277
277
 
278
278
                str = obj.get(buf);
279
 
                found = str.size() > 0;
 
279
                found = !str.empty();
280
280
                if (found) {
281
281
                        if (!STRICMP(str.c_str(), "none")) {
282
282
                                str = "";