src/fsmblockmap.cpp
author rubidium
Sun, 05 Aug 2007 00:39:42 +0000
branchNewGRF_ports
changeset 6751 08176dfe64b7
parent 6739 3f2ca4d0abda
child 6758 1545d187ab64
permissions -rw-r--r--
(svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
[NewGRF_ports] -Fix: a memleak.
6751
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
     1
/* $Id$ */
6739
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
     2
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
     3
/** @file fsmblockmap.cpp */
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
     4
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
     5
#include "fsmblockmap.h"
6751
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
     6
#include "debug.h"
6739
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
     7
6751
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
     8
FSMblockmap* SetFSMSingleBlock(const byte *blocklist)
6739
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
     9
{
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
    10
	FSMblockmap *singleblock = new FSMblockmap;
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
    11
	singleblock->ResetAll();
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
    12
	singleblock->Initialise(blocklist, 1);
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
    13
	return singleblock;
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
    14
}
3f2ca4d0abda (svn r10738) [NewGRF_ports] -Feature: FSMblockmap class added. Basic FSM import complete. Need to handle multiple blocks on import. Aircraft controller recoded to work with new 128 bit blocks. Still need to write saveload for new blocks.
richk
parents:
diff changeset
    15
6751
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
    16
void FSMblockmap::PrintBlock(bool newline) const
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
    17
{
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
    18
	printf("%016" OTTD_PRINTF64 "x%016" OTTD_PRINTF64 "x", this->block_upper, this->block_lower);
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
    19
	if (newline) printf("\n");
08176dfe64b7 (svn r10790) [NewGRF_ports] -Codechange: constify the fsmblockmaps where possible.
rubidium
parents: 6739
diff changeset
    20
}