#include "game_types.h"

/* Image_DrawStrip2 @ 0x080138B0 (real 76B) -- strip dispatch with halfword-gated SetMode. Mirrors src/matched/Image_DrawStrip2.c. */
/* Column dispatch like DrawColumn: on tag mismatch SetMode(node, tag);
   on match, SetMode only when the halfword is 0 or the word is negative. */
extern void BG_SetMode(int a, int b);

void Image_DrawStrip2(unsigned x)
{
    int *e = (int *)((char *)(int *)0x081ADBB0 + x * 4);
    unsigned h = *(unsigned short *)((char *)e + 4);
    int *node = *(int **)((char *)(int *)0x081ADB14 + h * 12);
    int tag = node[0];
    if (tag != e[0]) {
        BG_SetMode((int)node, e[0]);
        return;
    }
    {
        int t2 = node[1];
        if ((short)t2 == 0 || t2 < 0)
            BG_SetMode((int)node, tag);
    }
}
