X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2Finit.c;h=b3a1acb802bfb6bc60057ebb25c70b1908976cfa;hb=9f688962eb90591205c511c1ae9bf752d276d1f5;hp=5a234b3c8150953f63b859d1aa1f174707e8d3f5;hpb=fe656a41b406b06d9dc5b93d01191d52b1da3b4d;p=rocksndiamonds.git diff --git a/src/game_sp/init.c b/src/game_sp/init.c index 5a234b3c..b3a1acb8 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -7,36 +7,71 @@ Bitmap *sp_objects; Bitmap *screenBitmap; +static void init_struct_functions() +{ + Stage.Blt = &DDScrollBuffer_Blt; + Stage.ScrollTo = &DDScrollBuffer_ScrollTo; + Stage.ScrollTowards = &DDScrollBuffer_ScrollTowards; + Stage.SoftScrollTo = &DDScrollBuffer_SoftScrollTo; + + StretchedSprites.BltEx = &DDSpriteBuffer_BltEx; +} -static void BlitScreenToBitmap_SP__Stage_Blt() +static void init_global_values() { - BlitScreenToBitmap_SP(window); + menBorder.Checked = False; + menPanel.Checked = True; + menAutoScroll.Checked = True; + + MainForm.picPane.Width = picPane.Width = SCR_FIELDX * TILEX; + MainForm.picPane.Height = picPane.Height = SCR_FIELDY * TILEY; } void sp_open_all() { -#if 1 - printf("::: sp_open_all ...\n"); -#endif + init_struct_functions(); + init_global_values(); Form_Load(); SetBitmaps_SP(&sp_objects); +#if 0 + /* too small for oversized levels, but too big for graphics performance */ + /* (the whole playfield is drawn/updated, not only visible/scrolled area) */ + /* !!! FIX THIS !!! */ + screenBitmap = CreateBitmap(60 * TILEX, 24 * TILEY, + DEFAULT_DEPTH); +#else screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, DEFAULT_DEPTH); - - StretchedSprites.BltEx = &DDSpriteBuffer_BltEx; +#endif DDSpriteBuffer_CreateFromFile("[NONE]", 16, 16); - - Stage.Blt = &BlitScreenToBitmap_SP__Stage_Blt; - -#if 1 - printf("::: sp_open_all done\n"); -#endif } void sp_close_all() { } + +unsigned int InitEngineRandom_SP(long seed) +{ + if (seed == NEW_RANDOMIZE) + { +#if 0 + printf("::: init.c: InitEngineRandom_SP(): subRandomize()\n"); +#endif + + subRandomize(); + + seed = (long)RandomSeed; + } + + RandomSeed = (short)seed; + +#if 0 + printf("::: init.c: InitEngineRandom_SP(): RandomSeed == %d\n", RandomSeed); +#endif + + return (unsigned int) seed; +}