[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog backend/render_handler.h backen...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog backend/render_handler.h backen... |
Date: |
Sat, 10 Nov 2007 11:51:44 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/11/10 11:51:44
Modified files:
. : ChangeLog
backend : render_handler.h render_handler_agg.cpp
render_handler_cairo.cpp render_handler_d3d.cpp
render_handler_ogl.cpp render_handler_ogl.h
render_handler_tri.cpp render_handler_xbox.cpp
libbase : LoadThread.h
libgeometry : Point2d.h
server : button_character_instance.cpp character.cpp
character.h edit_text_character.cpp fontlib.cpp
fontlib.h generic_character.cpp gnash.h impl.h
matrix.cpp matrix.h movie_root.cpp rect.cpp
rect.h render.cpp shape.cpp shape.h
sprite_instance.cpp tesselate.cpp tesselate.h
types.cpp
server/parser : movie_definition.h shape_character_def.cpp
testsuite/server: PointTest.cpp
Log message:
typedefed gnash::point to Point2d<float>, drop some unused functions
and cleaned up headers a bit.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4822&r2=1.4823
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler.h?cvsroot=gnash&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg.cpp?cvsroot=gnash&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_cairo.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_d3d.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_ogl.cpp?cvsroot=gnash&r1=1.87&r2=1.88
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_ogl.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_tri.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_xbox.cpp?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/LoadThread.h?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/libgeometry/Point2d.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.107&r2=1.108
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.129&r2=1.130
http://cvs.savannah.gnu.org/viewcvs/gnash/server/fontlib.cpp?cvsroot=gnash&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/gnash/server/fontlib.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/gnash.h?cvsroot=gnash&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.h?cvsroot=gnash&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.cpp?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.120&r2=1.121
http://cvs.savannah.gnu.org/viewcvs/gnash/server/rect.cpp?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/server/rect.h?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/render.cpp?cvsroot=gnash&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.cpp?cvsroot=gnash&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.h?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.378&r2=1.379
http://cvs.savannah.gnu.org/viewcvs/gnash/server/tesselate.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/tesselate.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/types.cpp?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_definition.h?cvsroot=gnash&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/server/PointTest.cpp?cvsroot=gnash&r1=1.3&r2=1.4
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4822
retrieving revision 1.4823
diff -u -b -r1.4822 -r1.4823
--- ChangeLog 10 Nov 2007 09:46:53 -0000 1.4822
+++ ChangeLog 10 Nov 2007 11:51:41 -0000 1.4823
@@ -1,5 +1,10 @@
2007-11-10 Sandro Santilli <address@hidden>
+ * (lots of files): typedefed gnash::point to Point2d<float>,
+ drop some unused functions and cleaned up headers a bit.
+
+2007-11-10 Sandro Santilli <address@hidden>
+
* libgeometry/: Makefile.am, Point2d.h: initial implementation of
a generalized point class.
* testsuite/libgeometry/: Makefile.am, Point2dTest.cpp: initial
Index: backend/render_handler.h
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- backend/render_handler.h 1 Nov 2007 20:21:55 -0000 1.49
+++ backend/render_handler.h 10 Nov 2007 11:51:41 -0000 1.50
@@ -18,7 +18,7 @@
//
//
-/* $Id: render_handler.h,v 1.49 2007/11/01 20:21:55 bjacques Exp $ */
+/* $Id: render_handler.h,v 1.50 2007/11/10 11:51:41 strk Exp $ */
#ifndef RENDER_HANDLER_H
#define RENDER_HANDLER_H
@@ -316,8 +316,8 @@
point topleft = pixel_to_world(pixelbounds.getMinX(),
pixelbounds.getMinY());
point bottomright = pixel_to_world(pixelbounds.getMaxX(),
pixelbounds.getMaxY());
- return geometry::Range2d<float> (topleft.m_x, topleft.m_y,
- bottomright.m_x, bottomright.m_y);
+ return geometry::Range2d<float> (topleft.x, topleft.y,
+ bottomright.x, bottomright.y);
}
virtual geometry::Range2d<int> world_to_pixel(const
geometry::Range2d<float>& worldbounds)
Index: backend/render_handler_agg.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_agg.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- backend/render_handler_agg.cpp 6 Nov 2007 14:18:53 -0000 1.115
+++ backend/render_handler_agg.cpp 10 Nov 2007 11:51:41 -0000 1.116
@@ -17,7 +17,7 @@
-/* $Id: render_handler_agg.cpp,v 1.115 2007/11/06 14:18:53 udog Exp $ */
+/* $Id: render_handler_agg.cpp,v 1.116 2007/11/10 11:51:41 strk Exp $ */
// Original version by Udo Giacomozzi and Hannes Mayr,
// INDUNET GmbH (www.indunet.it)
@@ -531,11 +531,11 @@
mat.transform(&d, point(bounds->get_x_min(), bounds->get_y_max()));
agg::path_storage path;
- path.move_to(a.m_x, a.m_y);
- path.line_to(b.m_x, b.m_y);
- path.line_to(c.m_x, c.m_y);
- path.line_to(d.m_x, d.m_y);
- path.line_to(a.m_x, a.m_y);
+ path.move_to(a.x, a.y);
+ path.line_to(b.x, b.y);
+ path.line_to(c.x, c.y);
+ path.line_to(d.x, d.y);
+ path.line_to(a.x, a.y);
if (m_alpha_mask.empty()) {
@@ -808,11 +808,11 @@
const int16_t *vertex = static_cast<const int16_t*>(coords);
mat.transform(&pnt, point(vertex[0], vertex[1]));
- path.move_to(pnt.m_x, pnt.m_y);
+ path.move_to(pnt.x, pnt.y);
for (vertex += 2; vertex_count > 1; vertex_count--, vertex += 2) {
mat.transform(&pnt, point(vertex[0], vertex[1]));
- path.line_to(pnt.m_x, pnt.m_y);
+ path.line_to(pnt.x, pnt.y);
}
// -- render --
@@ -1146,25 +1146,25 @@
point oldpnt(the_path.m_ax, the_path.m_ay);
point newpnt;
mat.transform(&newpnt, oldpnt);
- the_path.m_ax = newpnt.m_x;
- the_path.m_ay = newpnt.m_y;
+ the_path.m_ax = newpnt.x;
+ the_path.m_ay = newpnt.y;
ecount = the_path.m_edges.size();
for (eno=0; eno<ecount; eno++) {
edge &the_edge = the_path.m_edges[eno];
- oldpnt.m_x = the_edge.m_ax;
- oldpnt.m_y = the_edge.m_ay;
+ oldpnt.x = the_edge.m_ax;
+ oldpnt.y = the_edge.m_ay;
mat.transform(&newpnt, oldpnt);
- the_edge.m_ax = newpnt.m_x;
- the_edge.m_ay = newpnt.m_y;
+ the_edge.m_ax = newpnt.x;
+ the_edge.m_ay = newpnt.y;
- oldpnt.m_x = the_edge.m_cx;
- oldpnt.m_y = the_edge.m_cy;
+ oldpnt.x = the_edge.m_cx;
+ oldpnt.y = the_edge.m_cy;
mat.transform(&newpnt, oldpnt);
- the_edge.m_cx = newpnt.m_x;
- the_edge.m_cy = newpnt.m_y;
+ the_edge.m_cx = newpnt.x;
+ the_edge.m_cy = newpnt.y;
}
@@ -1904,18 +1904,18 @@
// center of the pixel. This avoids blurring caused by anti-aliasing.
mat.transform(&origin,
- point(trunc(corners[0].m_x), trunc(corners[0].m_y)));
- path.move_to(trunc(origin.m_x)+0.5, trunc(origin.m_y)+0.5);
+ point(trunc(corners[0].x), trunc(corners[0].y)));
+ path.move_to(trunc(origin.x)+0.5, trunc(origin.y)+0.5);
for (unsigned int i=1; i<corner_count; i++) {
- mat.transform(&pnt, point(corners[i].m_x, corners[i].m_y));
+ mat.transform(&pnt, point(corners[i].x, corners[i].y));
- path.line_to(trunc(pnt.m_x)+0.5, trunc(pnt.m_y)+0.5);
+ path.line_to(trunc(pnt.x)+0.5, trunc(pnt.y)+0.5);
}
// close polygon
- path.line_to(trunc(origin.m_x)+0.5, trunc(origin.m_y)+0.5);
+ path.line_to(trunc(origin.x)+0.5, trunc(origin.y)+0.5);
@@ -1993,8 +1993,8 @@
// and Intersect() against valid range instead.
point p(world_x, world_y);
stage_matrix.transform(p);
- x = (int)p.m_x;
- y = (int)p.m_y;
+ x = (int)p.x;
+ y = (int)p.y;
}
geometry::Range2d<int> world_to_pixel(const rect& wb)
@@ -2121,8 +2121,8 @@
}
virtual void get_scale(point& scale) {
- scale.m_x = PIXELS_TO_TWIPS(stage_matrix.get_x_scale());
- scale.m_y = PIXELS_TO_TWIPS(stage_matrix.get_y_scale());
+ scale.x = PIXELS_TO_TWIPS(stage_matrix.get_x_scale());
+ scale.y = PIXELS_TO_TWIPS(stage_matrix.get_y_scale());
}
virtual unsigned int getBytesPerPixel() const {
Index: backend/render_handler_cairo.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_cairo.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- backend/render_handler_cairo.cpp 1 Nov 2007 10:29:55 -0000 1.29
+++ backend/render_handler_cairo.cpp 10 Nov 2007 11:51:42 -0000 1.30
@@ -345,10 +345,10 @@
return;
}
- cairo_move_to(_cr, corners[0].m_x, corners[0].m_y);
+ cairo_move_to(_cr, corners[0].x, corners[0].y);
for (size_t i = 0; i < corner_count; ++i) {
- cairo_line_to(_cr, corners[i].m_x, corners[i].m_y);
+ cairo_line_to(_cr, corners[i].x, corners[i].y);
}
cairo_close_path(_cr);
@@ -752,25 +752,25 @@
point oldpnt(the_path.m_ax, the_path.m_ay);
point newpnt;
mat.transform(&newpnt, oldpnt);
- the_path.m_ax = newpnt.m_x;
- the_path.m_ay = newpnt.m_y;
+ the_path.m_ax = newpnt.x;
+ the_path.m_ay = newpnt.y;
ecount = the_path.m_edges.size();
for (eno=0; eno<ecount; eno++) {
edge &the_edge = the_path.m_edges[eno];
- oldpnt.m_x = the_edge.m_ax;
- oldpnt.m_y = the_edge.m_ay;
+ oldpnt.x = the_edge.m_ax;
+ oldpnt.y = the_edge.m_ay;
mat.transform(&newpnt, oldpnt);
- the_edge.m_ax = newpnt.m_x;
- the_edge.m_ay = newpnt.m_y;
+ the_edge.m_ax = newpnt.x;
+ the_edge.m_ay = newpnt.y;
- oldpnt.m_x = the_edge.m_cx;
- oldpnt.m_y = the_edge.m_cy;
+ oldpnt.x = the_edge.m_cx;
+ oldpnt.y = the_edge.m_cy;
mat.transform(&newpnt, oldpnt);
- the_edge.m_cx = newpnt.m_x;
- the_edge.m_cy = newpnt.m_y;
+ the_edge.m_cx = newpnt.x;
+ the_edge.m_cy = newpnt.y;
}
Index: backend/render_handler_d3d.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_d3d.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- backend/render_handler_d3d.cpp 30 Oct 2007 18:55:40 -0000 1.11
+++ backend/render_handler_d3d.cpp 10 Nov 2007 11:51:42 -0000 1.12
@@ -875,8 +875,8 @@
m.transform(&a, gameswf::point(coords.m_x_min, coords.m_y_min));
m.transform(&b, gameswf::point(coords.m_x_max, coords.m_y_min));
m.transform(&c, gameswf::point(coords.m_x_min, coords.m_y_max));
- d.m_x = b.m_x + c.m_x - a.m_x;
- d.m_y = b.m_y + c.m_y - a.m_y;
+ d.x = b.x + c.x - a.x;
+ d.y = b.y + c.y - a.y;
// Set texture.
m_pd3dDevice->SetTexture(0, s_d3d_textures[bi->m_texture_id]);
@@ -901,26 +901,26 @@
abort();
}
- pVertices[0].x = a.m_x ;
- pVertices[0].y = a.m_y ;
+ pVertices[0].x = a.x ;
+ pVertices[0].y = a.y ;
pVertices[0].z = Z_DEPTH;
pVertices[0].tu = uv_coords.m_x_min ;
pVertices[0].tv = uv_coords.m_y_min ;
- pVertices[1].x = b.m_x ;
- pVertices[1].y = b.m_y ;
+ pVertices[1].x = b.x ;
+ pVertices[1].y = b.y ;
pVertices[1].z = Z_DEPTH;
pVertices[1].tu = uv_coords.m_x_max ;
pVertices[1].tv = uv_coords.m_y_min ;
- pVertices[2].x = c.m_x ;
- pVertices[2].y = c.m_y ;
+ pVertices[2].x = c.x ;
+ pVertices[2].y = c.y ;
pVertices[2].z = Z_DEPTH;
pVertices[2].tu = uv_coords.m_x_min ;
pVertices[2].tv = uv_coords.m_y_max ;
- pVertices[3].x = d.m_x ;
- pVertices[3].y = d.m_y ;
+ pVertices[3].x = d.x ;
+ pVertices[3].y = d.y ;
pVertices[3].z = Z_DEPTH;
pVertices[3].tu = uv_coords.m_x_max ;
pVertices[3].tv = uv_coords.m_y_max ;
Index: backend/render_handler_ogl.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_ogl.cpp,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -b -r1.87 -r1.88
--- backend/render_handler_ogl.cpp 2 Nov 2007 20:18:35 -0000 1.87
+++ backend/render_handler_ogl.cpp 10 Nov 2007 11:51:42 -0000 1.88
@@ -206,7 +206,7 @@
/// drawn from a to b.
point middle(const point& a, const point& b)
{
- return point(0.5 * (a.m_x + b.m_x), 0.5 * (a.m_y + b.m_y));
+ return point(0.5 * (a.x + b.x), 0.5 * (a.y + b.y));
}
@@ -233,7 +233,7 @@
// Midpoint on the curve.
point q = middle(mid, controlP);
- float dist = std::abs(mid.m_x - q.m_x) + std::abs(mid.m_y - q.m_y);
+ float dist = std::abs(mid.x - q.x) + std::abs(mid.y - q.y);
if (dist < 0.1 /*error tolerance*/) {
coords.push_back(oglVertex(endP));
@@ -660,15 +660,15 @@
m->transform(&a, gnash::point(bounds->get_x_min(), bounds->get_y_min()));
m->transform(&b, gnash::point(bounds->get_x_max(), bounds->get_y_min()));
m->transform(&c, gnash::point(bounds->get_x_min(), bounds->get_y_max()));
- d.m_x = b.m_x + c.m_x - a.m_x;
- d.m_y = b.m_y + c.m_y - a.m_y;
+ d.x = b.x + c.x - a.x;
+ d.y = b.y + c.y - a.y;
- float w_bounds = TWIPS_TO_PIXELS(b.m_x - a.m_x);
- float h_bounds = TWIPS_TO_PIXELS(c.m_y - a.m_y);
+ float w_bounds = TWIPS_TO_PIXELS(b.x - a.x);
+ float h_bounds = TWIPS_TO_PIXELS(c.y - a.y);
unsigned char* ptr = frame->data();
- float xpos = a.m_x < 0 ? 0.0f : a.m_x; //hack
- float ypos = a.m_y < 0 ? 0.0f : a.m_y; //hack
+ float xpos = a.x < 0 ? 0.0f : a.x; //hack
+ float ypos = a.y < 0 ? 0.0f : a.y; //hack
glRasterPos2f(xpos, ypos); //hack
size_t height = frame->height();
@@ -1452,8 +1452,8 @@
}
virtual void get_scale(point& scale) {
- scale.m_x = _xscale;
- scale.m_y = _yscale;
+ scale.x = _xscale;
+ scale.y = _yscale;
}
#ifdef OSMESA_TESTING
Index: backend/render_handler_ogl.h
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_ogl.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- backend/render_handler_ogl.h 2 Nov 2007 20:18:35 -0000 1.3
+++ backend/render_handler_ogl.h 10 Nov 2007 11:51:42 -0000 1.4
@@ -59,7 +59,7 @@
}
oglVertex(const point& p)
- : _x(p.m_x), _y(p.m_y), _z(0.0)
+ : _x(p.x), _y(p.y), _z(0.0)
{
}
Index: backend/render_handler_tri.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_tri.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- backend/render_handler_tri.cpp 21 Sep 2007 20:18:40 -0000 1.22
+++ backend/render_handler_tri.cpp 10 Nov 2007 11:51:42 -0000 1.23
@@ -18,7 +18,7 @@
//
//
-/* $Id: render_handler_tri.cpp,v 1.22 2007/09/21 20:18:40 bjacques Exp $ */
+/* $Id: render_handler_tri.cpp,v 1.23 2007/11/10 11:51:42 strk Exp $ */
#include "render_handler_tri.h"
@@ -318,8 +318,8 @@
// Create points array to vertex array
int16_t *vertex = new int16_t[(corner_count+1)*2];
for (unsigned int cno=0; cno<corner_count; cno++) {
- vertex[vno ] = static_cast<int16_t>(corners[cno].m_x);
- vertex[vno+1] = static_cast<int16_t>(corners[cno].m_y);
+ vertex[vno ] = static_cast<int16_t>(corners[cno].x);
+ vertex[vno+1] = static_cast<int16_t>(corners[cno].y);
vno+=2;
}
// add one more point to close the polygon
Index: backend/render_handler_xbox.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_xbox.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- backend/render_handler_xbox.cpp 7 Oct 2006 15:17:14 -0000 1.8
+++ backend/render_handler_xbox.cpp 10 Nov 2007 11:51:42 -0000 1.9
@@ -717,8 +717,8 @@
m.transform(&a, gnash::point(coords.m_x_min, coords.m_y_min));
m.transform(&b, gnash::point(coords.m_x_max, coords.m_y_min));
m.transform(&c, gnash::point(coords.m_x_min, coords.m_y_max));
- d.m_x = b.m_x + c.m_x - a.m_x;
- d.m_y = b.m_y + c.m_y - a.m_y;
+ d.x = b.x + c.x - a.x;
+ d.y = b.y + c.y - a.y;
// Set texture.
IDirect3DDevice8::SetTextureStageState(0, D3DTSS_COLOROP,
D3DTOP_MODULATE);
@@ -740,16 +740,16 @@
IDirect3DDevice8::Begin(D3DPT_TRIANGLESTRIP);
IDirect3DDevice8::SetVertexData2f(D3DVSDE_TEXCOORD0,
uv_coords.m_x_min, uv_coords.m_y_min);
- IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, a.m_x, a.m_y,
0, 1);
+ IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, a.x, a.y, 0,
1);
IDirect3DDevice8::SetVertexData2f(D3DVSDE_TEXCOORD0,
uv_coords.m_x_max, uv_coords.m_y_min);
- IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, b.m_x, b.m_y,
0, 1);
+ IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, b.x, b.y, 0,
1);
IDirect3DDevice8::SetVertexData2f(D3DVSDE_TEXCOORD0,
uv_coords.m_x_min, uv_coords.m_y_max);
- IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, c.m_x, c.m_y,
0, 1);
+ IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, c.x, c.y, 0,
1);
IDirect3DDevice8::SetVertexData2f(D3DVSDE_TEXCOORD0,
uv_coords.m_x_max, uv_coords.m_y_max);
- IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, d.m_x, d.m_y,
0, 1);
+ IDirect3DDevice8::SetVertexData4f(D3DVSDE_VERTEX, d.x, d.y, 0,
1);
IDirect3DDevice8::End();
@@ -762,16 +762,16 @@
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(uv_coords.m_x_min, uv_coords.m_y_min);
- glVertex2f(a.m_x, a.m_y);
+ glVertex2f(a.x, a.y);
glTexCoord2f(uv_coords.m_x_max, uv_coords.m_y_min);
- glVertex2f(b.m_x, b.m_y);
+ glVertex2f(b.x, b.y);
glTexCoord2f(uv_coords.m_x_min, uv_coords.m_y_max);
- glVertex2f(c.m_x, c.m_y);
+ glVertex2f(c.x, c.y);
glTexCoord2f(uv_coords.m_x_max, uv_coords.m_y_max);
- glVertex2f(d.m_x, d.m_y);
+ glVertex2f(d.x, d.y);
glEnd();
#endif // 0
Index: libbase/LoadThread.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/LoadThread.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- libbase/LoadThread.h 20 Oct 2007 09:33:28 -0000 1.13
+++ libbase/LoadThread.h 10 Nov 2007 11:51:42 -0000 1.14
@@ -66,7 +66,7 @@
/// Sets the stream used for the connection, and starts the download
/// is the stream is valid. Returns true is the stream is valid, and
else false.
- bool setStream(std::auto_ptr<tu_file> stream);
+ bool setStream(std::auto_ptr<tu_file> str);
/// Put read pointer at given position
/// Will block if there is not enough data buffered,
Index: libgeometry/Point2d.h
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/Point2d.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libgeometry/Point2d.h 10 Nov 2007 09:46:54 -0000 1.1
+++ libgeometry/Point2d.h 10 Nov 2007 11:51:42 -0000 1.2
@@ -21,7 +21,7 @@
//
-/* $Id: Point2d.h,v 1.1 2007/11/10 09:46:54 strk Exp $ */
+/* $Id: Point2d.h,v 1.2 2007/11/10 11:51:42 strk Exp $ */
#ifndef GNASH_POINT2DH
#define GNASH_POINT2DH
@@ -61,6 +61,15 @@
/// The y ordinate
T y;
+ /// Construct a Point2d with default X and Y ordinates
+ //
+ Point2d()
+ :
+ x(T(0.0)),
+ y(T(0.0))
+ {
+
+ }
/// Construct a Point2d with given X and Y ordinates
//
Point2d(T nx, T ny)
@@ -122,26 +131,45 @@
}
/// Return square distance between this and the given point
- float squareDistance(const Point2d<T>& p)
+ float squareDistance(const Point2d<T>& p) const
{
return squareDistance(*this, p);
}
/// Return distance between this and the given point
- float distance(const Point2d<T>& p)
+ float distance(const Point2d<T>& p) const
{
return sqrtf(squareDistance(p));
}
};
+/// Output operator
template <typename T> inline std::ostream&
operator<< (std::ostream& os, const Point2d<T>& p)
{
return os << "Point2d(" << p.x << "," << p.y << ")";
}
+/// Equality operator
+template <typename T> inline bool
+operator== (const Point2d<T>& p1, const Point2d<T>& p2)
+{
+ return p1.x == p2.x && p1.y == p2.y;
+}
+
+/// Inequality operator
+template <typename T> inline bool
+operator!= (const Point2d<T>& p1, const Point2d<T>& p2)
+{
+ return ! ( p1 == p2 );
+}
+
} // namespace gnash::geometry
+
+// for backward compatibility
+typedef geometry::Point2d<float> point;
+
} // namespace gnash
#endif // GNASH_POINT2DH
Index: server/button_character_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- server/button_character_instance.cpp 1 Nov 2007 21:54:45 -0000
1.63
+++ server/button_character_instance.cpp 10 Nov 2007 11:51:42 -0000
1.64
@@ -464,7 +464,7 @@
point sub_p;
rec.m_button_matrix.transform_by_inverse(&sub_p, p);
- if (rec.m_character_def->point_test_local(sub_p.m_x, sub_p.m_y))
+ if (rec.m_character_def->point_test_local(sub_p.x, sub_p.y))
{
// The mouse is inside the shape.
return this;
Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- server/character.cpp 9 Nov 2007 19:58:02 -0000 1.62
+++ server/character.cpp 10 Nov 2007 11:51:42 -0000 1.63
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: character.cpp,v 1.62 2007/11/09 19:58:02 strk Exp $ */
+/* $Id: character.cpp,v 1.63 2007/11/10 11:51:42 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -335,7 +335,7 @@
m.transform_by_inverse(&b, a);
- return as_value(TWIPS_TO_PIXELS(b.m_x));
+ return as_value(TWIPS_TO_PIXELS(b.x));
}
as_value
@@ -354,7 +354,7 @@
m.transform_by_inverse(&b, a);
- return as_value(TWIPS_TO_PIXELS(b.m_y));
+ return as_value(TWIPS_TO_PIXELS(b.y));
}
as_value
Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- server/character.h 9 Nov 2007 19:58:02 -0000 1.107
+++ server/character.h 10 Nov 2007 11:51:42 -0000 1.108
@@ -19,7 +19,7 @@
//
//
-/* $Id: character.h,v 1.107 2007/11/09 19:58:02 strk Exp $ */
+/* $Id: character.h,v 1.108 2007/11/10 11:51:42 strk Exp $ */
#ifndef GNASH_CHARACTER_H
#define GNASH_CHARACTER_H
@@ -54,6 +54,7 @@
class sprite_instance;
class movie_instance;
class ExecutableCode;
+ class action_buffer;
}
namespace gnash {
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -b -r1.129 -r1.130
--- server/edit_text_character.cpp 18 Oct 2007 18:54:33 -0000 1.129
+++ server/edit_text_character.cpp 10 Nov 2007 11:51:42 -0000 1.130
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: edit_text_character.cpp,v 1.129 2007/10/18 18:54:33 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.130 2007/11/10 11:51:42 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -496,10 +496,10 @@
float ymin = _bounds.getMinY();
float ymax = _bounds.getMaxY();
- coords[0].set(xmin, ymin); // = def_bounds.get_corner(0);
- coords[1].set(xmax, ymin); // = def_bounds.get_corner(1);
- coords[2].set(xmax, ymax); // = def_bounds.get_corner(2);
- coords[3].set(xmin, ymax); // = def_bounds.get_corner(3);
+ coords[0].setTo(xmin, ymin);
+ coords[1].setTo(xmax, ymin);
+ coords[2].setTo(xmax, ymax);
+ coords[3].setTo(xmin, ymax);
rgba borderColor = drawBorder ? getBorderColor() :
rgba(0,0,0,0);
rgba backgroundColor = drawBackground ? getBackgroundColor() :
rgba(0,0,0,0);
@@ -680,8 +680,8 @@
m.transform_by_inverse(&p, point(x, y));
//const rect& def_bounds = m_def->get_bounds();
- //if (def_bounds.point_test(p.m_x, p.m_y))
- if ( _bounds.contains(p.m_x, p.m_y) )
+ //if (def_bounds.point_test(p.x, p.y))
+ if ( _bounds.contains(p.x, p.y) )
{
return this;
}
@@ -1664,9 +1664,9 @@
matrix wm = get_world_matrix();
point lp(x, y);
wm.transform_by_inverse(lp);
- return _bounds.contains(lp.m_x, lp.m_y);
+ return _bounds.contains(lp.x, lp.y);
//const rect& def_bounds = m_def->get_bounds();
- //return def_bounds.point_test(lp.m_x, lp.m_y);
+ //return def_bounds.point_test(lp.x, lp.y);
}
bool
Index: server/fontlib.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/fontlib.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- server/fontlib.cpp 30 Oct 2007 18:55:42 -0000 1.35
+++ server/fontlib.cpp 10 Nov 2007 11:51:42 -0000 1.36
@@ -5,7 +5,7 @@
// A module to take care of all of gnash's loaded fonts.
-/* $Id: fontlib.cpp,v 1.35 2007/10/30 18:55:42 strk Exp $ */
+/* $Id: fontlib.cpp,v 1.36 2007/11/10 11:51:42 strk Exp $ */
#include "container.h"
#include "tu_file.h"
@@ -185,19 +185,19 @@
class pointi
{
public:
- int m_x, m_y;
+ int x, y;
pointi(int x = 0, int y = 0)
:
- m_x(x),
- m_y(y)
+ x(x),
+ y(y)
{
}
bool operator<(const pointi& p) const
// For sorting anchor points.
{
- return imin(m_x, m_y) < imin(p.m_x, p.m_y);
+ return imin(x, y) < imin(p.x, p.y);
}
};
// Candidates for upper-left corner of a new rectangle. Use
@@ -347,7 +347,7 @@
for (unsigned int i = 0; i < s_anchor_points.size(); i++)
{
const pointi& p = s_anchor_points[i];
- if (r.contains(p.m_x, p.m_y))
+ if (r.contains(p.x, p.y))
{
// Eliminate this point from consideration.
s_anchor_points.erase(s_anchor_points.begin() +
i);
@@ -402,7 +402,7 @@
for (int i = 0, n = s_anchor_points.size(); i < n; i++)
{
const pointi& p = s_anchor_points[i];
- recti r(p.m_x, p.m_x + width, p.m_y, p.m_y + height);
+ recti r(p.x, p.x + width, p.y, p.y + height);
// Is this spot any good?
if (is_rect_available(r))
@@ -716,9 +716,9 @@
tg = identical_tg;
// Use our own offset, in case it's different.
- tg.m_uv_origin.m_x = tg.m_uv_bounds.get_x_min()
+ tg.m_uv_origin.x = tg.m_uv_bounds.get_x_min()
+ rgi.m_offset_x /
GLYPH_CACHE_TEXTURE_SIZE;
- tg.m_uv_origin.m_y = tg.m_uv_bounds.get_y_min()
+ tg.m_uv_origin.y = tg.m_uv_bounds.get_y_min()
+ rgi.m_offset_y /
GLYPH_CACHE_TEXTURE_SIZE;
if (identical_tg.is_renderable())
@@ -850,8 +850,8 @@
// Fill out the glyph info.
texture_glyph tg;
- tg.m_uv_origin.m_x = (pack_x +
rgi.m_offset_x) / (GLYPH_CACHE_TEXTURE_SIZE);
- tg.m_uv_origin.m_y = (pack_y +
rgi.m_offset_y) / (GLYPH_CACHE_TEXTURE_SIZE);
+ tg.m_uv_origin.x = (pack_x +
rgi.m_offset_x) / (GLYPH_CACHE_TEXTURE_SIZE);
+ tg.m_uv_origin.y = (pack_y +
rgi.m_offset_y) / (GLYPH_CACHE_TEXTURE_SIZE);
tg.m_uv_bounds.enclose_point(
float(pack_x) /
(GLYPH_CACHE_TEXTURE_SIZE),
float(pack_y) /
(GLYPH_CACHE_TEXTURE_SIZE)
@@ -1094,8 +1094,8 @@
out->write_float32(tg.m_uv_bounds.get_y_min());
out->write_float32(tg.m_uv_bounds.get_x_max());
out->write_float32(tg.m_uv_bounds.get_y_max());
- out->write_float32(tg.m_uv_origin.m_x);
- out->write_float32(tg.m_uv_origin.m_y);
+ out->write_float32(tg.m_uv_origin.x);
+ out->write_float32(tg.m_uv_origin.y);
n++;
}
}
@@ -1228,8 +1228,8 @@
float ymax = in->read_float32();
tg.m_uv_bounds.enclose_point(xmin, ymin);
tg.m_uv_bounds.expand_to_point(xmax, ymax);
- tg.m_uv_origin.m_x = in->read_float32();
- tg.m_uv_origin.m_y = in->read_float32();
+ tg.m_uv_origin.x = in->read_float32();
+ tg.m_uv_origin.y = in->read_float32();
if (glyph_index < 0 || glyph_index >=
fnt->getEmbedGlyphCount())
{
@@ -1338,8 +1338,8 @@
return;
}
- bounds.shift_x (-tg.m_uv_origin.m_x);
- bounds.shift_y (-tg.m_uv_origin.m_y);
+ bounds.shift_x (-tg.m_uv_origin.x);
+ bounds.shift_y (-tg.m_uv_origin.y);
// Scale from uv coords to the 1024x1024 glyph square.
// @@ need to factor this out!
Index: server/fontlib.h
===================================================================
RCS file: /sources/gnash/gnash/server/fontlib.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/fontlib.h 10 Sep 2007 16:53:29 -0000 1.9
+++ server/fontlib.h 10 Nov 2007 11:51:43 -0000 1.10
@@ -28,6 +28,8 @@
namespace gnash {
class movie_def_impl;
class texture_glyph;
+ class matrix;
+ class font;
}
namespace gnash {
Index: server/generic_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/generic_character.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/generic_character.cpp 30 Oct 2007 18:55:42 -0000 1.9
+++ server/generic_character.cpp 10 Nov 2007 11:51:43 -0000 1.10
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: generic_character.cpp,v 1.9 2007/10/30 18:55:42 strk Exp $ */
+/* $Id: generic_character.cpp,v 1.10 2007/11/10 11:51:43 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -55,7 +55,7 @@
matrix wm = get_world_matrix();
point lp(x, y);
wm.transform_by_inverse(lp);
- return m_def->point_test_local(lp.m_x, lp.m_y);
+ return m_def->point_test_local(lp.x, lp.y);
}
} // namespace gnash
Index: server/gnash.h
===================================================================
RCS file: /sources/gnash/gnash/server/gnash.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- server/gnash.h 2 Nov 2007 20:18:35 -0000 1.110
+++ server/gnash.h 10 Nov 2007 11:51:43 -0000 1.111
@@ -34,7 +34,6 @@
#include <cstdarg> // for va_list arg to sprite_instance::call_method_args()
#include <string> // for movie_definition*
create_movie(std::auto_ptr<tu_file> in, const std::string& url);
-#include "as_value.h" // FIXME: for as_c_function_ptr typedef
(register_component)
// FIXME: The local usage of these constants should probably be renamed in this
// file because they conflict with definitions in the system header files.
Luckily
@@ -43,10 +42,6 @@
#undef INVALID
#undef ESCAPE
-class tu_file;
-class render_handler;
-class weak_proxy; // forward decl; defined in base/smart_ptr.h
-
// @@ forward decl to avoid including base/image.h; TODO change the
// render_handler interface to not depend on these classes at all.
namespace image { class image_base; class rgb; class rgba; }
@@ -54,23 +49,17 @@
// forward decl
namespace jpeg { class input; }
+class tu_file; // for file_opener_callback typedef
+
namespace gnash {
+
// Forward declarations.
-class action_buffer;
-class as_value;
-class execute_tag;
-class font;
-class matrix;
-class movie;
-class sprite_instance;
-class movie_definition;
-class render_handler;
-class resource;
-class rgba;
-class sound_handler;
-class stream;
-class URL;
-class rect;
+class sprite_instance; // for fscommand_callback typedef
+class movie_definition; // for create_movie
+class render_handler; // for set_render_handler
+class sound_handler; // for set_sound_handler
+class URL; // for set_base_url
+
// Sound callbacks stuff
@@ -142,6 +131,9 @@
/// calls this function..
///
///
+class as_value; // for the following typedef
+class fn_call; // for the following typedef
+typedef as_value (*as_c_function_ptr)(const fn_call& fn); // original typedef
is in as_value.h ...
void register_component(const std::string& name, as_c_function_ptr handler);
/// Use this to control how finely curves are subdivided. 1.0
@@ -156,8 +148,6 @@
DSOEXPORT render_handler* create_render_handler_ogl(bool init = true);
//DSOEXPORT render_handler* create_render_handler_cairo(void* cairohandle);
-class font;
-
/// For caching precomputed stuff. Generally of
/// interest to gnash_processor and programs like it.
class cache_options
@@ -346,60 +336,6 @@
///
DSOEXPORT void clear();
-
-//
-// point: used by rect which is used by render_handler (otherwise would be in
internal gnash_types.h)
-//
-
-
-/// Point class
-//
-/// TODO: move in libgeometry/point2d.{cpp,h}, provide a gnash::point2d typedef
-/// TODO: make m_x and m_y members private ? (or rename to x,y)
-/// TODO: provide a toString() and an output operator
-///
-class DSOLOCAL point
-{
-public:
- float m_x, m_y;
-
- /// Construct a point with X and Y values set to 0
- point() : m_x(0), m_y(0) {}
-
- /// Construct a point with X and Y values set to the given values
- point(float x, float y) : m_x(x), m_y(y) {}
-
- /// Set X and Y values of the point
- void set(float x, float y)
- {
- m_x = x;
- m_y = y;
- }
-
- /// Set to a + (b - a) * t
- void set_lerp(const point& a, const point& b, float t)
- {
- m_x = a.m_x + (b.m_x - a.m_x) * t;
- m_y = a.m_y + (b.m_y - a.m_y) * t;
- }
-
- /// Compare two points for 2d equality
- bool operator==(const point& p) const { return m_x == p.m_x && m_y ==
p.m_y; }
-
- /// Return the square of the distance between this and other point.
- float squareDistance(const point& other) const;
-
- /// Return the distance between this and other point.
- float distance(const point& other) const;
-
- /// Compare two points for bitwise equality
- //
- /// TODO: (should this really be different by normal equality?)
- ///
- bool bitwise_equal(const point& p) const;
-};
-
-
//
// texture and render callback handler.
//
Index: server/impl.h
===================================================================
RCS file: /sources/gnash/gnash/server/impl.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- server/impl.h 1 Jul 2007 10:54:23 -0000 1.47
+++ server/impl.h 10 Nov 2007 11:51:43 -0000 1.48
@@ -19,7 +19,7 @@
//
//
-/* $Id: impl.h,v 1.47 2007/07/01 10:54:23 bjacques Exp $ */
+/* $Id: impl.h,v 1.48 2007/11/10 11:51:43 strk Exp $ */
#ifndef GNASH_IMPL_H
#define GNASH_IMPL_H
@@ -31,13 +31,13 @@
#include "tu_config.h"
#include "gnash.h"
-#include "cxform.h" // for composition of display_info
+//#include "cxform.h" // for composition of display_info
+//#include "matrix.h" // for display_info composition
#include "types.h"
#include "container.h"
#include "utility.h"
#include "smart_ptr.h"
#include "swf/TagLoadersTable.h"
-#include "matrix.h" // for display_info composition
#include <cstdarg>
#include <cassert>
@@ -50,7 +50,6 @@
class bitmap_info;
class character;
class character_def;
-class display_info;
class font;
class movie_root;
class stream;
@@ -68,6 +67,7 @@
DSOEXPORT const char* get_workdir();
DSOEXPORT void set_workdir(const char* dir);
+#if 0
// Information about how to display a character.
class display_info
{
@@ -99,6 +99,7 @@
m_clip_depth = di.m_clip_depth;
}
};
+#endif
//
Index: server/matrix.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- server/matrix.cpp 30 Oct 2007 18:55:42 -0000 1.19
+++ server/matrix.cpp 10 Nov 2007 11:51:43 -0000 1.20
@@ -19,7 +19,7 @@
//
// Original author: Thatcher Ulrich <address@hidden> 2003
//
-// $Id: matrix.cpp,v 1.19 2007/10/30 18:55:42 strk Exp $
+// $Id: matrix.cpp,v 1.20 2007/11/10 11:51:43 strk Exp $
//
#ifdef HAVE_CONFIG_H
@@ -254,15 +254,15 @@
{
assert(result);
- result->m_x = m_[0][0] * p.m_x + m_[0][1] * p.m_y + m_[0][2];
- result->m_y = m_[1][0] * p.m_x + m_[1][1] * p.m_y + m_[1][2];
+ result->x = m_[0][0] * p.x + m_[0][1] * p.y + m_[0][2];
+ result->y = m_[1][0] * p.x + m_[1][1] * p.y + m_[1][2];
}
void
matrix::transform(point& p) const
// Transform point 'p' by our matrix.
{
- transform(p.m_x, p.m_y);
+ transform(p.x, p.y);
}
void
@@ -295,10 +295,10 @@
transform(p2);
transform(p3);
- r.setTo(p0.m_x, p0.m_y);
- r.expandTo(p1.m_x, p1.m_y);
- r.expandTo(p2.m_x, p2.m_y);
- r.expandTo(p3.m_x, p3.m_y);
+ r.setTo(p0.x, p0.y);
+ r.expandTo(p1.x, p1.y);
+ r.expandTo(p2.x, p2.y);
+ r.expandTo(p3.x, p3.y);
}
void
@@ -308,8 +308,8 @@
{
assert(result);
- result->m_x = m_[0][0] * v.m_x + m_[0][1] * v.m_y;
- result->m_y = m_[1][0] * v.m_x + m_[1][1] * v.m_y;
+ result->x = m_[0][0] * v.x + m_[0][1] * v.y;
+ result->y = m_[1][0] * v.x + m_[1][1] * v.y;
}
void
Index: server/matrix.h
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/matrix.h 1 Jul 2007 10:54:23 -0000 1.11
+++ server/matrix.h 10 Nov 2007 11:51:43 -0000 1.12
@@ -19,7 +19,7 @@
//
// Original author: Thatcher Ulrich <address@hidden> 2003
//
-// $Id: matrix.h,v 1.11 2007/07/01 10:54:23 bjacques Exp $
+// $Id: matrix.h,v 1.12 2007/11/10 11:51:43 strk Exp $
//
#ifndef GNASH_MATRIX_H
@@ -31,12 +31,12 @@
#include "tu_config.h" // for DSOEXPORT
#include "Range2d.h" // for transforming Range2d<float>
+#include "Point2d.h" // for transforming Point2d<float> (typedefe'd to point)
#include <iosfwd>
// Forward declarations
namespace gnash {
- class point;
class stream;
}
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- server/movie_root.cpp 9 Nov 2007 19:58:03 -0000 1.120
+++ server/movie_root.cpp 10 Nov 2007 11:51:43 -0000 1.121
@@ -678,8 +678,8 @@
point world_mouse(PIXELS_TO_TWIPS(x), PIXELS_TO_TWIPS(y));
// Compute offset
- int xoffset = world_mouse.m_x - world_origin.m_x;
- int yoffset = world_mouse.m_y - world_origin.m_y;
+ int xoffset = world_mouse.x - world_origin.x;
+ int yoffset = world_mouse.y - world_origin.y;
m_drag_state.setOffset(xoffset, yoffset);
}
@@ -704,8 +704,8 @@
if (! m_drag_state.isLockCentered())
{
- world_mouse.m_x -= m_drag_state.xOffset();
- world_mouse.m_y -= m_drag_state.yOffset();
+ world_mouse.x -= m_drag_state.xOffset();
+ world_mouse.y -= m_drag_state.yOffset();
}
matrix parent_world_mat;
@@ -721,7 +721,7 @@
// Place our origin so that it coincides with the mouse coords
// in our parent frame.
matrix local = dragChar->get_matrix();
- local.set_translation( parent_mouse.m_x, parent_mouse.m_y );
+ local.set_translation( parent_mouse.x, parent_mouse.y );
dragChar->set_matrix(local);
}
Index: server/rect.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/rect.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- server/rect.cpp 7 Aug 2007 20:53:10 -0000 1.13
+++ server/rect.cpp 10 Nov 2007 11:51:43 -0000 1.14
@@ -95,10 +95,10 @@
m.transform(&p2, r.get_corner(2));
m.transform(&p3, r.get_corner(3));
- enclose_point(p0.m_x, p0.m_y);
- expand_to_point(p1.m_x, p1.m_y);
- expand_to_point(p2.m_x, p2.m_y);
- expand_to_point(p3.m_x, p3.m_y);
+ enclose_point(p0.x, p0.y);
+ expand_to_point(p1.x, p1.y);
+ expand_to_point(p2.x, p2.y);
+ expand_to_point(p3.x, p3.y);
}
void rect::expand_to_rect(const rect& r)
@@ -128,10 +128,10 @@
// TODO: check for numeric overflow ?
- _range.expandTo(p0.m_x, p0.m_y);
- _range.expandTo(p1.m_x, p1.m_y);
- _range.expandTo(p2.m_x, p2.m_y);
- _range.expandTo(p3.m_x, p3.m_y);
+ _range.expandTo(p0.x, p0.y);
+ _range.expandTo(p1.x, p1.y);
+ _range.expandTo(p2.x, p2.y);
+ _range.expandTo(p3.x, p3.y);
}
@@ -163,8 +163,8 @@
// nothing to do, point is surely inside
if ( _range.isWorld() ) return;
- p.m_x = fclamp(p.m_x, _range.getMinX(), _range.getMaxX());
- p.m_y = fclamp(p.m_y, _range.getMinY(), _range.getMaxY());
+ p.x = fclamp(p.x, _range.getMinX(), _range.getMaxX());
+ p.y = fclamp(p.y, _range.getMinY(), _range.getMaxY());
}
std::string
Index: server/rect.h
===================================================================
RCS file: /sources/gnash/gnash/server/rect.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/rect.h 1 Jul 2007 10:54:24 -0000 1.21
+++ server/rect.h 10 Nov 2007 11:51:43 -0000 1.22
@@ -18,7 +18,7 @@
//
//
-/* $Id: rect.h,v 1.21 2007/07/01 10:54:24 bjacques Exp $ */
+/* $Id: rect.h,v 1.22 2007/11/10 11:51:43 strk Exp $ */
#ifndef GNASH_RECT_H
#define GNASH_RECT_H
@@ -30,6 +30,7 @@
#include "tu_config.h"
#include "Range2d.h"
+#include "Point2d.h"
#include <cassert> // for inlines
#include <iostream> // for output operator
@@ -38,7 +39,6 @@
namespace gnash {
class matrix;
class stream;
- class point; // is a forward declaration enough for a return type ?
}
namespace gnash {
Index: server/render.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/render.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- server/render.cpp 30 Oct 2007 18:55:42 -0000 1.18
+++ server/render.cpp 10 Nov 2007 11:51:43 -0000 1.19
@@ -90,8 +90,8 @@
if (s_render_handler) {
s_render_handler->get_scale(scale);
} else {
- scale.m_x = 1.0;
- scale.m_y = 1.0;
+ scale.x = 1.0;
+ scale.y = 1.0;
}
}
Index: server/shape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/shape.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- server/shape.cpp 9 Nov 2007 21:27:49 -0000 1.44
+++ server/shape.cpp 10 Nov 2007 11:51:43 -0000 1.45
@@ -79,14 +79,14 @@
float
edge::squareDistancePtSeg(const point& p, const point& A, const point& B)
{
- float dx = B.m_x - A.m_x;
- float dy = B.m_y - A.m_y;
+ float dx = B.x - A.x;
+ float dy = B.y - A.y;
/* if start==end, then use pt distance */
if ( dx == 0 && dy == 0 ) return p.squareDistance(A);
- float pdx = p.m_x - A.m_x;
- float pdy = p.m_y - A.m_y;
+ float pdx = p.x - A.x;
+ float pdy = p.y - A.y;
float u = (pdx * dx + pdy * dy) / (dx*dx + dy*dy);
@@ -103,10 +103,10 @@
}
point px;
- px.m_x = A.m_x + u * (B.m_x - A.m_x);
- px.m_y = A.m_y + u * (B.m_y - A.m_y);
+ px.x = A.x + u * (B.x - A.x);
+ px.y = A.y + u * (B.y - A.y);
- //cout << "R was between 0 and 1, u is " << u << " px : " << px.m_x <<
"," << px.m_y << endl;
+ //cout << "R was between 0 and 1, u is " << u << " px : " << px.x <<
"," << px.y << endl;
return p.squareDistance(px);
}
@@ -442,8 +442,8 @@
// convert to ints.
for (int i = 0; i < count; i++) {
- m_triangle_strip[i * 2] = int16_t(pts[i].m_x);
- m_triangle_strip[i * 2 + 1] = int16_t(pts[i].m_y);
+ m_triangle_strip[i * 2] = int16_t(pts[i].x);
+ m_triangle_strip[i * 2 + 1] = int16_t(pts[i].y);
}
// m_triangle_strip.resize(count);
@@ -494,8 +494,8 @@
// convert to ints.
for (int i = 0; i < coord_count; i++) {
- m_coords[i * 2] = int16_t(coords[i].m_x);
- m_coords[i * 2 + 1] = int16_t(coords[i].m_y);
+ m_coords[i * 2] = int16_t(coords[i].x);
+ m_coords[i * 2 + 1] = int16_t(coords[i].y);
}
}
@@ -540,7 +540,7 @@
{
// See if we can attach this mini-strip to an existing strip.
- if (l0.bitwise_equal(r0) == false) {
+ if (l0 != r0) {
// Check the next strip first; trapezoids will
// tend to arrive in rotating order through
// the active strips.
@@ -551,7 +551,7 @@
assert(str.size() >= 3); // should have at least one tri
already.
int last = str.size() - 1;
- if (str[last - 1].bitwise_equal(l0) &&
str[last].bitwise_equal(r0))
+ if (str[last - 1] == l0 && str[last] == r0)
{
// Can join these tris to this strip.
str.push_back(l1);
@@ -565,7 +565,7 @@
assert(str.size() >= 3); // should have at least one tri
already.
int last = str.size() - 1;
- if (str[last - 1].bitwise_equal(l0) &&
str[last].bitwise_equal(r0)) {
+ if (str[last - 1] == l0 && str[last] == r0) {
// Can join these tris to this strip.
str.push_back(l1);
str.push_back(r1);
Index: server/shape.h
===================================================================
RCS file: /sources/gnash/gnash/server/shape.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/shape.h 7 Nov 2007 12:08:16 -0000 1.29
+++ server/shape.h 10 Nov 2007 11:51:43 -0000 1.30
@@ -5,7 +5,7 @@
// Quadratic bezier outline shapes, the basis for most SWF rendering.
-/* $Id: shape.h,v 1.29 2007/11/07 12:08:16 strk Exp $ */
+/* $Id: shape.h,v 1.30 2007/11/10 11:51:43 strk Exp $ */
#ifndef GNASH_SHAPE_H
#define GNASH_SHAPE_H
@@ -16,6 +16,7 @@
// Forward declarations
namespace gnash {
+ class rect; // for path::expandBounds
namespace tesselate {
class tesselating_shape;
}
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.378
retrieving revision 1.379
diff -u -b -r1.378 -r1.379
--- server/sprite_instance.cpp 9 Nov 2007 21:43:43 -0000 1.378
+++ server/sprite_instance.cpp 10 Nov 2007 11:51:43 -0000 1.379
@@ -987,8 +987,8 @@
matrix world_mat = sprite->get_world_matrix();
world_mat.transform_by_inverse(pt);
- obj->set_member(NSV::PROP_X, TWIPS_TO_PIXELS(round(pt.m_x)));
- obj->set_member(NSV::PROP_Y, TWIPS_TO_PIXELS(round(pt.m_y)));
+ obj->set_member(NSV::PROP_X, TWIPS_TO_PIXELS(round(pt.x)));
+ obj->set_member(NSV::PROP_Y, TWIPS_TO_PIXELS(round(pt.y)));
return ret;
}
@@ -1049,8 +1049,8 @@
matrix world_mat = sprite->get_world_matrix();
world_mat.transform(pt);
- obj->set_member(NSV::PROP_X, TWIPS_TO_PIXELS(round(pt.m_x)));
- obj->set_member(NSV::PROP_Y, TWIPS_TO_PIXELS(round(pt.m_y)));
+ obj->set_member(NSV::PROP_X, TWIPS_TO_PIXELS(round(pt.x)));
+ obj->set_member(NSV::PROP_Y, TWIPS_TO_PIXELS(round(pt.y)));
return ret;
@@ -3105,7 +3105,7 @@
matrix parent_world_matrix = parent ?
parent->get_world_matrix() : matrix::identity;
point wp(x,y);
parent_world_matrix.transform(wp);
- if ( pointInVisibleShape(wp.m_x, wp.m_y) ) return this;
+ if ( pointInVisibleShape(wp.x, wp.y) ) return this;
else return NULL;
}
@@ -3114,12 +3114,12 @@
point p;
m.transform_by_inverse(&p, point(x, y));
- MouseEntityFinder finder(p.m_x, p.m_y);
+ MouseEntityFinder finder(p.x, p.y);
m_display_list.visitBackward(finder);
character* ch = finder.getEntity();
if ( ! ch )
{
- ch = _drawable_inst->get_topmost_mouse_entity(p.m_x, p.m_y);
+ ch = _drawable_inst->get_topmost_mouse_entity(p.x, p.y);
}
return ch; // might be NULL
Index: server/tesselate.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/tesselate.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/tesselate.cpp 30 Oct 2007 18:55:43 -0000 1.14
+++ server/tesselate.cpp 10 Nov 2007 11:51:43 -0000 1.15
@@ -71,17 +71,19 @@
// rationally deals with self-intersection by just overlapping parts
// of the tesselated poly.
-/* $Id: tesselate.cpp,v 1.14 2007/10/30 18:55:43 strk Exp $ */
+/* $Id: tesselate.cpp,v 1.15 2007/11/10 11:51:43 strk Exp $ */
#include "tesselate.h"
#include "types.h"
#include "utility.h"
#include "container.h"
+#include "Point2d.h"
#include <vector>
namespace gnash {
namespace tesselate {
+
// Curve subdivision error tolerance.
static float s_tolerance = 1.0f;
static trapezoid_accepter* s_accepter = NULL;
@@ -115,7 +117,7 @@
// For rasterization, we want to ensure that
// the segment always points towards positive
// y...
- if (m_begin.m_y > m_end.m_y)
+ if (m_begin.y > m_end.y)
{
flip();
}
@@ -133,9 +135,9 @@
float get_height() const
// Return segment height.
{
- assert(m_end.m_y >= m_begin.m_y);
+ assert(m_end.y >= m_begin.y);
- return m_end.m_y - m_begin.m_y;
+ return m_end.y - m_begin.y;
}
};
@@ -186,13 +188,13 @@
static int compare_segment_y(const void* a, const void* b)
- // For sorting segments by m_begin.m_y, and then by height.
+ // For sorting segments by m_begin.y, and then by height.
{
const fill_segment* A = (const fill_segment*) a;
const fill_segment* B = (const fill_segment*) b;
- const float ay0 = A->m_begin.m_y;
- const float by0 = B->m_begin.m_y;
+ const float ay0 = A->m_begin.y;
+ const float by0 = B->m_begin.y;
if (ay0 < by0)
{
@@ -224,13 +226,13 @@
static int compare_segment_x(const void* a, const void* b)
- // For sorting segments by m_begin.m_x, and then by m_end.m_x.
+ // For sorting segments by m_begin.x, and then by m_end.y.
{
const fill_segment* A = (const fill_segment*) a;
const fill_segment* B = (const fill_segment*) b;
- const float ax0 = A->m_begin.m_x;
- const float bx0 = B->m_begin.m_x;
+ const float ax0 = A->m_begin.x;
+ const float bx0 = B->m_begin.x;
if (ax0 < bx0)
{
@@ -238,8 +240,8 @@
}
else if (ax0 == bx0)
{
- const float ax1 = A->m_end.m_x;
- const float bx1 = B->m_end.m_x;
+ const float ax1 = A->m_end.y;
+ const float bx1 = B->m_end.y;
if (ax1 < bx1)
{
@@ -280,12 +282,12 @@
unsigned int base = 0;
while (base < s_current_segments.size())
{
- float ytop =
s_current_segments[base].m_begin.m_y;
+ float ytop =
s_current_segments[base].m_begin.y;
unsigned int next_base = base + 1;
for (;;)
{
if (next_base ==
s_current_segments.size()
- ||
s_current_segments[next_base].m_begin.m_y > ytop)
+ ||
s_current_segments[next_base].m_begin.y > ytop)
{
break;
}
@@ -301,24 +303,24 @@
// s_current_segments[base] through
s_current_segments[next_base - 1] is all the segs that start at ytop
if (next_base >= s_current_segments.size()
- || s_current_segments[base].m_end.m_y <=
s_current_segments[next_base].m_begin.m_y)
+ || s_current_segments[base].m_end.y <=
s_current_segments[next_base].m_begin.y)
{
// No segments start between ytop and
- // [base].m_end.m_y, so we can peel
+ // [base].m_end.y, so we can peel
// off that whole interval and render
// it right away.
- float ybottom =
s_current_segments[base].m_end.m_y;
+ float ybottom =
s_current_segments[base].m_end.y;
peel_off_and_emit(base, next_base,
ytop, ybottom);
while (base < s_current_segments.size()
- &&
s_current_segments[base].m_end.m_y <= ybottom)
+ &&
s_current_segments[base].m_end.y <= ybottom)
{
base++;
}
}
else
{
- float ybottom =
s_current_segments[next_base].m_begin.m_y;
+ float ybottom =
s_current_segments[next_base].m_begin.y;
assert(ybottom > ytop);
peel_off_and_emit(base, next_base,
ytop, ybottom);
@@ -349,18 +351,18 @@
for (int i = i0; i < i1; i++)
{
fill_segment* f = &s_current_segments[i];
- assert(f->m_begin.m_y == y0);
- assert(f->m_end.m_y >= y1);
+ assert(f->m_begin.y == y0);
+ assert(f->m_end.y >= y1);
- float dy = f->m_end.m_y - f->m_begin.m_y;
+ float dy = f->m_end.y - f->m_begin.y;
float t = 1.0f;
if (dy > 0)
{
- t = (y1 - f->m_begin.m_y) / dy;
+ t = (y1 - f->m_begin.y) / dy;
}
point intersection;
- intersection.m_y = y1;
- intersection.m_x = f->m_begin.m_x + (f->m_end.m_x -
f->m_begin.m_x) * t;
+ intersection.y = y1;
+ intersection.x = f->m_begin.x + (f->m_end.y -
f->m_begin.x) * t;
// Peel off.
slab.push_back(*f);
@@ -384,12 +386,12 @@
if (slab[i].m_right_style >= 0)
{
trapezoid tr;
- tr.m_y0 = slab[i].m_begin.m_y;
- tr.m_y1 = slab[i].m_end.m_y;
- tr.m_lx0 = slab[i].m_begin.m_x;
- tr.m_lx1 = slab[i].m_end.m_x;
- tr.m_rx0 = slab[i + 1].m_begin.m_x;
- tr.m_rx1 = slab[i + 1].m_end.m_x;
+ tr.m_y0 = slab[i].m_begin.y;
+ tr.m_y1 = slab[i].m_end.y;
+ tr.m_lx0 = slab[i].m_begin.x;
+ tr.m_lx1 = slab[i].m_end.y;
+ tr.m_rx0 = slab[i + 1].m_begin.x;
+ tr.m_rx1 = slab[i + 1].m_end.y;
s_accepter->accept_trapezoid(slab[i].m_right_style, tr);
}
}
@@ -401,12 +403,12 @@
if (slab[i].m_left_style >= 0)
{
trapezoid tr;
- tr.m_y0 = slab[i].m_begin.m_y;
- tr.m_y1 = slab[i].m_end.m_y;
- tr.m_lx0 = slab[i].m_begin.m_x;
- tr.m_lx1 = slab[i].m_end.m_x;
- tr.m_rx0 = slab[i + 1].m_begin.m_x;
- tr.m_rx1 = slab[i + 1].m_end.m_x;
+ tr.m_y0 = slab[i].m_begin.y;
+ tr.m_y1 = slab[i].m_end.y;
+ tr.m_lx0 = slab[i].m_begin.x;
+ tr.m_lx1 = slab[i].m_end.y;
+ tr.m_rx0 = slab[i + 1].m_begin.x;
+ tr.m_rx1 = slab[i + 1].m_end.y;
s_accepter->accept_trapezoid(slab[i].m_left_style, tr);
}
}
@@ -437,8 +439,8 @@
s_current_right_style = style_right;
s_current_line_style = line_style;
- s_last_point.m_x = ax;
- s_last_point.m_y = ay;
+ s_last_point.x = ax;
+ s_last_point.y = ay;
assert(s_current_path.size() == 0);
s_current_path.resize(0);
@@ -528,7 +530,7 @@
// as the control point in between.
{
// Subdivide, and add line segments...
- curve(s_last_point.m_x, s_last_point.m_y, cx, cy, ax, ay);
+ curve(s_last_point.x, s_last_point.y, cx, cy, ax, ay);
}
Index: server/tesselate.h
===================================================================
RCS file: /sources/gnash/gnash/server/tesselate.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/tesselate.h 26 Aug 2006 17:58:24 -0000 1.5
+++ server/tesselate.h 10 Nov 2007 11:51:43 -0000 1.6
@@ -13,6 +13,7 @@
#include "gnash.h"
#include "types.h"
+#include "Point2d.h" // for point
namespace gnash {
Index: server/types.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/types.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/types.cpp 7 Aug 2007 20:53:10 -0000 1.25
+++ server/types.cpp 10 Nov 2007 11:51:43 -0000 1.26
@@ -25,34 +25,6 @@
namespace gnash {
//
- // point
- //
-
-
- bool point::bitwise_equal(const point& p) const
- // Bitwise comparison; return true if *this is bitwise
- // identical to p.
- {
- return memcmp(this, &p, sizeof(p)) == 0;
- }
-
- float point::squareDistance(const point& other) const
- {
- float hside = other.m_x - m_x;
- float vside = other.m_y - m_y;
-
- return hside*hside + vside*vside;
- }
-
- float point::distance(const point& other) const
- {
- float sd = squareDistance(other);
- if ( ! sd ) return sd;
- else return sqrt(squareDistance(other));
- }
-
-
- //
// rgba
//
Index: server/parser/movie_definition.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_definition.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/parser/movie_definition.h 6 Oct 2007 09:06:28 -0000 1.32
+++ server/parser/movie_definition.h 10 Nov 2007 11:51:44 -0000 1.33
@@ -65,6 +65,7 @@
class bitmap_info;
class movie_instance;
class sprite_instance;
+ class execute_tag;
}
namespace gnash
Index: server/parser/shape_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- server/parser/shape_character_def.cpp 8 Nov 2007 17:16:12 -0000
1.46
+++ server/parser/shape_character_def.cpp 10 Nov 2007 11:51:44 -0000
1.47
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: shape_character_def.cpp,v 1.46 2007/11/08 17:16:12 udog Exp $ */
+/* $Id: shape_character_def.cpp,v 1.47 2007/11/10 11:51:44 strk Exp $ */
// Based on the public domain shape.cpp of Thatcher Ulrich <address@hidden>
2003
@@ -541,19 +541,19 @@
static void point_normalize(point* p)
{
- float mag2 = p->m_x * p->m_x + p->m_y * p->m_y;
+ float mag2 = p->x * p->x + p->y * p->y;
if (mag2 < 1e-9f) {
// Very short vector.
// @@ log error
// Arbitrary unit vector.
- p->m_x = 1;
- p->m_y = 0;
+ p->x = 1;
+ p->y = 0;
}
float inv_mag = 1.0f / sqrtf(mag2);
- p->m_x *= inv_mag;
- p->m_y *= inv_mag;
+ p->x *= inv_mag;
+ p->y *= inv_mag;
}
@@ -562,8 +562,8 @@
// We're inside a glBegin(GL_LINES)
// Eh, let's do it in binary, least sig four bits...
- float x = p.m_x;
- float y = p.m_y;
+ float x = p.x;
+ float y = p.y;
int mask = 8;
while (mask) {
@@ -625,13 +625,13 @@
glBegin(GL_LINE_STRIP);
mat.transform(&pt, point(p.m_ax, p.m_ay));
- glVertex2f(pt.m_x, pt.m_y);
+ glVertex2f(pt.x, pt.y);
for (unsigned int j = 0; j < p.m_edges.size(); j++) {
mat.transform(&pt, point(p.m_edges[j].m_cx, p.m_edges[j].m_cy));
- glVertex2f(pt.m_x, pt.m_y);
+ glVertex2f(pt.x, pt.y);
mat.transform(&pt, point(p.m_edges[j].m_ax, p.m_edges[j].m_ay));
- glVertex2f(pt.m_x, pt.m_y);
+ glVertex2f(pt.x, pt.y);
}
glEnd();
@@ -643,33 +643,33 @@
{
mat.transform(&p0, point(p.m_edges[j].m_cx, p.m_edges[j].m_cy));
mat.transform(&p1, point(p.m_edges[j].m_ax, p.m_edges[j].m_ay));
- dir = point(p1.m_x - p0.m_x, p1.m_y - p0.m_y);
+ dir = point(p1.x - p0.x, p1.y - p0.y);
point_normalize(&dir);
- right = point(-dir.m_y, dir.m_x); // perpendicular
+ right = point(-dir.y, dir.x); // perpendicular
const float ARROW_MAG = 60.f; // TWIPS?
if (p.getLeftFill() != 0)
{
glColor4f(0, 1, 0, 0.5);
- glVertex2f(p0.m_x,
- p0.m_y);
- glVertex2f(p0.m_x - dir.m_x * ARROW_MAG - right.m_x * ARROW_MAG,
- p0.m_y - dir.m_y * ARROW_MAG - right.m_y * ARROW_MAG);
+ glVertex2f(p0.x,
+ p0.y);
+ glVertex2f(p0.x - dir.x * ARROW_MAG - right.x * ARROW_MAG,
+ p0.y - dir.y * ARROW_MAG - right.y * ARROW_MAG);
- show_fill_number(point(p0.m_x - right.m_x * ARROW_MAG * 4,
- p0.m_y - right.m_y * ARROW_MAG * 4),
+ show_fill_number(point(p0.x - right.x * ARROW_MAG * 4,
+ p0.y - right.y * ARROW_MAG * 4),
p.getLeftFill());
}
if (p.getRightFill() != 0)
{
glColor4f(1, 0, 0, 0.5);
- glVertex2f(p0.m_x,
- p0.m_y);
- glVertex2f(p0.m_x - dir.m_x * ARROW_MAG + right.m_x * ARROW_MAG,
- p0.m_y - dir.m_y * ARROW_MAG + right.m_y * ARROW_MAG);
+ glVertex2f(p0.x,
+ p0.y);
+ glVertex2f(p0.x - dir.x * ARROW_MAG + right.x * ARROW_MAG,
+ p0.y - dir.y * ARROW_MAG + right.y * ARROW_MAG);
- show_fill_number(point(p0.m_x + right.m_x * ARROW_MAG * 4,
- p0.m_y + right.m_y * ARROW_MAG * 4),
+ show_fill_number(point(p0.x + right.x * ARROW_MAG * 4,
+ p0.y + right.y * ARROW_MAG * 4),
p.getRightFill());
}
}}
Index: testsuite/server/PointTest.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/server/PointTest.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/server/PointTest.cpp 1 Jul 2007 10:55:13 -0000 1.3
+++ testsuite/server/PointTest.cpp 10 Nov 2007 11:51:44 -0000 1.4
@@ -19,12 +19,13 @@
#include "config.h"
#endif
-#include "gnash.h" // for point !!
#include <iostream>
#include <sstream>
#include <cassert>
+#include <cmath>
#include "check.h"
+#include "Point2d.h" // this is really a point2d test...
using namespace std;
using namespace gnash;
@@ -59,6 +60,8 @@
main(int /*argc*/, char** /*argv*/)
{
+ typedef geometry::Point2d<float> point;
+
point p0(0, 0);
//