forked from mirrors/principia
Undefine preprocessor defines that conflict across source files
This commit is contained in:
parent
df00758dfe
commit
76bd4d9c70
18 changed files with 53 additions and 14 deletions
|
|
@ -125,3 +125,4 @@ bomber::attack(int add_cooldown)
|
||||||
this->attack_timer += add_cooldown;
|
this->attack_timer += add_cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef SHOOT_VELOCITY
|
||||||
|
|
|
||||||
|
|
@ -1051,3 +1051,6 @@ plug_base::on_release(game *g)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef QUALITY
|
||||||
|
#undef WIDTH
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#include "fxemitter.hh"
|
#include "fxemitter.hh"
|
||||||
#include "game.hh"
|
#include "game.hh"
|
||||||
|
|
||||||
#define FORCE 300.f
|
#define BOOM_FORCE 300.f
|
||||||
|
|
||||||
explosive::explosive(int explosive_type)
|
explosive::explosive(int explosive_type)
|
||||||
{
|
{
|
||||||
|
|
@ -165,7 +165,7 @@ explosive::trigger()
|
||||||
b2Vec2 p = this->get_position();
|
b2Vec2 p = this->get_position();
|
||||||
|
|
||||||
W->explode(this, trigger_point, this->get_layer(), 20,
|
W->explode(this, trigger_point, this->get_layer(), 20,
|
||||||
(W->level.version >= LEVEL_VERSION_1_5 ? FORCE*this->properties[2].v.f : FORCE),
|
(W->level.version >= LEVEL_VERSION_1_5 ? BOOM_FORCE*this->properties[2].v.f : BOOM_FORCE),
|
||||||
this->properties[1].v.f,
|
this->properties[1].v.f,
|
||||||
(W->level.version >= LEVEL_VERSION_1_5 ? .5f : 1.f)
|
(W->level.version >= LEVEL_VERSION_1_5 ? .5f : 1.f)
|
||||||
);
|
);
|
||||||
|
|
@ -222,3 +222,5 @@ explosive::on_slider_change(int s, float value)
|
||||||
G->show_numfeed(this->properties[1].v.f);
|
G->show_numfeed(this->properties[1].v.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef BOOM_FORCE
|
||||||
|
|
|
||||||
10
src/fan.cc
10
src/fan.cc
|
|
@ -6,8 +6,7 @@
|
||||||
#define NUM_RAYS 5
|
#define NUM_RAYS 5
|
||||||
#define RAY_LENGTH 10.f
|
#define RAY_LENGTH 10.f
|
||||||
#define FAN_WIDTH 1.f
|
#define FAN_WIDTH 1.f
|
||||||
|
#define FAN_FORCE 2.f
|
||||||
#define FORCE 2.f
|
|
||||||
|
|
||||||
fan::fan()
|
fan::fan()
|
||||||
: blade_rot(0.f)
|
: blade_rot(0.f)
|
||||||
|
|
@ -137,7 +136,7 @@ fan::solve_electronics()
|
||||||
return this->s_in[0].get_connected_edevice();
|
return this->s_in[0].get_connected_edevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->force = (this->s_in[0].get_value() * FORCE) / (float)NUM_RAYS;
|
this->force = (this->s_in[0].get_value() * FAN_FORCE) / (float)NUM_RAYS;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -159,3 +158,8 @@ fan::cb_handler::ReportFixture(b2Fixture *f, const b2Vec2 &pt, const b2Vec2 &nor
|
||||||
|
|
||||||
return -1.f;
|
return -1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef NUM_RAYS
|
||||||
|
#undef RAY_LENGTH
|
||||||
|
#undef FAN_WIDTH
|
||||||
|
#undef FAN_FORCE
|
||||||
|
|
|
||||||
|
|
@ -525,3 +525,7 @@ lmotor::restore()
|
||||||
j->SetMaxMotorForce(this->_force);
|
j->SetMaxMotorForce(this->_force);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef SPEED
|
||||||
|
#undef FORCE
|
||||||
|
#undef FRICTION
|
||||||
|
|
|
||||||
|
|
@ -96,3 +96,5 @@ lobber::attack(int add_cooldown)
|
||||||
this->attack_timer = LOBBER_RELOAD_TIME;
|
this->attack_timer = LOBBER_RELOAD_TIME;
|
||||||
this->attack_timer += add_cooldown;
|
this->attack_timer += add_cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef SHOOT_VELOCITY
|
||||||
|
|
|
||||||
|
|
@ -422,3 +422,6 @@ motor::on_slider_change(int s, float value)
|
||||||
G->show_numfeed(value * 8.f * SPEED);
|
G->show_numfeed(value * 8.f * SPEED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef SPEED
|
||||||
|
#undef TORQUE
|
||||||
|
|
|
||||||
|
|
@ -1992,3 +1992,4 @@ plant::set_position(float x, float y, uint8_t frame)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef QUALITY
|
||||||
|
|
|
||||||
|
|
@ -714,3 +714,5 @@ ragdoll::on_slider_change(int s, float value)
|
||||||
this->recreate_head_joint(true);
|
this->recreate_head_joint(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef FRICTION
|
||||||
|
|
|
||||||
|
|
@ -540,3 +540,6 @@ robot::modify_aim(float da)
|
||||||
|
|
||||||
w->set_arm_angle(w->get_arm_angle() + da, 0.1f);
|
w->set_arm_angle(w->get_arm_angle() + da, 0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef HEAD_SPEED_UP
|
||||||
|
#undef HEAD_SPEED_DOWN
|
||||||
|
|
|
||||||
|
|
@ -4713,3 +4713,5 @@ robot_parts::pickaxe::pickaxe(creature *c)
|
||||||
this->mass = 0.375f;
|
this->mass = 0.375f;
|
||||||
this->plant_dmg_multiplier = .4f;
|
this->plant_dmg_multiplier = .4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef HEAD_SPEED_UP
|
||||||
|
|
|
||||||
|
|
@ -778,3 +778,5 @@ void
|
||||||
rope::step()
|
rope::step()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef WIDTH
|
||||||
|
|
|
||||||
|
|
@ -337,3 +337,6 @@ rubberband_1::step(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef WIDTH
|
||||||
|
#undef MIN_WIDTH
|
||||||
|
|
|
||||||
|
|
@ -242,8 +242,6 @@ presolve_cog_cog(b2Contact *contact, entity *a, entity *b, int rev, const b2Mani
|
||||||
|
|
||||||
double diff = a2-a1;
|
double diff = a2-a1;
|
||||||
|
|
||||||
#define EPS .1f
|
|
||||||
|
|
||||||
//if ()
|
//if ()
|
||||||
//
|
//
|
||||||
//if (fabsf(a1) < .2f) tms_infof("A1 ALLOWED");
|
//if (fabsf(a1) < .2f) tms_infof("A1 ALLOWED");
|
||||||
|
|
@ -261,7 +259,7 @@ presolve_cog_cog(b2Contact *contact, entity *a, entity *b, int rev, const b2Mani
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if (fabsf(diff) > EPS && fabsf(diff) < (1.f-EPS)) {
|
//if (fabsf(diff) > EPS && fabsf(diff) < (1.f-EPS)) {
|
||||||
if (std::abs(diff) < EPS) {
|
if (std::abs(diff) < .1f) {
|
||||||
contact->SetEnabled(false);
|
contact->SetEnabled(false);
|
||||||
|
|
||||||
/* attach the gears to each other */
|
/* attach the gears to each other */
|
||||||
|
|
|
||||||
|
|
@ -475,3 +475,9 @@ void sticky::update(void) {
|
||||||
tmat3_copy_mat4_sub3x3(this->N, this->M);
|
tmat3_copy_mat4_sub3x3(this->N, this->M);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef WIDTH
|
||||||
|
#undef HEIGHT
|
||||||
|
|
||||||
|
#undef TEX_WIDTH
|
||||||
|
#undef TEX_HEIGHT
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ struct textbuf_vert {
|
||||||
|
|
||||||
textbuf_vert textbuffer::base[4];
|
textbuf_vert textbuffer::base[4];
|
||||||
|
|
||||||
|
#define TEX_WIDTH 1024.f
|
||||||
|
#define TEX_HEIGHT 1024.f
|
||||||
|
|
||||||
void textbuffer::_init()
|
void textbuffer::_init()
|
||||||
{
|
{
|
||||||
tms_infof("Initializing textbuffer...");
|
tms_infof("Initializing textbuffer...");
|
||||||
|
|
@ -161,9 +164,6 @@ textbuffer::add_char(glyph *gl,
|
||||||
int tx = 530;
|
int tx = 530;
|
||||||
int ty = 1024;
|
int ty = 1024;
|
||||||
|
|
||||||
#define TEX_WIDTH 1024.f
|
|
||||||
#define TEX_HEIGHT 1024.f
|
|
||||||
|
|
||||||
tvec2 uvb = {(float)bx / TEX_WIDTH, (float)by / TEX_HEIGHT};
|
tvec2 uvb = {(float)bx / TEX_WIDTH, (float)by / TEX_HEIGHT};
|
||||||
tvec2 uvt = {(float)tx / TEX_WIDTH, (float)ty / TEX_HEIGHT};
|
tvec2 uvt = {(float)tx / TEX_WIDTH, (float)ty / TEX_HEIGHT};
|
||||||
|
|
||||||
|
|
@ -238,9 +238,6 @@ textbuffer::add_char2(glyph *gl,
|
||||||
int tx = 530;
|
int tx = 530;
|
||||||
int ty = 1024;
|
int ty = 1024;
|
||||||
|
|
||||||
#define TEX_WIDTH 1024.f
|
|
||||||
#define TEX_HEIGHT 1024.f
|
|
||||||
|
|
||||||
tvec2 uvb = {(float)bx / TEX_WIDTH, (float)by / TEX_HEIGHT};
|
tvec2 uvb = {(float)bx / TEX_WIDTH, (float)by / TEX_HEIGHT};
|
||||||
tvec2 uvt = {(float)tx / TEX_WIDTH, (float)ty / TEX_HEIGHT};
|
tvec2 uvt = {(float)tx / TEX_WIDTH, (float)ty / TEX_HEIGHT};
|
||||||
|
|
||||||
|
|
@ -422,3 +419,6 @@ textbuffer::add_text2(const char *text, p_font *font,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef TEX_WIDTH
|
||||||
|
#undef TEX_HEIGHT
|
||||||
|
|
|
||||||
|
|
@ -303,3 +303,4 @@ trampoline::tpad::update()
|
||||||
tmat3_copy_mat4_sub3x3(this->N, this->M);
|
tmat3_copy_mat4_sub3x3(this->N, this->M);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef SPEED
|
||||||
|
|
|
||||||
|
|
@ -3114,3 +3114,5 @@ world::query_aabb(b2QueryCallback *callback,
|
||||||
G->unlock();
|
G->unlock();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef RAY_LENGTH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue