{
Lib3dsChunk c;
Lib3dsWord chunk;
- Lib3dsBool have_lin=LIB3DS_FALSE;
if (!lib3ds_chunk_read_start(&c, LIB3DS_LAYER_FOG, io)) {
return(LIB3DS_FALSE);
switch (chunk) {
case LIB3DS_LIN_COLOR_F:
lib3ds_io_read_rgb(io, fog->col);
- have_lin=LIB3DS_TRUE;
break;
case LIB3DS_COLOR_F:
lib3ds_io_read_rgb(io, fog->col);
{
Lib3dsChunk c;
Lib3dsWord chunk;
- Lib3dsBool have_lin=LIB3DS_FALSE;
if (!lib3ds_chunk_read_start(&c, LIB3DS_SOLID_BGND, io)) {
return(LIB3DS_FALSE);
switch (chunk) {
case LIB3DS_LIN_COLOR_F:
lib3ds_io_read_rgb(io, background->solid.col);
- have_lin=LIB3DS_TRUE;
break;
case LIB3DS_COLOR_F:
lib3ds_io_read_rgb(io, background->solid.col);
Matrix4x4 create_projection_matrix(scalar_t vfov, scalar_t aspect, scalar_t near_clip, scalar_t far_clip) {
#ifdef COORD_LHS
- scalar_t hfov = vfov * aspect;
- scalar_t w = 1.0f / (scalar_t)tan(hfov * 0.5f);
- scalar_t h = 1.0f / (scalar_t)tan(vfov * 0.5f);
+ scalar_t f = 1.0f / (scalar_t)tan(vfov * 0.5f);
scalar_t q = far_clip / (far_clip - near_clip);
-
+
Matrix4x4 mat;
- mat[0][0] = w;
- mat[1][1] = h;
+ mat[0][0] = f / aspect;
+ mat[1][1] = f;
mat[2][2] = q;
mat[3][2] = 1.0f;
mat[2][3] = -q * near_clip;
const size_t prop_size[] = {32, 8, 16, 32, 0};
struct PropTypeMatch {
- char *symb;
+ const char *symb;
PropType type;
} prop_match[] = {
{"float", PROP_FLOAT},
vector<Element> elem;
FILE *fp;
unsigned long header_skip;
+
+ Ply();
};
static Ply *read_header(FILE *fp);
static const char *ply_filename = 0; // for error reports
+Ply::Ply()
+{
+ fmt = PLY_ASCII;
+ fp = 0;
+ header_skip = 0;
+}
+
bool file_is_ply(FILE *file) {
char sig[5] = {0};
fseek(fp, 0, SEEK_SET);
Ply *ply = new Ply;
- memset(ply, 0, sizeof(Ply));
bool vertex_ok = false, face_ok = false;
v2 += origin;
float alpha = (float)((quad_count-1) - i) / (float)quad_count;
- dsys::overlay(tex, v1, v2, Color(1.0f, 1.0f, 1.0f, alpha), false);
+ dsys::overlay(tex, v1, v2, Color(1.0f, 1.0f, 1.0f, alpha), 0, false);
scale += dscale;
}
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
-
+
+ float aspect = (float)fxwt::screenx / fxwt::screeny;
+ float offs = (1.333333333f - aspect) / 2.0f;
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
- glOrtho(0.0, 1.0, 1.0, 0.0, 0.0, 1.0);
+ glOrtho(offs, 1.0 - offs, 1.0, 0.0, 0.0, 1.0);
set_lighting(false);
set_zbuffering(false);
//dsys::init();
// show loading screen
+ glClear(GL_COLOR_BUFFER_BIT);
dsys::overlay(get_texture("data/img/loading.jpg"), Vector2(0, 0), Vector2(1, 1), 1.0);
flip();