- XFlush(display);
-
- Random = Random * 129 + 1;
-}
-
-
-/* draw main menu background and copyright note */
-
-void title_initscreen(void)
-{
- xdebug("title_initscreen");
-
- screen_x = 0;
- screen_y = 0;
-
- colour_shuffle();
- colours[1] += 8;
- colour_anim = 0;
-
-#if 1
-
- /* draw title screen on menu background */
-
- BlitBitmap(ttlBitmap, screenBitmap, ORIG_MENU_SX, ORIG_MENU_SY,
- SCR_MENUX * TILEX, SCR_MENUY * TILEY, 0, 0);
-
- /* draw copyright note at footer */
-
- if (botmaskBitmap)
- {
- BlitBitmap(botBitmap, scoreBitmap, 0, colours[1] * SCOREY,
- SCR_MENUX * TILEX, SCOREY, 0, 0);
-
- SetClipOrigin(botBitmap, botBitmap->stored_clip_gc,
- 0, 0 - colours[0] * SCOREY);
- }
-
- BlitBitmapMasked(botBitmap, scoreBitmap, 0, colours[0] * SCOREY,
- SCR_MENUX * TILEX, SCOREY, 0, 0);
-
-#else
-
- XCopyArea(display, ttlPixmap, screenPixmap, screenGC,
- 0, 0, SCR_MENUX * TILEX, SCR_MENUY * TILEY, 0, 0);
-
- if (botmaskBitmap)
- {
- XCopyArea(display, botPixmap, scorePixmap, scoreGC,
- 0, colours[1] * SCOREY, SCR_MENUX * TILEX, SCOREY, 0, 0);
- XSetClipMask(display, scoreGC, botmaskBitmap);
- XSetClipOrigin(display, scoreGC, 0, 0 - colours[0] * SCOREY);
- }
-
- XCopyArea(display, botPixmap, scorePixmap, scoreGC,
- 0, colours[0] * SCOREY, SCR_MENUX * TILEX, SCOREY, 0, 0);
-
- if (botmaskBitmap)
- XSetClipMask(display, scoreGC, None);
-
-#endif
-}
-
-
-/* draw bouncing ball on main menu footer */
-
-void title_blitscore(void)
-{
- unsigned int x, y, i;
-
- xdebug("title_blitscore");
-
- if (++colour_anim > 30)
- colour_anim = 0;
-
- i = colour_anim >= 16 ? 31 - colour_anim : colour_anim;
- x = (i / 8 + 18) * 2 * SCOREX;
- y = (i % 8 + 16) * SCOREY;
-
-#if 1
- if (botmaskBitmap)
- {
- BlitBitmap(botBitmap, scoreBitmap,
- 32 * SCOREX, colours[1] * SCOREY, 2 * SCOREX, SCOREY,
- 32 * SCOREX, 0);
-
- SetClipOrigin(botBitmap, botBitmap->stored_clip_gc,
- 32 * SCOREX - x, 0 - y);
- }
-
- BlitBitmapMasked(botBitmap, scoreBitmap,
- x, y, 2 * SCOREX, SCOREY, 32 * SCOREX, 0);
-
-#else
-
- if (botmaskBitmap)
- {
- XCopyArea(display, botPixmap, scorePixmap, scoreGC,
- 32 * SCOREX, colours[1] * SCOREY, 2 * SCOREX, SCOREY,
- 32 * SCOREX, 0);
- XSetClipMask(display, scoreGC, botmaskBitmap);
- XSetClipOrigin(display, scoreGC, 32 * SCOREX - x, 0 - y);
- }
-
- XCopyArea(display, botPixmap, scorePixmap, scoreGC,
- x, y, 2 * SCOREX, SCOREY, 32 * SCOREX, 0);
-
- if (botmaskBitmap)
- XSetClipMask(display, scoreGC, None);
-#endif
-}
-
-void title_blitants(unsigned int y)
-{
- static const char ants_dashes[2] = { 8, 7 };
-
- xdebug("title_blitants");
-
- XSetDashes(display, antsGC, colour_anim, ants_dashes, 2);
- XDrawRectangle(display, screenPixmap, antsGC,
- 0, y * TILEY, SCR_MENUX * TILEX - 1, TILEY - 1);
-}
-
-void title_animscreen(void)
-{
- blitscreen();
- XFlush(display);
-
- Random = Random * 129 + 1;
-}
-
-static int ttl_map[] =
-{
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,0,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,2,3,4,-1, /* !',-. */
- 5,6,7,8,9,10,11,12,13,14,15,-1,-1,-1,-1,16, /* 0123456789:? */
- -1,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, /* ABCDEFGHIJKLMNO */
- 32,33,34,35,36,37,38,39,40,41,42,-1,-1,-1,-1,-1, /* PQRSTUVWXYZ */
- -1,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, /* abcdefghijklmno */
- 32,33,34,35,36,37,38,39,40,41,42,-1,-1,-1,-1,-1 /* pqrstuvwxyz */
-};
-
-void title_string(unsigned int y, unsigned int left, unsigned int right,
- char *string)
-{
- int i;
- unsigned int x;
-
- xdebug("title_string");
-
- y *= TILEY;
- left *= SCOREX;
- right *= SCOREX;
-
- x = (left + right - strlen(string) * MENUFONTX) / 2;
- if (x < left || x >= right)
- x = left;
-
- /* restore background graphic where text will be drawn */
- BlitBitmap(ttlBitmap, screenBitmap, ORIG_MENU_SX + left, ORIG_MENU_SY + y,
- right - left, MENUFONTY, left, y);
-
-#if 1
-#else
- if (ttlmaskBitmap)
- XSetClipMask(display, screenGC, ttlmaskBitmap);
-#endif
-
- for (i = 0; string[i] && x < right; i++)
- {
- int ch_pos, ch_x, ch_y;
-
- ch_pos = ttl_map[string[i] & 127];
-
- if (ch_pos == -1 || ch_pos > 22 * 2)
- continue; /* no graphic for this character */
-
- ch_x = (ch_pos % 22) * GFXMENUFONTX;
- ch_y = (ch_pos / 22 + 12) * TILEY;
-
-#if 1
- SetClipOrigin(ttlBitmap, ttlBitmap->stored_clip_gc,
- x - ORIG_MENU_SX - ch_x, y - ORIG_MENU_SY - ch_y);
-
- BlitBitmapMasked(ttlBitmap, screenBitmap, ch_x, ch_y, MENUFONTX, MENUFONTY,
- x - ORIG_MENU_SX, y - ORIG_MENU_SY);
-#else
- if (ttlmaskBitmap)
- XSetClipOrigin(display, screenGC, x - ch_x, y - ch_y);
-
- XCopyArea(display, ttlPixmap, screenPixmap, screenGC,
- ch_x, ch_y, MENUFONTX, MENUFONTY, x, y);
-#endif
-
- x += MENUFONTX;
- }
-
-#if 1
-#else
- XSetClipMask(display, screenGC, None);
-#endif