Files @ r10585:02717b4646db
Branch filter:

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

translators
(svn r14848) -Update: WebTranslator2 update to 2009-01-05 18:44:14
afrikaans - 11 fixed by Alrich (11)
arabic_egypt - 19 fixed, 21 changed by khaloofah (40)
danish - 40 fixed, 1 changed by ThomasA (41)
dutch - 2 fixed, 25 changed by Excel20 (27)
hebrew - 8 fixed by EScake (8)
hungarian - 18 fixed by alyr (18)
italian - 18 fixed by lorenzodv (18)
norwegian_bokmal - 3 fixed, 11 changed by khh (14)
norwegian_nynorsk - 8 fixed by Grilldyret (8)
polish - 3 fixed by xaxa (3)
portuguese - 7 fixed by SnowFlake (7)
urdu - 9 fixed by yasirniazkhan (9)
/* $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},
};