Browse Source

activated animu grill in nt builds

master
despair 5 years ago
parent
commit
30b2a95539
  1. 15
      src/graphics/components/AnimeComponent.cpp
  2. 4
      src/main.cpp

15
src/graphics/components/AnimeComponent.cpp

@ -2,6 +2,9 @@ @@ -2,6 +2,9 @@
#include <cmath>
#include <iostream>
#include "../../pnm.h"
#ifdef __MINGW32__
#include "../../../anime.h"
#endif
AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float rawWidth, const float rawHeight, const int passedWindowWidth, const int passedWindowHeight) : BoxComponent(rawX, rawY, rawWidth, rawHeight, 0x00000000, passedWindowWidth, passedWindowHeight) {
//std::cout << "AnimeComponent::AnimeComponent" << std::endl;
@ -14,11 +17,20 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r @@ -14,11 +17,20 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r
width = rawWidth;
height = rawHeight;
#ifdef __MINGW32__ // the old "huge string" works fine with mingw
for (int py = 0; py < 1024; py++) {
for (int px = 0; px < 1024; px++) {
for (int i = 0; i < 4; i++) {
data[1023 - py][px][i] = anime.pixel_data[((px * 4) + (py * 4 * 1024)) + i];
}
}
}
#else // this is either non-Windows or using Microsoft C/C++
RGBAPNMObject *anime = readPPM("anime.pnm");
if (!anime) {
std::cout << "Can't set up anime component, couldn't read anime.pnm" << std::endl;
}
for (int py = 0; py < 1024; py++) {
for (int px = 0; px < 1024; px++) {
if (anime) {
@ -31,6 +43,7 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r @@ -31,6 +43,7 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r
}
}
}
#endif
float vx = rawX;
float vy = rawY;

4
src/main.cpp

@ -8,11 +8,11 @@ @@ -8,11 +8,11 @@
#include <ctime>
#include <iostream>
#include <sys/stat.h>
#ifdef _WIN32
extern "C"{
#ifdef _WIN32
void init_heap();
#endif
}
#endif
#if defined(_WIN32) && !defined(_WIN64)
#define PLATFORM "i686-pc-winnt"
#endif

Loading…
Cancel
Save