Fix residual crosscompile, add (untested) temp font support under Win32
This commit is contained in:
parent
804e522c1b
commit
1627b484cb
5 changed files with 20 additions and 7 deletions
|
@ -4,7 +4,7 @@ SDL_LIBS=-L/usr/i586-mingw32msvc/lib -lSDL
|
||||||
|
|
||||||
CXXFLAGS = -W -Wall -Ilua/include $(SDL_CFLAGS) # -O2
|
CXXFLAGS = -W -Wall -Ilua/include $(SDL_CFLAGS) # -O2
|
||||||
LDFLAGS = -W -Wall # -O2
|
LDFLAGS = -W -Wall # -O2
|
||||||
LIBS = -Llua/lib -llua -llualib -lmingw32 -lopengl32 -lglu32 $(SDL_LIBS)
|
LIBS = -Llua/lib -llua -llualib -lmingw32 -lopengl32 -lglu32 -lgdi32 $(SDL_LIBS)
|
||||||
|
|
||||||
OBJS = main.o lab.o bitmap.o model.o resource.o material.o debug.o \
|
OBJS = main.o lab.o bitmap.o model.o resource.o material.o debug.o \
|
||||||
textsplit.o lua.o registry.o localize.o scene.o engine.o actor.o \
|
textsplit.o lua.o registry.o localize.o scene.o engine.o actor.o \
|
||||||
|
|
3
TODO
3
TODO
|
@ -1,8 +1,7 @@
|
||||||
Residual in-progress items (in rough order of priority):
|
Residual in-progress items (in rough order of priority):
|
||||||
-------------------------------------------------------0
|
-------------------------------------------------------0
|
||||||
* Add SMUSH (low-priority, but important) - Assigned to aquadran
|
* Add SMUSH (low-priority, but important) - Assigned to aquadran
|
||||||
* Add LAF font support to replace existing hack ]______
|
* Add LAF font support to replace existing hack
|
||||||
* .. meanwhile add Win32 support for said hack :) ] Ender
|
|
||||||
|
|
||||||
Residual TODO list (in rough order of priority):
|
Residual TODO list (in rough order of priority):
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
|
|
|
@ -49,7 +49,6 @@ void Actor::walkTo(Vector3d p) {
|
||||||
// For now, this is just the ignoring-boxes version (which afaict
|
// For now, this is just the ignoring-boxes version (which afaict
|
||||||
// isn't even in the original). This will eventually need a
|
// isn't even in the original). This will eventually need a
|
||||||
// following-boxes version also.
|
// following-boxes version also.
|
||||||
printf("walkto\n");
|
|
||||||
if (p == pos_)
|
if (p == pos_)
|
||||||
walking_ = false;
|
walking_ = false;
|
||||||
else {
|
else {
|
||||||
|
|
17
main.cpp
17
main.cpp
|
@ -35,6 +35,7 @@
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#else
|
#else
|
||||||
|
#include <SDL_syswm.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -128,7 +129,21 @@ int main(int argc, char *argv[]) {
|
||||||
// FIXME: Hacky temporary font renderer code
|
// FIXME: Hacky temporary font renderer code
|
||||||
Engine::instance()->font = glGenLists(256);
|
Engine::instance()->font = glGenLists(256);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#warning FIXME: Do Win32 code
|
{
|
||||||
|
#warning entering w32 code
|
||||||
|
HDC hDC;
|
||||||
|
HFONT font;
|
||||||
|
SDL_SysWMinfo wmi;
|
||||||
|
SDL_VERSION(&wmi.version);
|
||||||
|
SDL_GetWMInfo(&wmi);
|
||||||
|
|
||||||
|
hDC = GetDC(wmi.window);
|
||||||
|
font = CreateFont(0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
|
||||||
|
OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, 0 ,
|
||||||
|
FF_DONTCARE|DEFAULT_PITCH, "Courier New");
|
||||||
|
SelectObject(hDC, font);
|
||||||
|
wglUseFontBitmaps(hDC, 0, 256, Engine::instance()->font);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
Display *dpy = XOpenDisplay(NULL);
|
Display *dpy = XOpenDisplay(NULL);
|
||||||
|
|
|
@ -45,9 +45,9 @@ void TextObject::draw() {
|
||||||
glRasterPos2i(x_, y_);
|
glRasterPos2i(x_, y_);
|
||||||
glListBase(Engine::instance()->font);
|
glListBase(Engine::instance()->font);
|
||||||
glCallLists(
|
glCallLists(
|
||||||
strlen(rindex(localString, '/')) - 1,
|
strlen(strrchr(localString, '/')) - 1,
|
||||||
GL_UNSIGNED_BYTE,
|
GL_UNSIGNED_BYTE,
|
||||||
rindex(localString, '/') + 1
|
strrchr(localString, '/') + 1
|
||||||
);
|
);
|
||||||
|
|
||||||
glMatrixMode( GL_PROJECTION );
|
glMatrixMode( GL_PROJECTION );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue