Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • drubrkletern: be honest with me boss
      December 06, 2019, 01:31:52 AM
    • drubrkletern: now is it really that unique
      December 06, 2019, 01:31:47 AM
    • SuperNativeZ: COME PLAY THE MOST UNIQUE CUSTOM RSPS #1 [link][link][link]
      December 05, 2019, 09:22:55 PM
    • SuperNativeZ: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link][link][link]
      December 05, 2019, 09:22:42 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 60+ online : [link]
      December 05, 2019, 02:48:39 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      December 05, 2019, 02:48:31 PM
    • Cole1497: you click any of these links? those boner pills theyre selling are wicked
      December 04, 2019, 05:58:03 PM
    • Cole1497: oh shit vain whats crackin
      December 04, 2019, 05:57:49 PM
    • ArtexAdv: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link]
      December 04, 2019, 06:30:27 AM
    • Vain_: where the boys at
      December 01, 2019, 03:20:36 PM
    • black evil111: They should close this down, mostly the downloads section. The mods dont know how to do their jobs worth shit and its no excuse like "we have real life stuff going on" everyones replacable. Speaking of replacable, fix download links! Before I go to rune-server.
      December 01, 2019, 01:50:26 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:41:24 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:40:42 PM
    • 1strangler77: how do i post pictures on a post
      November 24, 2019, 05:16:18 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 23, 2019, 08:23:51 PM
    • Freja1793: Hi
      November 22, 2019, 07:58:41 PM
    • xdarklordxx: JOIN NOW [link]
      November 22, 2019, 03:19:16 PM
    • xdarklordxx: RUNITY IS BACK AND BETTER THAN EVER VERY NICE STAFF AND TONS OF CUSTOMS!!
      November 22, 2019, 03:18:36 PM
    • xdarklordxx: >!https://dl.dropbox.com/s/9iwtazv703mpqsw/LmfaoScape.jar<!
      November 22, 2019, 03:17:04 PM
    • Shadow Monarch: where do i get a client and source
      November 19, 2019, 11:17:48 PM

    Author Topic: [194] Refactored AnimationFrame class  (Read 671 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    [194] Refactored AnimationFrame class
    « on: November 03, 2014, 07:34:17 PM »
    Here is the refactored AnimationFrame class (originally class9) from the 194 client. All dummies have been removed.

    Code: Java
    1. publicclass AnimationFrame {
    2.         publicstatic AnimationFrame[] frames;
    3.         publicint endPoint;
    4.         public ModelJoint joint;
    5.         publicint size;
    6.         publicint[] transformSteps;
    7.         publicint[] transformX;
    8.         publicint[] transformY;
    9.         publicint[] transformZ;
    10.  
    11.         publicstaticvoid load(Archive archive){
    12.                 Stream head =new Stream(archive.getFile(null, "frame_head.dat"));
    13.                 Stream tran1 =new Stream(archive.getFile(null, "frame_tran1.dat"));
    14.                 Stream tran2 =new Stream(archive.getFile(null, "frame_tran2.dat"));
    15.                 Stream del =new Stream(archive.getFile(null, "frame_del.dat"));
    16.  
    17.                 int frameCount = head.getUnsignedLEShort();
    18.                 int highestFrameId = head.getUnsignedLEShort();
    19.  
    20.                 frames =new AnimationFrame[highestFrameId +1];
    21.                 int[] transformSteps =newint[500];
    22.                 int[] transformX =newint[500];
    23.                 int[] transformY =newint[500];
    24.                 int[] transformZ =newint[500];
    25.  
    26.                 for(int f =0; f < frameCount; f++){
    27.                         int frameId = head.getUnsignedLEShort();
    28.                         AnimationFrame frame = frames[frameId]=new AnimationFrame();
    29.                         frame.endPoint= del.getUnsignedByte();
    30.  
    31.                         int jointId = head.getUnsignedLEShort();
    32.                         ModelJoint joint = ModelJoint.joints[jointId];
    33.  
    34.                         frame.joint= joint;
    35.                         int transformCount = head.getUnsignedByte();
    36.                         int lastTransform =-1;
    37.                         int transformsComplete =0;
    38.                         for(int t =0; t < transformCount; t++){
    39.                                 int transformationType = tran1.getUnsignedByte();
    40.                                 if(transformationType >0){
    41.                                         if(joint.transformTypes[t]!=0){
    42.                                                 for(int step = t -1; step > lastTransform; step--){
    43.                                                         if(joint.transformTypes[step]==0){
    44.                                                                 transformSteps[transformsComplete]= step;
    45.                                                                 transformX[transformsComplete]=0;
    46.                                                                 transformY[transformsComplete]=0;
    47.                                                                 transformZ[transformsComplete]=0;
    48.                                                                 transformsComplete++;
    49.                                                                 break;
    50.                                                         }
    51.                                                 }
    52.                                         }
    53.                                         transformSteps[transformsComplete]= t;
    54.                                         int defaultTransformation =0;
    55.                                         if(joint.transformTypes[transformSteps[transformsComplete]]==3)
    56.                                                 defaultTransformation =128;
    57.                                        
    58.                                         if((transformationType & 0x1)!=0)
    59.                                                 transformX[transformsComplete]= tran2
    60.                                                                 .getSmartA();
    61.                                         else
    62.                                                 transformX[transformsComplete]= defaultTransformation;
    63.                                         if((transformationType & 0x2)!=0)
    64.                                                 transformY[transformsComplete]= tran2
    65.                                                                 .getSmartA();
    66.                                         else
    67.                                                 transformY[transformsComplete]= defaultTransformation;
    68.                                         if((transformationType & 0x4)!=0)
    69.                                                 transformZ[transformsComplete]= tran2
    70.                                                                 .getSmartA();
    71.                                         else
    72.                                                 transformZ[transformsComplete]= defaultTransformation;
    73.                                        
    74.                                         lastTransform = t;
    75.                                         transformsComplete++;
    76.                                 }
    77.                         }
    78.                         frame.size= transformsComplete;
    79.                         frame.transformSteps=newint[transformsComplete];
    80.                         frame.transformX=newint[transformsComplete];
    81.                         frame.transformY=newint[transformsComplete];
    82.                         frame.transformZ=newint[transformsComplete];
    83.                         for(int t =0; t < transformsComplete; t++){
    84.                                 frame.transformSteps[t]= transformSteps[t];
    85.                                 frame.transformX[t]= transformX[t];
    86.                                 frame.transformY[t]= transformY[t];
    87.                                 frame.transformZ[t]= transformZ[t];
    88.                         }
    89.                 }
    90.         }
    91. }
    « Last Edit: November 03, 2014, 07:53:11 PM by Ambokile »
    Runescape Gambling

    Offlinet4

    • Member
    • ****
    • *
    • *
    • *
    • Posts: 6,798
    • Thanks: +0/-0
      • View Profile
    Re: [194] Refactored AnimationFrame class
    « Reply #1 on: November 06, 2014, 02:40:29 PM »
    you should really just make a repository.

    OfflineVain_

    • Member
    • ****
    • Posts: 3,057
    • Thanks: +0/-0
      • View Profile
    Re: [194] Refactored AnimationFrame class
    « Reply #2 on: November 06, 2014, 04:41:36 PM »
    you should really just make a repository.
    he has one. Pretty sure he just wants to "be better" than pure_

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: [194] Refactored AnimationFrame class
    « Reply #3 on: November 06, 2014, 05:25:25 PM »
    you should really just make a repository.
    he has one. Pretty sure he just wants to "be better" than pure_

    Do I? Where?

    I posted this because I was unsure if I had got it completely right and wanted others to consolidate my thoughts. That's what this section is for.

    OfflineVain_

    • Member
    • ****
    • Posts: 3,057
    • Thanks: +0/-0
      • View Profile
    Re: [194] Refactored AnimationFrame class
    « Reply #4 on: November 06, 2014, 06:03:13 PM »
    Nowhere did you ask for anyone to review your refactoring project. You got into it with pure_ because your client is way better than his blah blah.

    Also there's no need to post a million topics. You can post one with the many different classes. Or just link to your github and allow for people to help you? Seeing as that's apparently what you want..?

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal