|
From: <at...@us...> - 2007-10-27 01:19:22
|
Revision: 517
http://cadcdev.svn.sourceforge.net/cadcdev/?rev=517&view=rev
Author: atani
Date: 2007-10-26 18:19:20 -0700 (Fri, 26 Oct 2007)
Log Message:
-----------
* removed plxcompat
* removed TikiTest, will replace with new version soon
* set svn:ignore on various directories
Modified Paths:
--------------
tiki/dc/Makefile
tiki/dc/src/init_shutdown.cpp
tiki/dc/src/platgl.cpp
tiki/examples/Makefile
tiki/examples/console/TikiSnake/src/snake.cpp
tiki/examples/nehe/lesson02/src/main.cpp
tiki/examples/nehe/lesson03/src/main.cpp
tiki/examples/nehe/lesson04/src/main.cpp
tiki/examples/nehe/lesson05/src/main.cpp
tiki/examples/net/httpclient/src/main.cpp
tiki/include/Tiki/TikiAll.h
tiki/include/Tiki/drawable.h
tiki/include/Tiki/drawables/console.h
tiki/include/Tiki/gl.h
tiki/include/Tiki/vector.h
tiki/nds/Makefile
tiki/nds/src/init_shutdown.cpp
tiki/nds/src/platgl.cpp
tiki/nds/tiki.cbp
tiki/osx/Makefile
tiki/osx/Tiki.xcodeproj/project.pbxproj
tiki/osx/src/init_shutdown.cpp
tiki/osx/src/platgl.cpp
tiki/sdl/Makefile
tiki/sdl/TikiSDL.cbp
tiki/sdl/src/init_shutdown.cpp
tiki/sdl/src/platgl.cpp
tiki/src/gl/drawable.cpp
tiki/src/gl/drawables/banner.cpp
tiki/src/gl/drawables/console.cpp
tiki/src/gl/drawables/label.cpp
tiki/src/gl/drawables/pointerArrow.cpp
tiki/src/gl/drawables/texturetile.cpp
tiki/src/gl/font.cpp
tiki/win32/Makefile
tiki/win32/src/init_shutdown.cpp
tiki/win32/src/platgl.cpp
tiki/win32/tiki.cbp
tiki/win32/tiki.vcproj
Removed Paths:
-------------
tiki/examples/TikiTest/
tiki/include/Tiki/plxcompat.h
tiki/src/gl/plxcompat.cpp
Property Changed:
----------------
tiki/examples/console/TikiSnake/
tiki/examples/nehe/lesson02/
tiki/examples/nehe/lesson03/
tiki/examples/nehe/lesson04/
tiki/examples/nehe/lesson05/
tiki/examples/net/basic/
tiki/examples/net/chat/
tiki/examples/net/chatd/
tiki/examples/net/httpclient/
tiki/nds/tikiarm7/
Modified: tiki/dc/Makefile
===================================================================
--- tiki/dc/Makefile 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/dc/Makefile 2007-10-27 01:19:20 UTC (rev 517)
@@ -37,7 +37,6 @@
-x "*/.svn/*"
cd .. && \
zip -9ru dist/$(SVN_VERSION)/tiki-$(SVN_VERSION)-dc.zip \
- examples/TikiTest/tikitest.elf \
examples/console/TikiSnake/tikisnake.elf \
-x "*/.svn/*"
Modified: tiki/dc/src/init_shutdown.cpp
===================================================================
--- tiki/dc/src/init_shutdown.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/dc/src/init_shutdown.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -11,7 +11,6 @@
#include "Tiki/tiki.h"
#include "Tiki/sound.h"
#include "Tiki/stream.h"
-#include "Tiki/plxcompat.h"
#include "Tiki/hid.h"
static pvr_init_params_t params = {
@@ -30,7 +29,6 @@
glKosInit();
snd_stream_init();
- GL::Plxcompat::plx_mat3d_init( 640, 480 );
Hid::init();
return true;
Modified: tiki/dc/src/platgl.cpp
===================================================================
--- tiki/dc/src/platgl.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/dc/src/platgl.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -15,14 +15,26 @@
using namespace Tiki;
-float Tiki::GL::Frame::getFrameRate() {
+namespace Tiki {
+namespace GL {
+namespace Frame {
+
+float getFrameRate() {
pvr_stats_t stats;
pvr_get_stats( &stats );
return stats.frame_rate;
}
-void Tiki::GL::Frame::setFrameRateLimit( int rate ) {}
+void setFrameRateLimit( int rate ) {}
+Vector getScreenExtents() {
+ return Vector( 640.0f, 480.0f, 0.0f );
+}
+
+}
+}
+}
+
extern "C" {
void tiki_wait_if_needed() {
Modified: tiki/examples/Makefile
===================================================================
--- tiki/examples/Makefile 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/examples/Makefile 2007-10-27 01:19:20 UTC (rev 517)
@@ -1,5 +1,5 @@
-SUBDIRS = TikiTest console net nehe
+SUBDIRS = console net nehe
TIKI_DIR ?= $(CURDIR)/../
include $(TIKI_DIR)$(TIKI_PLAT)/Makefile.rules
Property changes on: tiki/examples/console/TikiSnake
___________________________________________________________________
Name: svn:ignore
- Debug
Release
*.user
*.nds
*.ds.gba
*.elf
+ Debug
Release
*.user
*.nds
*.ds.gba
*.elf
tikisnake
Modified: tiki/examples/console/TikiSnake/src/snake.cpp
===================================================================
--- tiki/examples/console/TikiSnake/src/snake.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/examples/console/TikiSnake/src/snake.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -7,7 +7,6 @@
*/
#include <Tiki/tiki.h>
-#include <Tiki/plxcompat.h>
#include <Tiki/gl.h>
#include <Tiki/hid.h>
#include <Tiki/tikitime.h>
@@ -69,15 +68,17 @@
Hid::callbackReg( tkCallback, NULL );
//initialize the screen
- ConsoleText *ct = new ConsoleText( 80, 25, new Texture( "pc-ascii.png", true ) );
-
-#if TIKI_PLAT != TIKI_NDS
- ct->setSize( 640, 480 );
- ct->translate( Vector( 320, 240, 0 ) );
-#else
- ct->setSize( 256, 192);
- ct->translate( Vector( 128, 96, 0 ) );
-#endif
+#if TIKI_PLAT == TIKI_DC
+ RefPtr<Texture> cf = new Texture("/rd/pc-ascii.png", true);
+#else
+ RefPtr<Texture> cf = new Texture("pc-ascii.png", true);
+#endif
+ RefPtr<Console> ct = new Console( 80, 25, cf );
+
+ Vector screenExtents = Frame::getScreenExtents();
+ ct->setSize(screenExtents.x, screenExtents.y);
+ screenExtents *= 0.5f;
+ ct->setTranslate(screenExtents);
ct->setAutoScroll( 0 );
ct->setAutoWrap( 0 );
Property changes on: tiki/examples/nehe/lesson02
___________________________________________________________________
Name: svn:ignore
+ *.nds
*.ds.gba
nehe_lesson02
Modified: tiki/examples/nehe/lesson02/src/main.cpp
===================================================================
--- tiki/examples/nehe/lesson02/src/main.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/examples/nehe/lesson02/src/main.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -5,17 +5,30 @@
#include <Tiki/tiki.h>
#include <Tiki/gl.h>
+#include <Tiki/hid.h>
using namespace Tiki;
using namespace Tiki::GL;
void DrawGLScene();
+// Tiki Specific
+volatile bool g_quitting = false;
+void tkCallback( const Hid::Event & evt, void * data ) {
+ if ( evt.type == Hid::Event::EvtQuit ) {
+ g_quitting = true;
+ }
+ else if (evt.type == Hid::Event::EvtKeypress && evt.key == Hid::Event::KeyEsc) {
+ g_quitting = true;
+ }
+}
+
int main(int argc, char *argv[])
{
Tiki::init(argc, argv);
+ Hid::callbackReg( tkCallback, NULL );
- while (1)
+ while (!g_quitting)
{
Frame::begin();
Property changes on: tiki/examples/nehe/lesson03
___________________________________________________________________
Name: svn:ignore
+ *.nds
*.ds.gba
nehe_lesson03
Modified: tiki/examples/nehe/lesson03/src/main.cpp
===================================================================
--- tiki/examples/nehe/lesson03/src/main.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/examples/nehe/lesson03/src/main.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -5,17 +5,30 @@
#include <Tiki/tiki.h>
#include <Tiki/gl.h>
+#include <Tiki/hid.h>
using namespace Tiki;
using namespace Tiki::GL;
void DrawGLScene();
+// Tiki Specific
+volatile bool g_quitting = false;
+void tkCallback( const Hid::Event & evt, void * data ) {
+ if ( evt.type == Hid::Event::EvtQuit ) {
+ g_quitting = true;
+ }
+ else if (evt.type == Hid::Event::EvtKeypress && evt.key == Hid::Event::KeyEsc) {
+ g_quitting = true;
+ }
+}
+
int main(int argc, char *argv[])
{
Tiki::init(argc, argv);
+ Hid::callbackReg( tkCallback, NULL );
- while (1)
+ while (!g_quitting)
{
Frame::begin();
Frame::set3d();
Property changes on: tiki/examples/nehe/lesson04
___________________________________________________________________
Name: svn:ignore
- *.nds
*.ds.gba
+ *.nds
*.ds.gba
nehe_lesson04
Modified: tiki/examples/nehe/lesson04/src/main.cpp
===================================================================
--- tiki/examples/nehe/lesson04/src/main.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/examples/nehe/lesson04/src/main.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -6,6 +6,7 @@
// include your ndslib
#include <Tiki/tiki.h>
#include <Tiki/gl.h>
+#include <Tiki/hid.h>
using namespace Tiki;
using namespace Tiki::GL;
@@ -16,14 +17,23 @@
float rtri; // Angle For The Triangle ( NEW )
float rquad; // Angle For The Quad ( NEW )
+// Tiki Specific
+volatile bool g_quitting = false;
+void tkCallback( const Hid::Event & evt, void * data ) {
+ if ( evt.type == Hid::Event::EvtQuit ) {
+ g_quitting = true;
+ }
+ else if (evt.type == Hid::Event::EvtKeypress && evt.key == Hid::Event::KeyEsc) {
+ g_quitting = true;
+ }
+}
+
int main(int argc, char *argv[])
{
Tiki::init(argc, argv);
+ Hid::callbackReg( tkCallback, NULL );
- // Set the current matrix to be the model matrix
- glMatrixMode(GL_MODELVIEW);
-
- while (1)
+ while (!g_quitting)
{
Frame::begin();
Frame::set3d();
Property changes on: tiki/examples/nehe/lesson05
___________________________________________________________________
Name: svn:ignore
- *.nds
*.ds.gba
+ *.nds
*.ds.gba
nehe_lesson05
Modified: tiki/examples/nehe/lesson05/src/main.cpp
===================================================================
--- tiki/examples/nehe/lesson05/src/main.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/examples/nehe/lesson05/src/main.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -6,6 +6,7 @@
// include your ndslib
#include <Tiki/tiki.h>
#include <Tiki/gl.h>
+#include <Tiki/hid.h>
using namespace Tiki;
using namespace Tiki::GL;
@@ -15,11 +16,23 @@
float rtri; // Angle For The Triangle ( NEW )
float rquad; // Angle For The Quad ( NEW )
+// Tiki Specific
+volatile bool g_quitting = false;
+void tkCallback( const Hid::Event & evt, void * data ) {
+ if ( evt.type == Hid::Event::EvtQuit ) {
+ g_quitting = true;
+ }
+ else if (evt.type == Hid::Event::EvtKeypress && evt.key == Hid::Event::KeyEsc) {
+ g_quitting = true;
+ }
+}
+
int main(int argc, char *argv[])
{
- Tiki::init(argc, argv);
+ Tiki::init(argc, argv);
+ Hid::callbackReg( tkCallback, NULL );
- while (1)
+ while (!g_quitting)
{
Frame::begin();
Frame::set3d();
@@ -32,6 +45,7 @@
Frame::finish();
}
+ Tiki::shutdown();
return 0;
}
Property changes on: tiki/examples/net/basic
___________________________________________________________________
Name: svn:ignore
- Debug
Release
*.user
*.nds
*.ds.gba
+ Debug
Release
*.user
*.nds
*.ds.gba
basic
Property changes on: tiki/examples/net/chat
___________________________________________________________________
Name: svn:ignore
- Debug
Release
*.user
*.nds
*.ds.gba
+ Debug
Release
*.user
*.nds
*.ds.gba
chat
Property changes on: tiki/examples/net/chatd
___________________________________________________________________
Name: svn:ignore
- Debug
Release
*.user
*.nds
*.ds.gba
+ Debug
Release
*.user
*.nds
*.ds.gba
chatd
Property changes on: tiki/examples/net/httpclient
___________________________________________________________________
Name: svn:ignore
- Debug
Release
*.user
*.nds
*.ds.gba
+ Debug
Release
*.user
*.nds
*.ds.gba
httpclient
Modified: tiki/examples/net/httpclient/src/main.cpp
===================================================================
--- tiki/examples/net/httpclient/src/main.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/examples/net/httpclient/src/main.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -54,16 +54,16 @@
#else
RefPtr<Texture> cf = new Texture("pc-ascii.png", true);
#endif
- ConsoleText *console = new ConsoleText(80, 25, cf);
-#if TIKI_PLAT != TIKI_NDS
- console->setSize(640, 480);
- console->setTranslate( Vector( 320, 240, 0 ) );
-#else
- console->setSize(255, 191);
- console->setTranslate( Vector( 128, 96, 0 ) );
-#endif
+ RefPtr<Console> console = new Console(80, 25, cf);
+
+ Vector screenExtents = Frame::getScreenExtents();
+ console->setSize(screenExtents.x, screenExtents.y);
+ screenExtents *= 0.5f;
+ console->setTranslate(screenExtents);
console->setAutoWrap( true );
console->setAutoScroll( true );
+ console->color( BLACK, GREY );
+ console->clear();
console->printf("Sending request: %s\n", request->getUrl().c_str());
Response *response = useragent->get(request);
Modified: tiki/include/Tiki/TikiAll.h
===================================================================
--- tiki/include/Tiki/TikiAll.h 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/include/Tiki/TikiAll.h 2007-10-27 01:19:20 UTC (rev 517)
@@ -25,7 +25,6 @@
#include <Tiki/matrix.h>
#include <Tiki/object.h>
#include <Tiki/oggvorbis.h>
-#include <Tiki/plxcompat.h>
#include <Tiki/refcnt.h>
#include <Tiki/scene.h>
#include <Tiki/sound.h>
Modified: tiki/include/Tiki/drawable.h
===================================================================
--- tiki/include/Tiki/drawable.h 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/include/Tiki/drawable.h 2007-10-27 01:19:20 UTC (rev 517)
@@ -179,14 +179,6 @@
}
protected:
- /// Setup a transform matrix, taking into account the
- /// parent relative rotation and scaling parameters. Pushes the old
- /// matrix onto the stack.
- void pushTransformMatrix() const;
-
- /// Pops the old matrix off the stack.
- void popTransformMatrix() const;
-
bool m_t_prelative; ///< Is translation parent-relative?
bool m_r_prelative; ///< Is rotation parent-relative?
bool m_s_prelative; ///< Is scaling parent-relative?
Modified: tiki/include/Tiki/drawables/console.h
===================================================================
--- tiki/include/Tiki/drawables/console.h 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/include/Tiki/drawables/console.h 2007-10-27 01:19:20 UTC (rev 517)
@@ -6,8 +6,8 @@
Copyright (C)2001 - 2006 Sam Steele
*/
-#ifndef __TIKI_DRW_CONSOLETEXT_H
-#define __TIKI_DRW_CONSOLETEXT_H
+#ifndef __TIKI_DRW_CONSOLE_H
+#define __TIKI_DRW_CONSOLE_H
#include "Tiki/gl.h"
#include "Tiki/drawable.h"
@@ -41,10 +41,10 @@
};
/** ConsoleText -- ConsoleText displays an array of fixed width characters. */
- class ConsoleText : public Drawable {
+ class Console : public Drawable {
public:
- ConsoleText(int cols, int rows, Texture * texture);
- virtual ~ConsoleText();
+ Console(int cols, int rows, Texture * texture);
+ virtual ~Console();
void setTexture(Texture * txr);
void setSize(float w, float h);
@@ -92,31 +92,31 @@
m_colorData[(y*m_cols) + x] = attr;
}
- ConsoleText& operator <<(std::string input) {
+ Console& operator <<(std::string input) {
printf("%s",input.c_str());
return *this;
}
- ConsoleText& operator <<(const char *input) {
+ Console& operator <<(const char *input) {
printf("%s",input);
return *this;
}
- ConsoleText& operator <<(int input) {
+ Console& operator <<(int input) {
printf("%i",input);
return *this;
}
- ConsoleText& operator <<(char input) {
+ Console& operator <<(char input) {
printf("%c",input);
return *this;
}
- ConsoleText& operator <<(float input) {
+ Console& operator <<(float input) {
printf("%f",input);
return *this;
Modified: tiki/include/Tiki/gl.h
===================================================================
--- tiki/include/Tiki/gl.h 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/include/Tiki/gl.h 2007-10-27 01:19:20 UTC (rev 517)
@@ -9,7 +9,9 @@
#ifndef __TIKI_GL_H
#define __TIKI_GL_H
+#include "Tiki/tiki.h"
#include "Tiki/glhdrs.h"
+#include "Tiki/vector.h"
namespace Tiki {
namespace GL {
@@ -38,6 +40,10 @@
// number of frames per second allowed. The default is 60.
void setFrameRateLimit( int rate );
+// Returns the max size of the screen in pixels
+// defaults to window size for platform.
+Tiki::Math::Vector getScreenExtents();
+
}
}
}
Deleted: tiki/include/Tiki/plxcompat.h
===================================================================
--- tiki/include/Tiki/plxcompat.h 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/include/Tiki/plxcompat.h 2007-10-27 01:19:20 UTC (rev 517)
@@ -1,808 +0,0 @@
-/*
- Tiki
-
- plxcompat.h
-
- Copyright (C)2002,2004 Dan Potter
- Copyright (C)2005 Cryptic Allusion, LLC
-*/
-
-#ifndef __TIKI_PLXCOMPAT_H
-#define __TIKI_PLXCOMPAT_H
-
-// These convenience methods are just an easier way to submit commands to
-// OpenGL. These are based on Parallax's prim.h, matrix.h, and sprite.h files,
-// and are mostly shortcut methods for porting old code.
-
-#include "Tiki/color.h"
-#include "Tiki/vector.h"
-#include "Tiki/matrix.h"
-#include "Tiki/glhdrs.h"
-
-namespace Tiki {
-namespace GL {
-
-class Texture;
-
-namespace Plxcompat {
-
-////////////////////////////////////////////////////////////////////////////////////
-// dr.h
-
-typedef void * plx_dr_state_t;
-static inline void plx_dr_init( plx_dr_state_t * t ) { }
-
-////////////////////////////////////////////////////////////////////////////////////
-// context.h
-
-/**
- Select a texture for use with the context system. If you delete the
- texture this has selected and then try to use contexts without
- setting another texture, you'll probably get some gross garbage
- on your output. Specify a NULL texture here to disable texturing.
- */
-void plx_cxt_texture( Texture * txr );
-
-/**
- Set the blending mode to use with the context. What's available is
- platform dependent, but we have defines for DC below.
- */
-void plx_cxt_blending( int src, int dst );
-// glBlendFunc
-
-/* Constants for blending modes */
-#define PLX_BLEND_ZERO GL_ZERO
-#define PLX_BLEND_ONE GL_ONE
-#define PLX_BLEND_DESTCOLOR GL_DST_COLOR
-#define PLX_BLEND_INVDESTCOLOR GL_ONE_MINUS_DST_COLOR
-#define PLX_BLEND_SRCALPHA GL_SRC_ALPHA
-#define PLX_BLEND_INVSRCALPHA GL_ONE_MINUS_SRC_ALPHA
-#define PLX_BLEND_DESTALPHA GL_DST_ALPHA
-#define PLX_BLEND_INVDESTALPHA GL_ONE_MINUS_DST_ALPHA
-
-/**
- Set the culling mode.
- */
-void plx_cxt_culling( int type );
-// glCullFace
-// glFrontFace
-
-/* Constants for culling modes */
-#define PLX_CULL_NONE GL_FRONT_AND_BACK /**< Show everything */
-#define PLX_CULL_CW GL_BACK /**< Remove clockwise polys */
-#define PLX_CULL_CCW GL_FRONT /**< Remove counter-clockwise polys */
-
-/**
- Submit the selected context for rendering.
- */
-static inline void plx_cxt_send( int /*foo*/ ) { }
-
-
-////////////////////////////////////////////////////////////////////////////////////
-// matrix.h
-
-// This isn't perfect but will catch most uses by client code.
-typedef Matrix matrix_t;
-typedef Vector vector_t;
-typedef Vector point_t;
-
-/* Copy the internal matrix out to a memory one */
-void mat_store( matrix_t *out );
-
-/* Copy a memory matrix into the internal one */
-void mat_load( matrix_t *out );
-
-/* Clear internal to an identity matrix */
-void mat_identity();
-
-/* "Apply" a matrix: multiply a matrix onto the "internal" one */
-void mat_apply( matrix_t *src );
-
-/* Transform zero or more sets of vectors using the current internal
- matrix. Each vector is three floats long. */
-void mat_transform( vector_t *invecs, vector_t *outvecs, int veccnt, int vecskip );
-
-/* Inline mat_transform which works on the three coordinates passed in;
- this works most efficiently if you've already got the three numbers
- (x,y,z) in the right registers (fr0,fr1,fr2). */
-void mat_trans_single( float & x, float & y, float & z );
-
-/* Same as above, but allows an input to and preserves the Z/W value */
-void mat_trans_single4( float & x, float & y, float & z, float & w );
-
-/* This is like mat_trans_single, but it leaves z/w instead of 1/w
- for the z component. */
-void mat_trans_single3( float & x, float & y, float & z );
-
-/* Transform vector, without any perspective division. */
-void mat_trans_nodiv( float & x, float & y, float & z, float & w );
-
-void mat_rotate_x( float r );
-void mat_rotate_y( float r );
-void mat_rotate_z( float r );
-void mat_rotate( float xr, float yr, float zr );
-void mat_translate( float x, float y, float z );
-void mat_scale( float x, float y, float z );
-
-static inline void plx_mat_store( matrix_t *out ) {
- mat_store( out );
-}
-static inline void plx_mat_load( matrix_t *out ) {
- mat_load( out );
-}
-static inline void plx_mat_identity() {
- mat_identity();
-}
-static inline void plx_mat_apply( matrix_t *src ) {
- mat_apply( src );
-}
-static inline void plx_mat_transform( vector_t *invecs, vector_t *outvecs, int veccnt, int vecskip ) {
- mat_transform( invecs, outvecs, veccnt, vecskip );
-}
-static inline void plx_mat_tfip_3d( float & x, float & y, float & z ) {
- mat_trans_single( x, y, z );
-}
-static inline void plx_mat_tfip_3dw( float & x, float & y, float & z, float & w ) {
- mat_trans_single4( x, y, z, w );
-}
-static inline void plx_mat_tfip_2d( float & x, float & y, float & z ) {
- mat_trans_single3( x, y, z );
-}
-
-static inline void plx_mat_rotate_x( float r ) {
- mat_rotate_x( r );
-}
-static inline void plx_mat_rotate_y( float r ) {
- mat_rotate_y( r );
-}
-static inline void plx_mat_rotate_z( float r ) {
- mat_rotate_z( r );
-}
-static inline void plx_mat_rotate( float xr, float yr, float zr ) {
- mat_rotate( xr, yr, zr );
-}
-static inline void plx_mat_translate( float x, float y, float z ) {
- mat_translate( x, y, z );
-}
-static inline void plx_mat_scale( float x, float y, float z ) {
- mat_scale( x, y, z );
-}
-
-/* The 3D matrix operations, somewhat simplified from KGL. All of these use
- the matrix regs, but do not primarily keep their values in them. To get
- the values out into the matrix regs (and usable) you'll want to set
- everything up and then call plx_mat3d_apply(). */
-
-/** Call before doing anything else, or after switching video
- modes to setup some basic parameters. */
-void plx_mat3d_init( int width, int height );
-
-/** Set which matrix we are working on */
-void plx_mat3d_mode( int mode );
-
-/* Constants for plx_mat3d_mode and plx_mat3d_apply */
-static const int PLX_MAT_PROJECTION = 0;
-static const int PLX_MAT_MODELVIEW = 1;
-static const int PLX_MAT_SCREENVIEW = 2;
-static const int PLX_MAT_SCRATCH = 3;
-static const int PLX_MAT_WORLDVIEW = 4;
-static const int PLX_MAT_COUNT = 5;
-
-/** Load an identity matrix */
-void plx_mat3d_identity();
-
-/** Load a raw matrix */
-void plx_mat3d_load( matrix_t * src );
-
-/** Save a raw matrix */
-void plx_mat3d_store( matrix_t * src );
-
-/** Setup viewport parameters */
-void plx_mat3d_viewport( int x1, int y1, int width, int height );
-
-void plx_mat3d_depthrange( float n, float f );
-
-/** Setup a perspective matrix */
-void plx_mat3d_perspective( float angle, float aspect, float znear, float zfar );
-
-/** Setup a frustum matrix */
-void plx_mat3d_frustum( float left, float right, float bottom, float top, float znear, float zfar );
-
-/** Push a matrix on the stack */
-void plx_mat3d_push();
-
-/** Pop a matrix from the stack and reload it */
-void plx_mat3d_pop();
-
-/** Reload a matrix from the top of the stack, but don't pop it */
-void plx_mat3d_peek();
-
-/** Rotation */
-void plx_mat3d_rotate( float angle, float x, float y, float z );
-
-/** Scaling */
-void plx_mat3d_scale( float x, float y, float z );
-
-/** Translation */
-void plx_mat3d_translate( float x, float y, float z );
-
-/** Do a camera "look at" */
-void plx_mat3d_lookat( const point_t * eye, const point_t * center, const vector_t * up );
-
-/** Apply a matrix from one of the matrix modes to the matrix regs */
-void plx_mat3d_apply( int mode );
-
-/** Manually apply a matrix */
-void plx_mat3d_apply_mat( matrix_t * src );
-
-/** Apply all the matrices for a normal 3D scene */
-void plx_mat3d_apply_all();
-
-
-////////////////////////////////////////////////////////////////////////////////////
-// prim.h
-
-static const int PLX_VERT = 0;
-static const int PLX_VERT_EOS = 1;
-
-typedef struct {
- int flags;
- float x, y, z;
- float u, v;
- uint32 argb;
- uint32 oargb; // no one is using this.. probably..
-}
-plx_vertex_t;
-
-// Incoming Z coords will be divided by this number, to ensure they
-// stay inside the ortho depth limits.
-static const float zscale = 1000.0f;
-#define PRIMPRE() do { \
- if (!stripping) \
- glBegin(GL_TRIANGLE_STRIP); \
-} while(0)
-
-#define PRIMPOST(flags) do { \
- if (flags == PLX_VERT_EOS) { \
- glEnd(); \
- stripping = false; \
- } else { \
- stripping = true; \
- } \
-} while(0)
-
-static inline void glColoru32( uint32 argb ) {
- uint8 r = ( uint8 ) ( ( argb >> 16 ) & 0xff );
- uint8 g = ( uint8 ) ( ( argb >> 8 ) & 0xff );
- uint8 b = ( uint8 ) ( ( argb >> 0 ) & 0xff );
-#if TIKI_PLAT != TIKI_NDS
- uint8 a = ( uint8 ) ( ( argb >> 24 ) & 0xff );
- glColor4ub( r, g, b, a );
-#else
- glColor3b( r, g, b );
-#endif
-}
-
-// This function will handle the meat of the Parallax emulation. Note
-// that it's invalid with this design to have cross-module vertex submission
-// within a single strip, but that generally shouldn't be happening anyway.
-static bool stripping = false;
-static inline void plx_prim( plx_vertex_t * vert, int size = 0 ) {
- PRIMPRE();
- glColoru32( vert->argb );
- glTexCoord2f( vert->u, vert->v );
- glVertex3f( vert->x, vert->y, vert->z / zscale );
- PRIMPOST( vert->flags );
-}
-
-void plx_xform( float & x, float & y, float & z );
-static inline void plx_xform( plx_vertex_t * vert ) {
- plx_xform( vert->x, vert->y, vert->z );
-}
-static inline uint32 plx_pack_color( float a, float r, float g, float b ) {
- return Color::pack( a, r, g, b );
-}
-
-
-/**
- This simple primitive function will fill a vertex structure for
- you from parameters. It uses floating point numbers for the color
- values and no u/v coordinates. The "vert" parameter may be a DR target.
- */
-static inline void plx_vert_fnn( plx_vertex_t * vert, int flags, float x, float y, float z,
- float a, float r, float g, float b ) {
- vert->flags = flags;
- vert->x = x;
- vert->y = y;
- vert->z = z;
- vert->u = vert->v = 0.0f;
- vert->argb = plx_pack_color( a, r, g, b );
- vert->oargb = 0;
-}
-
-/**
- Like plx_vert_fnn, but it takes a pre-packed integer color value.
- */
-static inline void plx_vert_inn( plx_vertex_t * vert, int flags, float x, float y, float z,
- uint32 color ) {
- vert->flags = flags;
- vert->x = x;
- vert->y = y;
- vert->z = z;
- vert->u = vert->v = 0.0f;
- vert->argb = color;
- vert->oargb = 0;
-}
-
-/**
- Like plx_vert_fnn, but it takes u/v texture coordinates as well.
- */
-static inline void plx_vert_ffn( plx_vertex_t * vert, int flags, float x, float y, float z,
- float a, float r, float g, float b, float u, float v ) {
- vert->flags = flags;
- vert->x = x;
- vert->y = y;
- vert->z = z;
- vert->u = u;
- vert->v = v;
- vert->argb = plx_pack_color( a, r, g, b );
- vert->oargb = 0;
-}
-
-/**
- Like plx_vert_fnn, but it takes u/v texture coordinates and a pre-packed integer
- color value.
- */
-static inline void plx_vert_ifn( plx_vertex_t * vert, int flags, float x, float y, float z,
- uint32 color, float u, float v ) {
- vert->flags = flags;
- vert->x = x;
- vert->y = y;
- vert->z = z;
- vert->u = u;
- vert->v = v;
- vert->argb = color;
- vert->oargb = 0;
-}
-
-/****************************************************** PLX_PRIM VERTEX ****/
-// In PX, these are pretty much all implemented as GL at the low level.
-
-/**
- Like plx_vert_fnp, but submits the point using plx_prim.
- */
-static inline void plx_vert_fnp( int flags, float x, float y, float z, float a, float r, float g, float b ) {
- PRIMPRE();
-#if TIKI_PLAT != TIKI_NDS
- glColor4f( r, g, b, a );
-#else
- glColor3f( r, g, b );
-#endif
- glVertex3f( x, y, z / zscale );
- PRIMPOST( flags );
-}
-
-/**
- Like plx_vert_inn, but submits the point using plx_prim.
- */
-static inline void plx_vert_inp( int flags, float x, float y, float z, uint32 color ) {
- PRIMPRE();
- glColoru32( color );
- glVertex3f( x, y, z / zscale );
- PRIMPOST( flags );
-}
-
-/**
- Like plx_vert_indm3, but uses plx_prim.
- */
-static inline void plx_vert_inpm3( int flags, float x, float y, float z, uint32 color ) {
- PRIMPRE();
- glColoru32( color );
- plx_xform( x, y, z );
- glVertex3f( x, y, z / zscale );
- PRIMPOST( flags );
-}
-
-/**
- Like plx_vert_ifpm3, but uses plx_prim.
- */
-static inline void plx_vert_ifpm3( int flags, float x, float y, float z, uint32 color, float u, float v ) {
- PRIMPRE();
- glColoru32( color );
- glTexCoord2f( u, v );
- glVertex3f( x, y, z / zscale );
- PRIMPOST( flags );
-}
-
-/**
- Like plx_vert_ffn, but submits the point using plx_prim.
- */
-static inline void plx_vert_ffp( int flags, float x, float y, float z,
- float a, float r, float g, float b, float u, float v ) {
- PRIMPRE();
-#if TIKI_PLAT != TIKI_NDS
- glColor4f( r, g, b, a );
-#else
- glColor3f( r, g, b );
-#endif
- glTexCoord2f( u, v );
- glVertex3f( x, y, z / zscale );
- PRIMPOST( flags );
-}
-
-/**
- Like plx_vert_ifn, but submits the point using plx_prim.
- */
-static inline void plx_vert_ifp( int flags, float x, float y, float z, uint32 color, float u, float v ) {
- PRIMPRE();
- glColoru32( color );
- glTexCoord2f( u, v );
- glVertex3f( x, y, z / zscale );
- PRIMPOST( flags );
-}
-
-/********************************************************* DR VERTEX ****/
-// In PX, these are just wrappers for the p versions.
-
-/**
- Like plx_vert_fnn, but submits the point using DR.
- */
-static inline void plx_vert_fnd( plx_dr_state_t * state, int flags, float x, float y, float z,
- float a, float r, float g, float b ) {
- plx_vert_fnp( flags, x, y, z, a, r, g, b );
-}
-
-/**
- Like plx_vert_inn, but submits the point using DR.
- */
-static inline void plx_vert_ind( plx_dr_state_t * state, int flags, float x, float y, float z,
- uint32 color ) {
- plx_vert_inp( flags, x, y, z, color );
-}
-
-/**
- Like plx_vert_ffn, but submits the point using DR.
- */
-static inline void plx_vert_ffd( plx_dr_state_t * state, int flags, float x, float y, float z,
- float a, float r, float g, float b, float u, float v ) {
- plx_vert_ffp( flags, x, y, z, a, r, g, b, u, v );
-}
-
-/**
- Like plx_vert_ifn, but submits the point using DR.
- */
-static inline void plx_vert_ifd( plx_dr_state_t * state, int flags, float x, float y, float z,
- uint32 color, float u, float v ) {
- plx_vert_ifp( flags, x, y, z, color, u, v );
-}
-
-/**
- Like plx_vert_ind, but also transforms via the active matrices for 3D
- */
-static inline void plx_vert_indm3( plx_dr_state_t * state, int flags, float x, float y, float z,
- uint32 color ) {
- plx_vert_inpm3( flags, x, y, z, color );
-}
-
-/**
- Like plx_vert_ifd, but also transforms via the active matrices for 3D
- */
-static inline void plx_vert_ifdm3( plx_dr_state_t * state, int flags, float x, float y, float z,
- uint32 color, float u, float v ) {
- plx_vert_ifpm3( flags, x, y, z, color, u, v );
-}
-
-
-////////////////////////////////////////////////////////////////////////////////////
-// sprite.h
-
-/**
- Submit a quad using the given coordinates, color, and UV values via
- DR. The coordinates are at the center point.
- */
-static inline void plx_spr_fnd( plx_dr_state_t * state,
- float wi, float hi,
- float x, float y, float z,
- float a, float r, float g, float b ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- plx_vert_ffd( state, PLX_VERT,
- x - w, y + h, z,
- a, r, g, b,
- 0.0f, 1.0f );
- plx_vert_ffd( state, PLX_VERT,
- x - w, y - h, z,
- a, r, g, b,
- 0.0f, 0.0f );
- plx_vert_ffd( state, PLX_VERT,
- x + w, y + h, z,
- a, r, g, b,
- 1.0f, 1.0f );
- plx_vert_ffd( state, PLX_VERT_EOS,
- x + w, y - h, z,
- a, r, g, b,
- 1.0f, 0.0f );
-}
-
-/**
- Like plx_spr_fnd, but with integer color.
- */
-static inline void plx_spr_ind( plx_dr_state_t * state,
- float wi, float hi,
- float x, float y, float z,
- uint32 color ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- plx_vert_ifd( state, PLX_VERT,
- x - w, y + h, z,
- color,
- 0.0f, 1.0f );
- plx_vert_ifd( state, PLX_VERT,
- x - w, y - h, z,
- color,
- 0.0f, 0.0f );
- plx_vert_ifd( state, PLX_VERT,
- x + w, y + h, z,
- color,
- 1.0f, 1.0f );
- plx_vert_ifd( state, PLX_VERT_EOS,
- x + w, y - h, z,
- color,
- 1.0f, 0.0f );
-}
-
-/**
- Like plx_spr_fnd, but using matrix math.
- */
-static inline void plx_spr_fmd( plx_dr_state_t * state,
- float wi, float hi,
- float xi, float yi, float zi,
- float a, float r, float g, float b ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- float x, y, z;
-
- x = xi - w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffd( state, PLX_VERT,
- x, y, z,
- a, r, g, b,
- 0.0f, 1.0f );
-
- x = xi - w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffd( state, PLX_VERT,
- x, y, z,
- a, r, g, b,
- 0.0f, 0.0f );
-
- x = xi + w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffd( state, PLX_VERT,
- x, y, z,
- a, r, g, b,
- 1.0f, 1.0f );
-
- x = xi + w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffd( state, PLX_VERT_EOS,
- x, y, z,
- a, r, g, b,
- 1.0f, 0.0f );
-}
-
-/**
- Like plx_spr_fmd, but using integer colors.
- */
-static inline void plx_spr_imd( plx_dr_state_t * state,
- float wi, float hi,
- float xi, float yi, float zi,
- uint32 color ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- float x, y, z;
-
- x = xi - w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifd( state, PLX_VERT,
- x, y, z,
- color,
- 0.0f, 1.0f );
-
- x = xi - w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifd( state, PLX_VERT,
- x, y, z,
- color,
- 0.0f, 0.0f );
-
- x = xi + w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifd( state, PLX_VERT,
- x, y, z,
- color,
- 1.0f, 1.0f );
-
- x = xi + w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifd( state, PLX_VERT_EOS,
- x, y, z,
- color,
- 1.0f, 0.0f );
-}
-
-/**************************************************** PVR_PRIM VERSIONS ***/
-
-/**
- Like plx_spr_fnd, but using pvr_prim.
- */
-static inline void plx_spr_fnp(
- float wi, float hi,
- float x, float y, float z,
- float a, float r, float g, float b ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- plx_vert_ffp( PLX_VERT,
- x - w, y + h, z,
- a, r, g, b,
- 0.0f, 1.0f );
- plx_vert_ffp( PLX_VERT,
- x - w, y - h, z,
- a, r, g, b,
- 0.0f, 0.0f );
- plx_vert_ffp( PLX_VERT,
- x + w, y + h, z,
- a, r, g, b,
- 1.0f, 1.0f );
- plx_vert_ffp( PLX_VERT_EOS,
- x + w, y - h, z,
- a, r, g, b,
- 1.0f, 0.0f );
-}
-
-/**
- Like plx_spr_ind, but using pvr_prim.
- */
-static inline void plx_spr_inp(
- float wi, float hi,
- float x, float y, float z,
- uint32 color ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- plx_vert_ifp( PLX_VERT,
- x - w, y + h, z,
- color,
- 0.0f, 1.0f );
- plx_vert_ifp( PLX_VERT,
- x - w, y - h, z,
- color,
- 0.0f, 0.0f );
- plx_vert_ifp( PLX_VERT,
- x + w, y + h, z,
- color,
- 1.0f, 1.0f );
- plx_vert_ifp( PLX_VERT_EOS,
- x + w, y - h, z,
- color,
- 1.0f, 0.0f );
-}
-
-/**
- Like plx_spr_fmd, but using pvr_prim.
- */
-static inline void plx_spr_fmp(
- float wi, float hi,
- float xi, float yi, float zi,
- float a, float r, float g, float b ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- float x, y, z;
-
- x = xi - w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffp( PLX_VERT,
- x, y, z,
- a, r, g, b,
- 0.0f, 1.0f );
-
- x = xi - w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffp( PLX_VERT,
- x, y, z,
- a, r, g, b,
- 0.0f, 0.0f );
-
- x = xi + w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffp( PLX_VERT,
- x, y, z,
- a, r, g, b,
- 1.0f, 1.0f );
-
- x = xi + w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ffp( PLX_VERT_EOS,
- x, y, z,
- a, r, g, b,
- 1.0f, 0.0f );
-}
-
-/**
- Like plx_spr_imd, but using pvr_prim.
- */
-static inline void plx_spr_imp(
- float wi, float hi,
- float xi, float yi, float zi,
- uint32 color ) {
- float w = wi / 2.0f;
- float h = hi / 2.0f;
- float x, y, z;
-
- x = xi - w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifp( PLX_VERT,
- x, y, z,
- color,
- 0.0f, 1.0f );
-
- x = xi - w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifp( PLX_VERT,
- x, y, z,
- color,
- 0.0f, 0.0f );
-
- x = xi + w;
- y = yi + h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifp( PLX_VERT,
- x, y, z,
- color,
- 1.0f, 1.0f );
-
- x = xi + w;
- y = yi - h;
- z = zi;
- plx_mat_tfip_2d( x, y, z );
- plx_vert_ifp( PLX_VERT_EOS,
- x, y, z,
- color,
- 1.0f, 0.0f );
-}
-
-
-}
-}
-}
-
-#endif // __TIKI_PLXCOMPAT_H
-
Modified: tiki/include/Tiki/vector.h
===================================================================
--- tiki/include/Tiki/vector.h 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/include/Tiki/vector.h 2007-10-27 01:19:20 UTC (rev 517)
@@ -11,7 +11,8 @@
#define __TIKI_VECTOR_H
#include <assert.h>
-#include "tikimath.h"
+#include "Tiki/tikimath.h"
+#include "Tiki/debug.h"
namespace Tiki {
namespace Math {
Modified: tiki/nds/Makefile
===================================================================
--- tiki/nds/Makefile 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/nds/Makefile 2007-10-27 01:19:20 UTC (rev 517)
@@ -76,8 +76,6 @@
../examples/net/httpclient
cd .. && \
zip -9ru dist/$(SVN_VERSION)/tiki-$(SVN_VERSION)-nds.zip \
- examples/TikiTest/tikitest.nds \
- examples/TikiTest/tikitest.ds.gba \
examples/console/TikiSnake/pc-ascii.png \
examples/console/TikiSnake/tikisnake.nds \
examples/console/TikiSnake/tikisnake.ds.gba \
Modified: tiki/nds/src/init_shutdown.cpp
===================================================================
--- tiki/nds/src/init_shutdown.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/nds/src/init_shutdown.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -10,7 +10,6 @@
#include "Tiki/sound.h"
#include "Tiki/stream.h"
-#include "Tiki/plxcompat.h"
#include "Tiki/hid.h"
#include <nds.h>
@@ -85,7 +84,6 @@
fatInitDefault();
// initialize parallax
- GL::Plxcompat::plx_mat3d_init( 256, 192 );
Tiki::Debug::printf("Enabling Sound\n");
Audio::Stream::initGlobal();
Hid::init();
Modified: tiki/nds/src/platgl.cpp
===================================================================
--- tiki/nds/src/platgl.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/nds/src/platgl.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -23,6 +23,9 @@
namespace GL {
namespace Frame {
+Vector getScreenExtents() {
+ return Vector( 256.0f, 192.0f, 0.0f );
+}
float getFrameRate() {
uint64 cur = Tiki::Time::gettime();
Modified: tiki/nds/tiki.cbp
===================================================================
--- tiki/nds/tiki.cbp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/nds/tiki.cbp 2007-10-27 01:19:20 UTC (rev 517)
@@ -452,7 +452,6 @@
<Unit filename="../include/Tiki/net/util/date.h" />
<Unit filename="../include/Tiki/object.h" />
<Unit filename="../include/Tiki/oggvorbis.h" />
- <Unit filename="../include/Tiki/plxcompat.h" />
<Unit filename="../include/Tiki/refcnt.h" />
<Unit filename="../include/Tiki/scene.h" />
<Unit filename="../include/Tiki/sound.h" />
@@ -510,7 +509,6 @@
<Unit filename="../src/gl/font.cpp" />
<Unit filename="../src/gl/genmenu.cpp" />
<Unit filename="../src/gl/gl.cpp" />
- <Unit filename="../src/gl/plxcompat.cpp" />
<Unit filename="../src/gl/texture.cpp" />
<Unit filename="../src/gl/trigger.cpp" />
<Unit filename="../src/gl/triggers/birth.cpp" />
Property changes on: tiki/nds/tikiarm7
___________________________________________________________________
Name: svn:ignore
- build
tikiarm7.arm7.elf
+ build
tikiarm7.arm7.elf
tikiarm7.arm7
Modified: tiki/osx/Makefile
===================================================================
--- tiki/osx/Makefile 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/osx/Makefile 2007-10-27 01:19:20 UTC (rev 517)
@@ -3,16 +3,12 @@
xcodebuild -target Tiki -configuration Deployment
examples:
- xcodebuild -project ../examples/TikiTest/TikiTest.xcodeproj -configuration Development
- xcodebuild -project ../examples/TikiTest/TikiTest.xcodeproj -configuration Deployment
xcodebuild -project ../examples/console/TikiSnake/TikiSnake.xcodeproj -configuration Development
xcodebuild -project ../examples/console/TikiSnake/TikiSnake.xcodeproj -configuration Deployment
clean:
-xcodebuild -target Tiki -configuration Development clean
-xcodebuild -target Tiki -configuration Deployment clean
- -xcodebuild -project ../examples/TikiTest/TikiTest.xcodeproj -configuration Development clean
- -xcodebuild -project ../examples/TikiTest/TikiTest.xcodeproj -configuration Deployment clean
-xcodebuild -project ../examples/console/TikiSnake/TikiSnake.xcodeproj -configuration Development clean
-xcodebuild -project ../examples/console/TikiSnake/TikiSnake.xcodeproj -configuration Deployment clean
@@ -20,8 +16,6 @@
mkdir ../dist/$(SVN_VERSION)/tmp-debug
ditto -v build/Development/Tiki.framework \
../dist/$(SVN_VERSION)/tmp-debug/Tiki.framework
- ditto -v ../examples/TikiTest/build/Development/TikiTest.app \
- ../dist/$(SVN_VERSION)/tmp-debug/TikiTest.app
ditto -v ../examples/console/TikiSnake/build/Development/TikiSnake.app \
../dist/$(SVN_VERSION)/tmp-debug/TikiSnake.app
hdiutil create -fs HFS+ \
@@ -35,8 +29,6 @@
mkdir ../dist/$(SVN_VERSION)/tmp-release
ditto -v build/Deployment/Tiki.framework \
../dist/$(SVN_VERSION)/tmp-release/Tiki.framework
- ditto -v ../examples/TikiTest/build/Deployment/TikiTest.app \
- ../dist/$(SVN_VERSION)/tmp-release/TikiTest.app
ditto -v ../examples/console/TikiSnake/build/Deployment/TikiSnake.app \
../dist/$(SVN_VERSION)/tmp-release/TikiSnake.app
hdiutil create -fs HFS+ \
Modified: tiki/osx/Tiki.xcodeproj/project.pbxproj
===================================================================
--- tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-10-27 01:19:20 UTC (rev 517)
@@ -182,7 +182,6 @@
C4F51583079A0D0B0001D0D0 /* matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4F5157F079A0D0B0001D0D0 /* matrix.cpp */; };
C4F51584079A0D0B0001D0D0 /* vector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4F51580079A0D0B0001D0D0 /* vector.cpp */; };
C4F51585079A0D0B0001D0D0 /* vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4F51581079A0D0B0001D0D0 /* vector3.cpp */; };
- C4F515F2079A302D0001D0D0 /* plxcompat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4F515F1079A302D0001D0D0 /* plxcompat.cpp */; };
C4F51613079A34260001D0D0 /* gl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4F51612079A34260001D0D0 /* gl.cpp */; };
/* End PBXBuildFile section */
@@ -444,8 +443,6 @@
C4F5157F079A0D0B0001D0D0 /* matrix.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = matrix.cpp; path = ../src/math/matrix.cpp; sourceTree = SOURCE_ROOT; };
C4F51580079A0D0B0001D0D0 /* vector.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = vector.cpp; path = ../src/math/vector.cpp; sourceTree = SOURCE_ROOT; };
C4F51581079A0D0B0001D0D0 /* vector3.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = vector3.cpp; path = ../src/math/vector3.cpp; sourceTree = SOURCE_ROOT; };
- C4F515AA079A27E10001D0D0 /* plxcompat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = plxcompat.h; path = ../include/Tiki/plxcompat.h; sourceTree = SOURCE_ROOT; };
- C4F515F1079A302D0001D0D0 /* plxcompat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = plxcompat.cpp; path = ../src/gl/plxcompat.cpp; sourceTree = SOURCE_ROOT; };
C4F5160B079A33AA0001D0D0 /* gl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = gl.h; path = ../include/Tiki/gl.h; sourceTree = SOURCE_ROOT; };
C4F51612079A34260001D0D0 /* gl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = gl.cpp; path = ../src/gl/gl.cpp; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
@@ -992,7 +989,6 @@
C4F5152C079A0B690001D0D0 /* font.cpp */,
C4F5152D079A0B690001D0D0 /* genmenu.cpp */,
C4F51612079A34260001D0D0 /* gl.cpp */,
- C4F515F1079A302D0001D0D0 /* plxcompat.cpp */,
C4F5152E079A0B690001D0D0 /* texture.cpp */,
C4F5152F079A0B690001D0D0 /* trigger.cpp */,
);
@@ -1045,7 +1041,6 @@
C4F51564079A0C430001D0D0 /* font.h */,
C4F51565079A0C430001D0D0 /* genmenu.h */,
C4F5160B079A33AA0001D0D0 /* gl.h */,
- C4F515AA079A27E10001D0D0 /* plxcompat.h */,
C4F51566079A0C430001D0D0 /* texture.h */,
C4F51567079A0C430001D0D0 /* trigger.h */,
);
@@ -1242,7 +1237,6 @@
C4F51583079A0D0B0001D0D0 /* matrix.cpp in Sources */,
C4F51584079A0D0B0001D0D0 /* vector.cpp in Sources */,
C4F51585079A0D0B0001D0D0 /* vector3.cpp in Sources */,
- C4F515F2079A302D0001D0D0 /* plxcompat.cpp in Sources */,
C4F51613079A34260001D0D0 /* gl.cpp in Sources */,
C453992B079A477500F3A584 /* hid.cpp in Sources */,
C453994B079A509100F3A584 /* plathid.mm in Sources */,
Modified: tiki/osx/src/init_shutdown.cpp
===================================================================
--- tiki/osx/src/init_shutdown.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/osx/src/init_shutdown.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -20,7 +20,6 @@
#include "Tiki/sound.h"
#include "Tiki/stream.h"
-#include "Tiki/plxcompat.h"
#include "Tiki/hid.h"
extern "C" void tiki_set_window_name( CFStringRef windowName );
@@ -47,7 +46,6 @@
Audio::Sound::initGlobal();
Audio::Stream::initGlobal();
- GL::Plxcompat::plx_mat3d_init( 640, 480 );
Hid::init();
return true;
Modified: tiki/osx/src/platgl.cpp
===================================================================
--- tiki/osx/src/platgl.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/osx/src/platgl.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -37,13 +37,6 @@
frameCnt++;
totalFrameCnt++;
-#ifndef NDEBUG
- /* if (frameCnt && !(frameCnt % 250)) {
- Debug::printf("frame %d, fps = %.2f\n", (int)frameCnt,
- (double)Tiki::GL::Frame::getFrameRate());
- } */
-#endif
-
if ( lastFrame.tv_sec == 0 ) {
gettimeofday( &lastFrame, NULL );
return ;
@@ -60,7 +53,10 @@
gettimeofday( &lastFrame, NULL );
}
-float Tiki::GL::Frame::getFrameRate() {
+namespace Tiki {
+namespace GL {
+namespace Frame {
+float getFrameRate() {
uint64 cur = Tiki::Time::gettime();
// Avoid divzero
@@ -70,7 +66,14 @@
return ( float ) ( ( frameCnt * 1000000.0 ) / ( cur - firstFrame ) );
}
-void Tiki::GL::Frame::setFrameRateLimit( int rate ) {
+void setFrameRateLimit( int rate ) {
targetFrameRate = rate;
}
+Vector getScreenExtents() {
+ return Vector( 640.0f, 480.0f, 0.0f );
+}
+
+}
+}
+}
Modified: tiki/sdl/Makefile
===================================================================
--- tiki/sdl/Makefile 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/sdl/Makefile 2007-10-27 01:19:20 UTC (rev 517)
@@ -74,7 +74,6 @@
cp ../examples/net/httpclient/resources/pc-ascii.png \
../examples/net/httpclient
tar -uvf ../dist/$(SVN_VERSION)/tiki-$(SVN_VERSION)-sdl.tar -C ../ \
- examples/TikiTest/tikitest \
examples/net/basic/basic \
examples/net/chat/chat \
examples/net/chatd/chatd \
Modified: tiki/sdl/TikiSDL.cbp
===================================================================
--- tiki/sdl/TikiSDL.cbp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/sdl/TikiSDL.cbp 2007-10-27 01:19:20 UTC (rev 517)
@@ -457,7 +457,6 @@
<Unit filename="../include/Tiki/net/util/base64.h" />
<Unit filename="../include/Tiki/object.h" />
<Unit filename="../include/Tiki/oggvorbis.h" />
- <Unit filename="../include/Tiki/plxcompat.h" />
<Unit filename="../include/Tiki/refcnt.h" />
<Unit filename="../include/Tiki/scene.h" />
<Unit filename="../include/Tiki/sound.h" />
@@ -515,7 +514,6 @@
<Unit filename="../src/gl/font.cpp" />
<Unit filename="../src/gl/genmenu.cpp" />
<Unit filename="../src/gl/gl.cpp" />
- <Unit filename="../src/gl/plxcompat.cpp" />
<Unit filename="../src/gl/texture.cpp" />
<Unit filename="../src/gl/trigger.cpp" />
<Unit filename="../src/gl/triggers/birth.cpp" />
Modified: tiki/sdl/src/init_shutdown.cpp
===================================================================
--- tiki/sdl/src/init_shutdown.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/sdl/src/init_shutdown.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -11,9 +11,10 @@
#include <AL/al.h>
#include <AL/alc.h>
+#include "Tiki/tiki.h"
+#include "Tiki/gl.h"
#include "Tiki/sound.h"
#include "Tiki/stream.h"
-#include "Tiki/plxcompat.h"
#include "Tiki/hid.h"
#include <SDL/SDL.h>
@@ -66,7 +67,6 @@
glDepthFunc( GL_LEQUAL ); // The Type Of Depth Testing To Do
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); // Really Nice Perspective Calculations
- GL::Plxcompat::plx_mat3d_init( 640, 480 );
}
return Hid::init();
}
Modified: tiki/sdl/src/platgl.cpp
===================================================================
--- tiki/sdl/src/platgl.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/sdl/src/platgl.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -26,7 +26,11 @@
static uint64 firstFrame = 0;
static uint64 frameCnt = 0, totalFrameCnt = 0;
-float Tiki::GL::Frame::getFrameRate() {
+namespace Tiki {
+namespace GL {
+namespace Frame {
+
+float getFrameRate() {
uint64 cur = Tiki::Time::gettime();
// Avoid divzero
@@ -36,10 +40,18 @@
return ( float )(( frameCnt * 1000000.0 ) / ( cur - firstFrame ) );
}
-void Tiki::GL::Frame::setFrameRateLimit( int rate ) {
+void setFrameRateLimit( int rate ) {
targetFrameRate = rate;
}
+Vector getScreenExtents() {
+ return Vector( 640.0f, 480.0f, 0.0f );
+}
+
+}
+}
+}
+
extern "C" {
void tiki_wait_if_needed() {
Modified: tiki/src/gl/drawable.cpp
===================================================================
--- tiki/src/gl/drawable.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/src/gl/drawable.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -10,7 +10,6 @@
#include "pch.h"
#include "Tiki/drawable.h"
#include "Tiki/matrix.h"
-#include "Tiki/plxcompat.h"
using namespace Tiki::GL;
@@ -229,19 +228,3 @@
return tint;
}
-
-void Drawable::pushTransformMatrix() const {
- const Vector & pos = getTranslate();
- const Vector & rot = getRotate();
- const Vector & scale = getScale();
-
- Plxcompat::plx_mat3d_push();
- Plxcompat::plx_mat3d_translate( pos.x, pos.y, pos.z );
- Plxcompat::plx_mat3d_rotate( rot.w, rot.x, rot.y, rot.z );
- Plxcompat::plx_mat3d_scale( scale.x, scale.y, scale.z );
-}
-
-void Drawable::popTransformMatrix() const {
- Plxcompat::plx_mat3d_pop();
-}
-
Modified: tiki/src/gl/drawables/banner.cpp
===================================================================
--- tiki/src/gl/drawables/banner.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/src/gl/drawables/banner.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -10,10 +10,8 @@
#include "pch.h"
#include "Tiki/drawables/banner.h"
-#include "Tiki/plxcompat.h"
using namespace Tiki::GL;
-using namespace Tiki::GL::Plxcompat;
Banner::Banner(ObjType t, Texture * texture) {
m_list = t;
@@ -75,18 +73,18 @@
if (list != Trans) {
argb.a = 1.0f;
}
-
argb.select();
-
- glBegin(GL_TRIANGLE_STRIP);
- glTexCoord2f(m_u1, m_v1);
- glVertex3f(tv.x - w/2, tv.y + h/2, tv.z);
+
+ glLoadIdentity();
+ glBegin(GL_QUADS);
glTexCoord2f(m_u2, m_v2);
- glVertex3f(tv.x - w/2, tv.y - h/2, tv.z);
- glTexCoord2f(m_u3, m_v3);
- glVertex3f(tv.x + w/2, tv.y + h/2, tv.z);
+ glVertex3f(tv.x - w/2, tv.y - h/2, tv.z / 1000.0f);
glTexCoord2f(m_u4, m_v4);
- glVertex3f(tv.x + w/2, tv.y - h/2, tv.z);
+ glVertex3f(tv.x + w/2, tv.y - h/2, tv.z / 1000.0f);
+ glTexCoord2f(m_u3, m_v3);
+ glVertex3f(tv.x + w/2, tv.y + h/2, tv.z / 1000.0f);
+ glTexCoord2f(m_u1, m_v1);
+ glVertex3f(tv.x - w/2, tv.y + h/2, tv.z / 1000.0f);
glEnd();
}
Modified: tiki/src/gl/drawables/console.cpp
===================================================================
--- tiki/src/gl/drawables/console.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/src/gl/drawables/console.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -10,14 +10,12 @@
#include "pch.h"
#include "Tiki/tiki.h"
-#include "Tiki/plxcompat.h"
#include "Tiki/drawables/console.h"
#include <stdarg.h>
using namespace Tiki::GL;
-using namespace Tiki::GL::Plxcompat;
-ConsoleText::ConsoleText( int cols, int rows, Texture * texture )
+Console::Console( int cols, int rows, Texture * texture )
{
m_texture = texture;
m_rows = rows;
@@ -54,21 +52,21 @@
clear();
}
-ConsoleText::~ConsoleText()
+Console::~Console()
{}
-void ConsoleText::setTexture( Texture * txr )
+void Console::setTexture( Texture * txr )
{
m_texture = txr;
}
-void ConsoleText::setSize( float w, float h )
+void Console::setSize( float w, float h )
{
m_w = w;
m_h = h;
}
-void ConsoleText::clear()
+void Console::clear()
{
int x;
@@ -86,7 +84,7 @@
refresh();
}
-void ConsoleText::scroll( int rows, int top, int left, int bottom, int right )
+void Console::scroll( int rows, int top, int left, int bottom, int right )
{
assert( top >= 0 && left >= 0 && bottom <= m_rows && right <= m_cols );
@@ -111,18 +109,18 @@
refresh();
}
-void ConsoleText::scroll( int rows )
+void Console::scroll( int rows )
{
scroll( rows, 0, 0, m_rows - 1, m_cols - 1 );
}
-void ConsoleText::locate( int x, int y )
+void Console::locate( int x, int y )
{
m_cursor_x = x;
m_cursor_y = y;
}
-void ConsoleText::color( int fg, int bg )
+void Console::color( int fg, int bg )
{
m_attr = 0x0000;
if ( fg > 7 && fg <= 16 )
@@ -134,7 +132,7 @@
m_attr |= ( bg << 8 );
}
-void ConsoleText::printf( const char *fmt, ... )
+void Console::printf( const char *fmt, ... )
{
#if TIKI_PLAT == TIKI_NDS
char buf[ 1024 ];
@@ -219,7 +217,7 @@
refresh();
}
-void ConsoleText::renderCharacter( float x, float y, float w, float h, unsigned char c, int attr )
+void Console::renderCharacter( float x, float y, float w, float h, unsigned char c, int attr )
{
float u = static_cast<float>( ( c % 16 ) * 8 );
float v = static_cast<float>( ( c / 16 ) * 8 );
@@ -248,7 +246,7 @@
glVertex3f(tv.x + w - (m_w / 2), tv.y + h - (m_h / 2), tv.z);
}
-void ConsoleText::renderBackground( float x, float y, float w, float h, int color )
+void Console::renderBackground( float x, float y, float w, float h, int color )
{
const Vector & sv = getScale();
w *= sv.x;
@@ -263,7 +261,7 @@
glVertex3f(tv.x + w - (m_w / 2), tv.y + h - (m_h / 2), tv.z);
}
-void ConsoleText::draw( ObjType list )
+void Console::draw( ObjType list )
{
int x = 0, y = 0;
float x_step = ( m_w / m_cols );
@@ -300,7 +298,7 @@
}
}
-void ConsoleText::processAnsiString()
+void Console::processAnsiString()
{
if ( ansistr[ 1 ] == '[' )
{
@@ -355,7 +353,6 @@
m_cursor_x = m_cols - 1;
if ( m_cursor_y > m_rows - 1 )
m_cursor_y = m_rows - 1;
- //printf("**** GOTO XY(%u,%u) ****\n", m_cursor_x, m_cursor_y);
}
break;
case 'A': // UP * lines
@@ -368,7 +365,6 @@
m_cursor_x = m_cols - 1;
if ( m_cursor_y > m_rows - 1 )
m_cursor_y = m_rows - 1;
- //printf("**** UP %u ****\n",m_cursor_y);
break;
case 'B': // DOWN * lines
m_cursor_y += args[ 0 ];
@@ -380,7 +376,6 @@
m_cursor_x = m_cols - 1;
if ( m_cursor_y > m_rows - 1 )
m_cursor_y = m_rows - 1;
- //printf("**** DOWN %u ****\n",m_cursor_y);
break;
case 'C': // RIGHT * chars
m_cursor_x += args[ 0 ];
@@ -392,7 +387,6 @@
m_cursor_x = m_cols - 1;
if ( m_cursor_y > m_rows - 1 )
m_cursor_y = m_rows - 1;
- //printf("**** RIGHT %u ****\n",m_cursor_y);
break;
case 'D': // LEFT * chars
m_cursor_x -= args[ 0 ];
@@ -404,26 +398,21 @@
m_cursor_x = m_cols - 1;
if ( m_cursor_y > m_rows - 1 )
m_cursor_y = m_rows - 1;
- //printf("**** LEFT %u ****\n",m_cursor_y);
break;
case 'J': // clearscreen
clear();
- //printf("**** CLEAR SCREEN ****\n");
break;
case 's': // save location
m_save_x = m_cursor_x;
m_save_y = m_cursor_y;
- //printf("**** SAVE XY (%u, %u) ****\n", save_x, save_y);
break;
case 'u': // restore location
m_cursor_x = m_save_x;
m_cursor_y = m_save_y;
m_save_x = m_save_y = 0;
- //printf("**** RESTORE XY (%u, %u) ****\n", m_cursor_x, m_cursor_y);
break;
case 'n': // ANSI detect
//remoteHost->write("\x1b[1;1R", 6);
- //printf("**** ANSI DETECTION ****\n");
break;
case 'k':
case 'K': // clear EOL
@@ -434,16 +423,13 @@
m_charData[ ( m_cursor_y * m_cols ) + x ] = 0;
m_colorData[ ( m_cursor_y * m_cols ) + x++ ] = m_attr;
}
- //printf("**** CLEAR EOL %u ****\n", m_cursor_y);
}
break;
case 'm': // set color attribute, currently ignored
{
- //printf("**** SET ATTRIBUTE [%u]", argptr);
int i;
for ( i = 0; i < argptr; i++ )
{
- //printf(" %u", args[i]);
switch ( args[ i ] )
{
case 0:
@@ -530,14 +516,9 @@
break;
}
}
- //printf(" ****\n");
}
break;
}
}
- // else
- // {
- // printf("Bogus ANSI: %s\n", ansistr);
- // }
ansiptr = 0;
}
Modified: tiki/src/gl/drawables/label.cpp
===================================================================
--- tiki/src/gl/drawables/label.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/src/gl/drawables/label.cpp 2007-10-27 01:19:20 UTC (rev 517)
@@ -10,10 +10,8 @@
#include "pch.h"
#include "Tiki/drawables/label.h"
-#include "Tiki/plxcompat.h"
using namespace Tiki::GL;
-using namespace Tiki::GL::Plxcompat;
Label::Label(Font * fh, const string & text, float size, bool centered, bool smear) {
m_fh = fh;
Modified: tiki/src/gl/drawables/pointerArrow.cpp
===================================================================
--- tiki/src/gl/drawables/pointerArrow.cpp 2007-10-26 19:19:14 UTC (rev 516)
+++ tiki/src/gl/drawables/pointerArrow.cpp 2007-10-27 01:19...
[truncated message content] |