Eu tentei fazer uma animação e o Visual Studio dá o erro Debug -Abort() Has Been Called
.
Código:
#include <allegro5\allegro.h>
#include <allegro5\allegro_native_dialog.h>
#include <allegro5/allegro_image.h>
const int WIDTH = 1000;
const int HEIGHT = 600;
bool exit = false;
const int maxFrame = 12;
int curFrame = 0;
int frameCount = 0;
int frameDelay = 5;
int main()
{
ALLEGRO_DISPLAY *display = NULL;
ALLEGRO_EVENT_QUEUE *event_queue = NULL;
ALLEGRO_TIMER *timer;
ALLEGRO_BITMAP *image[maxFrame];
if(!al_init())
{
return -1;
}
display = al_create_display(WIDTH, HEIGHT);
if(!display)
{
return -1;
}
al_install_keyboard;
al_init_image_addon;
image[0] = al_load_bitmap("walking w0000.bmp");
image[1] = al_load_bitmap("walking w0001.bmp");
image[2] = al_load_bitmap("walking w0002.bmp");
image[3] = al_load_bitmap("walking w0003.bmp");
image[4] = al_load_bitmap("walking w0004.bmp");
image[5] = al_load_bitmap("walking w0005.bmp");
image[6] = al_load_bitmap("walking w0006.bmp");
image[7] = al_load_bitmap("walking w0007.bmp");
image[8] = al_load_bitmap("walking w0008.bmp");
image[9] = al_load_bitmap("walking w0009.bmp");
image[10] = al_load_bitmap("walking w0010.bmp");
image[11] = al_load_bitmap("walking w0011.bmp");
for(int i = 0; i < maxFrame; i++)
{
al_convert_mask_to_alpha(image[i], al_map_rgb(106, 76, 48));
}
event_queue = al_create_event_queue();
timer = al_create_timer(1.0 / 60);
al_register_event_source(event_queue, al_get_timer_event_source(timer));
al_register_event_source(event_queue, al_get_keyboard_event_source());
al_start_timer(timer);
while(!exit)
{
ALLEGRO_EVENT ev;
al_wait_for_event(event_queue, &ev);
if(ev.type == ALLEGRO_EVENT_KEY_DOWN)
{
switch(ev.keyboard.keycode)
{
case ALLEGRO_KEY_ESCAPE:
exit = true;
break;
case ALLEGRO_KEY_LEFT:
break;
case ALLEGRO_KEY_RIGHT:
break;
case ALLEGRO_KEY_UP:
break;
case ALLEGRO_KEY_DOWN:
break;
}
}
else if(ev.type == ALLEGRO_EVENT_TIMER)
{
if(++frameCount >= frameDelay)
{
if(++curFrame >= maxFrame)
{
curFrame = 0;
}
frameCount = 0;
}
}
al_draw_bitmap(image[curFrame], 200, 100, 0);
al_flip_display();
al_clear_to_color(al_map_rgb(0, 0, 0));
}
for(int i = 0; i < maxFrame; i++)
{
al_destroy_bitmap(image[i]);
}
al_destroy_event_queue(event_queue);
al_destroy_display(display);
return 0;
}
Erro completo:
'Sobrevivencia.exe': Loaded 'C:\Users\Lucas-PC\Desktop\Arquivos\Sobrevivencia\Debug\Sobrevivencia.exe', Symbols loaded.
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\allegro-5.0.10-monolith-md-debug.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.17415_none_dad8722c5bcc2d8f\GdiPlus.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\comdlg32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\combase.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\winmmbase.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9600.17810_none_7c5b6194aa0716f1\comctl32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\SHCore.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\d3d9.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\aticfx32.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\atiu9pag.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Unloaded 'C:\Windows\SysWOW64\atiu9pag.dll'
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\atiu9pag.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\atiumdag.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\atiumdva.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Program Files (x86)\Internet Download Manager\idmmkb.dll', Cannot find or open the PDB file
'Sobrevivencia.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
Sobrevivencia.exe has triggered a breakpoint
The thread 'Win32 Thread' (0x14c0) has exited with code 3 (0x3).
The thread 'Win32 Thread' (0xcfc) has exited with code 3 (0x3).
The thread 'Win32 Thread' (0x17e0) has exited with code 3 (0x3).
The thread 'Win32 Thread' (0x140c) has exited with code 3 (0x3).
The thread 'Win32 Thread' (0x804) has exited with code 3 (0x3).
The program '[4472] Sobrevivencia.exe: Native' has exited with code 3 (0x3).
Cannot find or open the PDB file
provavelmente não são importantes. A parte que importa acho que é a partir doSobrevivencia.exe has triggered a breakpoint
.