Ein paar verbesserungen...
This commit is contained in:
parent
e8de360ed9
commit
b41c12950d
|
@ -36,6 +36,11 @@ void GLCamera::setCamera() {
|
||||||
// glTranslateP3D(-pos);
|
// glTranslateP3D(-pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLCamera::setPosDirNorm(Punkt3D p, Punkt3D d, Punkt3D n) {
|
||||||
|
pos = p;
|
||||||
|
dir = d.getNormalized();
|
||||||
|
norm = n.getNormalized();
|
||||||
|
}
|
||||||
|
|
||||||
// Move-Funktionen
|
// Move-Funktionen
|
||||||
|
|
||||||
|
@ -170,6 +175,10 @@ void GLCamera::renderCoord() {
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Punkt3D GLCamera::getPos() {
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
GLCamera::~GLCamera() {
|
GLCamera::~GLCamera() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ class GLCamera {
|
||||||
// GLCamera(Punkt3d
|
// GLCamera(Punkt3d
|
||||||
|
|
||||||
void setCamera();
|
void setCamera();
|
||||||
|
void setPosDirNorm(Punkt3D p, Punkt3D D, Punkt3D n);
|
||||||
|
|
||||||
// Std Move
|
// Std Move
|
||||||
void moveForward(float sec);
|
void moveForward(float sec);
|
||||||
|
@ -51,6 +52,7 @@ class GLCamera {
|
||||||
|
|
||||||
void print();
|
void print();
|
||||||
void renderCoord();
|
void renderCoord();
|
||||||
|
Punkt3D getPos();
|
||||||
|
|
||||||
~GLCamera();
|
~GLCamera();
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,7 @@ bool GLFontEngine::addFont(std::string fontfile, std::string fontname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fontpool[fontname] = tmp;
|
fontpool[fontname] = tmp;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLFontEngine::quit() {
|
void GLFontEngine::quit() {
|
||||||
|
@ -124,7 +124,7 @@ void GLFontEngine::renderLine(std::string text, SDL_Rect pos) {
|
||||||
for(unsigned int i=0; i<text.length(); i++) {
|
for(unsigned int i=0; i<text.length(); i++) {
|
||||||
int ch = text[i];
|
int ch = text[i];
|
||||||
if(ch<0) {
|
if(ch<0) {
|
||||||
ch += 256; // char geht wohl in machen fällen nur von -128 bis +127 *hust*
|
ch += 256; // char geht wohl in machen f<EFBFBD>llen nur von -128 bis +127 *hust*
|
||||||
}
|
}
|
||||||
// std::cout << (int)text[i] << " ";
|
// std::cout << (int)text[i] << " ";
|
||||||
tex_x = ((ch-1)%16 / 16.0f);
|
tex_x = ((ch-1)%16 / 16.0f);
|
||||||
|
@ -174,7 +174,7 @@ void GLFontEngine::renderLine(std::string str, int x, int y, bool center, SDL_Re
|
||||||
|
|
||||||
void GLFontEngine::renderLines(std::string str, int x, int y, bool center, SDL_Rect *rendered_to, int wrap, int paintbackground) {
|
void GLFontEngine::renderLines(std::string str, int x, int y, bool center, SDL_Rect *rendered_to, int wrap, int paintbackground) {
|
||||||
if(wrap) {
|
if(wrap) {
|
||||||
// \n einfügen, wenns zu groß ist
|
// \n einf<EFBFBD>gen, wenns zu gro<72> ist
|
||||||
for(unsigned int i=0, a=0; i<str.length(); i++, a++) {
|
for(unsigned int i=0, a=0; i<str.length(); i++, a++) {
|
||||||
if(str[i]!='\n') {
|
if(str[i]!='\n') {
|
||||||
if(a*font->charwidth*fsize>wrap) {
|
if(a*font->charwidth*fsize>wrap) {
|
||||||
|
|
|
@ -21,6 +21,10 @@ class MenuMenu {
|
||||||
int maxwidth;
|
int maxwidth;
|
||||||
int valuewidth;
|
int valuewidth;
|
||||||
GLFontEngine fontengine;
|
GLFontEngine fontengine;
|
||||||
|
|
||||||
|
// Soll anderes center evtl. ersetzen
|
||||||
|
// TODO: cleanup
|
||||||
|
bool fullcenter;
|
||||||
public:
|
public:
|
||||||
MenuMenu();
|
MenuMenu();
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,7 @@ bool GLSDLScreen::apply() {
|
||||||
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||||
glEnable(GL_ALPHA_TEST);
|
glEnable(GL_ALPHA_TEST);
|
||||||
glAlphaFunc(GL_GREATER, 0.1);
|
glAlphaFunc(GL_GREATER, 0.1);
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Projection
|
// Projection
|
||||||
|
@ -124,7 +125,7 @@ bool GLSDLScreen::apply() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Texturen neuladen, eigentlich nur für Windows. Aber egal.
|
// Texturen neuladen, eigentlich nur f<EFBFBD>r Windows. Aber egal.
|
||||||
GLTexture::reloadAll();
|
GLTexture::reloadAll();
|
||||||
glMatrixMode(GL_TEXTURE);
|
glMatrixMode(GL_TEXTURE);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
|
@ -16,6 +16,7 @@ class GLSDLScreen {
|
||||||
bool resizable;
|
bool resizable;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
|
|
||||||
|
|
||||||
// OpenGL related
|
// OpenGL related
|
||||||
float znear, zfar;
|
float znear, zfar;
|
||||||
void (*extraglparam)();
|
void (*extraglparam)();
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef __LOADOBJ_H
|
#ifndef __LOADOBJ_H
|
||||||
#define __LOADOBJ_H
|
#define __LOADOBJ_H
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
#include "modelloader.h"
|
#include "modelloader.h"
|
||||||
#include "model.h"
|
#include "model.h"
|
||||||
#include "../extstring.h"
|
#include "../extstring.h"
|
||||||
|
|
Loading…
Reference in New Issue