catastropher / x3d-68k Goto Github PK
View Code? Open in Web Editor NEWA 3D portal-rendering game engine for the TI-nSpire and PC
A 3D portal-rendering game engine for the TI-nSpire and PC
3D polygons have a number of utility functions, but we're lacking their 2D counterparts:
void x3d_polygon2d_translate(X3D_Polygon2D* poly, X3D_Vex2D shift);
void x3d_polygon2d_reverse(X3D_Polygon2D* poly);
void x3d_polygon2d_center(X3D_Polygon2D* poly, X3D_Vex2D* dest);
void x3d_polygon2d_scale(X3D_Polygon2D* poly, fp8x8 scale);
void x3d_polygon2d_copy(X3D_Polygon2D* src, X3D_Polygon2D* dest);
Take a look at C/geo/polygon.c and headers/X3D_polygon.h
With interrupts enabled on the Nspire, a clock cursor automatically appears and is drawn to the screen. While annoying, it's actually causing a crash. The Nspire OS assumes the LCD is in 16-bit color mode, but X3D uses 8-bit color. So, the screen is only half as big as it expects and it draws it off the screen.
Solution: find a way to disable the clock cursor.
Screen initialization shouldn't be performed in the vidrestart callback - it should be performed in the platform initialization code.
Large surfaces seem to be cut off for some reason while rendering them on a polygon (see below, screenshot from XBuilder).
While rendering, this debug info was dumped to the console, which may be relevant:
/home/michael/code/X3D-68k/src/C/render/geo/render_polygon_texture_generic.h:59:25: runtime error: left shift of negative value -1048
/home/michael/code/X3D-68k/src/C/render/geo/render_polygon_texture_generic.h:50:19: runtime error: signed integer overflow: 1614449424 + 1614449424 cannot be represented in type 'int'
/home/michael/code/X3D-68k/src/C/render/geo/render_polygon_flat.c:47:19: runtime error: signed integer overflow: 2109702881 + 45809696 cannot be represented in type 'int'
/home/michael/code/X3D-68k/src/C/render/surface.c:59:56: runtime error: left shift of negative value -516
/home/michael/code/X3D-68k/src/C/render/geo/render_polygon_texture_generic.h:59:25: runtime error: left shift of negative value -24634
/home/michael/code/X3D-68k/src/C/render/geo/render_polygon_texture_generic.h:50:19: runtime error: signed integer overflow: 1614446591 + 1614451024 cannot be represented in type 'int'
You might want to consider renaming the repository, as this is no longer a 68k project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.