他人の空似自作物置場

ilda_dll.zip/ilda_test.cpp

#include "ilda.h"
#include <stdio.h>
#include "DxLib.h"

ILDA_HANDLE handle;

int Draw(unsigned int frame_number) {
	struct ILDAPoint *start_ptr;
	unsigned int *point_num;
	unsigned int point_num_size;
	ILDA_ERROR_ID error = GetPointData(handle, frame_number, 1, &start_ptr, &point_num, &point_num_size);
	if(error || point_num_size != 1) {
		return 1;
	}
	unsigned int x = 128;
	unsigned int y = 128;
	for(unsigned int j = 0; j < point_num[0]; j++) {
		if(start_ptr->blanking != TRUE) {
			DrawLine(x, y, start_ptr->x, 255-start_ptr->y, GetColor(255, 255, 255));
		}
		x = start_ptr->x;
		y = 255-start_ptr->y;
		start_ptr++;
	}
	return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
	//ウィンドウモード
	ChangeWindowMode(TRUE);
	//画面のちらつき防止
	SetDrawScreen(DX_SCREEN_BACK);
	//ログ出力をしない
	SetOutApplicationLogValidFlag(FALSE);

	DxLib_Init();

	handle = ILDAOpenHandle("badapple.ild");
	if(handle == ILDA_INVALID_HANDLE) {
		return 1;
	}

	unsigned int frame = 0;
	while(ProcessMessage() != -1) {
		ClearDrawScreen();
		if(Draw(frame)) {
			break;
		}
		ScreenFlip();

		frame++;
	}

	ILDACloseHandle(handle);
	DxLib_End();

	return 0;
}