Esempio n. 1
0
unsigned expand_last( void )
{
obj list = ZERO;
unsigned N = 0;

  switch (arg_count_reg)
    {
    case 0:
      scheme_error( "expand_list: no arguments", 0 );
      break;

      STAGE(0,1);
      STAGE(1,2);
      STAGE(2,3);
      STAGE(3,4);
      STAGE(4,5);
      STAGE(5,6);
      STAGE(6,7);
      STAGE(7,8);
      STAGE(8,9);
      STAGE(9,10);
    default:
      /* this is for cases 11, 12, ..., since STAGE(9,10) is case 10
       * hence, N = (arg_count_reg - 1) is at least 10
       */
      N = arg_count_reg - 1;
      list = REG(N);
    filled_10:
      while (PAIR_P(list))
	{
	  REG(N) = pair_car( list );
	  list = pair_cdr( list );
	  N++;
	  if (N >= IMPL_ARG_LIMIT)
	    scheme_error( "expand_last: list of args too long at: ~#*@40s",
			  1, list );
	}
      break;
    }
    if (!NULL_P(list))
    {
	scheme_error( "expand_last: last arg not a proper list at ~a",
		      1,
		      list );
    }
    return N;
}
Esempio n. 2
0
void game::init_construction()
{
 int id = -1;
 int tl, cl, sl;

 #define CONSTRUCT(name, difficulty, able, done) \
  sl = -1; id++; \
  constructions.push_back( new constructable(id, name, difficulty, able, done))

 #define STAGE(...)\
  tl = 0; cl = 0; sl++; \
  constructions[id]->stages.push_back(construction_stage(__VA_ARGS__));
 #define TOOL(...)   setvector(constructions[id]->stages[sl].tools[tl], \
                               __VA_ARGS__); tl++
 #define COMP(...)   setvector(constructions[id]->stages[sl].components[cl], \
                               __VA_ARGS__); cl++

/* CONSTRUCT( name, time, able, done )
 * Name is the name as it appears in the menu; 30 characters or less, please.
 * time is the time in MINUTES that it takes to finish this construction.
 *  note that 10 turns = 1 minute.
 * able is a function which returns true if you can build it on a given tile
 *  See construction.h for options, and this file for definitions.
 * done is a function which runs each time the construction finishes.
 *  This is useful, for instance, for removing the trap from a pit, or placing
 *  items after a deconstruction.
 */

 CONSTRUCT(_("Dig Pit"), 0, &construct::able_dig, &construct::done_pit);
  STAGE(t_pit_shallow, 10);
   TOOL(itm_shovel, NULL);
  STAGE(t_pit, 10);
   TOOL(itm_shovel, NULL);

 CONSTRUCT(_("Spike Pit"), 0, &construct::able_pit, &construct::done_trap_pit);
  STAGE(t_pit_spiked, 5);
   COMP(itm_spear_wood, 4, NULL);

 CONSTRUCT(_("Fill Pit"), 0, &construct::able_pit, &construct::done_fill_pit);
  STAGE(t_pit_shallow, 5);
   TOOL(itm_shovel, NULL);
  STAGE(t_dirt, 5);
   TOOL(itm_shovel, NULL);

 CONSTRUCT(_("Clean Broken Window"), 0, &construct::able_broken_window,
                                     &construct::done_nothing);
  STAGE(t_window_empty, 5);

 CONSTRUCT(_("Remove Window Pane"),  1, &construct::able_window_pane,
                                     &construct::done_window_pane);
  STAGE(t_window_empty, 10);
   TOOL(itm_hammer, itm_rock, itm_hatchet, NULL);
   TOOL(itm_screwdriver, itm_knife_butter, itm_toolset, NULL);

 CONSTRUCT(_("Repair Door"), 1, &construct::able_door_broken,
                             &construct::done_nothing);
  STAGE(t_door_c, 10);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 3, NULL);
   COMP(itm_nail, 12, NULL);

 CONSTRUCT(_("Board Up Door"), 0, &construct::able_door, &construct::done_nothing);
  STAGE(t_door_boarded, 8);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 4, NULL);
   COMP(itm_nail, 8, NULL);

 CONSTRUCT(_("Board Up Window"), 0, &construct::able_window,
                                 &construct::done_nothing);
  STAGE(t_window_boarded, 5);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 4, NULL);
   COMP(itm_nail, 8, NULL);

 CONSTRUCT(_("Build Wall"), 2, &construct::able_empty, &construct::done_nothing);
  STAGE(t_wall_half, 10);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 10, NULL);
   COMP(itm_nail, 20, NULL);
  STAGE(t_wall_wood, 10);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 10, NULL);
   COMP(itm_nail, 20, NULL);

 CONSTRUCT(_("Build Window"), 3, &construct::able_wall_wood,
                              &construct::done_nothing);
  STAGE(t_window_empty, 10);
   TOOL(itm_saw, NULL);
  STAGE(t_window, 5);
   COMP(itm_glass_sheet, 1, NULL);

 CONSTRUCT(_("Build Door"), 4, &construct::able_wall_wood,
                              &construct::done_nothing);
  STAGE(t_door_frame, 15);
   TOOL(itm_saw, NULL);
  STAGE(t_door_b, 15);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 4, NULL);
   COMP(itm_nail, 12, NULL);
  STAGE(t_door_c, 15);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 4, NULL);
   COMP(itm_nail, 12, NULL);

/*  Removed until we have some way of auto-aligning fences!
 CONSTRUCT("Build Fence", 1, 15, &construct::able_empty);
  STAGE(t_fence_h, 10);
   TOOL(itm_hammer, itm_hatchet, NULL);
   COMP(itm_2x4, 5, itm_nail, 8, NULL);
*/

 CONSTRUCT(_("Build Roof"), 4, &construct::able_between_walls,
                            &construct::done_nothing);
  STAGE(t_floor, 40);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 8, NULL);
   COMP(itm_nail, 40, NULL);

}
Esempio n. 3
0
void game::init_construction()
{
 int id = -1;
 int tl, cl, sl;

 #define CONSTRUCT(name, difficulty, able, done) \
  sl = -1; id++; \
  constructions.push_back( new constructable(id, name, difficulty, able, done))

 #define STAGE(...)\
  tl = -1; cl = -1; sl++; \
  constructions[id]->stages.push_back(construction_stage(__VA_ARGS__));
 #define TOOL(item)  ++tl; constructions[id]->stages[sl].tools[tl].push_back(component(item, -1))
 #define TOOLCONT(item) constructions[id]->stages[sl].tools[tl].push_back(component(item, -1))
 #define COMP(item, amount)  ++cl; constructions[id]->stages[sl].components[cl].push_back(component(item,amount))
 #define COMPCONT(item, amount) constructions[id]->stages[sl].components[cl].push_back(component(item,amount))


/* CONSTRUCT( name, time, able, done )
 * Name is the name as it appears in the menu; 30 characters or less, please.
 * time is the time in MINUTES that it takes to finish this construction.
 *  note that 10 turns = 1 minute.
 * able is a function which returns true if you can build it on a given tile
 *  See construction.h for options, and this file for definitions.
 * done is a function which runs each time the construction finishes.
 *  This is useful, for instance, for removing the trap from a pit, or placing
 *  items after a deconstruction.
 */

 CONSTRUCT("Dig Pit", 0, &construct::able_dig, &construct::done_nothing);
  STAGE(t_pit_shallow, 10);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");
   TOOLCONT("digging_stick");
  STAGE(t_pit, 10);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");

 CONSTRUCT("Spike Pit", 0, &construct::able_pit, &construct::done_nothing);
  STAGE(t_pit_spiked, 5);
   COMP("spear_wood", 4);
   COMPCONT("pointy_stick", 4);

 CONSTRUCT("Fill Pit", 0, &construct::able_pit, &construct::done_nothing);
  STAGE(t_pit_shallow, 5);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");
  STAGE(t_dirt, 5);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");

 CONSTRUCT("Chop Down Tree", 0, &construct::able_tree, &construct::done_tree);
  STAGE(t_dirt, 10);
   TOOL("ax");
   TOOLCONT("primitive_axe");
   TOOLCONT("chainsaw_on");

 CONSTRUCT("Chop Up Log", 0, &construct::able_log, &construct::done_log);
  STAGE(t_dirt, 20);
   TOOL("ax");
   TOOLCONT("primitive_axe");
   TOOLCONT("chainsaw_on");

 CONSTRUCT("Move Furniture", -1, &construct::able_furniture, &construct::done_furniture);
  STAGE(t_null, 1);

 CONSTRUCT("Clean Broken Window", 0, &construct::able_broken_window,
                                     &construct::done_nothing);
  STAGE(t_window_empty, 5);

/* CONSTRUCT("Remove Window Pane",  1, &construct::able_window_pane,
                                     &construct::done_window_pane);
  STAGE(t_window_empty, 10);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("rock");
   TOOLCONT("hatchet");
   TOOL("screwdriver");
   TOOLCONT("knife_butter");
   TOOLCONT("toolset");
*/

 CONSTRUCT("Repair Door", 1, &construct::able_door_broken,
                             &construct::done_nothing);
  STAGE(t_door_c, 10);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 3);
   COMP("nail", 12);

 CONSTRUCT("Board Up Door", 0, &construct::able_door, &construct::done_nothing);
  STAGE(t_door_boarded, 8);
   TOOL("hammer");
   TOOLCONT("hammer_sledge");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 4);
   COMP("nail", 8);

 CONSTRUCT("Board Up Window", 0, &construct::able_window,
                                 &construct::done_nothing);
  STAGE(t_window_boarded, 5);
   TOOL("hammer");
   TOOLCONT("hammer_sledge");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 4);
   COMP("nail", 8);

 CONSTRUCT("Build Wall", 2, &construct::able_empty, &construct::done_nothing);
  STAGE(t_wall_half, 10);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 10);
   COMP("nail", 20);
  STAGE(t_wall_wood, 10);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 10);
   COMP("nail", 20);

 CONSTRUCT("Build Log Wall", 2, &construct::able_pit, &construct::done_nothing);
  STAGE(t_wall_log_half, 20);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");
   COMP("log", 2);
   COMP("stick", 3);
   COMPCONT("2x4", 6);
  STAGE(t_wall_log, 20);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");
   COMP("log", 2);
   COMP("stick", 3);
   COMPCONT("2x4", 6);

 CONSTRUCT("Build Palisade Wall", 2, &construct::able_pit, &construct::done_nothing);
  STAGE(t_palisade, 20);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");
   COMP("log", 3);
   COMP("rope_6", 2);

 CONSTRUCT("Build Rope & Pulley System", 2, &construct::able_empty, &construct::done_nothing);
  STAGE(t_palisade_pulley, 0);
   COMP("rope_30", 1);
   COMP("stick", 8);
   COMPCONT("2x4", 8);

 CONSTRUCT("Build Palisade Gate", 2, &construct::able_pit, &construct::done_nothing);
  STAGE(t_palisade_gate, 20);
   TOOL("shovel");
   TOOLCONT("primitive_shovel");
   COMP("log", 2);
   COMP("2x4", 3);
   COMP("rope_6", 2);

 CONSTRUCT("Build Window", 2, &construct::able_make_window,
                              &construct::done_nothing);
  STAGE(t_window_empty, 10);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 15);
   COMPCONT("log", 2);
   COMP("nail", 30);
  STAGE(t_window, 5);
   COMP("glass_sheet", 1);
  STAGE(t_window_domestic, 5);
   TOOL("saw");
   COMP("nail", 4);
   COMP("sheet", 2);
   COMP("stick", 1);
   COMP("string_36", 1);

 CONSTRUCT("Build Door", 2, &construct::able_empty,
                              &construct::done_nothing);
  STAGE(t_door_frame, 15);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 12);
   COMP("nail", 24);
  STAGE(t_door_c, 15);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 4);
   COMP("nail", 12);

 CONSTRUCT("Build Wire Fence",3, &construct::able_dig,
                                 &construct::done_nothing);
  STAGE(t_chainfence_posts, 20);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("rock");
   COMP("pipe", 6);
   COMP("scrap", 8);
  STAGE(t_chainfence_v, 20);
   COMP("wire", 20);

 CONSTRUCT("Realign Fence",   0, &construct::able_chainlink,
                                 &construct::done_nothing);
  STAGE(t_chainfence_h, 0);
  STAGE(t_chainfence_v, 0);

 CONSTRUCT("Build Wire Gate", 3, &construct::able_between_walls,
                                 &construct::done_nothing);
  STAGE(t_chaingate_c, 15);
   COMP("wire", 20);
   COMP("steel_chunk", 3);
   COMPCONT("scrap", 12);
   COMP("pipe", 6);

/*  Removed until we have some way of auto-aligning fences!
 CONSTRUCT("Build Fence", 1, 15, &construct::able_empty);
  STAGE(t_fence_h, 10);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   COMP("2x4", 5);
   COMPCONT("nail", 8);
   */

 CONSTRUCT("Build Roof", 3, &construct::able_between_walls,
                            &construct::done_nothing);
  STAGE(t_floor, 40);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 8);
   COMP("nail", 40);

 CONSTRUCT("Build Log & Sod Roof", 3, &construct::able_between_walls,
                            &construct::done_nothing);
  STAGE(t_floor, 80);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOL("shovel");
   TOOLCONT("primitive_shovel");
   COMP("log", 2);
   COMP("stick", 4);
   COMPCONT("2x4", 8);


// Base stuff
 CONSTRUCT("Build Bulletin Board", 0, &construct::able_empty,
 		                                   &construct::done_nothing);
  STAGE(t_bulletin, 10)
   TOOL("saw");
   TOOL("hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("2x4", 4);
   COMP("nail", 8);

// Household stuff
 CONSTRUCT("Build Dresser", 1, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_dresser, 20);
   TOOL("saw");
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("nail", 8);
   COMP("2x4", 6);

 CONSTRUCT("Build Bookcase", 1, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_bookcase, 20);
   TOOL("saw");
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("nail", 16);
   COMP("2x4", 12);

 CONSTRUCT("Build Locker", 1, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_locker, 20);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOL("wrench");
   COMP("sheet_metal", 2);
   COMP("pipe", 8);

 CONSTRUCT("Build Metal Rack", 1, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_rack, 20);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOL("wrench");
   COMP("pipe", 12);

 CONSTRUCT("Build Counter", 0, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_counter, 20);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("nail", 8);
   COMP("2x4", 6);

 CONSTRUCT("Build Makeshift Bed", 0, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_makeshift_bed, 20);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   COMP("nail", 8);
   COMP("2x4", 10);
   COMP("blanket", 1);

 CONSTRUCT("Tape up window", 0, &construct::able_window_pane,
                                &construct::done_tape);
  STAGE(t_null, 2);
  COMP("duct_tape", 50);

 CONSTRUCT("Deconstruct Furniture", 0, &construct::able_deconstruct,
                                &construct::done_deconstruct);
  STAGE(t_null, 20);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("hatchet");
   TOOLCONT("nailgun");
   TOOL("screwdriver");
   TOOLCONT("toolset");

 CONSTRUCT("Start vehicle construction", 0, &construct::able_empty, &construct::done_vehicle);
  STAGE(t_null, 10);
   COMP("frame", 1);

 CONSTRUCT("Fence Posts", 0, &construct::able_dig,
                             &construct::done_nothing);
  STAGE(t_fence_post, 5);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("shovel");
   TOOLCONT("primitive_shovel");
   TOOLCONT("rock");
   TOOLCONT("hatchet");
   TOOLCONT("ax");
   TOOLCONT("primitive_axe");
   COMP("pointy_stick", 2);
   COMPCONT("spear_wood", 2);

 CONSTRUCT("Build Wood Stove", 0, &construct::able_empty,
 		                                   &construct::done_nothing);
  STAGE(t_woodstove, 10);
   TOOL("hacksaw");
   COMP("metal_tank", 1);
   COMP("pipe", 1);

 CONSTRUCT("Build Stone Fireplace", 0, &construct::able_empty,
 		                                   &construct::done_nothing);
  STAGE(t_fireplace, 40);
   TOOL("hammer");
   TOOLCONT("primitive_hammer");
   TOOLCONT("shovel");
   TOOLCONT("primitive_shovel");
   COMP("rock", 40);
}
Esempio n. 4
0
void game::init_construction()
{
 int id = -1;
 int tl, cl, sl;

 #define CONSTRUCT(name, difficulty, able, done) \
  sl = -1; id++; \
  constructions.push_back( new constructable(id, name, difficulty, able, done))

 #define STAGE(...)\
  tl = 0; cl = 0; sl++; \
  constructions[id]->stages.push_back(construction_stage(__VA_ARGS__));
 #define TOOL(...)   setvector(constructions[id]->stages[sl].tools[tl], \
                               __VA_ARGS__); tl++
 #define COMP(...)   setvector(constructions[id]->stages[sl].components[cl], \
                               __VA_ARGS__); cl++

/* CONSTRUCT( name, time, able, done )
 * Name is the name as it appears in the menu; 30 characters or less, please.
 * time is the time in MINUTES that it takes to finish this construction.
 *  note that 10 turns = 1 minute.
 * able is a function which returns true if you can build it on a given tile
 *  See construction.h for options, and this file for definitions.
 * done is a function which runs each time the construction finishes.
 *  This is useful, for instance, for removing the trap from a pit, or placing
 *  items after a deconstruction.
 */

 CONSTRUCT("Dig Pit", 0, &construct::able_dig, &construct::done_nothing);
  STAGE(t_pit_shallow, 10);
   TOOL(itm_shovel, NULL);
  STAGE(t_pit, 10);
   TOOL(itm_shovel, NULL);

 CONSTRUCT("Spike Pit", 0, &construct::able_pit, &construct::done_nothing);
  STAGE(t_pit_spiked, 5);
   COMP(itm_spear_wood, 4, NULL);

 CONSTRUCT("Fill Pit", 0, &construct::able_pit, &construct::done_nothing);
  STAGE(t_pit_shallow, 5);
   TOOL(itm_shovel, NULL);
  STAGE(t_dirt, 5);
   TOOL(itm_shovel, NULL);

 CONSTRUCT("Chop Down Tree", 0, &construct::able_tree, &construct::done_tree);
  STAGE(t_dirt, 10);
   TOOL(itm_ax, itm_chainsaw_on, NULL);

 CONSTRUCT("Chop Up Log", 0, &construct::able_log, &construct::done_log);
  STAGE(t_dirt, 20);
   TOOL(itm_ax, itm_chainsaw_on, NULL);

 CONSTRUCT("Move Furniture", -1, &construct::able_furniture, &construct::done_furniture);
  STAGE(t_null, 1);

 CONSTRUCT("Clean Broken Window", 0, &construct::able_broken_window,
                                     &construct::done_nothing);
  STAGE(t_window_empty, 5);

/* CONSTRUCT("Remove Window Pane",  1, &construct::able_window_pane,
                                     &construct::done_window_pane);
  STAGE(t_window_empty, 10);
   TOOL(itm_hammer, itm_rock, itm_hatchet, NULL);
   TOOL(itm_screwdriver, itm_knife_butter, itm_toolset, NULL);
*/

 CONSTRUCT("Repair Door", 1, &construct::able_door_broken,
                             &construct::done_nothing);
  STAGE(t_door_c, 10);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 3, NULL);
   COMP(itm_nail, 12, NULL);

 CONSTRUCT("Board Up Door", 0, &construct::able_door, &construct::done_nothing);
  STAGE(t_door_boarded, 8);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 4, NULL);
   COMP(itm_nail, 8, NULL);

 CONSTRUCT("Board Up Window", 0, &construct::able_window,
                                 &construct::done_nothing);
  STAGE(t_window_boarded, 5);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 4, NULL);
   COMP(itm_nail, 8, NULL);

 CONSTRUCT("Build Wall", 2, &construct::able_empty, &construct::done_nothing);
  STAGE(t_wall_half, 10);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 10, NULL);
   COMP(itm_nail, 20, NULL);
  STAGE(t_wall_wood, 10);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 10, NULL);
   COMP(itm_nail, 20, NULL);

 CONSTRUCT("Build Log Wall", 2, &construct::able_pit, &construct::done_nothing);
  STAGE(t_wall_log_half, 20);
   TOOL(itm_shovel, NULL);
   COMP(itm_log, 2, NULL);
   COMP(itm_stick, 3, NULL);
  STAGE(t_wall_log, 20);
   TOOL(itm_shovel, NULL);
   COMP(itm_log, 2, NULL);
   COMP(itm_stick, 3, NULL);

 CONSTRUCT("Build Palisade Wall", 2, &construct::able_pit, &construct::done_nothing);
  STAGE(t_palisade, 20);
   TOOL(itm_shovel, NULL);
   COMP(itm_log, 3, NULL);
   COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);

 CONSTRUCT("Build Palisade Gate", 2, &construct::able_pit, &construct::done_nothing);
  STAGE(t_palisade_gate, 20);
   TOOL(itm_shovel, NULL);
   COMP(itm_log, 2, NULL);
   COMP(itm_2x4, 3, NULL);
   COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);

 CONSTRUCT("Build Window", 2, &construct::able_empty,
                              &construct::done_nothing);
  STAGE(t_window_empty, 10);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 15, itm_log, 2, NULL);
   COMP(itm_nail, 30, NULL);
  STAGE(t_window, 5);
   COMP(itm_glass_sheet, 1, NULL);
  STAGE(t_window_domestic, 5);
   TOOL(itm_saw, NULL);
   COMP(itm_nail, 4, NULL);
   COMP(itm_sheet, 2, NULL);
   COMP(itm_stick, 1, NULL);


 CONSTRUCT("Build Door", 2, &construct::able_empty,
                              &construct::done_nothing);
  STAGE(t_door_frame, 15);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 12, NULL);
   COMP(itm_nail, 24, NULL);
  STAGE(t_door_c, 15);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 4, NULL);
   COMP(itm_nail, 12, NULL);

 CONSTRUCT("Build Wire Fence",3, &construct::able_dig,
                                 &construct::done_nothing);
  STAGE(t_chainfence_posts, 20);
   TOOL(itm_hammer, itm_hatchet, itm_rock, NULL);
   COMP(itm_pipe, 6, NULL);
   COMP(itm_scrap, 8, NULL);
  STAGE(t_chainfence_v, 20);
   COMP(itm_wire, 15, NULL);

 CONSTRUCT("Realign Fence",   0, &construct::able_chainlink,
                                 &construct::done_nothing);
  STAGE(t_chainfence_h, 0);
  STAGE(t_chainfence_v, 0);

 CONSTRUCT("Build Wire Gate", 3, &construct::able_between_walls,
                                 &construct::done_nothing);
  STAGE(t_chaingate_c, 15);
   COMP(itm_wire, 20, NULL);
   COMP(itm_steel_chunk, 3, itm_scrap, 12, NULL);
   COMP(itm_pipe, 6, NULL);

/*  Removed until we have some way of auto-aligning fences!
 CONSTRUCT("Build Fence", 1, 15, &construct::able_empty);
  STAGE(t_fence_h, 10);
   TOOL(itm_hammer, itm_hatchet, NULL);
   COMP(itm_2x4, 5, itm_nail, 8, NULL);
*/

 CONSTRUCT("Build Roof", 3, &construct::able_between_walls,
                            &construct::done_nothing);
  STAGE(t_floor, 40);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_2x4, 8, NULL);
   COMP(itm_nail, 40, NULL);

// Household stuff
 CONSTRUCT("Build Dresser", 1, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_dresser, 20);
   TOOL(itm_saw, NULL);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_nail, 8, NULL);
   COMP(itm_2x4, 6, NULL);

 CONSTRUCT("Build Bookcase", 1, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_bookcase, 20);
   TOOL(itm_saw, NULL);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_nail, 16, NULL);
   COMP(itm_2x4, 12, NULL);

 CONSTRUCT("Build Counter", 0, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_counter, 20);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_nail, 8, NULL);
   COMP(itm_2x4, 6, NULL);

 CONSTRUCT("Build Makeshift Bed", 0, &construct::able_indoors,
                                &construct::done_nothing);
  STAGE(t_makeshift_bed, 20);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   COMP(itm_nail, 8, NULL);
   COMP(itm_2x4, 10, NULL);
   COMP(itm_sheet, 1, NULL);

 CONSTRUCT("Tape up window", 0, &construct::able_window,
                                &construct::done_tape);
  STAGE(t_null, 2);
  COMP(itm_duct_tape, 50, NULL);

 CONSTRUCT("Deconstruct Furniture", 0, &construct::able_deconstruct,
                                &construct::done_deconstruct);
  STAGE(t_null, 20);
   TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
   TOOL(itm_screwdriver, itm_toolset, NULL);

 CONSTRUCT("Start vehicle construction", 0, &construct::able_empty, &construct::done_vehicle);
  STAGE(t_null, 10);
   COMP(itm_frame, 1, NULL);

 CONSTRUCT("Fence Posts", 0, &construct::able_dig,
                             &construct::done_nothing);
  STAGE(t_fence_post, 5);
  TOOL(itm_hammer, itm_shovel, itm_rock, itm_hatchet, itm_ax, NULL);
  COMP(itm_spear_wood, 2, NULL);

}
Esempio n. 5
0
    void Init_sse41() {
        box_blur_xx          = sse41::box_blur_xx;
        box_blur_xy          = sse41::box_blur_xy;
        box_blur_yx          = sse41::box_blur_yx;
        srcover_srgb_srgb    = sse41::srcover_srgb_srgb;
        blit_row_s32a_opaque = sse41::blit_row_s32a_opaque;

    #define STAGE(stage, kCallNext) \
        stages_4  [SkRasterPipeline::stage] = stage_4  <SK_OPTS_NS::stage, kCallNext>; \
        stages_1_3[SkRasterPipeline::stage] = stage_1_3<SK_OPTS_NS::stage, kCallNext>

        STAGE(store_565 , false);
        STAGE(store_srgb, false);
        STAGE(store_f16 , false);

        STAGE(load_s_565 , true);
        STAGE(load_s_srgb, true);
        STAGE(load_s_f16 , true);

        STAGE(load_d_565 , true);
        STAGE(load_d_srgb, true);
        STAGE(load_d_f16 , true);

        STAGE(scale_u8, true);

        STAGE(lerp_u8            , true);
        STAGE(lerp_565           , true);
        STAGE(lerp_constant_float, true);

        STAGE(constant_color, true);

    #undef STAGE

    #define STAGE(stage) \
        stages_4  [SkRasterPipeline::stage] = SK_OPTS_NS::stage; \
        stages_1_3[SkRasterPipeline::stage] = SK_OPTS_NS::stage

        STAGE(dst);
        STAGE(dstatop);
        STAGE(dstin);
        STAGE(dstout);
        STAGE(dstover);
        STAGE(srcatop);
        STAGE(srcin);
        STAGE(srcout);
        STAGE(srcover);
        STAGE(clear);
        STAGE(modulate);
        STAGE(multiply);
        STAGE(plus_);
        STAGE(screen);
        STAGE(xor_);
        STAGE(colorburn);
        STAGE(colordodge);
        STAGE(darken);
        STAGE(difference);
        STAGE(exclusion);
        STAGE(hardlight);
        STAGE(lighten);
        STAGE(overlay);
        STAGE(softlight);
    #undef STAGE

    }