1. Neil.e clear_screen() fix

Fiestaclear_screen() would fail for text modes.  This fixes it

procedure oldclear_screen()
  clear_screen()
end procedure

global procedure clear_screen()
--> Clears the screen to the color set by bg_color and moves cursor to (0,0)
  if mode_type then
    text_x = 0
    text_y = 0
    display_image({0,0}, repeat(repeat(back_color, SCREEN_W), SCREEN_H))
  else
    oldclear_screen()
  end if
end procedure


        Lucius L. Hilley III
.     __         __  __     ______     ______     __  __    _____
.    /\ \       /\ \/\ \   /\     \   /\     \   /\ \/\ \  /\    \
.   /  \_\     /  \_\ \_\ /  \_____\  \ \_____\ /  \_\ \_\/  \____\
.  /   / /    /   / / / //   / ____/  /\_   __//   / / / /\  /  __ \
. /   / /    /   / / / //   / /    __/   / /  /   / / / /\_\/  /_ \/
./   / /\   /   / /\/ //   / /\   /\ \  / /  /   / /\/ /\ \ \__  \
.\  / /__\  \  / /_/ / \  / /__\  \ \_\/ /_\ \  / /_/ /  \/\_\/  /
. \/_____/   \/_____/   \/_____/   \/______/  \/_____/    \_____/

new topic     » topic index » view message » categorize

2. Re: Neil.e clear_screen() fix

On Wed, 19 Apr 2000 13:57:54 -0400, Lucius L. Hilley III wrote:

>Fiestaclear_screen() would fail for text modes.  This fixes it
>
>procedure oldclear_screen()
>  clear_screen()
>end procedure
>
>global procedure clear_screen()
>--> Clears the screen to the color set by bg_color and moves cursor to
(0,0)
>  if mode_type then
>    text_x = 0
>    text_y = 0
>    display_image({0,0}, repeat(repeat(back_color, SCREEN_W), SCREEN_H))
>  else
>    oldclear_screen()
>  end if
>end procedure

I don't know anything about Neil.e but I see an endless loop here if
 mode_type = 0

-- Brian

new topic     » goto parent     » topic index » view message » categorize

3. Re: Neil.e clear_screen() fix

>Fiestaclear_screen() would fail for text modes.  This fixes it
>
>procedure oldclear_screen()
>  clear_screen()
>end procedure
>
>global procedure clear_screen()
>--> Clears the screen to the color set by bg_color and moves cursor to
(0,0)
>  if mode_type then
>    text_x =3D 0
>    text_y =3D 0
>    display_image({0,0}, repeat(repeat(back_color, SCREEN_W), SCREEN_H))
>  else
>    oldclear_screen()
>  end if
>end procedure

>I don't know anything about Neil.e but I see an endless loop here if
> mode_type =3D 0

>-- Brian

There's no endless loop because oldclear_screen() can't see the user =
defined clear_screen().  So it looks for the internal procedure with that =
name, and does what is expected.  In order for oldclear_screen() to see =
the user's clear_screen(), it would have to be called with call_proc/routin=
e_id.  This kind of method is useful for overriding built-in Euphoria =
functions/procedures.  There's a lot more information about this in the =
documentation, especially relating to compare and sort.

HTH,
Michael J. Sabal

new topic     » goto parent     » topic index » view message » categorize

4. Re: Neil.e clear_screen() fix

On Wed, 19 Apr 2000 14:16:24 -0400, Mike Sabal wrote:

>
>There's no endless loop because oldclear_screen() can't see the user
defined clear_screen().  So it looks for the internal procedure with that
name, and does what is expected.  In order for oldclear_screen() to see the
user's clear_screen(), it would have to be called with
call_proc/routine_id.  This kind of method is useful for overriding built-
in Euphoria functions/procedures.  There's a lot more information about
this in the documentation, especially relating to compare and sort.
>
>HTH,
>Michael J. Sabal

Ahhh! (light bulb turns on), thanks for clearing that up for me.  I guess
I'm too used to working with Windows (& win32lib) where routine_id is
frequently used (and clear_screen is usually never used).

-- Brian

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu