Mercurial > hg > Game > Cerium
changeset 73:811ffebd8deb
*** empty log message ***
author | gongo |
---|---|
date | Mon, 18 Feb 2008 03:34:35 +0900 |
parents | cf36120bc158 |
children | 5da437ae84db |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Test/simple_render/Makefile TaskManager/Test/simple_render/polygon.cpp TaskManager/Test/simple_render/vertex.cpp TaskManager/Test/simple_render/vertex.h TaskManager/Test/simple_render/viewer.cpp |
diffstat | 6 files changed, 46 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Mon Feb 18 02:13:56 2008 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Mon Feb 18 03:34:35 2008 +0900 @@ -108,7 +108,7 @@ } } } - } while (!list && bufferManager->waitTaskQueue); + } while (list == NULL && !bufferManager->activeTaskQueue); if (list == NULL) { next_list = set_task();
--- a/TaskManager/Test/simple_render/Makefile Mon Feb 18 02:13:56 2008 +0900 +++ b/TaskManager/Test/simple_render/Makefile Mon Feb 18 03:34:35 2008 +0900 @@ -13,9 +13,9 @@ EXTRA_CFLAGS = `sdl-config --cflags` `xml2-config --cflags`\ -LIBS = `sdl-config --libs` -lSDL_image -Wl,-framework,OpenGL \ +LIBS = `sdl-config --libs` -lSDL_image -lGL \ `xml2-config --libs`\ - -L../../ -lmanager# -lspe2 -lpthread + -L../../ -lmanager -lspe2 -lpthread .SUFFIXES: .cpp .o
--- a/TaskManager/Test/simple_render/polygon.cpp Mon Feb 18 02:13:56 2008 +0900 +++ b/TaskManager/Test/simple_render/polygon.cpp Mon Feb 18 03:34:35 2008 +0900 @@ -333,23 +333,31 @@ void Polygon::draw(PolygonPack *pp) { - for(int n=0; n<pp->info.size; n++) - { - Vertex *ver1 = new Vertex(pp->tri[n].x1,pp->tri[n].y1,pp->tri[n].z1,pp->tri[n].tex_x1,pp->tri[n].tex_y1); - Vertex *ver2 = new Vertex(pp->tri[n].x2,pp->tri[n].y2,pp->tri[n].z2,pp->tri[n].tex_x2,pp->tri[n].tex_y2); - Vertex *ver3 = new Vertex(pp->tri[n].x3,pp->tri[n].y3,pp->tri[n].z3,pp->tri[n].tex_x3,pp->tri[n].tex_y3); + Vertex *ver1 = new Vertex(0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + Vertex *ver2 = new Vertex(0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + Vertex *ver3 = new Vertex(0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + + for (int n = 0; n < pp->info.size; n++) { + //Vertex *ver1 = new Vertex(pp->tri[n].x1,pp->tri[n].y1,pp->tri[n].z1,pp->tri[n].tex_x1,pp->tri[n].tex_y1); + //Vertex *ver2 = new Vertex(pp->tri[n].x2,pp->tri[n].y2,pp->tri[n].z2,pp->tri[n].tex_x2,pp->tri[n].tex_y2); + //Vertex *ver3 = new Vertex(pp->tri[n].x3,pp->tri[n].y3,pp->tri[n].z3,pp->tri[n].tex_x3,pp->tri[n].tex_y3); + + ver1->set(pp->tri[n].x1,pp->tri[n].y1,pp->tri[n].z1,pp->tri[n].tex_x1,pp->tri[n].tex_y1); + ver2->set(pp->tri[n].x2,pp->tri[n].y2,pp->tri[n].z2,pp->tri[n].tex_x2,pp->tri[n].tex_y2); + ver3->set(pp->tri[n].x3,pp->tri[n].y3,pp->tri[n].z3,pp->tri[n].tex_x3,pp->tri[n].tex_y3); + + Triangle *tri = new Triangle( ver1, ver2, ver3); + Span *span = new Span(); + span->viewer = viewer; + span->p = this; + span->create_span(tri,texture_image); + delete tri; + delete span; + } - Triangle *tri = new Triangle(ver1,ver2,ver3); - Span *span = new Span(); - span->viewer = viewer; - span->p = this; - span->create_span(tri,texture_image); - delete ver1; - delete ver2; - delete ver3; - delete tri; - delete span; - } + delete ver1; + delete ver2; + delete ver3; }
--- a/TaskManager/Test/simple_render/vertex.cpp Mon Feb 18 02:13:56 2008 +0900 +++ b/TaskManager/Test/simple_render/vertex.cpp Mon Feb 18 03:34:35 2008 +0900 @@ -9,3 +9,13 @@ tex_x = tmp_tex_x; tex_y = tmp_tex_y; } + +void +Vertex::set(float tmp_x,float tmp_y, float tmp_z,float tmp_tex_x,float tmp_tex_y) { + x = tmp_x; + y = tmp_y; + z = tmp_z; + tex_x = tmp_tex_x; + tex_y = tmp_tex_y; +} +
--- a/TaskManager/Test/simple_render/vertex.h Mon Feb 18 02:13:56 2008 +0900 +++ b/TaskManager/Test/simple_render/vertex.h Mon Feb 18 03:34:35 2008 +0900 @@ -2,10 +2,12 @@ #define INCLUDE_VERTEX class Vertex { - public: - float x,y,z,tex_x,tex_y; +public: + float x,y,z,tex_x,tex_y; + + Vertex(float tmp_x, float tmp_y, float tmp_z,float tmp_tex_x, float tmp_tex_y); - Vertex(float tmp_x, float tmp_y, float tmp_z,float tmp_tex_x, float tmp_tex_y); + void set(float, float, float, float, float); }; #endif
--- a/TaskManager/Test/simple_render/viewer.cpp Mon Feb 18 02:13:56 2008 +0900 +++ b/TaskManager/Test/simple_render/viewer.cpp Mon Feb 18 03:34:35 2008 +0900 @@ -32,7 +32,7 @@ exit( 1 ); } -#ifndef DEBUG +#ifdef _DEBUG screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE); if (screen == NULL) { fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); @@ -299,6 +299,7 @@ graph_line(); fd_update_sgp = manager->open("UpdateSGP"); + fd_update_sgp = 1; fd_create_pp = manager->open("CreatePP"); fd = manager->open("ViewerRunDraw"); task_update_sgp = manager->create_task(fd_update_sgp, @@ -319,7 +320,7 @@ task_create_pp->spawn(); task->spawn(); - sgp_buff->swap_buffer(); + //sgp_buff->swap_buffer(); } void @@ -332,7 +333,7 @@ pp_buff->get_buffer(&pp); - polygon->draw(pp); // test draw of PolygonPack + //polygon->draw(pp); // test draw of PolygonPack SDL_BlitSurface(bitmap, NULL, screen, NULL); SDL_UpdateRect(screen, 0, 0, 0, 0); @@ -340,7 +341,6 @@ fd = manager->open("ViewerRunLoop"); task = manager->create_task(fd, 0, 0, 0, NULL); - //manager->spawn_task(task); task->spawn(); }