- 
                Notifications
    
You must be signed in to change notification settings  - Fork 148
 
Battle HP Bar and related code #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer more documentation but I don't think that's feasible as of right now
| u8 script; | ||
| void *unk4; | ||
| void *unk8; | ||
| struct { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using pokeplatinum/retsam to try and match stuff, they did something similar on their end. didn't help the three affected functions tho.
| void ov12_0226498C(BattleHpBar *hpBar, u32 num, u32 flag) { | ||
| GF_ASSERT(hpBar->unk4 != NULL); | ||
| if (hpBar->type == HP_BAR_TYPE_SAFARI) { | ||
| flag &= 0xC00; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer some consts here even if theyre all unown, ie #def HP_BAR_FLAG_4 (1 << 4) type things
        
          
                src/battle/battle_hp_bar.c
              
                Outdated
          
        
      | 
               | 
          ||
| narc = NARC_New(NARC_a_0_0_8, HEAP_ID_BATTLE); | ||
| 
               | 
          ||
| renderer = ov12_0223A8E4(hpBar->bsys); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ov12_0223A8E4 -> BattleSystem_GetSpriteRenderer
        
          
                src/battle/battle_hp_bar.c
              
                Outdated
          
        
      | narc = NARC_New(NARC_a_0_0_8, HEAP_ID_BATTLE); | ||
| 
               | 
          ||
| renderer = ov12_0223A8E4(hpBar->bsys); | ||
| gfxHandler = ov12_0223A8EC(hpBar->bsys); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ov12_0223A8EC -> BattleSystem_GetGfxHandler
        
          
                src/battle/battle_hp_bar.c
              
                Outdated
          
        
      | Sprite_SetPositionXY(hpBar->unk4->sprite, r4->x + x, r4->y + y); | ||
| if (hpBar->unk8 != NULL) { | ||
| Sprite_SetPositionXY(hpBar->unk8->sprite, | ||
| r4->x + x - ov12_0226D368[hpBar->type], | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ov12_0226D368 -> sHpBarXOffsets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or sHpBoxXOffsets, etc, whatever you want
| AddTextPrinterParameterizedWithColorAndSpacing(&window, 0, string, 0, 0, TEXT_SPEED_NOTRANSFER, MAKE_TEXT_COLOR(14, 2, 15), 0, 0, NULL); | ||
| srcBuf = window.pixelBuffer; | ||
| 
               | 
          ||
| { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brackets required to match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc yes
| #ifdef NONMATCHING | ||
| static void ov12_02264F44(BattleHpBar *hpBar, int x, int y) { | ||
| const UnkTemplate_0200D748 *r4; | ||
| const UnkTemplate_0200D748 *tmplate; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmplate -> template
No description provided.