int Computer_setup(Computer *computer, int index) { int j, counter = 0, flag; int x, y; int screensize = Game_screensize(); int border = BORDER(screensize); do { if (++counter > 4000) return 0; x = RAND(border, screensize - border - width); y = RAND(border, screensize - border - height); flag = 1; /* check for conflicting computer placement */ for (j = 0; j < index && flag; j++) { Computer *c = Network_get_computer(j); int twidth = width - BILL_OFFSET_X + Bill_width(); if (UI_intersect(x, y, twidth, height, c->x, c->y, twidth, height)) flag = 0; } } while (!flag); computer->x = x; computer->y = y; computer->type = RAND(1, NUM_SYS - 1); computer->os = determineOS(computer); computer->busy = 0; computer->stray = NULL; return 1; }
} shifter_set_palette(dt, dt->frame[0]); update_stuff(UPD_PAL); } } #undef _ #define _(X) X #define WBbase shifter_dd static void *shifter_code[] = { WINDOWm(_("Palette Shifter")), XVBOXB, // !!! Originally the main vbox was that way TABLE(4, 9), BORDER(LABEL, 0), uSPIN(row, 0, 7), EVENT(CHANGE, shifter_moved), EVENT(MULTI, shift_all), TLLABELx(_("Start"), 1, 0, 0, 0, 5), uSPIN(sfd[0], 0, 255), EVENT(CHANGE, shifter_moved), TLLABELx(_("Finish"), 2, 0, 0, 0, 5), uSPIN(sfd[1], 0, 255), EVENT(CHANGE, shifter_moved), TLLABELx(_("Delay"), 3, 0, 0, 0, 5), uSPIN(sfd[2], 0, 255), EVENT(CHANGE, shifter_moved), DEFBORDER(LABEL), TLTEXT("0\n1\n2\n3\n4\n5\n6\n7", 0, 1), REF(spinpack), TLSPINPACKv(spins, 3 * NSHIFT, shifter_moved, 3, 1, 1), TRIGGER, WDONE, HBOX, UTOGGLEv(_("Play"), shift_play_state, shift_btn), UNNAME, BORDER(LABEL, 0),
void init_xsection (void) { int i; /* outline of extrusion */ i=0; BORDER (-0.75, 2.0); BORDER (-0.75, 1.38); BORDER (-0.5, 1.25); BORDER (0.88, 1.12); BORDER (1.0, 0.62); BORDER (1.12, 0.1); BORDER (0.5, -0.5); BORDER (0.2, -1.12); /* corpus */ BORDER (0.3, -1.5); /* brownsville */ BORDER (-0.25, -1.45); BORDER (-1.06, -0.3); BORDER (-1.38, -0.3); BORDER (-1.65, -0.6); BORDER (-2.5, 0.5); /* midland */ BORDER (-1.5, 0.5); BORDER (-1.5, 2.0); /* panhandle */ BORDER (-0.75, 2.0); }
static void *spawn_code[] = { WINDOWm(_("Configure File Actions")), DEFSIZE(500, 400), XVBOXb(0, 5), // !!! Originally the main vbox was that way XSCROLL(1, 1), // auto/auto WLIST, NTXTCOLUMND(_("Action"), spawn_row, name, 200, 0), NTXTCOLUMND(_("Command"), spawn_row, cmd, 0 /* 200 */, 0), COLUMNDATA(strs, sizeof(spawn_row)), CLEANUP(strs), REF(list), LISTCd(nidx, cnt, faction_select_row), TRIGGER, REF(group), GROUP(1), FHBOX(_("Action")), XENTRY(name), EVENT(CHANGE, faction_changed), WDONE, FHBOX(_("Command")), XENTRY(cmd), EVENT(CHANGE, faction_changed), WDONE, PATH(_("Directory"), _("Select Directory"), FS_SELECT_DIR, dir), EVENT(CHANGE, faction_changed), BORDER(OKBOX, 0), OKBOX(_("OK"), faction_btn, _("Cancel"), NULL), OKADD(_("Execute"), faction_btn), WSHOW }; #undef WBbase void pressed_file_configure() { spawn_dd tdata; spawn_row *rp; char txt[64], *s; int i, j; rp = tdata.strs = calloc(FACTION_ROWS_TOTAL, sizeof(spawn_row)); if (!rp) return; // Not enough memory