diff TaskManager/Test/simple_render/viewer.cpp @ 101:c31499d11926

*** empty log message ***
author gongo
date Mon, 03 Mar 2008 14:06:33 +0900
parents 57bac9e07662
children 62679f4cae18
line wrap: on
line diff
--- a/TaskManager/Test/simple_render/viewer.cpp	Fri Feb 29 05:43:43 2008 +0900
+++ b/TaskManager/Test/simple_render/viewer.cpp	Mon Mar 03 14:06:33 2008 +0900
@@ -30,7 +30,7 @@
 	exit( 1 );
     }
     
-#ifdef _DEBUG
+#ifndef _DEBUG
     screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE);
     if (screen == NULL) {
 	fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
@@ -291,13 +291,13 @@
     task = manager->create_task(fd, 0, 0, 0, NULL);      
     task->spawn();
     
-    posix_memalign((void**)&__texture, 16, 128*128*3);
-    memcpy(__texture, polygon->texture_image->pixels, 128*128*3);
-    HTaskPtr task_init_tex = manager->create_task(0, 0, (uint32)__texture, 0, NULL);
-    task_init_tex->set_cpu(CPU_SPE);
-    task_init_tex->spawn();
+    //posix_memalign((void**)&__texture, 16, 128*128*3);
+    //memcpy(__texture, polygon->texture_image->pixels, 128*128*3);
+    //HTaskPtr task_init_tex = manager->create_task(0, 0, (uint32)__texture, 0, NULL);
+    //task_init_tex->set_cpu(CPU_SPE);
+    //task_init_tex->spawn();
 
-    fbdev_addr = get_fbdev_addr();
+    //fbdev_addr = get_fbdev_addr();
 }
 
 void
@@ -329,11 +329,11 @@
     // clean_pixels や zRow_init は、
     // spe で fb に draw する時は必要ない。
     // ppe 側で draw する時にだけ呼ぶべき。
-    //clean_pixels();
-    //zRow_init();
+    clean_pixels();
+    zRow_init();
 
     // これ自身、一つのタスクとして回す方がよいか
-    //graph_line();
+    graph_line();
 
     fd_update_sgp = manager->open("UpdateSGP");
     fd_create_pp  = manager->open("CreatePP");
@@ -395,8 +395,8 @@
  * 本当はタスクとして TestDraw を選ぶ
  */
 
-#define DRAW_POLYGON
-//#define DRAW_SPANPACK
+//#define DRAW_POLYGON
+#define DRAW_SPANPACK
 //#define DRAW_SPUSPAN
 void
 Viewer::run_draw(void)
@@ -408,7 +408,7 @@
     fd = manager->open("ViewerRunLoop");
     task = manager->create_task(fd, 0, 0, 0, NULL);
 
-#if 1
+#if 0
     for (int j = 0; j < 6; j++) {
 	 for (int i = 0; i < 10; i++) {
 	      if (ssl->ss[j].spp[i].info.size < 1) continue;
@@ -423,13 +423,8 @@
     }
 #endif
     task->spawn();
-
-    SDL_BlitSurface(bitmap, NULL, screen, NULL);
-    SDL_UpdateRect(screen, 0, 0, 0, 0);    
-
-    frames++;
     
-    return;
+    //return;
     
 #if 0 // USE DOUBLE BUFFER
     PolygonPack *pp;
@@ -440,17 +435,14 @@
 #endif
 
 #ifdef DRAW_POLYGON
-    polygon->draw(pp);    // test draw of PolygonPack
-
+    //polygon->draw(pp);    // test draw of PolygonPack
+    polygon->draw(sgp);    // test draw of PolygonPack
 #else
 #  ifdef DRAW_SPANPACK // test draw of SpanPack
-    for (int i = 0; i < 1; i++) {
-	polygon->draw(&ssl->ss[0].spp[i]);
-	polygon->draw(&ssl->ss[1].spp[i]);
-	polygon->draw(&ssl->ss[2].spp[i]);
-	polygon->draw(&ssl->ss[3].spp[i]);
-	polygon->draw(&ssl->ss[4].spp[i]);
-	polygon->draw(&ssl->ss[5].spp[i]);
+    for (int j = 0; j < 6; j++) {
+	 for (int i = 0; i < 10; i++) {
+	      polygon->draw(&ssl->ss[j].spp[i]);
+	 }
     }
 #  else
     polygon->draw(&ssl->ss[0]);
@@ -462,6 +454,11 @@
 #  endif
 #endif
 
+    SDL_BlitSurface(bitmap, NULL, screen, NULL);
+    SDL_UpdateRect(screen, 0, 0, 0, 0);    
+
+    frames++;
+
     return;
 }