The Dink Network

Reply to Re: Some problem

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
December 5th 2005, 05:03 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Man o' Magic wasn't saying that sp_editor_num(x) = sp(x)... he was saying (put in a valid, DinkC way):

int &editor_sprite1 = 1;
int &active_sprite = sp(&editor_sprite1);
int &editor_sprite2 = sp_editor_num(&active_sprite);
if (&editor_sprite1 == &editor_sprite2)
{
say("They're always equal (unless it doesn't exist)!", 1);
}

That is:

sp_editor_num converts an active sprite number into an editor sprite number.

sp converts an editor sprite number into an active sprite number.

Therefore, if sp_editor_num uses the output of sp as an input, it will result in the input of sp, assuming the editor sprite and the active sprite exist.

All Dink functions (with the exception of editor_seq, editor_frame, and editor_type) use active sprite numbers.

The only valid use of sp is to look in DinkEdit or WinDinkedit, record the editor sprite number of a sprite, and use it as an input in sp to get the active sprite number. However, because editor sprite numbers are apt to change (at least with WinDinkedit), this isn't recommended.