diff Renderer/Engine/polygon.cc @ 1130:5addc6c1d5c4 draft

fix.
author root@dolphins.cr.ie.u-ryukyu.ac.jp
date Sun, 13 Feb 2011 22:34:44 +0900
parents a8bffdb5d2e3
children 786e800abfb4
line wrap: on
line diff
--- a/Renderer/Engine/polygon.cc	Sun Feb 13 07:20:55 2011 +0900
+++ b/Renderer/Engine/polygon.cc	Sun Feb 13 22:34:44 2011 +0900
@@ -15,8 +15,13 @@
 using namespace std;
 
 
-Polygon::Polygon(void)
+
+
+Polygon::Polygon()
 {
+    matrix      = (float*)polygon_allocate(sizeof(float)*16);
+    real_matrix = (float*)polygon_allocate(sizeof(float)*16);
+    texture_info = (texture_list*)polygon_allocate(sizeof(texture_list));
     position_init();
 }
 
@@ -221,16 +226,16 @@
     //Uint32 temp, pixel;
     Uint8 red, green, blue;
 
-    fmt = texture_info.texture_image->format;
+    fmt = texture_info->texture_image->format;
 
     if (tx<0) tx = 0;
-    if (texture_info.texture_image->w-1< tx) tx = texture_info.texture_image->w-1 ;
+    if (texture_info->texture_image->w-1< tx) tx = texture_info->texture_image->w-1 ;
     if (ty<0) ty = 0;
-    if (texture_info.texture_image->h-1< ty) ty = texture_info.texture_image->h-1 ;
+    if (texture_info->texture_image->h-1< ty) ty = texture_info->texture_image->h-1 ;
 
 
     //SDL_LockSurface(texture_image);
-    char *p = get_pixel(tx,ty,texture_info.texture_image);
+    char *p = get_pixel(tx,ty,texture_info->texture_image);
     blue  = (Uint8) p[0];
     green = (Uint8) p[1];
     red   = (Uint8) p[2];