- SP->_use_meta = FALSE;
-#endif
- SP->_endwin = FALSE;
-
- /* Check whether we can optimize scrolling under dumb terminals in case
- * we do not have any of these capabilities, scrolling optimization
- * will be useless.
- */
- SP->_scrolling = ((scroll_forward && scroll_reverse) ||
- ((parm_rindex || parm_insert_line || insert_line) &&
- (parm_index || parm_delete_line || delete_line)));
-
- baudrate(); /* sets a field in the SP structure */
-
- SP->_keytry = 0;
-
- /*
- * Check for mismatched graphic-rendition capabilities. Most SVr4
- * terminfo trees contain entries that have rmul or rmso equated to
- * sgr0 (Solaris curses copes with those entries). We do this only for
- * curses, since many termcap applications assume that smso/rmso and
- * smul/rmul are paired, and will not function properly if we remove
- * rmso or rmul. Curses applications shouldn't be looking at this
- * detail.
- */
+ SP_PARM->_use_meta = FALSE;
+#endif
+ SP_PARM->_endwin = FALSE;
+#ifndef USE_TERM_DRIVER
+ /*
+ * Check whether we can optimize scrolling under dumb terminals in
+ * case we do not have any of these capabilities, scrolling
+ * optimization will be useless.
+ */
+ SP_PARM->_scrolling = ((scroll_forward && scroll_reverse) ||
+ ((parm_rindex ||
+ parm_insert_line ||
+ insert_line) &&
+ (parm_index ||
+ parm_delete_line ||
+ delete_line)));
+#endif
+
+ NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets a field in the screen structure */
+
+ SP_PARM->_keytry = 0;
+
+ /* compute movement costs so we can do better move optimization */
+#ifdef USE_TERM_DRIVER
+ TCBOf(SP_PARM)->drv->td_scinit(SP_PARM);
+#else /* ! USE_TERM_DRIVER */
+ /*
+ * Check for mismatched graphic-rendition capabilities. Most SVr4
+ * terminfo trees contain entries that have rmul or rmso equated to
+ * sgr0 (Solaris curses copes with those entries). We do this only
+ * for curses, since many termcap applications assume that
+ * smso/rmso and smul/rmul are paired, and will not function
+ * properly if we remove rmso or rmul. Curses applications
+ * shouldn't be looking at this detail.
+ */