Exemplo n.º 1
0
static void DEH_SoundParseLine(deh_context_t *context, char *line, void *tag)
{
    sfxinfo_t *sfx;
    char *variable_name, *value;
    int ivalue;
    
    if (tag == NULL)
       return;

    sfx = (sfxinfo_t *) tag;

    // Parse the assignment

    if (!DEH_ParseAssignment(line, &variable_name, &value))
    {
        // Failed to parse
        DEH_Warning(context, "Failed to parse assignment");
        return;
    }
    
    // all values are integers

    ivalue = atoi(value);
    
    // Set the field value

    DEH_SetMapping(context, &sound_mapping, sfx, variable_name, ivalue);
}
Exemplo n.º 2
0
static void DEH_WeaponParseLine(deh_context_t *context, char *line, void *tag)
{
    char *variable_name, *value;
    weaponinfo_t *weapon;
    int ivalue;

    if (tag == NULL)
        return;

    weapon = (weaponinfo_t *) tag;

    if (!DEH_ParseAssignment(line, &variable_name, &value))
    {
        // Failed to parse

        DEH_Warning(context, "Failed to parse assignment");
        return;
    }

    ivalue = atoi(value);

    // If this is a frame field, we need to map from Heretic 1.0 frame
    // numbers to Heretic 1.3 frame numbers.

    if (M_StrCaseStr(variable_name, "frame") != NULL)
    {
        ivalue = DEH_MapHereticFrameNumber(ivalue);
    }

    DEH_SetMapping(context, &weapon_mapping, weapon, variable_name, ivalue);
}
Exemplo n.º 3
0
static void DEH_ThingParseLine(deh_context_t *context, char *line, void *tag)
{
    mobjinfo_t *mobj;
    char *variable_name, *value;
    int ivalue;
    
    if (tag == NULL)
       return;

    mobj = (mobjinfo_t *) tag;

    // Parse the assignment

    if (!DEH_ParseAssignment(line, &variable_name, &value))
    {
        // Failed to parse

        DEH_Warning(context, "Failed to parse assignment");
        return;
    }
    
//    printf("Set %s to %s for mobj\n", variable_name, value);

    // all values are integers

    ivalue = atoi(value);
    
    // Set the field value

    DEH_SetMapping(context, &thing_mapping, mobj, variable_name, ivalue);
}
Exemplo n.º 4
0
static void DEH_FrameParseLine(deh_context_t *context, char *line, void *tag)
{
    state_t *state;
    char *variable_name, *value;
    int ivalue;

    if (tag == NULL)
       return;

    state = (state_t *) tag;

    // Parse the assignment

    if (!DEH_ParseAssignment(line, &variable_name, &value))
    {
        // Failed to parse

        DEH_Warning(context, "Failed to parse assignment");
        return;
    }

    // all values are integers

    ivalue = atoi(value);

    // Action pointer field is a special case:

    if (!strcasecmp(variable_name, "Action pointer"))
    {
        void *func;

        if (!GetActionPointerForOffset(ivalue, &func))
        {
            SuggestOtherVersions(ivalue);
            DEH_Error(context, "Unknown action pointer: %i", ivalue);
            return;
        }

        state->action = func;
    }
    else
    {
        // "Next frame" numbers need to undergo mapping.

        if (!strcasecmp(variable_name, "Next frame"))
        {
            ivalue = DEH_MapHereticFrameNumber(ivalue);
        }

        DEH_SetMapping(context, &state_mapping, state, variable_name, ivalue);
    }
}
Exemplo n.º 5
0
static void DEH_ThingParseLine(deh_context_t *context, char *line, void *tag)
{
    mobjinfo_t *mobj;
    char *variable_name, *value;
    int ivalue;

    if (tag == NULL)
       return;

    mobj = (mobjinfo_t *) tag;

    // Parse the assignment

    if (!DEH_ParseAssignment(line, &variable_name, &value))
    {
        // Failed to parse

        DEH_Warning(context, "Failed to parse assignment");
        return;
    }

    // all values are integers

    ivalue = atoi(value);

    // If the value to be set is a frame, the frame number must
    // undergo transformation from a Heretic 1.0 index to a
    // Heretic 1.3 index.

    if (M_StrCaseStr(variable_name, "frame") != NULL)
    {
        ivalue = DEH_MapHereticFrameNumber(ivalue);
    }

    // Set the field value

    DEH_SetMapping(context, &thing_mapping, mobj, variable_name, ivalue);
}
Exemplo n.º 6
0
static void DEH_WeaponParseLine(deh_context_t *context, char *line, void *tag)
{
	char *variable_name, *value;
	weaponinfo_t *weapon;
	int ivalue;
	
	if (tag == NULL)
		return;

	weapon = (weaponinfo_t *) tag;

	if (!DEH_ParseAssignment(line, &variable_name, &value))
	{
		// Failed to parse

		DEH_Warning(context, "Failed to parse assignment");
		return;
	}

	ivalue = atoi(value);

	DEH_SetMapping(context, &weapon_mapping, weapon, variable_name, ivalue);
}
Exemplo n.º 7
0
static void DEH_FrameParseLine(deh_context_t *context, char *line, void *tag)
{
    state_t *state;
    char *variable_name, *value;
    int ivalue;
    
    if (tag == NULL)
       return;

    state = (state_t *) tag;

    // Parse the assignment

    if (!DEH_ParseAssignment(line, &variable_name, &value))
    {
        // Failed to parse

        DEH_Warning(context, "Failed to parse assignment");
        return;
    }
    
    // all values are integers

    ivalue = atoi(value);
    
    if (state == &states[NUMSTATES - 1])
    {
        DEH_FrameOverflow(context, variable_name, ivalue);
    }
    else
    {
        // set the appropriate field

        DEH_SetMapping(context, &state_mapping, state, variable_name, ivalue);
    }
}