Files @ r10737:2346af7e04e8
Branch filter:

Location: cpp/openttd-patchpack/source/src/saveload/signs_sl.cpp

translators
(svn r15070) -Update: WebTranslator2 update to 2009-01-13 18:42:22
brazilian_portuguese - 16 fixed by tucalipe (16)
catalan - 8 fixed by arnaullv (8)
croatian - 24 fixed by tifached (24)
czech - 8 fixed by Hadez (8)
dutch - 2 fixed by Excel20 (2)
finnish - 7 fixed, 1 changed by UltimateSephiroth (8)
hungarian - 7 fixed, 2 changed by IPG (2), alyr (7)
indonesian - 23 fixed, 2 changed by fanioz (25)
italian - 7 fixed, 1 changed by lorenzodv (8)
japanese - 59 fixed by ickoonite (59)
polish - 3 fixed by xaxa (3)
romanian - 23 fixed, 1 changed by kkmic (24)
slovak - 59 fixed by James (59)
spanish - 58 fixed by Dominus (30), eusebio (28)
turkish - 7 fixed, 1 changed by Emin (8)
/* $Id$ */

/** @file signs_sl.cpp Code handling saving and loading of economy data */

#include "../stdafx.h"
#include "../strings_func.h"
#include "../company_func.h"
#include "../signs_base.h"
#include "../signs_func.h"

#include "saveload_internal.h"
#include "saveload.h"

static const SaveLoad _sign_desc[] = {
  SLE_CONDVAR(Sign, name,  SLE_NAME,                   0, 83),
  SLE_CONDSTR(Sign, name,  SLE_STR, 0,                84, SL_MAX_VERSION),
  SLE_CONDVAR(Sign, x,     SLE_FILE_I16 | SLE_VAR_I32, 0, 4),
  SLE_CONDVAR(Sign, y,     SLE_FILE_I16 | SLE_VAR_I32, 0, 4),
  SLE_CONDVAR(Sign, x,     SLE_INT32,                  5, SL_MAX_VERSION),
  SLE_CONDVAR(Sign, y,     SLE_INT32,                  5, SL_MAX_VERSION),
  SLE_CONDVAR(Sign, owner, SLE_UINT8,                  6, SL_MAX_VERSION),
      SLE_VAR(Sign, z,     SLE_UINT8),
	SLE_END()
};

/** Save all signs */
static void Save_SIGN()
{
	Sign *si;

	FOR_ALL_SIGNS(si) {
		SlSetArrayIndex(si->index);
		SlObject(si, _sign_desc);
	}
}

/** Load all signs */
static void Load_SIGN()
{
	int index;
	while ((index = SlIterateArray()) != -1) {
		Sign *si = new (index) Sign();
		SlObject(si, _sign_desc);
	}
}

extern const ChunkHandler _sign_chunk_handlers[] = {
	{ 'SIGN', Save_SIGN, Load_SIGN, CH_ARRAY | CH_LAST},
};