View Issue Details

IDProjectCategoryView StatusLast Update
0000290GZDoom (All)[All Projects] Featurepublic2017-02-19 10:24
ReporterMajor Cooke 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status resolvedResolutionfixed 
Summary0000290: Change menu coordinate points to doubles
DescriptionSo I have this sine wave to demonstrate a moving menu, and while it works, there's a problem with it. It has a noticeable jaggedness when slowing down and speeding up, thanks to the fact that the x and y coordinates are all ints.

Would it be at all possible to switch the ints to doubles?
Additional Information
Class ListMenuScroller : ListMenu
{
    double sineWave;
    Array<Double> px;
    bool saved;
    
    override void Ticker()
    {	
        if (px.Size() <= 0)
            px.Reserve(mDesc.mItems.Size());
        
        sineWave = (sineWave + (360.0 / 35.0)) % 360.0;
        
        for(int i=0; i < mDesc.mItems.Size(); i++)
        {
            if (!saved)
            {
                px[i] = mDesc.mItems[i].GetX();
            }
            mDesc.mItems[i].SetX(px[i] + sin(sineWave) * 5);
        }
        saved = true;
        Super.Ticker();
    }
}
TagsNo tags attached.

Relationships

Activities

Nash

Nash

2017-02-17 19:37

reporter   ~0000645

Would be nice to have doubles for smoothly animated menus and visual effects.
Major Cooke

Major Cooke

2017-02-17 19:38

reporter   ~0000646

Agreed.
Graf Zahl

Graf Zahl

2017-02-18 04:50

administrator   ~0000648

Should be possible, but I first need to export the entire ListMenu hierachy to ZScript. Otherwise it'd be too much mess.

Still 3 classes to convert first.
Major Cooke

Major Cooke

2017-02-19 09:29

reporter   ~0000656

I'm looking forward to this one. Sine waves will be made all the better for it.

Issue History

Date Modified Username Field Change
2017-02-17 13:10 Major Cooke New Issue
2017-02-17 19:37 Nash Note Added: 0000645
2017-02-17 19:38 Major Cooke Note Added: 0000646
2017-02-18 04:50 Graf Zahl Note Added: 0000648
2017-02-19 09:29 Major Cooke Note Added: 0000656
2017-02-19 10:24 Graf Zahl Status new => resolved
2017-02-19 10:24 Graf Zahl Resolution open => fixed