Permalink
Browse files

Updated code for allegro 4.9.15.1

  • Loading branch information...
1 parent 8a2de60 commit 0da749c9d4f56109fc69b07cfcd3cfec9bc1160d @trezker committed Nov 6, 2009
View
@@ -8,9 +8,9 @@ env = Environment(CPPPATH = ['include'])
debug = ARGUMENTS.get('debug', 0)
if int(debug):
env.Append(CCFLAGS = '-g')
- env.Append(LIBS=['GL','GLU','glut','allegro-debug-4.9.11','a5_iio-debug-4.9.11','a5_font-debug-4.9.11','a5_ttf-debug-4.9.11','a5_primitives-debug-4.9.11','a5_dialog-debug-4.9.11','zoidcomd'])
+ env.Append(LIBS=['GL','GLU','glut','allegro-debug-4.9.16','a5_iio-debug-4.9.16','a5_font-debug-4.9.16','a5_ttf-debug-4.9.16','a5_primitives-debug-4.9.16','a5_dialog-debug-4.9.16','zoidcomd'])
else:
- env.Append(LIBS=['GL','GLU','glut','allegro-4.9.11','a5_iio-4.9.11','a5_font-4.9.11','a5_ttf-4.9.11','a5_primitives-4.9.11','a5_dialog-4.9.11','zoidcom'])
+ env.Append(LIBS=['GL','GLU','glut','allegro-4.9.16','allegro_image-4.9.16','allegro_font-4.9.16','allegro_ttf-4.9.16','allegro_primitives-4.9.16','allegro_dialog-4.9.16','zoidcom'])
env.Append(CCFLAGS = '-Wall')
@@ -23,6 +23,10 @@ math = env.StaticLibrary('lib/math', math_files)
#md5_files = [x.replace("src", "obj") for x in md5_files]
#md5 = env.StaticLibrary('lib/md5', md5_files)
+particles_files = glob.glob('src/particles/*.cpp')
+particles_files = [x.replace("src", "obj") for x in particles_files]
+particles = env.StaticLibrary('lib/particles', particles_files)
+
scenegraph_files = glob.glob('src/scenegraph/*.cpp')
scenegraph_files = [x.replace("src", "obj") for x in scenegraph_files]
scenegraph = env.StaticLibrary('lib/scenegraph', scenegraph_files)
@@ -31,7 +35,7 @@ interface_files = glob.glob('src/interface/*.cpp')
interface_files = [x.replace("src", "obj") for x in interface_files]
interface = env.StaticLibrary('lib/interface', interface_files)
-env.Append(LIBS = [scenegraph, interface, math])
+env.Append(LIBS = [scenegraph, particles, interface, math])
interface_test_files = glob.glob('src/interface/test/*.cpp')
interface_test_files = [x.replace("src", "obj") for x in interface_test_files]
env.Program('bin/interface_test', interface_test_files)
View
@@ -6,10 +6,10 @@
#include <scenegraph/Cameranode.h>
#include <scenegraph/Lightnode.h>
#include <allegro5/allegro5.h>
-#include <allegro5/a5_iio.h>
-#include <allegro5/a5_font.h>
-#include <allegro5/a5_ttf.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_image.h>
+#include <allegro5/allegro_font.h>
+#include <allegro5/allegro_ttf.h>
+#include <allegro5/allegro_opengl.h>
#include "Gamestate.h"
class Editor: public Gamestate
View
@@ -2,10 +2,10 @@
#define Game_h
#include <allegro5/allegro5.h>
-#include <allegro5/a5_iio.h>
-#include <allegro5/a5_font.h>
-#include <allegro5/a5_ttf.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_image.h>
+#include <allegro5/allegro_font.h>
+#include <allegro5/allegro_ttf.h>
+#include <allegro5/allegro_opengl.h>
#include "Gamestate.h"
#include <zoidcom/zoidcom.h>
#include "Play.h"
View
@@ -5,7 +5,7 @@
#include "scenegraph/Scenenode.h"
#include "math/Vector3.h"
#include <allegro5/allegro5.h>
-#include <allegro5/a5_iio.h>
+#include <allegro5/allegro_image.h>
#include <zoidcom/zoidcom.h>
struct Height_point
View
@@ -9,10 +9,10 @@
#include "scenegraph/Modelnode.h"
#include "scenegraph/Transformnode.h"
#include <allegro5/allegro5.h>
-#include <allegro5/a5_iio.h>
-#include <allegro5/a5_font.h>
-#include <allegro5/a5_ttf.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_image.h>
+#include <allegro5/allegro_font.h>
+#include <allegro5/allegro_ttf.h>
+#include <allegro5/allegro_opengl.h>
#include "Gamestate.h"
#include <vector>
#include "Bomb.h"
@@ -1,5 +1,5 @@
-#ifndef interface_Rect_h
-#define interface_Rect_h
+#ifndef adagio_Rect_h
+#define adagio_Rect_h
#include "math/Vector2.h"
@@ -5,7 +5,7 @@
#include <list>
#include <string>
#include <allegro5/allegro5.h>
-#include <allegro5/a5_font.h>
+#include <allegro5/allegro_font.h>
#include "interface/Widget.h"
#include "interface/Rect.h"
@@ -4,7 +4,7 @@
#include "Scenenode.h"
#include <string>
#include <allegro5/allegro5.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_opengl.h>
#include <vector>
#include <map>
#include "math/Vector3.h"
@@ -4,7 +4,7 @@
#include "Scenenode.h"
#include <string>
#include <allegro5/allegro5.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_opengl.h>
#include <vector>
#include "math/Vector3.h"
@@ -4,7 +4,7 @@
#include "math/Vector3.h"
#include "Scenenode.h"
#include <allegro5/allegro5.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_opengl.h>
class Quadnode: public Scenenode
{
View
@@ -4,6 +4,7 @@
#include "Net.h"
#include "Play.h"
#include "Heightmap.h"
+#include <cstdio>
Client::Client()
:ready(false)
View
@@ -34,7 +34,7 @@ void Game::Run()
al_init();
al_install_mouse();
al_install_keyboard();
- al_init_iio_addon();
+ al_init_image_addon();
al_init_font_addon();
ALLEGRO_DISPLAY *display;
@@ -43,14 +43,14 @@ void Game::Run()
display = al_create_display(width, height);
if(!display)
{
- printf("Failed to create display\n");
+ std::cout<<"Failed to create display"<<std::endl;
return;
}
ALLEGRO_EVENT_QUEUE *event_queue = al_create_event_queue();
al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)display);
- al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)al_get_keyboard());
- al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)al_get_mouse());
+ al_register_event_source(event_queue, al_get_keyboard_event_source());
+ al_register_event_source(event_queue, al_get_mouse_event_source());
if(!Init())
return;
@@ -99,7 +99,7 @@ bool Game::Init()
zcom = new ZoidCom();
if (!zcom || !zcom->Init())
{
- printf("Zoidcom init failed");
+ std::cout<<"Zoidcom init failed"<<std::endl;
return false;
}
View
@@ -1,8 +1,8 @@
#include "Heightmap.h"
#include <allegro5/allegro5.h>
-#include <allegro5/a5_font.h>
-#include <allegro5/a5_ttf.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_font.h>
+#include <allegro5/allegro_ttf.h>
+#include <allegro5/allegro_opengl.h>
#include <cmath>
#include <iostream>
#include "Net.h"
View
@@ -6,7 +6,8 @@
#include "scenegraph/Quadnode.h"
#include "scenegraph/Modelnode.h"
#include "Net.h"
-#include <allegro5/a5_primitives.h>
+#include <allegro5/allegro_primitives.h>
+#include <cstdio>
Play::Play()
:camera(NULL)
View
@@ -101,6 +101,9 @@ void Player::Update(double dt, Vector3 camera_right, Vector3 camera_front, Heigh
}
if(control == 0)
{
+ /* TODO:
+ * Different approach. Decide direction only when input changes then let the player move straight.
+ * */
Vector3 direction(move_left-move_right, 0/*move_up-move_down*/, move_forward-move_backward);
direction.Normalize();
View
@@ -1,6 +1,7 @@
#include "Server.h"
#include <iostream>
#include "Net.h"
+#include <cstdio>
Server::Server()
:heightmap(NULL)
@@ -1,6 +1,6 @@
#include "interface/Renderer.h"
#include <algorithm>
-#include <allegro5/a5_primitives.h>
+#include <allegro5/allegro_primitives.h>
namespace interface
{
@@ -1,8 +1,8 @@
#include <allegro5/allegro5.h>
-#include <allegro5/a5_opengl.h>
-#include <allegro5/a5_iio.h>
-#include <allegro5/a5_font.h>
-#include <allegro5/a5_ttf.h>
+#include <allegro5/allegro_opengl.h>
+#include <allegro5/allegro_image.h>
+#include <allegro5/allegro_font.h>
+#include <allegro5/allegro_ttf.h>
#include <iostream>
#include "interface/Renderer.h"
#include "interface/Button.h"
@@ -15,6 +15,7 @@
#include "interface/Group.h"
#include "interface/Attribute_group.h"
#include "interface/Attribute_groups.h"
+#include <cstdio>
interface::Renderer* renderer = NULL;
interface::Group* root_interface;
@@ -232,7 +233,7 @@ int main()
al_init();
al_install_mouse();
al_install_keyboard();
- al_init_iio_addon();
+ al_init_image_addon();
al_init_font_addon();
ALLEGRO_DISPLAY *display;
@@ -245,13 +246,15 @@ int main()
return 0;
}
- ALLEGRO_EVENT_SOURCE *time_event_source = al_create_user_event_source();
+ ALLEGRO_EVENT_SOURCE time_event_source;
+ al_init_user_event_source(&time_event_source);
+ //ALLEGRO_EVENT_SOURCE *time_event_source = al_create_user_event_source();
ALLEGRO_EVENT_QUEUE *event_queue = al_create_event_queue();
al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)display);
- al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)al_get_keyboard());
- al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)al_get_mouse());
- al_register_event_source(event_queue, time_event_source);
+ al_register_event_source(event_queue, al_get_keyboard_event_source());
+ al_register_event_source(event_queue, al_get_mouse_event_source());
+ al_register_event_source(event_queue, &time_event_source);
if(!Init())
return 0;
@@ -271,7 +274,7 @@ int main()
interface::UPDATE_EVENT ue;
ue.dt = dt;
time_event.user.data1 = (intptr_t)(&ue);
- al_emit_user_event(time_event_source, &time_event, NULL);
+ al_emit_user_event(&time_event_source, &time_event, NULL);
ALLEGRO_EVENT event;
@@ -1,9 +1,9 @@
#include <allegro5/allegro5.h>
-#include <allegro5/a5_opengl.h>
-#include <allegro5/a5_iio.h>
-#include <allegro5/a5_font.h>
-#include <allegro5/a5_ttf.h>
-#include <allegro5/a5_native_dialog.h>
+#include <allegro5/allegro_opengl.h>
+#include <allegro5/allegro_image.h>
+#include <allegro5/allegro_font.h>
+#include <allegro5/allegro_ttf.h>
+#include <allegro5/allegro_native_dialog.h>
#include <iostream>
#include "interface/Renderer.h"
#include "interface/Button.h"
@@ -25,6 +25,8 @@
#include <GL/glu.h>
+#include <cstdio>
+
interface::Renderer* renderer = NULL;
interface::Group* root_interface;
@@ -165,12 +167,12 @@ void Event(ALLEGRO_EVENT event)
if(e.source == load_button)
{
ALLEGRO_NATIVE_DIALOG *file_chooser = al_create_native_file_dialog(
- al_path_create("./media/"), "Choose model to load", ".;tmf", ALLEGRO_FILECHOOSER_FILE_MUST_EXIST);
+ al_create_path("./media/"), "Choose model to load", ".;tmf", ALLEGRO_FILECHOOSER_FILE_MUST_EXIST);
al_show_native_file_dialog(file_chooser);
if(al_get_native_file_dialog_count(file_chooser) != 0)
{
const ALLEGRO_PATH *path = al_get_native_file_dialog_path(file_chooser, 0);
- const char *char_path = al_path_to_string(path, '/');
+ const char *char_path = al_path_cstr(path, '/');
filename_label->Set_text(char_path);
model->Loadmodel(char_path);
@@ -208,7 +210,7 @@ int main()
al_init();
al_install_mouse();
al_install_keyboard();
- al_init_iio_addon();
+ al_init_image_addon();
al_init_font_addon();
ALLEGRO_DISPLAY *display;
@@ -221,13 +223,15 @@ int main()
return 0;
}
- ALLEGRO_EVENT_SOURCE *time_event_source = al_create_user_event_source();
+ ALLEGRO_EVENT_SOURCE time_event_source;
+ al_init_user_event_source(&time_event_source);
+// ALLEGRO_EVENT_SOURCE *time_event_source = al_create_user_event_source();
ALLEGRO_EVENT_QUEUE *event_queue = al_create_event_queue();
al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)display);
- al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)al_get_keyboard());
- al_register_event_source(event_queue, (ALLEGRO_EVENT_SOURCE *)al_get_mouse());
- al_register_event_source(event_queue, time_event_source);
+ al_register_event_source(event_queue, al_get_keyboard_event_source());
+ al_register_event_source(event_queue, al_get_mouse_event_source());
+ al_register_event_source(event_queue, &time_event_source);
if(!Init())
return 0;
@@ -247,7 +251,7 @@ int main()
interface::UPDATE_EVENT ue;
ue.dt = dt;
time_event.user.data1 = (intptr_t)(&ue);
- al_emit_user_event(time_event_source, &time_event, NULL);
+ al_emit_user_event(&time_event_source, &time_event, NULL);
ALLEGRO_EVENT event;
@@ -6,7 +6,7 @@
#include <cmath>
#include <algorithm>
#include <allegro5/allegro5.h>
-#include <allegro5/a5_iio.h>
+#include <allegro5/allegro_image.h>
Animated_modelnode::Animated_modelnode()
{
@@ -1,6 +1,6 @@
#include "scenegraph/Billboardnode.h"
#include <allegro5/allegro5.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_opengl.h>
void Billboardnode::Set_position(Vector3 p)
{
@@ -1,9 +1,9 @@
#include "scenegraph/Cameranode.h"
#include <allegro5/allegro5.h>
-#include <allegro5/a5_iio.h>
-#include <allegro5/a5_font.h>
-#include <allegro5/a5_ttf.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_image.h>
+#include <allegro5/allegro_font.h>
+#include <allegro5/allegro_ttf.h>
+#include <allegro5/allegro_opengl.h>
#include <GL/glu.h>
Cameranode::Cameranode()
@@ -1,6 +1,6 @@
#include "scenegraph/Lightnode.h"
#include <allegro5/allegro5.h>
-#include <allegro5/a5_opengl.h>
+#include <allegro5/allegro_opengl.h>
void Lightnode::Prerender()
{
Oops, something went wrong.

0 comments on commit 0da749c

Please sign in to comment.