Skip to content

Commit

Permalink
Merge pull request #15 from blackbeard334/garbage
Browse files Browse the repository at this point in the history
Release 0.0.6
  • Loading branch information
blackbeard334 committed May 26, 2016
2 parents 2cf9d65 + 486bee6 commit ca35b1f
Show file tree
Hide file tree
Showing 76 changed files with 4,803 additions and 1,871 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ crashlytics-build.properties
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### NotepadPP template
# Notepad++ backups #
*.bak

25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
#djoom3 - a Doom 3 Java port.


####23-05-16
Version 0.0.6

**ingame BANZAI!**

Too dark, and lots and LOTS of graphics bugs though, but who cares.

Check the 2nd half of the video for the wireframe rendering, to see what's actually going on.

[http://www.youtube.com/watch?v=vudRn5F0Z3w](http://www.youtube.com/watch?v=vudRn5F0Z3w)
[![Screenshot](http://img.youtube.com/vi/vudRn5F0Z3w/0.jpg)](http://www.youtube.com/watch?v=vudRn5F0Z3w"djoom3 0.0.6")


####23-03-16
Version 0.0.5

[http://www.youtube.com/watch?v=JstU-T1mHPo](http://www.youtube.com/watch?v=JstU-T1mHPo)
[![Screenshot](http://img.youtube.com/vi/JstU-T1mHPo/0.jpg)](http://www.youtube.com/watch?v=JstU-T1mHPo"djoom3 0.0.5")


####05-03-16
Version 0.0.4

Expand All @@ -12,9 +33,9 @@ Version 0.0.4
####05-02-15:
-Initial non playable release.

![http://wiki.djoom3.googlecode.com/git/init_menus.png](http://wiki.djoom3.googlecode.com/git/init_menus.png)
![https://raw.githubusercontent.com/blackbeard334/djoom3/wiki/init_menus.png](https://raw.githubusercontent.com/blackbeard334/djoom3/wiki/init_menus.png)

![http://wiki.djoom3.googlecode.com/git/title.png](http://wiki.djoom3.googlecode.com/git/title.png)
![https://raw.githubusercontent.com/blackbeard334/djoom3/wiki/title.png](https://raw.githubusercontent.com/blackbeard334/djoom3/wiki/title.png)



Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.djoom3</groupId>
<artifactId>djoom3</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6-SNAPSHOT</version>

<packaging>jar</packaging>

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/neo/CM/CollisionModel_local.java
Original file line number Diff line number Diff line change
Expand Up @@ -6632,14 +6632,14 @@ private void OptimizeArrays(cm_model_s model) {

// realloc vertices
oldVertices = model.vertices;
if (oldVertices != null) {
if (oldVertices != null && oldVertices.length != 0) {
model.vertices = cm_vertex_s.generateArray(model.numVertices);
System.arraycopy(oldVertices, 0, model.vertices, 0, Math.min(oldVertices.length, model.numVertices));
}

// realloc edges
oldEdges = model.edges;
if (oldEdges != null) {
if (oldEdges != null && oldEdges.length != 0) {
model.edges = cm_edge_s.generateArray(model.numEdges);
System.arraycopy(oldEdges, 0, model.edges, 0, Math.min(oldEdges.length, model.numEdges));
}
Expand Down Expand Up @@ -7016,7 +7016,7 @@ private boolean TrmFromModel(final cm_model_s model, idTraceModel trm) {
if (!TrmFromModel_r(trm, model.node)) {
common.Printf("idCollisionModelManagerLocal::TrmFromModel: model %s has too many polygons.\n", model.name);
PrintModelInfo(model);
return false;
// return false;//HACKME::9
}

// copy vertices
Expand Down Expand Up @@ -7045,7 +7045,7 @@ private boolean TrmFromModel(final cm_model_s model, idTraceModel trm) {
if (numEdgeUsers[i] != 2) {
common.Printf("idCollisionModelManagerLocal::TrmFromModel: model %s has dangling edges, the model has to be an enclosed hull.\n", model.name);
PrintModelInfo(model);
return false;
// return false;//HACKME::9
}
}

Expand Down
114 changes: 104 additions & 10 deletions src/main/java/neo/Game/AFEntity.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package neo.Game;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import neo.CM.CollisionModel.trace_s;
import neo.Game.AF.idAF;
import neo.Game.AFEntity.jointTransformData_t;
import static neo.Game.Animation.Anim.ANIMCHANNEL_ALL;
import static neo.Game.Animation.Anim.jointModTransform_t.JOINTMOD_WORLD;
import static neo.Game.Animation.Anim.jointModTransform_t.JOINTMOD_WORLD_OVERRIDE;
import neo.Game.Animation.Anim_Blend.idDeclModelDef;

import static neo.Game.Entity.EV_Activate;
import static neo.Game.Entity.EV_SetAngularVelocity;
import static neo.Game.Entity.EV_SetLinearVelocity;
import static neo.Game.Entity.TH_PHYSICS;
Expand All @@ -17,7 +22,14 @@
import neo.Game.Entity.idAnimatedEntity;
import neo.Game.Entity.idEntity;
import static neo.Game.GameSys.Class.EV_Remove;

import neo.Game.GameSys.Class;
import neo.Game.GameSys.Class.eventCallback_t;
import neo.Game.GameSys.Class.eventCallback_t0;
import neo.Game.GameSys.Class.eventCallback_t1;
import neo.Game.GameSys.Class.eventCallback_t2;
import neo.Game.GameSys.Class.idClass;
import neo.Game.GameSys.Class.idEventArg;
import neo.Game.GameSys.Event.idEventDef;
import neo.Game.GameSys.SaveGame.idRestoreGame;
import neo.Game.GameSys.SaveGame.idSaveGame;
Expand Down Expand Up @@ -490,6 +502,12 @@ public void UnlinkCombat() {

public static class idAFEntity_Base extends idAnimatedEntity {
// public CLASS_PROTOTYPE( idAFEntity_Base );
private static Map<idEventDef, eventCallback_t> eventCallbacks = new HashMap<>();

static {
eventCallbacks.putAll(idAnimatedEntity.getEventCallBacks());
eventCallbacks.put(EV_SetConstraintPosition, (eventCallback_t2<idAFEntity_Base>) idAFEntity_Base::Event_SetConstraintPosition);
}

protected idAF af; // articulated figure
protected idClipModel combatModel; // render model for hit detection
Expand Down Expand Up @@ -790,8 +808,17 @@ public static void DropAFs(idEntity ent, final String type, idList<idEntity> lis
}
}

protected void Event_SetConstraintPosition(final String name, final idVec3 pos) {
af.SetConstraintPosition(name, pos);
protected void Event_SetConstraintPosition(final idEventArg<String> name, final idEventArg<idVec3> pos) {
af.SetConstraintPosition(name.value, pos.value);
}

@Override
public eventCallback_t getEventCallBack(idEventDef event) {
return eventCallbacks.get(event);
}

public static Map<idEventDef, eventCallback_t> getEventCallBacks() {
return eventCallbacks;
}
};
/*
Expand All @@ -804,6 +831,13 @@ protected void Event_SetConstraintPosition(final String name, final idVec3 pos)

public static class idAFEntity_Gibbable extends idAFEntity_Base {
// CLASS_PROTOTYPE( idAFEntity_Gibbable );
private static Map<idEventDef, eventCallback_t> eventCallbacks = new HashMap<>();

static {
eventCallbacks.putAll(idAFEntity_Base.getEventCallBacks());
eventCallbacks.put(EV_Gib, (eventCallback_t1<idAFEntity_Gibbable>) idAFEntity_Gibbable::Event_Gib);
eventCallbacks.put(EV_Gibbed, (eventCallback_t0<idAFEntity_Gibbable>) idAFEntity_Base::Event_Remove);
}

protected idRenderModel skeletonModel;
protected int skeletonModelDefHandle;
Expand Down Expand Up @@ -995,8 +1029,8 @@ protected void InitSkeletonModel() {
}
}

protected void Event_Gib(final String damageDefName) {
Gib(new idVec3(0, 0, 1), damageDefName);
protected void Event_Gib(final idEventArg<String> damageDefName) {
Gib(new idVec3(0, 0, 1), damageDefName.value);
}

/**
Expand All @@ -1021,6 +1055,16 @@ public final void idAFEntity_Base_Show() {
public final boolean idAFEntity_Base_UpdateAnimationControllers() {
return super.UpdateAnimationControllers();
}

@Override
public eventCallback_t getEventCallBack(idEventDef event) {
return eventCallbacks.get(event);
}

public static Map<idEventDef, eventCallback_t> getEventCallBacks() {
return eventCallbacks;
}

};

/*
Expand All @@ -1032,6 +1076,12 @@ public final boolean idAFEntity_Base_UpdateAnimationControllers() {
*/
public static class idAFEntity_Generic extends idAFEntity_Gibbable {
// CLASS_PROTOTYPE( idAFEntity_Generic );
private static Map<idEventDef, eventCallback_t> eventCallbacks = new HashMap<>();

static {
eventCallbacks.putAll(idAFEntity_Gibbable.getEventCallBacks());
eventCallbacks.put(EV_Activate, (eventCallback_t1<idAFEntity_Generic>) idAFEntity_Generic::Event_Activate);
}

private final boolean[] keepRunningPhysics = {false};
//
Expand Down Expand Up @@ -1085,7 +1135,7 @@ public void KeepRunningPhysics() {
keepRunningPhysics[0] = true;
}

private void Event_Activate(idEntity activator) {
private void Event_Activate(idEventArg<idEntity> activator) {
float delay;
idVec3 init_velocity = new idVec3(), init_avelocity = new idVec3();

Expand All @@ -1111,6 +1161,16 @@ private void Event_Activate(idEntity activator) {
PostEventSec(EV_SetAngularVelocity, delay, init_avelocity);
}
}

@Override
public eventCallback_t getEventCallBack(idEventDef event) {
return eventCallbacks.get(event);
}

public static Map<idEventDef, eventCallback_t> getEventCallBacks() {
return eventCallbacks;
}

};

/*
Expand All @@ -1122,6 +1182,13 @@ private void Event_Activate(idEntity activator) {
*/
public static class idAFEntity_WithAttachedHead extends idAFEntity_Gibbable {
// CLASS_PROTOTYPE( idAFEntity_WithAttachedHead );
private static Map<idEventDef, eventCallback_t> eventCallbacks = new HashMap<>();

static {
eventCallbacks.putAll(idAFEntity_Gibbable.getEventCallBacks());
eventCallbacks.put(EV_Gib, (eventCallback_t1<idAFEntity_WithAttachedHead>) idAFEntity_WithAttachedHead::Event_Gib);
eventCallbacks.put(EV_Activate, (eventCallback_t1<idAFEntity_WithAttachedHead>) idAFEntity_WithAttachedHead::Event_Activate);
}

private idEntityPtr<idAFAttachment> head;
//
Expand Down Expand Up @@ -1274,11 +1341,11 @@ protected void Gib(final idVec3 dir, final String damageDefName) {
}

@Override
protected void Event_Gib(final String damageDefName) {
Gib(new idVec3(0, 0, 1), damageDefName);
protected void Event_Gib(final idEventArg<String> damageDefName) {
Gib(new idVec3(0, 0, 1), damageDefName.value);
}

private void Event_Activate(idEntity activator) {
private void Event_Activate(idEventArg<idEntity> activator) {
float delay;
idVec3 init_velocity = new idVec3(), init_avelocity = new idVec3();

Expand All @@ -1304,6 +1371,16 @@ private void Event_Activate(idEntity activator) {
PostEventSec(EV_SetAngularVelocity, delay, init_avelocity);
}
}

@Override
public eventCallback_t getEventCallBack(idEventDef event) {
return eventCallbacks.get(event);
}

public static Map<idEventDef, eventCallback_t> getEventCallBacks() {
return eventCallbacks;
}

};

/*
Expand Down Expand Up @@ -2090,6 +2167,13 @@ private void InitSteamRenderEntity() {
public static class idAFEntity_ClawFourFingers extends idAFEntity_Base {
// public:
// CLASS_PROTOTYPE( idAFEntity_ClawFourFingers );
private static Map<idEventDef, eventCallback_t> eventCallbacks = new HashMap<>();

static {
eventCallbacks.putAll(idAFEntity_Base.getEventCallBacks());
eventCallbacks.put(EV_SetFingerAngle, (eventCallback_t1<idAFEntity_ClawFourFingers>) idAFEntity_ClawFourFingers::Event_SetFingerAngle);
eventCallbacks.put(EV_StopFingers, (eventCallback_t0<idAFEntity_ClawFourFingers>) idAFEntity_ClawFourFingers::Event_StopFingers);
}

public idAFEntity_ClawFourFingers() {
fingers[0] = null;
Expand Down Expand Up @@ -2147,11 +2231,11 @@ public void Restore(idRestoreGame savefile) {
//
//

private void Event_SetFingerAngle(float angle) {
private void Event_SetFingerAngle(idEventArg<Float> angle) {
int i;

for (i = 0; i < 4; i++) {
fingers[i].SetSteerAngle(angle);
fingers[i].SetSteerAngle(angle.value);
fingers[i].SetSteerSpeed(0.5f);
}
af.GetPhysics().Activate();
Expand All @@ -2164,6 +2248,16 @@ private void Event_StopFingers() {
fingers[i].SetSteerAngle(fingers[i].GetAngle());
}
}

@Override
public eventCallback_t getEventCallBack(idEventDef event) {
return eventCallbacks.get(event);
}

public static Map<idEventDef, eventCallback_t> getEventCallBacks() {
return eventCallbacks;
}

};

/*
Expand Down
Loading

0 comments on commit ca35b1f

Please sign in to comment.